[pomoc] dialog problem

Započeo El Toni, Februar 01, 2013, 00:54:26 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim: EVL
Detaljan opis problema: kad udzem u auto koe se prodaje nekad mi izadze dialog i tekst za da kupim vozilo a nekad neizade ? sta je problem kako da uradim kad udzem u auto na prodaji da izadze dialog za kupuvanje? evo dio skripte
Dio skripte:
if(IsAnOwnableCar(newcar))
{
    if(CarInfo[newcar][cOwned]==0)
    {
format(string, sizeof(string), "{FFAF00}Se Prodava\n{FFAF00}Model: {FFFFFF}%s\n{FFAF00}Cena: {FFFFFF}%d", CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
    ShowPlayerDialog(playerid, 669, DIALOG_STYLE_MSGBOX, "{FFAF00}Prodazba", string, "Kupi", "Izlezi");
                format(string,sizeof(string),"{FFAF00}| Se Prodava | {FFAF00}Vozilo: {FFFFFF}%s {FFAF00}| Cena: {FFFFFF}%d {FFAF00}|",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
                SendClientMessage(playerid, COLOR_WHITE, string);
SCM(playerid,COLOR_GRAD1,"{FFAF00}[Prodavac] {FFFFFF}Dokolku ne vi se pokaze dialog napisete {FFAF00}/v buy !");
TogglePlayerControllable(playerid, 0);
}
    if(CarInfo[newcar][cOwned]==1)
    {
        format(string,sizeof(string),"{FFAF00}[Gazda]: {FFFFFF}%s",CarInfo[newcar][cOwner]);
SendClientMessage(playerid, COLOR_BLUE, string);
/*if(keycar != vehicle)
{
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
}*/
if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
else
{
    if(PlayerInfo[playerid][pAdmin] >= 1339 && AdminDuty[playerid] == 1)
{
    SendClientMessage(playerid, COLOR_WHITE, "[INFO] {FFAF00}Mozete da go vozite ova vozilo bidejki ste Admin na Dolznost !");
}
    else
    {
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid,0);
    SendClientMessage(playerid, COLOR_GREY, "Nemate klucevi od ova vozilo !");
}
}
}
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):




ovaj text ,tacnije dialog je podesen za vozila sa prodaje, tako da ce ti izbacivati text samo na vozilima sa prodaje, a ukoliko vozila nisu na prodaju, nece nista, i to je to

Gigov mislim da je problem to kad udjes u jedno auto na prodaji ima text pa izadjes u drugom nema ? vrati se opet u drugo imace... desavalo se i meni nista strasno :D

jeste..mozda je i od lag-a to..ali kad udzem u to vozilo i kad neizadze dialog mogu da startujem vozilo i da vozim :/

Citat: Gigov.so poslato Februar 01, 2013, 01:00:12 PRE PODNE
jeste..mozda je i od lag-a to..ali kad udzem u to vozilo i kad neizadze dialog mogu da startujem vozilo i da vozim :/
problem sigurno nije u skripti ilite u kodu, sada sam proverio, ispravno je, tako da ne moras da brines

Onda moram da vratim onaj 3D text sto pise da ja auto na prodaju..ja sam to trgo jel kad kupim auto i 3d text jos stoi do GMX.... pa sta je problem tu u ovo...kada kupim 3dtekst treba da se trgne ali kod mene ostane.. evo dio skripte

for(new h = 243; h < sizeof(CarInfo); h++)
{
AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
if(CarInfo[h][cOwned] == 0)
{
new result[500];
format(result, sizeof(result),"{FFAF00}Voziloto se Prodava!\n {FFAF00}Model:{ffffff} %s \n {FFAF00}Cena:{ffffff} $%d \n {FFAF00}za da kupis koristi {ffffff}/v buy {FFAF00}!", CarInfo[h][cDescription],CarInfo[h][cValue]);
vozilanap[h] = Create3DTextLabel(result,0x8361FFFF,CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz],15,0,1);
Attach3DTextLabelToVehicle(vozilanap[h], h, 0.0, 0.0, 0.0);
}
}


if(strcmp(x_nr,"sell",true) == 0)
        {
                  if(PlayerToPoint(160.0,playerid, 1654.2977,-1054.5654,23.8984))
                  {
    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
                {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    new ownvehkey;
                    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
                    else { return 1; }
                    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
                    {
                        new carsellprice = CarInfo[ownvehkey][cValue] / 4 * 3;
                        new Float:x,Float:y,Float:z;
                        new Float:a;
                        CarInfo[ownvehkey][cOwned] = 0;
                        strmid(CarInfo[ownvehkey][cOwner], "Dealership", 0, strlen("Dealership"), 999);
                        SafeJBC_GivePlayerMoney(playerid,carsellprice);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        format(string, sizeof(string), "~w~Go prodadovte avtomobilot za: ~n~~g~$%d", carsellprice);
                        GameTextForPlayer(playerid, string, 10000, 3);
                        GetVehiclePos(ownvehkey, x, y, z);
                        GetVehicleZAngle(ownvehkey, a);
                        CarInfo[ownvehkey][cLocationx] = x;
                        CarInfo[ownvehkey][cLocationy] = y;
                        CarInfo[ownvehkey][cLocationz] = z;
                        CarInfo[ownvehkey][cAngle] = a;
                        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { PlayerInfo[playerid][pPcarkey] = 999; }
                        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { PlayerInfo[playerid][pPcarkey2] = 999; }
                        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { PlayerInfo[playerid][pPcarkey3] = 999; }
                        RemovePlayerFromVehicle(playerid);
                        TogglePlayerControllable(playerid, 1);
                        if(PlayerInfo[playerid][pLocal] == ownvehkey)
                        {
                            SetPlayerInterior(playerid,0);
                            JBC_SetPlayerPos(playerid,CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]);
                            PlayerInfo[playerid][pInt] = 0;
                        }
                        OnPropUpdate();
                        OnPlayerUpdateCustom(playerid);
                        DestroyVehicle(ownvehkey);
CreateVehicle(CarInfo[ownvehkey][cModel],CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]+1.0,CarInfo[ownvehkey][cAngle],CarInfo[ownvehkey][cColorOne],CarInfo[ownvehkey][cColorTwo],60000);
new h= ownvehkey;
new result[500];
format(result, sizeof(result),"{FFAF00}Avtomobil na prodazba!\n {FFAF00}Model:{ffffff} %s \n {FFAF00}Cena:{ffffff} $%d \n {FFAF00}Da kupis napisi {ffffff}/v buy {FFAF00}!", CarInfo[h][cDescription],CarInfo[h][cValue]);
vozilanap[h] = Create3DTextLabel(result,0x8361FFFF,CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz],15,0,1);
Attach3DTextLabelToVehicle(vozilanap[h], h, 0.0, 0.0, 0.0);
return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "Morate da ste vo avtomobil! ");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Moras da bides na parking kaj banka kade se prodavaat vozila!");
                return 1;
            }
        }

u komandu za kupovinu vozila stavis da ti deletuje 3dtextlabel

Citat: Blaeks poslato Februar 01, 2013, 01:09:33 PRE PODNE
u komandu za kupovinu vozila stavis da ti deletuje 3dtextlabel
ups! mesto buy ja sam stavio sell komandu.. ima ono za brisenje 3dtext? evo pogledaj (Delete3DTextLabel(vozilanap[idcar]);)
else if(strcmp(x_nr,"buy",true) == 0)
        {
            if(IsAnOwnableCar(idcar))
            {
                if(PlayerInfo[playerid][pLevel] < 2)
    {
                    SendClientMessage(playerid, COLOR_GREY, "Morate da bidete lvl 2 da kupite vozilo!");
                    return 1;
    }
    if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Nemame veke zaliha", 5000, 4);
return 1;
}
    if(PlayerInfo[playerid][pPcarkey] == 999) { }
    else if(PlayerInfo[playerid][pPcarkey2] == 999) { }
    else if(PlayerInfo[playerid][pPcarkey3] == 999) { }
    else { SendClientMessage(playerid, COLOR_GREY, "Veke imate 3 vozila !"); return 1; }
if(CarInfo[idcar][cOwned]==1)
{
    SendClientMessage(playerid, COLOR_GREY, "[GREKSA] Nekoj veke go poseduva toa vozilo !");
    return 1;
}
if(GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])
{
    if(PlayerInfo[playerid][pPcarkey] == 999) { PlayerInfo[playerid][pPcarkey] = idcar; }
    else if(PlayerInfo[playerid][pPcarkey2] == 999) { PlayerInfo[playerid][pPcarkey2] = idcar; }
    else if(PlayerInfo[playerid][pPcarkey3] == 999) { PlayerInfo[playerid][pPcarkey3] = idcar; }
    else { return 1; }
CarInfo[idcar][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
SafeJBC_GivePlayerMoney(playerid,-CarInfo[idcar][cValue]);
SBizzInfo[1][sbTill] += 5000;
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
Delete3DTextLabel(vozilanap[idcar]);
GameTextForPlayer(playerid, "~w~Cestitamo~n~Ne zaboravajte /v park da go parkirate vaseto vozilo!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "{0F629F}Cestitame za novo kupeniot avtomobil!");
SendClientMessage(playerid, COLOR_GRAD2, "{0F629F}Napisete /vozilo da gi vidite upatstvata!");
SendClientMessage(playerid, COLOR_WHITE, "Sega mozete da go zapalite motorot !");
gEngine[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
DateProp(playerid);
OnPropUpdate();
OnPlayerUpdateCustom(playerid);
return 1;
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "Nemate dovolno pari kaj sebe ! ");
    return 1;
}
            }
        }
        else
        {

            ShowPlayerDialog(playerid,213,DIALOG_STYLE_MSGBOX, "{0F629F}Vozilo Pomos","{0F629F}/v park - {FFFFFF}Da go parkirate\n{0F629F}/v lock (1-3) - {FFFFFF}Da go zaklucite\n{0F629F}/v sell - {FFFFFF}Da go prodadete\n{0F629F}/v sellto - {FFFFFF}Da go prodadete na igrac\n{0F629F}/v color - {FFFFFF}Da go ofarbate\n{0F629F}/v list - {FFFFFF}Da vidite lista na vozila\n{0F629F}/v find(1-3) - {FFFFFF}Da go pronajdete voziloto","Ok","");
            return 1;
        }
    }
    return 1;
}


Poslednja Izmena: Februar 01, 2013, 01:22:30 PRE PODNE od Gigov.so

stavis u komandu kao sto si gore naveo :)

Citat: Blaeks poslato Februar 01, 2013, 10:45:57 PRE PODNE
stavis u komandu kao sto si gore naveo :)
ma ovo lete3DTextLabel(vozilanap[idcar]); vec je imalo u komandu ali nevredi opet..zabelezao sam kad udzem u auto i kad da dialog i kupim vozilo 3dtext stoi a kad kupim vozilo sa komandu /v buy dialog nestane ..?