Freeze player
#1

How to freeze player for 3 seconds? I know, that freeze player with TogglePlayerControllable(playerid,0); , but how for 3 secs?
Reply
#2

You could use a timer.
PHP код:
SetTimerEx("Player_Frozen"3000false"i"playerid);
forward Player_Frozen(playerid);
public 
Player_Frozen(playerid) {
    
TogglePlayerControllable(playerid1);
    return 
1;

Reply
#3

add these codes in the part you want its use.
PHP код:
//You code......
    
TogglePlayerControllable(playeridfalse);
    
SetTimerEx("UnfreezePlayer"3000false"i"playerid); 
add this function as global.
PHP код:
forward UnfreezePlayer(playerid);
public 
UnfreezePlayer(playerid)
{
    return 
TogglePlayerControllable(playeridtrue);

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)