Requesting Car (+rep)
#1

Hello.I have problem with selling a car to player.When i sell to him and he accept the request and the car is mine again ... And i can type /vozilo its on macedonian language but its /car command and i can type /car he can't type /car but i sell the car to him and not working :/ why ?? but text is working perfectly ... Repping Thanks but fast please if is possible Thanks

pawn Код:
if(dialogid == DIALOG_APPONUDA)
        {
            new i;
            new TCID, TCID1;
            new sendername[MAX_PLAYER_NAME];
            new prodaznovozilo = GetPlayerVehicleID(playerid);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            i = ConvertVehIDtoDYID(prodaznovozilo);
            if(!response)
            {
                SCMF(ProdavacAvtomobil[playerid],BELA,"{739EFA}%s ja odbi ponudata da go kupi vasiot Avtomobil",GetName(playerid));
                SCMF(playerid,BELA,"{739EFA}Ja odbivte ponudata da go kupite avtomobilot na %s",GetName(ProdavacAvtomobil[playerid]));
                CenaAvtomobil[playerid] = 0;
                IDavtomobil[playerid] = 0;
                IgracKProdajesA[ProdavacAvtomobil[playerid]] = 0;
                ProdavacAvtomobil[playerid] = 0;
            }
            else
            {
                TCID = PlayerOwnedVehID(playerid,prodaznovozilo);
                TCID1 = PlayerOwnedVehID(ProdavacAvtomobil[playerid],prodaznovozilo);
                if(!ProxDetectorS(5.0,playerid,ProdavacAvtomobil[playerid])) return SCM(playerid,BELA,"{FF4040}GRESKA:{FFFFFF}Gazdata na avtomobilot ne e blisku do vas!");
                if(GetPlayerMoney(playerid) < CenaAvtomobil[playerid]) return SCM(playerid,BELA,"{FF4040}GRESKA:{FFFFFF}Nemate dovolno pari za da go kupite ovoj Avtomobil");
                if(PlayerInfo[playerid][pLevel] < 5) return SCM(playerid,BELA,"{FF4040}GRESKA:{FFFFFF}Nemate dovolno Level za da kupite Avtomobil (5+)");
                GivePlayerMoney(playerid,-CenaAvtomobil[playerid]);
                GivePlayerMoney(ProdavacAvtomobil[playerid],CenaAvtomobil[playerid]);
                SCMF(playerid, COLOR_WHITE, "{739EFA}Ja prifativte ponudata i go kupivte avtomobilot na %s", GetName(ProdavacAvtomobil[playerid]));
                SCMF(ProdavacAvtomobil[playerid], COLOR_WHITE, "{739EFA}%s ja prifati ponudata i go kupi vasiot avtomobil", GetName(playerid));
                strmid(MyVehicle[TCID][MyVehOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);
                RemovePlayerFromVehicle(ProdavacAvtomobil[playerid]);
                MyVehicle[TCID][MyVehCar] = 1;
                OnPlayerUpdate(playerid);
                MyVehicle[TCID1][MyVehCar] = -1;
                OnPlayerUpdate(ProdavacAvtomobil[playerid]);
                MyVehicle[TCID][MyVehLock] = 0;
            }
        }
Thanks

that is /vozilo command (/car)

pawn Код:
CMD:vozilo(playerid,params[])
{
    new vozilo = GetPlayerVehicleID(playerid);
    new cm = AllMyCars(playerid);
    if(cm < 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "{FF4040}GRESKA:{FFFFFF}Ne poseduvate vozilo");
        return 1;
    }
    if(PlayerOwnedVehID(playerid,vozilo) != -1)
    {
        ShowPlayerDialog(playerid,AVTOMENI, DIALOG_STYLE_LIST,"{FF4040}°{739EFA} Avtomobil Meni {FF4040}°","{FF4040}» {739EFA}Otkluci\n{FF4040}» {739EFA}Zakluci\n{FF4040}» {739EFA}Parkiraj\n{FF4040}» {739EFA}Registriraj\n{FF4040}» {739EFA}Lociraj\n{FF4040}» {739EFA}Prodadi\n{FF4040}» {739EFA}Prodadi na Igrac","Odberi","Otkazi");
    }
    else
    {
        ShowPlayerDialog(playerid,AVTOMENI1, DIALOG_STYLE_LIST, "{FF4040}°{739EFA} Avtomobil Meni {FF4040}°","{FF4040}» {739EFA}Pronajdi Avtomobil","Odberi","Otkazi");
        return 1;
    }
    return 1;
}
PlayerOwnedVehID

pawn Код:
stock PlayerOwnedVehID(playerid,vehicleid)
{
    new ime[MAX_PLAYER_NAME];
    GetPlayerName(playerid,ime,sizeof(ime));
    for(new i = 0; i < sizeof(MyVehicle); i++)
    {
            if(MyVehicle[i][MyVehSlot] == 1 && MyVehicle[i][MyVehID] == vehicleid)
            {
                if (strmatch(MyVehicle[i][MyVehOwner], ime))return i;
            }
    }
    return -1;
}
Reply
#2

help?
Reply
#3

pawn Код:
MyVehicle[playeris][MyVehCar] = -1; //to make the seller car set to none
Reply
#4

i have it but i know right now what is problem ... If the owner of vehicle MyVehOwner not change to player which car was selled he cant type /vozilo but now why strmid not working here ?;/
Reply
#5

helpp
Reply
#6

bumpp
Reply
#7

help please :/
Reply
#8

Bump plz repping
Reply
#9

nevermind i fixed ... the problem was in car. .. i put GetPlayerVehicleID(playerid); and now working thanks repped for all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)