pawn Код:
if(strcmp(cmd, "/repararcarro", true) == 0)// By DJ Bruninho(Bruno Pereira)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, TEAM_GREEN_COLOR, " Veiculo Reparado");
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/criarcarro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [carid] [COLOR1] [COLOR2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "O ID do veнculo nгo pode ser inferior a 400 nem superior a 611!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [carid] [COLOR1] [COLOR2]");
return 1;
}
new COLOR1;
COLOR1 = strval(tmp);
if(COLOR1 < 0 || COLOR1 > 255) { SendClientMessage(playerid, COLOR_GREY, "O nъmero da Cor 1 nгo pode ser menor a 1 nem maior a 255!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [carid] [COLOR1] [COLOR2]");
return 1;
}
new COLOR2;
COLOR2 = strval(tmp);
if(COLOR2 < 0 || COLOR2 > 255) { SendClientMessage(playerid, COLOR_GREY, "O nъmero da Cor 2 nгo pode ser menor a 1 nem maior a 255!"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, COLOR1, COLOR2, 60000);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
format(string, sizeof(string), "Carro %d criado com sucesso.", carid);
SendClientMessage(playerid, COLOR_YELLOW2, string);
SendClientMessage(playerid, COLOR_LIGHTRED, "Nгo crie muitos carros pois vocк poderб ser PUNIDO!");
SetVehicleNumberPlate(carid, "DJBruninho");
new message[128];
format(message,sizeof(message), "\n\n\n\n\n\n\n\nCarro Criado\nPor: %s", PlayerName(playerid));
VehicleLicense[carid] = Create3DTextLabel(message, COLOR_AZULBB, 0.0, 0.0, 0.0, 50.0, 0, 0);
Attach3DTextLabelToVehicle(VehicleLicense[carid], carid, 0.0, 0.0, 2.0);
format(string, 256, "[CARRO]: O Player %s criou o carro id %d, totalizando: %d carros no servidor.",PlayerName(playerid),car,carid);
ABroadCast(COLOR_LIGHTRED,string,1);
}
return 1;
}