[Ajuda] Comando /admvcarro
#1

Tipo q quando eu uso /admvcarro para vender um veiculo do player, tipo q aparece q ele foi vendido ... e ele vai direto para a concecionбria sу q , o carro q eu vendi, ainda continua com o mesmo dono ... nao sei pq , poderam me ajudar, para quando eu usa-se esse comando , iria vender o veiculo

aqui estб o codi

PHP код:
 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 (
PlayerInfo[playerid][pAdmin] >= 1340)
            {
                if(
admtrampando[playerid] < 1 && PlayerInfo[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);
                
SaveCars();
                
SetVehicleToRespawn(carid2);
                return 
1;
            }
            else
            {
                
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem permissгo para usar esse comando !");
            }
        }
        return 
1;
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)