09.12.2011, 16:15
your code is wrong (if that is your whole code)
Additionally to get sure what is stopping your script, add "SendClientMessage(playerid, 0x999999AA, "Called 1");" before "if(PlayerKilled.....)"
and "SendClientMessage(playerid, 0x999999AA, "Called 2");" below that line (below the } ofc)...
I suppose your "IsKeyJustDown" is not working correctly
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PlayerKilled[playerid] == 1)
{
if(IsKeyJustDown(KEY_SPRINT,newkeys,oldkeys))
{
TogglePlayerSpectating(playerid, 0);
PlayerSpectating[playerid] = 0;
PlayerKilled[playerid] = 0;
TextDrawHideForPlayer(playerid, txtSpec);
}
if (PRESSED(KEY_LOOK_BEHIND))
{
SendClientMessage(playerid, COLOR_BLUE, "You take the point");
return 1;
}
}
return 1;
}
and "SendClientMessage(playerid, 0x999999AA, "Called 2");" below that line (below the } ofc)...
I suppose your "IsKeyJustDown" is not working correctly