28.01.2015, 20:08
Bem tentei criar um comando /admvcarro para vender os carros vip, quando digito /admvcarro [id carro]
o carro respawna na concessionaria e continua com o mesmo dono
o carro respawna na concessionaria e continua com o mesmo dono
Код:
}
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);
vehid -= totalveiculosc;
if (JogadorInfo[playerid][pAdmin] >= 1340)
{
if(admtrabalhando[playerid] < 1 && JogadorInfo[playerid][pAdmin] != 1340 && JogadorInfo[playerid][pAdmin] != 1341 && JogadorInfo[playerid][pAdmin] != 1342)
{
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);
CarregarCarros();
SetVehicleToRespawn(carid2);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem permissгo para usar esse comando !");
}
}
return 1;



nгo estou usando o bgl, sou iniciante estou tentando desbugar essa gm e estudando, pode explicar melhor? onde devo meter o codigo?