06.07.2009, 16:14
It would be better if you use a player variable + OnPlayerKeyStateChange, for example:
For a list of keys check https://sampwiki.blast.hk/wiki/GetPlayerKeys#Key_List you will have to change the 1024 to the key you want.
I hope this helped you
pawn Код:
// On top:
new IsInCheckPoint[MAX_PLAYERS];
// At OnPlayerEnterCheckpoint (case 24)
IsInCheckPoint[playerid] = 1; // 1 will mean in this case the entered checkpoint 24
// OnPlayerKeyStateChange
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsInCheckPoint[playerid] == 1) // check if the player is in checkpoint 24
{
if(newkeys & 1024) // check if they pressed ALT
{
TogglePlayerControllable(playerid, true); // unfreeze the player
IsInCheckPoint[playerid] = 0; // set this variable back to 0 so when you press ALT unfreezing wont be toggled again
return 1;
}
}
return 1;
}
I hope this helped you