changecolor timer
#9

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
I'd say try this:
PHP код:
new Rainbow_Timer[MAX_PLAYERS];
CMD:rainbow(playeridparams[])
{
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playeridCOLOR_RED"[ERROR]: You need to be a driver in a vehicle to use that command.");
    
    
ChangeVehicleColor(GetPlayerVehicleID(playerid),-1,-1);
    
Rainbow_Timer[playerid] = SetTimerEx("RainBow"2000true"i"playerid);
    return 
1;
}
forward RainBow(playerid);
public 
RainBow(playerid)
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVERChangeVehicleColor(GetPlayerVehicleID(playerid),-1,-1);
    
    return 
1;

And use:
Код:
KillTimer(Rainbow_Timer[playerid]);
At OnPlayerDisconnect strictly:
PHP код:
public OnPlayerDisconnect(playeridreason)
{
    
KillTimer(Rainbow_Timer[playerid]);
    return 
1;

and

OnPlayerStateChange with a state check
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == && oldstate == 2)  KillTimer(Rainbow_Timer[playerid]);
    return 
1;

KillTimer(Rainbow_Timer[playerid]);
should be
KillTimer(Rainbow_Timer(playerid)); since the compiler complains when i use [playerid] for timers
Reply


Messages In This Thread
changecolor timer - by rakinz - 23.02.2018, 08:16
Re: changecolor timer - by RogueDrifter - 23.02.2018, 08:18
Re: changecolor timer - by rfr - 23.02.2018, 08:22
Re: changecolor timer - by rakinz - 23.02.2018, 08:28
Re: changecolor timer - by rfr - 23.02.2018, 08:30
Re: changecolor timer - by PepsiCola23 - 23.02.2018, 08:33
Re: changecolor timer - by rakinz - 23.02.2018, 08:39
Re: changecolor timer - by RogueDrifter - 23.02.2018, 08:44
Re: changecolor timer - by rfr - 23.02.2018, 08:48
Re: changecolor timer - by RogueDrifter - 23.02.2018, 08:49

Forum Jump:


Users browsing this thread: 1 Guest(s)