Respawn
#1

toate masinile au fost respawnate = spams.(RO/ENG): all cars where respawned.If you need rep,il give you rep!


PHP код:
            public ScheduledRespawn(playerid)
                    {
                    new 
bool:unwanted[CAR_AMOUNT];
                    for(new 
0MAX_PLAYERSi++)
                    {
                        for(new 
player=0player<MAX_PLAYERSplayer++)
                    {
                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                    }
                    }
                    for(new 
car 1car <= 359car++)
                    {
                        if(!
unwanted[car]) SetVehicleToRespawn(car);
                    }
                    
SendClientMessage(playerid,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
                    } 
Reply
#2

Want he wants is a function that will reset all the vehicles that are currently not occupied. But i'm guessing this is on a timer or at a certain time. Example (12:00pm, Reset All Vehicles).

Also yes, its not very clear so next time please fix up your English or goto the foreign section of the forums.
Reply
#3

what am i not clear?that message spams..thats all..yes i have timer..you dont need timer..do you?
Reply
#4

I wouldn't use a timer for this.

Id use get time.
pawn Код:
getTime();
and then check to see if time is equal to a specif time.

pawn Код:
new Time = getTime();

if(Time == "12:00")
{
      RespawnVehicles();
}
Info
I'm very tired, so im not sure if, im right. If i'm wrong then im sorry and I will continue to help
Reply
#5

no..i want how i posted..sorry..please help..
Reply
#6

Your post is misleading then. As that's how I understood it. Please rewrite it in as much english as you can.
Reply
#7

ok.Whats so hard to understand

this message spams: SendClientMessage(playerid,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");

im not writing in chineese..
Reply
#8

Use a IsPlayerConnected condition before.
Reply
#9

you sure?wow..test it..you tell me stupid stuff..X(

Quote:

public ScheduledRespawn(playerid)
{
if(IsPlayerConnected(playerid))
{
new bool:unwanted[CAR_AMOUNT];
for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player))
{
unwanted[GetPlayerVehicleID(player)]=true;
}
for(new car = 1; car <= 359; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
SendClientMessage(playerid,COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
}
}
}
}

Quote:

public SyncTime()
{
new string[64];
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
format(string, sizeof(string), "Este ora Fix Ceasul acuma este: %d:00 Succes incontinuare!",tmphour);
BroadCast(COLOR_WHITE,string);
ghour = tmphour;
PayDay();
if (realtime)
{
SetWorldTime(tmphour);
}
for(new i=0; i<MAX_PLAYERS; i++)
{
SendClientMessage( i, COLOR_YELLOW, "• In 20 secunde toate masinile se vor respawna ! •");
}
SetTimer("ScheduledRespawn",20000,false);
}
}

Reply
#10

So basically... you created a loop, inside a loop, for the exact same thing, players...
Put this under OnGameModeInit/OnFilterScriptInit:
pawn Код:
public OnGameModeInit()
{
    SetTimer("ScheduledRespawn", time, true); //Change time to your wanted time span
    return 1;
}
Replace 'time' with the duration you want the cars to respawn in... (Example: 1 minute = 60 * 1000 = 60000)

pawn Код:
forward ScheduledRespawn();
public ScheduledRespawn()
{
    new bool:unwanted[MAX_VEHICLES];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            unwanted[GetPlayerVehicleID(i)] = true;
        }
    }
    for(new car = 0; car < MAX_VEHICLES; car++)
    {
        if(!unwanted[car])
        {
            SetVehicleToRespawn(car);
        }
    }
    SendClientMessageToAll(COLOR_YELLOW,"• Toate masinile au fost respawnate ! •");
}
And I wouldn't be calling other people stupid when you can't make a simple car respawner for yourself. Be nice to the people who actually WANT to help you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)