if(strcmp(cmd, "/veh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(CreatedCar >= 100)
{
SendClientMessage(playerid, COLOR_GRAD1, "Jб criaram muitos carros, destrua alguns primeiro /destruirid");
return true;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [IDCARRO] [COR1] [COR2]");
return true;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, " Modelo Do Carro Tem Que Ser Entre 411 e 600 !"); return true; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [IDCARRO] [COR1] [COR2]");
return true;
}
new COLOR1;
COLOR1 = strval(tmp);
if(COLOR1 < 0 || COLOR1 > 236) { SendClientMessage(playerid, COLOR_GREY, " Nъmero Da Cor tem que ser entre 0 e 126 !"); return true; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [IDCARRO] [COR1] [COR2]");
return true;
}
new COLOR2;
COLOR2 = strval(tmp);
if(COLOR2 < 0 || COLOR2 > 236) { SendClientMessage(playerid, COLOR_GREY, " Nъmero Da Cor tem que ser entre 0 e 126 !"); return true; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y+2,Z, 0.0, COLOR1, COLOR2, 60000);
new mot, lu, alar, por, cap, porma, ob;
//new carro = GetPlayerVehicleID(playerid);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
GetVehicleParamsEx(carid, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carid, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
format(string, sizeof(string), " Veiculo %d Criado.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
return true;
}
if(!strcmp("/destruirid", cmdtext, true))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
MSGPLAYER(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
return 1;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
new counter = 0;
new result;
new plyName[MAX_PLAYER_NAME];
GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
for(new i; i != MAX_VEHICLES; i++)
{
new dist = ChecarveiculoThiago(5, playerid, i);
if(dist)
{
result = i;
counter++;
}
}
switch(counter)
{
case 0:
{
MSGPLAYER(playerid, COLOR_GREY, " Nгo hб nenhum carro nesse raio!");
}
case 1:
{
if(result < CAR_AMOUNT)
{
MSGPLAYER(playerid, COLOR_GREY, "Vocк sу pode destruir veнculos criados");
return 1;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
DestroyVehicle(result);
format(string, sizeof(string), "Vocк destruiu o veнculo ID:[%d]", result);
MSGPLAYER(playerid, COLOR_GREY, string);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi destruido Por: Boot_Server", result);
ABroadCast(COLOR_YELLOW,string,1);
}
else
{
format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi destruido Por: %s", result, name);
ABroadCast(COLOR_YELLOW,string,1);
}
}
default:
{
MSGPLAYER(playerid, COLOR_GREY, " Foram encontrados mais de um carro nesse raio");
}
}
}
return 1;
}
if(!strcmp("/rcarro", cmdtext, true) || !strcmp("/repararid", cmdtext, true))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
MSGPLAYER(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
return 1;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
new counter = 0;
new result;
new plyName[MAX_PLAYER_NAME];
GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
for(new i; i != MAX_VEHICLES; i++)
{
new dist = ChecarveiculoThiago(5, playerid, i);
if(dist)
{
result = i;
counter++;
}
}
switch(counter)
{
case 0:
{
MSGPLAYER(playerid, COLOR_GREY, " Nгo hб nenhum carro nesse raio!");
}
case 1:
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Vocк reparou o carro ID:[%d]", result);
MSGPLAYER(playerid, COLOR_GREY, string);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi reparado Por: Boot_Server", result);
ABroadCast(COLOR_YELLOW,string,1);
}
else
{
format(string, sizeof(string), "AdmAviso: Carro ID:[%d] foi reparado Por: %s", result, name);
ABroadCast(COLOR_YELLOW,string,1);
}
RepairVehicle(result);
}
default:
{
MSGPLAYER(playerid, COLOR_GREY, " Foram encontrados mais de um carro nesse raio");
}
}
}
return 1;
}
native IsValidVehicle(vehicleid);
new count=0;
for(new vehicleid=0; vehicleid < MAX_VEHICLES; vehicleid++)
{
if(IsValidVehicle(vehicleid))
{
count++;
}
}
new cstring[128];
format(cstring, sizeof(cstring), "Carros no servidor: %i || Maximo de carros permitido: %i || Quantos carros ainda podem ser adicionados: %i", count, MAX_VEHICLES, MAX_VEHICLES - count);
SendClientMessage(playerid, 0x00FF00FF, cstring);
return 1;
|
Quando vocк inicia um servidor caseiro aparece:
Number of vehicles models : (QUANTIA). Sу pega essa quantia e definir "Define CAR_AMOUNT". |
|
Number of vehicles models й o numero de modelos de veнculos existentes no servidor e nгo a quantia de veнculos.
|