Need simple Help
#1

I need CMD for restart server all 5 mintues and Its respawn the cars and player spawn with textdraw for a second on the game.

Thanks for helpers !
Reply
#2

Command for respawning all cars.

pawn Код:
CMD:respawncars(playerid,params[])
{
        for(new i=0; i<MAX_VEHICLES; i++)
        {
            if(UnoccupiedVehicle(i))
            {
                SetVehicleToRespawn(i);
            }
        }
        return SendClientMessage(playerid,yellow,"You have respawned all vehicles!");
}
What kind of textdraw do you want when a player connects to your server ? and the timer should be 5 seconds rite ?
Reply
#3

I want the server do restart of the spawn player and of the cars evrey 5 mintues... sorry for the bad english
Reply
#4

if you mean auto respawn every 5 mints so put that code in ongamemodeinit:
pawn Код:
//OnGameModeInIt
SetTimer("reSpawn",300000,true);
and where ever you want put that code but not in any callback:
pawn Код:
forward reSpawn();
public reSpawn()
{
for(new i=0; i<MAX_VEHICLES; i++)
        {
            if(UnoccupiedVehicle(i))
            {
                SetVehicleToRespawn(i);
            }
        }
return 1;
}
Reply
#5

Why ?

Quote:

undefined symbol "UnoccupiedVehicle"

Reply
#6

pawn Код:
forward reSpawn();
public reSpawn()
{
    for(new v =0; v<MAX_VEHICLES; v++)
        {
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(!IsPlayerInVehicle(i, v))
            {
                SetVehicleToRespawn(i);
            }
        }
    }
    return 1;
}
That should do it.
Reply
#7

warning 225: unreachable code
invalid expression, assumed zeroinvalid expression, assumed zero
too many error messages on
Reply
#8

pawn Код:
forward reSpawn();
public reSpawn()
{
    for(new v =0; v<MAX_VEHICLES; v++)
        {
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(!IsPlayerInVehicle(i, v))
            {
                SetVehicleToRespawn(v);
            }
        }
    }
    return 1;
}
Sorry, I forgot to change v.
Reply
#9

You should to put after return 1;

It's }
but I fix It thanks people !
Reply
#10

What should I have done?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)