Changing car colors.
#1

Hi all.
I want to know how to do a progressive car color changing.
Like:
The current color is ID 1, i do the command and it becomes ID 2, i do again the command and it becomes ID 3, and so on.

How can I do it? Thanks!

(Sorry my bad english)
Reply
#2

pawn Код:
new c_color = 0;//on top

CMD:pcarcolor(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, -1, "{ff0000}You need to be in car to use this command");

ChangeVehicleColor(GetPlayerVehicleID(playerid), c_color, c_color);
new mes[128];
format(mes, sizeof(mes), "{00cc00}[INFO]: {ffffff}You have changed your car color to id {ff0000}%i",c_color);
SendClientMessage(playerid, -1, mes);
c_color++;
return 1;
}
Reply
#3

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
pawn Код:
new c_color = 0;//on top

CMD:pcarcolor(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, -1, "{ff0000}You need to be in car to use this command");

ChangeVehicleColor(GetPlayerVehicleID(playerid), c_color, c_color);
new mes[128];
format(mes, sizeof(mes), "{00cc00}[INFO]: {ffffff}You have changed your car color to id {ff0000}%i",c_color);
SendClientMessage(playerid, -1, mes);
c_color++;
return 1;
}
Thank you man! REP+!
Reply
#4

I'd be using a MAX_VEHICLES array... otherwise if someone else uses the command it won't work the way you want it to...
Reply
#5

Quote:
Originally Posted by Threshold
Посмотреть сообщение
I'd be using a MAX_VEHICLES array... otherwise if someone else uses the command it won't work the way you want it to...
i think he is using for testing colors
he could find colors online too
Reply
#6

No, I have created a system for buying cars! After buying you have to select the colour.
Reply
#7

Quote:
Originally Posted by alanhutch
Посмотреть сообщение
No, I have created a system for buying cars! After buying you have to select the colour.
so why you use a system command like this

selecting colors with selectable textdraws would look more good and impressive
Reply
#8

I'm using a selectable textdraw with arrows. When you click the arrow the color switch to another one!
Reply
#9

So?..
Reply
#10

u need the code of selectable text draws too?
or u can do with a example?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)