22.10.2015, 03:26
However, the message only gets sent when they press the key - not hold it. I don't want a player to spam press sprint, OR hold it. Is there anyway to prevent them from doing this?
pawn Код:
if (GetPlayerState(playerid) == 1 && (newkeys & KEY_SPRINT) && !(oldkeys & KEY_SPRINT))
{
if(PLAYER_BROKEN_LEGS[playerid] == true && HOLDING(KEY_SPRINT))
{
SCM(pid, COLOR_GREY, "You're unable to sprint, as your leg is broken.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
ClearAnimations(playerid);
return 1;
}
}