Choose colour for vehicle in-game
#1

Hi all,

I'm looking for a way for the player to choose the colours of their vehicle in-game, alternatively to them just entering the colour ids in game (I dont know the idea of this). Really what I'd like, is the colours display, or a list of colours displayed, and then they can click on a specific colour which is then chosen for their vehicle.

How exactly could I go about doing this, as I can't even begin to start? Or do you have any alternatively ideas?

Thanks
Reply
#2

PHP код:
CMD:colorcar(playeridparams[])
{
    new 
color[2];
    if(
sscanf(params,"dD",color[0],color[1]))
    {
        return 
SendClientMessage(playerid, -1"USAGE: /colorcar [color1] [color2]");
    }
    new
        
string[128];
    
format(stringsizeof(string), "You have change the vehicle's color 1 to %d and color 2 to %d!",color[0],color[1]);
    
SendClientMessage(playerid, -1string);
     
ChangeVehicleColor(GetPlayerVehicleID(playerid),color[0],color[1]);
     return 
1;

change the name or the command to whatever you want, I just showed an example of what I think you wanted.
Reply
#3

Quote:
Originally Posted by KeithCooper
Посмотреть сообщение
PHP код:
CMD:colorcar(playeridparams[])
{
    new 
color[2];
    if(
sscanf(params,"dD",color[0],color[1]))
    {
        return 
SendClientMessage(playerid, -1"USAGE: /colorcar [color1] [color2]");
    }
    new
        
string[128];
    
format(stringsizeof(string), "You have change the vehicle's color 1 to %d and color 2 to %d!",color[0],color[1]);
    
SendClientMessage(playerid, -1string);
     
ChangeVehicleColor(GetPlayerVehicleID(playerid),color[0],color[1]);
     return 
1;

change the name or the command to whatever you want, I just showed an example of what I think you wanted.
Hi, thanks for your help but this is actually the opposite of what I wanted :') What you've posted above is the way my current system works.

What I actually want, is for the colours to be displayed on screen, and the player clicks on the colour they wish to have, and that is then selected.
Reply
#4

Quote:
Originally Posted by Jonesy96
Посмотреть сообщение
Hi, thanks for your help but this is actually the opposite of what I wanted :') What you've posted above is the way my current system works.

What I actually want, is for the colours to be displayed on screen, and the player clicks on the colour they wish to have, and that is then selected.
ohh
Well it's quite simple, just go to your OnPlayerEnterVehicle and add a Dialog which displays the commands, last but not least go to the OnDialogResponse and add if the player clicks on the blue color it will change the cars color to blue..etc
Edited: you don't have to use a dialog, just my example, you could send a client message too
Reply
#5

Quote:
Originally Posted by KeithCooper
Посмотреть сообщение
ohh
Well it's quite simple, just go to your OnPlayerEnterVehicle and add a Dialog which displays the commands, last but not least go to the OnDialogResponse and add if the player clicks on the blue color it will change the cars color to blue..etc
Edited: you don't have to use a dialog, just my example, you could send a client message too
Thanks, yeah this is what I figured. However, I guess my question actually is how do I display all the different colours, for the player to pick from?
Reply
#6

Quote:
Originally Posted by Jonesy96
Посмотреть сообщение
Thanks, yeah this is what I figured. However, I guess my question actually is how do I display all the different colours, for the player to pick from?
If I understood you correctly I did explain that in the post above, did you mean e.g
Код:
Vehicle Colors
Red
Blue
that it's displayed like that?
Reply
#7

Something like this? kvann created it but personally I wouldn't waste 256 textdraws for the colors themselves.

An alternative way is this:
http://forum.sa-mp.com/showpost.php?...postcount=1019
http://forum.sa-mp.com/showpost.php?...postcount=1020

and displays all the color in a dialog but the string is ~4300 if I'm not mistaken and you don't want to mess with run time errors so last option is the above colors in a client message like a preview of the specified color.
Reply
#8

How do I display the text like that in the dialogs with the appropriate colour, so for example 'Red' comes out as red coloured text. I'd want this colour to be the same as the vehicle colour ID that would be selected as a result, if that makes sense.

I may be asking a silly question
Reply
#9

Just add hex colors for e.g {F51D50}Red,{651DF5}Blue..etc
Search for Color Picker and just add brackets between the code and put it to whatever text you want in which color.
Reply
#10

Thanks Konstantinos, I think that's actually useful for exactly what I need!

KeithCooper, thanks for your help.

Both repped of course
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)