05.05.2011, 15:14
nop, I'm outside of a vehicle... sec I'll post my code...
the command that freezes the player also sets sgtPlayerVehicle[playerid] = 0
the command that freezes the player also sets sgtPlayerVehicle[playerid] = 0
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(sgtPlayerVehicle[playerid] != -1)
{
if((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
{
TextDrawHideForPlayer(playerid, Info);
TextDrawHideForPlayer(playerid, Name[playerid]);
DestroyVehicle(sgtVehicle[playerid]);
sgtVehicle[playerid] = -1;
sgtPlayerVehicle[playerid] = -1;
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
}
else if((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION))
{
TextDrawHideForPlayer(playerid, Info);
TextDrawHideForPlayer(playerid, Name[playerid]);
sgtVehicle[playerid] = -1;
sgtPlayerVehicle[playerid] = -1;
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
}
}
return 1;
}