/respawnallcars
#10

Quote:
Originally Posted by SomebodyAndMe
Посмотреть сообщение
Nope, still respawning cars when a guy is inside it. Damn thing.
Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
pawn Код:
// Top of script
forward PlayerInCar(vehicleid);

// ZCMD command, anywhere in the script not under a function or callback
CMD:respawnvehicles(playerid,params[])
{
        vehicles<MAX_VEHICLES; vehicles++)
        {
            if(!PlayerInCar(vehicles))
            {
                SetVehicleToRespawn(vehicles);
            }
        }
        return 1;
    }
    else return 0;
}
// Bottom of the script
public PlayerInCar(vehicleid)
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInVehicle(i,vehicleid)) return 1;
    }
    return 0;
}
EDIT: funky was very fast. I recommend using his code rather than mine.
Have you tried this?
Reply


Messages In This Thread
/respawnallcars - by SomebodyAndMe - 11.12.2011, 10:46
Re: /respawnallcars - by Ash. - 11.12.2011, 11:06
Re: /respawnallcars - by suhrab_mujeeb - 11.12.2011, 11:07
Re: /respawnallcars - by SomebodyAndMe - 11.12.2011, 11:25
Re: /respawnallcars - by THE_KNOWN - 11.12.2011, 11:27
Re: /respawnallcars - by Ash. - 11.12.2011, 11:58
Re: /respawnallcars - by SomebodyAndMe - 11.12.2011, 19:25
Re: /respawnallcars - by SnG.Scot_MisCuDI - 11.12.2011, 19:36
Re: /respawnallcars - by Kostas' - 11.12.2011, 19:38
Re: /respawnallcars - by suhrab_mujeeb - 12.12.2011, 09:25

Forum Jump:


Users browsing this thread: 2 Guest(s)