Liquid44
Banned
I wrote a very basic menu to select any colour you want and then do something with it like setting the current vehicle to your specified colour. I don't exactly know what the numbers for each colour is as its not RGB format, im just going by the fact that the range of colours is between 0 and 133.
Its mainly a system for other developers to tweak to their liking.
There is an example of usage in the comments
All you need to do is thread:
Also you need to define the usual core includes of scocl, I have compiled it without any errors.
Key A turns the menu on or off
key M and B will cycle through the list of colours and print the current number
Key Enter will do something with the current colour selected.
Enjoy.
The formatting and indenting is a bit off due to the forum code tags so you might need to adjust the spacing in a editor of your choice.
This is an example of how to make a simple menu, so you could change it to make a menu for anything.
If you have no idea what to do with this then its not for you...
Its mainly a system for other developers to tweak to their liking.
There is an example of usage in the comments
All you need to do is thread:
Code:
colourMenu();
selectColour();
Also you need to define the usual core includes of scocl, I have compiled it without any errors.
Key A turns the menu on or off
key M and B will cycle through the list of colours and print the current number
Key Enter will do something with the current colour selected.
Enjoy.
Code:
#define NO_OF_COLOURS 133
bool isKeyPressed(uint key)
{
return IS_GAME_KEYBOARD_KEY_JUST_PRESSED(key);
}
void print(char *string)
{
PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", string, 5000, 1);
}
uint colourIndex = 0;
bool inColourMenu = false;
uint finalColour = 0;
void colourMenu(void)
{
if(isKeyPressed(KEY_A))
{
if(inColourMenu)
{
inColourMenu = false;
print("Colour menu closed");
}
else
{
inColourMenu = true;
print("Colour menu activated");
}
}
}
void selectColour(void)
{
if(inColourMenu)
{
print(colourIndex);
if(isKeyPressed(KEY_M))
{
colourIndex += 1;
if(colourIndex > ( NO_OF_COLOURS ) )
colourIndex = 0;
print( colourIndex );
finalColour = colourIndex;
}
if(isKeyPressed(KEY_B))
{
colourIndex -= 1;
if(colourIndex < 0 )
colourIndex = 0;
print( colourIndex );
finalColour = colourIndex;
}
if(isKeyPressed(KEY_ENTER))
{
//Do stuff with the desired colour here
//using the var finalColour
/****************Example********************
Car car;
GET_CAR_CHAR_IS_USING(GetPlayerPed(), &car);
CHANGE_CAR_COLOUR(car, finalColour, finalColour);
**********************************************/
}
}
}
The formatting and indenting is a bit off due to the forum code tags so you might need to adjust the spacing in a editor of your choice.
This is an example of how to make a simple menu, so you could change it to make a menu for anything.
If you have no idea what to do with this then its not for you...