11.05.2011, 18:20
I have this code, i think its correct, but even the vehicle being wih full health, why does it still send a message saying
"It's to wrecked... use (/phone)"
Everything works exept that bit of the health, if it's full it still sends a message saying it's to wrecked
"It's to wrecked... use (/phone)"
Everything works exept that bit of the health, if it's full it still sends a message saying it's to wrecked
pawn Код:
public Start(playerid)
{
new engine,lights,alarm,doors,bonnet,boot,objective,Float:health,rand;
if(GetVehicleHealth(GetPlayerVehicleID(playerid),health) < 500)
{
SendClientMessage(playerid,white,"*"lred"The vehicle is too wrecked, please call assistance! "lyellow2"(/phone)");
starting[playerid] = 0;
}
rand = random(2);
if(rand == 0)
{
SendClientMessage(playerid,white,"*"lred"Unable to start the vehicle"lwhite"*");
starting[playerid] = 0;
}
if(rand == 1 && Started[GetPlayerVehicleID(playerid)] == 0)
{
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,lights,alarm,doors,bonnet,boot,objective);
Started[GetPlayerVehicleID(playerid)] = 1;
SendClientMessage(playerid,white,"*"lred"Vehicle "lgreen"started"lred"!"lwhite"*");
starting[playerid] = 0;
}
return 1;
}