how to add Timer for map!?
#8

PHP код:
forward MyFunct(playerid);
new 
timercreated[MAX_PLAYERS];
new 
mytimer[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
timercreated[playerid] = 1;
    
mytimer[playerid] = SetTimerEx("MyFunct",120000,0,"i",playerid); // Timer for 2 minutes for every player who connect to the server, without repeating
    
return true;
}
public 
OnPlayerDisconnect(playerid)
{
    if(
timercreated[playerid] == 1)
    {
        
KillTimer(mytimer[playerid]);
        
timercreated[playerid] = 0;
    }
    return 
true;
}
public 
MyFunct(playerid)
{
    if(
playerid != INVALID_PLAYER_ID)
    {
        
timercreated[playerid] = 0;
        
// If time goes and he isn't finished.
    
}
    return 
true;

And u need to add

PHP код:
if(timercreated[playerid] == 1)
{
    
KillTimer(mytimer[playerid]);
    
timercreated[playerid] = 0;

in code when player end game.
Reply


Messages In This Thread
how to add Timer for map!? - by Recardo - 19.05.2016, 14:32
Re: how to add Timer for map!? - by BloodyRP - 19.05.2016, 14:34
Re: how to add Timer for map!? - by Recardo - 19.05.2016, 14:35
Re: how to add Timer for map!? - by BloodyRP - 19.05.2016, 14:38
Re: how to add Timer for map!? - by Recardo - 19.05.2016, 14:40
Re: how to add Timer for map!? - by BloodyRP - 19.05.2016, 14:42
Re: how to add Timer for map!? - by Recardo - 19.05.2016, 14:44
Re: how to add Timer for map!? - by BloodyRP - 19.05.2016, 14:47
Re: how to add Timer for map!? - by Recardo - 19.05.2016, 14:55
Re: how to add Timer for map!? - by BloodyRP - 19.05.2016, 14:56

Forum Jump:


Users browsing this thread: 1 Guest(s)