09.08.2009, 08:35
Hey,
Here's my code for vehicles respawn:
Earlier it respawned vehicles like in 5 - 10 seconds.. (The code was without IsPlayerInAnyVehicle check) EDIT: But IsPlayerInAnyVehicle doesn't help cause even if player is in vehicle, his vehicle gets respawned..
But now it takes about 25-35 seconds to respawn (vehicle count is almost same as it was before) and it lags the server... Why?
And BTW Why vehicles usually spawn in wrong place? I save them to spawn in parking lot but they spawn in front of the road... After /respawnvehicles, they spawn correctly
And I do not use any vehicle streamer!
Here's my code for vehicles respawn:
pawn Код:
if (strcmp(cmdtext, "/respawnvehicles", true) == 0 && pAdminLvl[playerid] >= 3)
{
SystemMsg(playerid,"Respawning all vehicles in server.. Please wait..");
for(new v = 0; v < MAX_VEHICLES; v++)
{
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(!IsPlayerInAnyVehicle(i))
{
SetVehicleToRespawn(v);
}
}
}
SystemMsg(playerid,"All vehicles has been respawned!");
return 1;
}
But now it takes about 25-35 seconds to respawn (vehicle count is almost same as it was before) and it lags the server... Why?
And BTW Why vehicles usually spawn in wrong place? I save them to spawn in parking lot but they spawn in front of the road... After /respawnvehicles, they spawn correctly
And I do not use any vehicle streamer!