19.07.2011, 20:54
The title says it all, is there a function to check if ANY player is in/driving that vehicle.
The title says it all, is there a function to check if ANY player is in/driving that vehicle.
|
public OnVehicleDeath(vehicleid, killerid)
{
for (new i = 0; i != MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i))
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
}
return 1;
}
for (new i = 0; i != MAX_PLAYERS; i++) { if(IsPlayerInAnyVehicle(i)) { }
The title says it all, is there a function to check if ANY player is in/driving that vehicle.
|
VehicleHasPlayer(vehicleid, &player_seat = -1)
{
for(new i = 0, j = GetMaxPlayers(); i < j; i++)
if(IsPlayerConnected(i))
if(IsPlayerInVehicle(i, vehicleid))
{
player_seat = GetPlayerVehicleSeat(i);
return i;
}
return (-1);
}