[Ajuda] Lag
#1

Queria saber porque quando eu uso esses comandos o servidor comeзa a trava?
pawn Код:
if(!strcmp(cmd,"/respawnveiculos", true) && pAdmin[playerid] >= 4)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string),"{0099FF} | Admin | {FFFFFF} %s(ID: %d) respawnou todos os veiculos", pname, playerid);
SendClientMessageToAll(AdminCor, string);
new carro = 0;
for(carro = 0; carro < MAX_VEHICLES; carro++)
{
SetVehicleToRespawn(carro);
}
return 1;
}
if(!strcmp(cmd,"/rc", true) && pAdmin[playerid] >= 2)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string),"{0099FF} | Admin | {FFFFFF} %s(ID: %d) respawnou os veiculos desocupados", pname, playerid);
SendClientMessageToAll(AdminCor, string);
new carro = 0;
for(carro = 0; carro < MAX_VEHICLES; carro++)
{
if(!IsVehicleOccupied(carro)) SetVehicleToRespawn(carro);
}
return 1;
}
Reply
#2

Tem Muitos veiculos no servidor?
Reply
#3

Nгo.
Reply
#4

MAX_VEHICLES , por padrгo, vem com valor 2000.

Diminua para o nъmero de veнculos que vocк utiliza...

Eu particularmente, tenho funзгo prуpria para criar e destruir veнculos.
Com isso eu tenho o controle exato de quantos veнculos tenho no servidor, independentemente de quantos foram criado/deletados durante o jogo...

Aconselho a fazer o mesmo.
Reply
#5

Nгo й o seu computador que ta travando nгo ? vocк ja testou com outras pessoas?
Reply
#6

entao voce tem que definir ele no GM
Reply
#7

pawn Код:
new iMAX_VEHICLES;

stock sAddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, resdelay = -1)
    return AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2),iMAX_VEHICLES++;
   
stock sCreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay )
    return sAddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, respawn_delay);
   
stock iAddStaticVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay )
    return sAddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, respawn_delay);
   
#undef AddStaticVehicle
    #define AddStaticVehicle sAddStaticVehicle

#undef CreteVehicle
    #define CreteVehicle sAddStaticVehicle

#undef AddStaticVehicleEx
    #define AddStaticVehicleEx iAddStaticVehicleEx
Faзa algo parecido com isto, nгo arrumei ainda e nem testei.
Estou preparando uma includes para looping =)
Reply
#8

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
pawn Код:
new iMAX_VEHICLES;

stock sAddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, resdelay = -1)
    return AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2),iMAX_VEHICLES++;
   
stock sCreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay )
    return sAddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, respawn_delay);
   
stock iAddStaticVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay )
    return sAddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, respawn_delay);
   
#undef AddStaticVehicle
    #define AddStaticVehicle sAddStaticVehicle

#undef CreteVehicle
    #define CreteVehicle sAddStaticVehicle

#undef AddStaticVehicleEx
    #define AddStaticVehicleEx iAddStaticVehicleEx
Faзa algo parecido com isto, nгo arrumei ainda e nem testei.
Estou preparando uma includes para looping =)
Tem que acrescentar tambйm o DestroyVehicle, por conta daquele problema que te falei !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)