Problem with timer
#1

PHP код:
LockNearbyVehicles(playeridFloat:radi)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    for(new 
i=1i<MAX_VEHICLESi++)
    {
        if(
GetVehicleModel(i))
        {
            
TimeRunning[i] = 40;
            new 
Float:posxFloat:posyFloat:posz;
            new 
Float:tempposxFloat:tempposyFloat:tempposz;
            
GetVehiclePos(iposxposyposz);
            
tempposx = (posx x);
            
tempposy = (posy y);
            
tempposz = (posz z);
            if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
            {
                if(
!= GetPlayerVehicleID(playerid))   {
                
GetVehicleParamsEx(ienginelightsalarmdoorsbonnetbootobjective);
                
SetVehicleParamsEx(iVEHICLE_PARAMS_OFFVEHICLE_PARAMS_ONalarmdoorsbonnetbootobjective);    }
            }
        }
    }

PHP код:
forward SecUpdate2();
public 
SecUpdate2()
{
    
MafiaCheck();
    for(new 
=0<= MAX_VEHICLESi++)
    {
        if(
TimeRunning[i] > 0)  {
            
TimeRunning[i]--;   }
            
    }

This lock's all nearby vehicles for 40 seconds but 40 seconds never end's
HELP :/
Reply
#2

You need to kill the timer if the time passed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)