16.11.2013, 20:25
(
Последний раз редактировалось Konstantinos; 17.11.2013 в 09:43.
)
OnPlayerStateChange and OnPlayerKeyStateChange differ from each other.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(!Engine[GetPlayerVehicleID(playerid)])
{
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW, "((use /e to turn the vehicle engine on))");
}
else
{
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, COLOR_YELLOW, "Engine Running...");
}
}
return 1;
}
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !Engine[GetPlayerVehicleID(playerid)])
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
return 1;
}