SA-MP Forums Archive
TooglePlayerControllable bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TooglePlayerControllable bug (/showthread.php?tid=413672)



TooglePlayerControllable bug - cChaD - 06.02.2013

Hi,

i have a bug with my timer freeze, when i would be freeze but im not freeze.

look code :

PHP код:
public StartMap()
{
    
timerFreeze SetTimer("FreezeTime"1000true);
    
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        
TogglePlayerControllable(i0);
    }
    return 
1;

PHP код:
public FreezeTime()
{
    
printf("%i"time);
    
time--;
    if(
time == 0)
    {
        
KillTimer(timerFreeze);
        for(new 
i=0i<MAX_PLAYERSi++)
        {
            
TogglePlayerControllable(i1);
        }
    }
    return 
1;




Re: TooglePlayerControllable bug - 3ventic - 06.02.2013

Where's time-variable set?


Re: TooglePlayerControllable bug - Jewell - 06.02.2013

pawn Код:
public StartMap()
{
    timerFreeze = SetTimer("FreezeTime", 1000, true);
    new time = 1; // change this.. if you want to repeat the freeze time.
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        TogglePlayerControllable(i, 0);
    }
    return 1;
}  

public FreezeTime()
{
    printf("%i", time);
    time--;
    if(time == 0)
    {
        KillTimer(timerFreeze);
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            TogglePlayerControllable(i, 1);
        }
    }
    return 1;
}



Re : TooglePlayerControllable bug - cChaD - 06.02.2013

i have resolved ! the freeze was called when the server start ^^ and nobody was co !