[FilterScript] [CCC] (RainBow) ChangeCarColor
#7

its a good idea but you can improve that.

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;
}
and can be improved more.
Reply


Messages In This Thread
[CCC] (RainBow) ChangeCarColor - by Chris53340 - 19.05.2014, 14:41
Re: [CCC] (RainBow) ChangeCarColor - by JonathanW - 19.05.2014, 14:49
Re: [CCC] (RainBow) ChangeCarColor - by Gasartobi - 19.05.2014, 16:53
Re : [CCC] (RainBow) ChangeCarColor - by Chris53340 - 19.05.2014, 17:24
Re: [CCC] (RainBow) ChangeCarColor - by Hwang - 19.05.2014, 18:18
Re : [CCC] (RainBow) ChangeCarColor - by Chris53340 - 19.05.2014, 18:27
Re: [CCC] (RainBow) ChangeCarColor - by PT - 19.05.2014, 18:29
Re : [CCC] (RainBow) ChangeCarColor - by Chris53340 - 19.05.2014, 18:33

Forum Jump:


Users browsing this thread: 1 Guest(s)