14.10.2014, 14:04
Firstly, look what Vince said.
You are checking if vehicle ID is 425 AND 520 (&&), and that's impossible.
You have to check if vehicle ID is 425 OR 520(||).
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_YES))
{
new vid = GetPlayerVehicleID(playerid);
new Float:hp;
GetVehicleHealth(vid, hp);
if(vid == 425 || vid == 520 && hp < 251)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y , Z + 40);
SendClientMessage(playerid, RED, "Ejected!");
}
}
return 1;
}
You are checking if vehicle ID is 425 AND 520 (&&), and that's impossible.
You have to check if vehicle ID is 425 OR 520(||).
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_YES))
{
new vid = GetPlayerVehicleID(playerid);
new Float:hp;
GetVehicleHealth(vid, hp);
if(vid == 425 || vid == 520 && hp < 251)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y , Z + 40);
SendClientMessage(playerid, RED, "Ejected!");
}
}
return 1;
}