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