19.05.2014, 18:29
its a good idea but you can improve that.
look:
and can be improved more.
look:
pawn Код:
/*
Fait par Christopher # Kiki_Readon # Kiki53
CCC [ChangeCarColor]
*/
#include <a_samp>
forward RainBowColor(playerid);
new RainBowColor1;
new RainBow[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/rainbow", true) == 0)
{
if( !IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, -1, "Not such a vehicle!" );
RainBow[playerid] = RainBow[playerid] == 0 ? 1 : 0;
SendClientMessage(playerid, -1, RainBow[playerid] == 1 ? ("RainBow activated") : ("Rainbow off"));
RainBowColor(playerid);
return 1;
}
return 0;
}
public RainBowColor(playerid)
{
if(RainBow[playerid] == 1)
{
ChangeVehicleColor(GetPlayerVehicleID(playerid), -1, -1);
RainBowColor1 = SetTimerEx("RainBowColor", 500, 0, "d" ,playerid);
}
else KillTimer(RainBowColor1);
return 1;
}