Rent Dialog

MilosColbart Započeo ShomY071
pre 7 godina
524
pregleda
10
postova
MilosColbart
Enforcer
pre 7 godina
Problem(error/warning): Problem je u tome sto se u dialogu prikazuje samo zadnje vozilo (zadnji fRentVeh koji je veci od 0), tj ako je fRentVeh2 405 (id od sentinela), pisace samo Sentinel u dialogu, nbtn da li postoji i fRentVeh1.. Takodje
Dio skripte:

    format(rentveh, sizeof(rentveh), "");
if(FirmaInfo > 0)
{
format(strg1, sizeof(strg1), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg1, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg2, sizeof(strg2), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg2, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg3, sizeof(strg3), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg3, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg4, sizeof(strg4), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg4, sizeof(rentveh));
}
SPD(playerid, RENTFIRMA_RENT, DIALOG_STYLE_LIST, "Izaberi Vozilo", rentveh, "Iznajmi", "Izlaz");

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Slika/video ingame problema(obavezno ako je ingame problem): https://ibb.co/pjhYJJ9 (( feltzer je inc vozilo sa fRentVeh3, prethodna 2 su bmx i sentinel, ali se oni ne prikazuju, tako isto se nece feltzer prikazivati ako budem kupio jos 1 vozilo ))
Armandooâ„¢
Shot Caller
pre 7 godina
probaj ovako nisam siguran da će raditi
format(rentveh, sizeof(rentveh), "");
if(FirmaInfo > 0)
{
format(strg1, sizeof(strg1), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg1, sizeof(rentveh));
}
if(FirmaInfo > 0)
{
format(strg2, sizeof(strg2), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg2, sizeof(rentveh));
}
if(FirmaInfo > 0)
{
format(strg3, sizeof(strg3), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg3, sizeof(rentveh));
}
if(FirmaInfo > 0)
{
format(strg4, sizeof(strg4), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg4, sizeof(rentveh));
}
SPD(playerid, RENTFIRMA_RENT, DIALOG_STYLE_LIST, "Izaberi Vozilo", rentveh, "Iznajmi", "Izlaz");
Mate
Underboss
pre 7 godina
Ne koristi else if/if gdje ti ne treba, prebaci u switch/case. Pogledaj isto tako, dali su na nekakvoj listi poravnati da budu tako gdje treba u dialog.
MilosColbart
Enforcer
pre 7 godina
prebacivanje else if u if nece pomoci, takodje msm da GodoS tvoja preporuka nece pomoci, btw to je cmd, ne dialog...
Pa ja sam 100% siguran da je problem u tome sto ne otvara novi red, ali ne kapiram kako da sastavim ovo a da otvara lepo kako je i zamisljeno 😛
TerzaScripting
Underboss
pre 7 godina
Posalji taj dialog ceo
MilosColbart
Enforcer
pre 7 godina
Sve sto ima veze sa ovim dialogo trenutno, nalazi se ovde 😛

    new rentveh, strg1, strg2, strg3, strg4;
format(rentveh, sizeof(rentveh), "");
if(FirmaInfo > 0)
{
format(strg1, sizeof(strg1), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg1, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg2, sizeof(strg2), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg2, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg3, sizeof(strg3), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg3, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg4, sizeof(strg4), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg4, sizeof(rentveh));
}
SPD(playerid, RENTFIRMA_RENT, DIALOG_STYLE_LIST, "Izaberi Vozilo", rentveh, "Iznajmi", "Izlaz");
TerzaScripting
Underboss
pre 7 godina
ShomY071 wrote on December 21, 2018, 10:25 pm:
Sve sto ima veze sa ovim dialogo trenutno, nalazi se ovde 😛

    new rentveh, strg1, strg2, strg3, strg4;
format(rentveh, sizeof(rentveh), "");
if(FirmaInfo > 0)
{
format(strg1, sizeof(strg1), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg1, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg2, sizeof(strg2), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg2, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg3, sizeof(strg3), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg3, sizeof(rentveh));
}
else if(FirmaInfo > 0)
{
format(strg4, sizeof(strg4), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
strcat(rentveh, strg4, sizeof(rentveh));
}
SPD(playerid, RENTFIRMA_RENT, DIALOG_STYLE_LIST, "Izaberi Vozilo", rentveh, "Iznajmi", "Izlaz");

Koristi samo if ako vec to hoces.
Obrisi ove stringove 'strg1(2,3,4,5,6)' i formatiraj u jedan
format(buffer, sizeof(buffer), "%s- %s\t%d$\n", buffer, ....);

Takodje i format rentveh na pocetku je bespotreban..
MilosColbart
Enforcer
pre 7 godina
Nisam te bas razumeo oko buffera ovog, tj oko formatiranja sve u 1 string,  mozes malo detaljnije da mi obj ?
TerzaScripting
Underboss
pre 7 godina

new
buffer[(21 + 30 + 10) * 2];

if(FirmaInfo > 0)
{
format(buffer, sizeof(buffer), "- %s\t"C_ZELENA"%d$\n", GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
}
if(FirmaInfo > 0)
{
format(buffer, sizeof(buffer), "%s- %s\t"C_ZELENA"%d$\n", buffer, GetVehicleNameEx(FirmaInfo), RentCena(FirmaInfo));
}
.
.
.
MilosColbart
Enforcer
pre 7 godina
fixano

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava