Welches System nutzt du?
Kannst eins von beiden nutzen.
-> ZCMD
stock IsVehicleInUse(vehicleid)
{
for(new playerid; playerid < GetMaxPlayers(); playerid++)
if(IsPlayerConnected(playerid))
if(IsPlayerInAnyVehicle(playerid))
if(GetPlayerVehicleID(playerid) == vehicleid)
return true;
return false;
}
COMMAND:respawn(playerid, params[])
{
for(new vehicleid = 0; vehicle < MAX_VEHICLES; vehicleid++)
if(!IsVehicleInUse(vehicleid))
SetVehicleToRespawn(vehicleid);
return true;
}
COMMAND:respawnatpos(playerid, params[])
{
new Float:Pos[4];
for(new vehicleid = 0; vehicle < MAX_VEHICLES; vehicleid++)
if(!IsVehicleInUse(vehicleid))
{
GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(vehicleid, Pos[3]);
SetVehicleToRespawn(vehicleid);
SetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
SetVehicleZAngle(vehicleid, Pos[3]);
}
return true;
}