SA-MP Forums Archive
help - 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: help (/showthread.php?tid=476887)



help - Gafsi - 20.11.2013

hello how to cheak if player is freezes or not?


Re: help - InglewoodRoleplay - 20.11.2013

pawn Код:
new playerFrozen[MAX_PLAYERS];
TogglePlayerControllableEx(playerid, status) {
    playerFrozen[playerid] = status==1?0:1;
    TogglePlayerControllable(playerid, status);
}
isFrozen(playerid) {
    return playerFrozen[playerid];
}

//Usage:
TogglePlayerControllableEx(playerid, 0); //to freeze them and 1 to unfreeze them

if(isFrozen(playerid)) {
    SendClientMessage(playerid, COLOR_WHITE, "The player is frozen");
    return 1;
}