05.05.2011, 18:14
Ok how can check which players are there in particular vehicle id and set their hp to zero? Thanks in advance
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == id) return SetPlayerHealth(playerid, 0);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if ((newstate == PLAYER_STATE_DRIVER) && (oldstate == PLAYER_STATE_ONFOOT))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 432) // Tank's vehicle model id is 432
{
SetPlayerHealth(playerid, 0);
}
}
}