12.04.2012, 06:59
pawn Код:
if(strcmp(cmd, "/admvcarro", true) == 0 || strcmp(cmd, "/admvc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /admvcarro [Carro id]");
return 1;
}
new vehid = strval(tmp);
if(!CarroMala(vehid))
{
SendClientMessage(playerid, COLOR_GREY, "Digite o ID de um Carro VIP Vбlido.");
return 1;
}
vehid = vehid-totalveiculosc;
if (PlayerInfo[playerid][pAdmin] >= 1340)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341 && PlayerInfo[playerid][pAdmin] != 1340)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
CarInfo[vehid][cOwned] = 0;
strmid(CarInfo[vehid][cOwner], "Dealership", 0, strlen("Dealership"), 999);
format(string, sizeof(string), "~w~Voce vendeu este veiculo");
GameTextForPlayer(playerid, string, 10000, 3);
new rand = random(sizeof(gRandomCarsSpawns));
CarInfo[vehid][cLocationx] = gRandomCarsSpawns[rand][0];
CarInfo[vehid][cLocationy] = gRandomCarsSpawns[rand][1];
CarInfo[vehid][cLocationz] = gRandomCarsSpawns[rand][2];
CarInfo[vehid][cAngle] = gRandomCarsSpawns[rand][3];
RemovePlayerFromVehicleEx(playerid);
DestroyVehicle(vehid+totalveiculosc);
new carid2 = CreateVehicle(CarInfo[vehid][cModel],CarInfo[vehid][cLocationx],CarInfo[vehid][cLocationy],CarInfo[vehid][cLocationz]+1.0,CarInfo[vehid][cAngle],CarInfo[vehid][cColorOne],CarInfo[vehid][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
SaveCars();
SetVehicleToRespawn(carid2);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem permissгo para usar esse comando !");
}
}
return 1;
}