22.06.2011, 21:45
So here is a prob, I got cmd like that
and here is
So this is suppose to respawn ONLY unused cars as I used "RespawnAllEmptyCars" but it respawns everycar even if player is inside them.
Any solution?
pawn Код:
CMD:respawnveh(playerid, unused[])
{
if(PlayerInfo[playerid][Admin] < 4)
return SendClientMessage(playerid, COLOR_RED, "You are not a Public Safety Member! Or your PSM level is too low!");
SendClientMessageToAll(COLOR_RED, "All unused vehicles have been respawned by Public Safety Member!");
RespawnAllEmptyCars();
#pragma unused unused
for(new i; (++ i) != MAX_VEHICLES; ) {
SetVehicleToRespawn(i);
}
return true;
}
pawn Код:
//=============Respawn Vehs====================//
stock IsVehicleInUse(vid)
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerInVehicle(i, vid)) return 1;
}
return 0;
}
stock RespawnAllEmptyCars()
{
for(new i=0; i < 700; i++)
{
if(!IsVehicleInUse(i)) SetVehicleToRespawn(i);
}
}
//=============Respawn Vehs====================//
Any solution?