if (strcmp(cmd, "/rv",true) == 0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] > 0){
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[NH] O Administrador %s (%d) respawnou todos os veiculos.", pname,playerid);
SendClientMessageToAll(tcadm, string);
for(new v; v<MAX_VEHICLES; v++) SetVehicleToRespawn(v);
SendClientMessage(playerid, Verde, "[NH] Veiculos Respawnados");
proximocarro = 0;
for(new carro = 0; carro < MAX_CARROS; carro++)
{
format(string, sizeof(string), "carro%d.ini", carro);
if(dini_Exists(string)){
new carroid;
DestroyVehicle(dini_Int(string, "Id"));
carroid = AddStaticVehicle(dini_Int(string, "Modelo"), dini_Float(string, "CordX"), dini_Float(string, "CordY"), dini_Float(string, "CordZ"), dini_Float(string, "Angulo"), dini_Int(string, "Cor1"), dini_Int(string, "Cor2"));
dini_IntSet(string, "Id", carroid);
proximocarro++;
}
}
return 1;
}
}
troque
for(new v; v<MAX_VEHICLES; v++) SetVehicleToRespawn(v);
por
SetVehicleToRespawn(v);
tambem tente usar
for(new v = 0; v < MAX_VEHICLES; v++)
{
SetVehicleToRespawn(v);
}
Coloquei isto, compilou de boa, mas ainda fica respawnando os carros usados. E agora?
|
o topico tava /rv
se vocк quizer /rvu
for(new v = 0; v < MAX_VEHICLES; v++)
{
if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);
}
// stock
stock IsVehicleOccupied(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER || GetPlayerState(i) == PLAYER_STATE_PASSENGER)
{
if(GetPlayerVehicleID(i) == vehicleid)
{
return 1;
}
}
}
}
return 0;
}
Estou com a mesma dъvida mais preciso disto em ZCMD, Poderia ajudar?
|
CMD:rvu(playerid) { if(pAdmin[playerid] >= 1) for(new v = 0; v < MAX_VEHICLES; v++) { if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v); } } new string[80], pNome[MAX_PLAYER_NAME]; GetPlayerName(playerid, pNome, MAX_PLAYER_NAME); format(string, sizeof(string), "O(A) administrador %s (%d) respawnou todos os veнculos desocupados.", pNome,(playerid); SendClientMessageToAll(-1, string); return 1; }
Tenta esse,
Code:
CMD:rvu(playerid) { if(pAdmin[playerid] >= 1) for(new v = 0; v < MAX_VEHICLES; v++) { if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v); } } new string[80], pNome[MAX_PLAYER_NAME]; GetPlayerName(playerid, pNome, MAX_PLAYER_NAME); format(string, sizeof(string), "O(A) administrador %s (%d) respawnou todos os veнculos desocupados.", pNome,(playerid); SendClientMessageToAll(-1, string); return 1; } ![]() |
error 017: undefined symbol "IsVehicleOccupied
CMD:rvu(playerid)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERRO,"| ERRO | Vocк nгo й um administrador!");{
for(new v = 0; v < MAX_VEHICLES; v++)
{
if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);
}
}
new str[127];
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(str, sizeof(str), "[LvAdmin] O administrador(a) %s respawno os veнculos nгo ocupados!", aname);
SendClientMessageToAll(COLOR_ADM, str);
return 1;
}
CMD:rvu(playerid)
{
if(pAdmin[playerid] >= 1)
{
for(new v = 0; v < MAX_VEHICLES; v++)
{
if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);
}
new string[80], pNome[MAX_PLAYER_NAME];
GetPlayerName(playerid, pNome, MAX_PLAYER_NAME);
format(string, sizeof(string), "O(A) administrador %s (%d) respawnou todos os veнculos desocupados.", pNome, playerid);
SendClientMessageToAll(-1, string);
}
return 1;
}
stock IsVehicleOccupied(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER || GetPlayerState(i) == PLAYER_STATE_PASSENGER)
{
if(GetPlayerVehicleID(i) == vehicleid)
{
return 1;
}
}
}
}
return 0;
}
Vejo que o amiguinho sу copiou a parada e postou QUE BELEZAAAAAA
OBS:::: Vamos arrumar o cmd dele: pawn Code:
|
if(!strcmp(cmd,"/rv", true) && pAdmin[playerid] >= 1)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string),"{1E9FC7}| INFO | O(A) Administrador(a) %s[%d] respawnou todos os veiculos sem uso!", pname, playerid);
SendClientMessageToAll(0x80cf80AA, string);
new carro = 0;
for(carro = 0; carro < MAX_VEHICLES; carro++)
{
if(!IsVehicleOccupied(carro)) SetVehicleToRespawn(carro);
}
return 1;
}
CMD:rc(playerid, params[])
{
SendAdminText(playerid, "/rc", params);
if (APlayerData[playerid][PlayerLevel] < 2) return SendClientMessageToAll(-1, "{FFFF00}[ERRO] {FF0000}Vocк nгo tem permissгo para usar esse comando!");
{
for(new i; i < MAX_VEHICLES; i++)
{
if(!IsVehicleInUse(i))
SetVehicleToRespawn(i);
}
SendClientMessageToAll(-1, "{FFFF00}[INFO] {00FF00}O administrador respawnou todos os veнculos desocupados!");
}
return 1;
}
stock IsVehicleInUse(vehicleid)
{
new Veiculo;
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == vehicleid)
Veiculo = vehicleid;
if(GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid)
Veiculo = vehicleid;
}
return Veiculo;
}