TogglePlayerControllable
#1

Ok guys did TogglePlayerControllable refused to work for me? Under OnPlayerSpawn, I placed TogglePlayerControllable(playerid, 0); and nothing happens. On second thougt, I made a timer that would make the person controllable after some seconds (TogglePlayerControllable(playerid, 1), and it works. I mean I can see that when I spawn after them seconds I look like I was synchronized or something. Why freezing won't work. Again, it's placed under OnPlayerSpawn.
Reply
#2

Add this and post the results of what happends
PHP код:
new
    
FrozenTest[MAX_PLAYERS];
    
forward UnfreezePlayer(playerid);
    
public 
OnPlayerSpawn(playerid) {
    
TogglePlayerControllable(playerid,0);
    
FrozenTest[playerid] = 0;
    
printf("FrozenTest: %i",FrozenTest[playerid]);
    
SetTimerEx("UnfreezePlayer",5000,false,"i",playerid);
    return 
true;
}

public 
UnfreezePlayer(playerid) {
    
TogglePlayerControllable(playerid,1);
    
FrozenTest[playerid] = 1;
    
printf("FrozenTest: %i",FrozenTest[playerid]);
    return 
true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)