26.07.2017, 10:39
PHP код:
stock GetDriverID(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) //Loops through all players
{
if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return i;
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new id = GetDriverID(vehicleid);
if(IsPlayerInAnyVehicle(id) && !ispassenger && GetPlayerTeam(playerid) == GetPlayerTeam(id))
{
// your code to kick him out
}
return 1;
}