AddStaticVehicleEx(428,568.6840,-1262.7968,16.9294,279.6335,6,6); // Veiculo Forte 1
AddStaticVehicleEx(428,569.5797,-1266.9418,16.6769,281.6876,6,6); // Veiculo Forte 2
if (strcmp(cmd, "/rv",true) == 0){
if(pAdmin[playerid] >= 3 || pAdmin[playerid] >= 4 || pAdmin[playerid] >= 5){
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), " | INFO - SERVER | O Administrador %s (%d) deu respawn nos veнculos.", pname,playerid);
SendClientMessageToAll(adm, string);
for(new v; v<MAX_VEHICLES; v++) SetVehicleToRespawn(v);
SendClientMessage(playerid, Verde, "[ X ] Veiculos Respawnados!");
return 1;
}
}
if(!strcmp(cmd,"/rvs", true) && pAdmin[playerid] > 0){
if(pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
format(string, sizeof(string), "| INFO - SERVER | O(A) Administrador(a): %s respawnou todos os veнculos sem uso!",PlayerName(playerid));
SendClientMessageToAll(ocd, string);
for(new i; i < MAX_VEHICLES; i++)
if(!IsVehicleInUse(i))
SetVehicleToRespawn(i);
}
return 1;
}
if(strcmp("/rss", cmdtext, true) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new i = 1; i <= MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
SendClientMessage(playerid, -1, " ");
}
else
{
SendClientMessage(playerid, -1, " ");
}
return 1;
}
Tenta sem o IsVehicleInUse
PHP код:
|
AddStaticVehicleEx(428,568.6840,-1262.7968,16.9294,279.6335,6,6);
AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren=0);
if(strcmp(cmdtext, "/rc", true) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000, "[ERRO] VocК nгo estб logado na RCON.");
new str[40], nome[24], bool:vehicle[MAX_VEHICLES];
GetPlayerName(playerid, nome, 24);
format(str, 40, "O Admin %s Respawnou os veiculos", nome);
SendClientMessageToAll(-1, str);
for(new j = 1; GetVehicleModel(j); ++j)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
if(IsPlayerInVehicle(i, j))
{
vehicle[j] = true;
break;
}
}
if(!vehicle[j]) SetVehicleToRespawn(j);
}
return 1;
}