29.11.2014, 10:05
Well I was trying to do this with no luck.
I want to detect if the vehicle health is lower than 300, then remove the player from that vehicle. It sounds easy but I can't make it work with this.
Can I add it into this function? or should I write a new one?
I want to detect if the vehicle health is lower than 300, then remove the player from that vehicle. It sounds easy but I can't make it work with this.
Can I add it into this function? or should I write a new one?
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
if(IsABumperCar(vehicleid))
{
new string[128];
if(!pChip[playerid])
{
format(string,sizeof(string),"* You need a chip to drive a Bumper Car");
TogglePlayerControllable(playerid,0);
ClearAnimations(playerid);
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid,0xFFFFFFAA,string);
}
if(IsVehicleOccupied(vehicleid))
{
format(string,sizeof(string),"* This Bumper Car is occupied! Please take another one.");
TogglePlayerControllable(playerid,0);
ClearAnimations(playerid);
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid,0xFFFFFFAA,string);
}
}
return 1;
}