03.02.2015, 03:53
Alguйm pode me ajudar com este comando? pois й funcional mais bugado, tipo, dou /rv ae depois de 30 segundos o servidor buga todo.. ae mostra direto a mensagem floodando, '* Todos veнculos foram respawnados!', isso nгo desbuga atй que o servidor seja desligado, alguйm ae pode me informar o erro no cуdigo?
- Comando -
- Public chamada -
- Comando -
pawn Код:
if (strcmp(cmd, "/respawnveiculos", true) == 0 || strcmp(cmd, "/rv", true) == 0)
{
if (IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 2)
{
format(string, sizeof(string), "Admin [%d] %s: Respawn de todos os veiculos em 30 segundos.", PlayerInfo[playerid][pAdmin], GetPlayerNameRP(playerid));
SendClientMessageToAll(COR_AZUL_ESCURO, string);
SetTimer("respawnveiculos", 30000, false);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo tem nнvel administrativo suficiente.");
}
}
return true;
}
pawn Код:
forward respawnveiculos();
public respawnveiculos()
{
new string[256];
format(string,sizeof(string),"* Todos veнculos foram respawnados!");
OOCNews(COLOR_YELLOW,string);
GameTextForAll("~r~Veiculos Respawnados",4000,3);
new bool:unwanted[CAR_AMOUNT];
for(new player=0; player<MAX_SLOTS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 0; car < MAX_VEHICLES; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
return true;
}