[pomoc] dialog fs

Započeo El Toni, Maj 13, 2012, 12:21:26 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: CL
Detaljan opis problema: pa dali su mi jednu FS koja je sa dinamicno radenje firme....idem na srw postavim firmu i kad se doblizis daje ti dialog sa Kupi FIrma - Prodaj firma - Izvadi pare ali te ne rade a i kad se maknes iz pickup i odes na taij opet ili na neki drug ne pokaze ti dialog samo jednom ti pokaze ako oces opet moras relog napravit?? zasto je tako ...moze neko da mi objasni kako da napravim taij dialog u komande... /kupi /prodaj /pare ..ili da mi pomogne da sredimo problem sa dialog...evo deo skripte ako nie taj del recite mi koij da kopiram da vi dam tu...
Dio skripte:
//--------------------------------------------------------------------------
//Obicni dialog koji se moze samo ugasiti
if(dialogid == closedialog) {
if(response || !response) return SetPVarInt(playerid, "dialog", 0);
//--------------------------------------------------------------------------
//Dialog za kupiti bizz, prodati ga, uci u njega, dignuti novac ili zakljucati
}else if(dialogid == bizzdialog) {
if(!response) return SetPVarInt(playerid, "dialog", 0);
//----------------------------------------------------------------------
#if !defined SIMPLE_BIZZS // Ukoliko nije definirano te koristimo bizzeve s interiorima
//----------------------------------------------------------------------
if(listitem == 0) {
    for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
if(bInfo[i][bLocked] == 1) { GameTextForPlayer(playerid, "~r~Zakljucano ~w~!", 2000, 6); SetPVarInt(playerid, "dialog", 0); return 1; }
        SetPlayerPos(playerid, bInfo[i][bIntX], bInfo[i][bIntY], bInfo[i][bIntZ]); SetPlayerInterior(playerid, bInfo[i][bInterior]); SetPlayerVirtualWorld(playerid, bInfo[i][bVW]); SetPVarInt(playerid, "dialog", 0); SetPVarInt(playerid, "enterbizz", 1); return 1; } }
}else if(listitem == 1) {
    for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
if(GetPVarInt(playerid, "bizz") != -1) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Vekje si vlasnik na nekoj biznis!"); SetPVarInt(playerid, "dialog", 0); return 1; }
if(bInfo[i][bKupljen] == 1) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Ovoj biz ima vlasnik !"); SetPVarInt(playerid, "dialog", 0); return 1; }
#if defined CHECK_LEVEL
if(bInfo[i][bLevel] > GetPlayerScore(playerid)) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Nemas dovolen level za da ja kupis ovaa firma !"); SetPVarInt(playerid, "dialog", 0); return 1; }
#endif
if(bInfo[i][bCijena] > GetPlayerMoney(playerid)) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Nemas dovolno pari da ja kupis ovaa firma !"); SetPVarInt(playerid, "dialog", 0); return 1; }
new string[256], stringa[MAX_PLAYER_NAME]; format(string,sizeof(string),"Dali si siguren da ja kupis ovaa firma  ?\n\nCena: %d $\nZarabotka: %d $\nLevel: %d",bInfo[i][bCijena],bInfo[i][bZarada],bInfo[i][bLevel]); format(stringa,sizeof(stringa),"%s",bInfo[i][bIme]); ShowPlayerDialog(playerid, bizzkupidialog, DIALOG_STYLE_MSGBOX, stringa, string, "Kupi", "Odustani"); } }
    }else if(listitem == 2) {
    for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
if(GetPVarInt(playerid, "bizz") != i) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Ne si vlasnik na ovoj biz !"); SetPVarInt(playerid, "dialog", 0); return 1; }
new string[256], stringa[MAX_PLAYER_NAME]; SetPVarInt(playerid, "dialog", 1); format(string,sizeof(string),"Dali si siguren da ja prodades ovaa firma ?\n\nCena: %d $\nZarabotka: %d $\nLevel: %d",bInfo[i][bCijena],bInfo[i][bZarada],bInfo[i][bLevel]); format(stringa,sizeof(stringa),"%s",bInfo[i][bIme]); ShowPlayerDialog(playerid, bizzprodajdialog, DIALOG_STYLE_MSGBOX, stringa, string, "Prodaj", "Odustani"); } }
    }else if(listitem == 3) {
    for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
if(GetPVarInt(playerid, "bizz") != i) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Nisi vlasnik ovog bizza !"); SetPVarInt(playerid, "dialog", 0); return 1; }
new string[256], stringa[MAX_PLAYER_NAME]; format(string,sizeof(string), "Upisi koliko novaca zelis podignti !\nMAX: %d $", bInfo[i][bNovac]); format(stringa, sizeof(stringa), "%s", bInfo[i][bIme]); ShowPlayerDialog(playerid, bizznovacdialog, DIALOG_STYLE_INPUT, stringa, string, "Podigni", "Odustani"); } }
        }else if(listitem == 4) {
    for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
if(GetPVarInt(playerid, "bizz") != i) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Nisi vlasnik ovog bizza !"); SetPVarInt(playerid, "dialog", 0); return 1; }
if(bInfo[i][bLocked] == 0) { bInfo[i][bLocked] = 1; GameTextForPlayer(playerid, "~r~Zakljucano~w~ !", 1000, 6); SetPVarInt(playerid, "dialog", 0); SaveBizz(i);
}else if(bInfo[i][bLocked] == 1) { bInfo[i][bLocked] = 0; GameTextForPlayer(playerid, "~g~Otkljucano~w~ !", 1000, 6); SetPVarInt(playerid, "dialog", 0); SaveBizz(i); return 1; } } } }
//----------------------------------------------------------------------
#else // Ukoliko koristimo bizzeve bez interiora
//----------------------------------------------------------------------
  if(listitem == 0) {
    for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
if(GetPVarInt(playerid, "bizz") != -1) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Vekje si vlasnik na firma !"); SetPVarInt(playerid, "dialog", 0); return 1; }
if(bInfo[i][bKupljen] == 1) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Ovaa firma ima vlasnik !"); SetPVarInt(playerid, "dialog", 0); return 1; }
#if defined CHECK_LEVEL
if(bInfo[i][bLevel] > GetPlayerScore(playerid)) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}:Ne si dovolen golem level za da ja kupis ovaa firma!"); SetPVarInt(playerid, "dialog", 0); return 1; }
#endif
if(bInfo[i][bCijena] > GetPlayerMoney(playerid)) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}:Nemas dovolno pari za da ja kupis ovaa fira !"); SetPVarInt(playerid, "dialog", 0); return 1; }
new string[256], stringa[MAX_PLAYER_NAME]; format(string,sizeof(string),"Dali si siguren deka sakas da go kupis ovoj biznis ?\n\nCena: %d $\nZarabotka: %d $\nLevel: %d",bInfo[i][bCijena],bInfo[i][bZarada],bInfo[i][bLevel]); format(stringa,sizeof(stringa),"%s",bInfo[i][bIme]); ShowPlayerDialog(playerid, bizzkupidialog, DIALOG_STYLE_MSGBOX, stringa, string, "Kupi", "Odustani"); } }
    }else if(listitem == 1) {
    for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
if(GetPVarInt(playerid, "bizz") != i) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Ne si vlasnik na ovoj biznis !"); SetPVarInt(playerid, "dialog", 0); return 1; }
new string[256], stringa[MAX_PLAYER_NAME]; SetPVarInt(playerid, "dialog", 1); format(string,sizeof(string),"Dali si siguren da go prodades ovoj biznis ?\n\nCena: %d $\nZarabotka: %d $\nLevel: %d",bInfo[i][bCijena],bInfo[i][bZarada],bInfo[i][bLevel]); format(stringa,sizeof(stringa),"%s",bInfo[i][bIme]); ShowPlayerDialog(playerid, bizzprodajdialog, DIALOG_STYLE_MSGBOX, stringa, string, "Prodaj", "Odustani"); } }
    }else if(listitem == 2) {
    for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
if(GetPVarInt(playerid, "bizz") != i) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Ne si vlasnik na ovoj biznis !"); SetPVarInt(playerid, "dialog", 0); return 1; }
new string[256], stringa[MAX_PLAYER_NAME]; format(string,sizeof(string), "Napisi kolku pari sakas da izvadis !\nMAX: %d $", bInfo[i][bNovac]); format(stringa, sizeof(stringa), "%s", bInfo[i][bIme]); ShowPlayerDialog(playerid, bizznovacdialog, DIALOG_STYLE_INPUT, stringa, string, "Podigni", "Odustani"); } } }
//----------------------------------------------------------------------
#endif

//Dialog za odluciti dali izaci iz bizza
}else if(dialogid == bizzizlazakdialog) {
    if(!response) return SetPVarInt(playerid, "dialog", 0);
for(new i=0;i<CountBizzs();i++) {
    if(PlayerToPoint(5.0, playerid, bInfo[i][bIntX], bInfo[i][bIntY], bInfo[i][bIntZ]) && GetPlayerVirtualWorld(playerid) == bInfo[i][bVW]) { SetPlayerPos(playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetPVarInt(playerid, "dialog", 0); SetPVarInt(playerid, "enterbizz", 1); PlayerPlaySound(playerid, 1149, 0, 0, 0); return 1; } }
//--------------------------------------------------------------------------
//Dialog za odluciti dali kupiti bizz
}else if(dialogid == bizzkupidialog) {
    if(!response) return SetPVarInt(playerid, "dialog", 0);
        for(new i=0;i<CountBizzs();i++) {
if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
            if(GetPVarInt(playerid, "bizz") != -1) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Vekje si vlasnik na nekoj biznis !"); SetPVarInt(playerid, "dialog", 0); return 1; }
  if(bInfo[i][bKupljen] == 1) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Ovoj biznis ima vlasnik !"); SetPVarInt(playerid, "dialog", 0); return 1; }
if(bInfo[i][bCijena] > GetPlayerMoney(playerid)) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Nemas dovolno pari za da ja kupis ovaa firma !"); SetPVarInt(playerid, "dialog", 0); return 1; }
new string[256]; SetPVarInt(playerid, "bizz", i); bInfo[i][bKupljen] = 1; strmid(bInfo[i][bVlasnik], pName(playerid), 0, strlen(pName(playerid)), 255); GIVE_MONEY_COMMAND(playerid, -bInfo[i][bCijena]); SaveBizz(i);
format(string,sizeof(string),"Cestito!Kupivte firma !\n\n%s\nCena: %d $\nZarabotka: %d $\nPari: %d $",bInfo[i][bIme], bInfo[i][bCijena], bInfo[i][bZarada], bInfo[i][bNovac]); ShowPlayerDialog(playerid, closedialog, DIALOG_STYLE_MSGBOX, "Cestitamo !", string, "Zatvori", ""); } }
//--------------------------------------------------------------------------
//Dialog za odluciti dali prodati bizz
}else if(dialogid == bizzprodajdialog) {
    if(!response) return SetPVarInt(playerid, "dialog", 0);
        for(new i=0;i<CountBizzs();i++) {
if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
            if(GetPVarInt(playerid, "bizz") != i) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Ne si vlasnik na ovoj biznis !"); SetPVarInt(playerid, "dialog", 0); return 1; }
SetPVarInt(playerid, "dialog", 0); SetPVarInt(playerid, "bizz", -1); bInfo[i][bKupljen] = 0; bInfo[i][bLocked] = 0; strmid(bInfo[i][bVlasnik], "Se prodava", 0, strlen("Na_Prodaju"), 255); GIVE_MONEY_COMMAND(playerid, bInfo[i][bCijena]);
new string[256]; format(string,sizeof(string),"* BIZZ{FFFFFF}: Prodade firma , nazad dobi %d $", bInfo[i][bCijena]); SendClientMessage(playerid, bizzboja1, string); SaveBizz(i); } }
//--------------------------------------------------------------------------
//Dialog za upisati koliko novaca zelis podignuti iz bizza
}else if(dialogid == bizznovacdialog) {
    if(!response || !inputtext[0]) return SetPVarInt(playerid, "dialog", 0);
        for(new i=0;i<CountBizzs();i++) {
if(PlayerToPoint(5.0, playerid, bInfo[i][bPosX], bInfo[i][bPosY], bInfo[i][bPosZ])) {
            if(GetPVarInt(playerid, "bizz") != i) { SendClientMessage(playerid, crvena, "* BIZZ{FFFFFFF}: Ne si vlasnik na ovoj biznis !"); SetPVarInt(playerid, "dialog", 0); return 1; }
new string[256], stringa[MAX_PLAYER_NAME], novac = strval(inputtext);
if(novac < 1) { format(string,sizeof(string), "Napisi kolku sakas da izvadis !\nMAX: %d $", bInfo[i][bNovac]); format(stringa, sizeof(stringa), "%s", bInfo[i][bIme]); SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Nemozes ne podignuti nista iz ovog bizza !"); ShowPlayerDialog(playerid, bizznovacdialog, DIALOG_STYLE_INPUT, stringa, string, "Podigni", "Odustani"); return 1; }
if(novac > bInfo[i][bNovac]) { SetPVarInt(playerid, "dialog", 0); format(string,sizeof(string), "Napisi kolko sakas da izvadis pari!\nMAX: %d $", bInfo[i][bNovac]); format(stringa, sizeof(stringa), "%s", bInfo[i][bIme]); SendClientMessage(playerid, crvena, "* BIZZ{FFFFFF}: Nemas toliko novaca u bizzu !"); return 1; }
GIVE_MONEY_COMMAND(playerid, novac); bInfo[i][bNovac]-=novac; format(string,sizeof(string),"Izvadi: %d $\nStanje bizza: %d",novac,bInfo[i][bNovac]); format(stringa,sizeof(stringa),"%s",bInfo[i][bIme]); ShowPlayerDialog(playerid, closedialog, DIALOG_STYLE_MSGBOX, stringa, string, " ", "Zatvori"); SaveBizz(i); } }
//--------------------------------------------------------------------------
    return 1; }
return 0; }

ovo je celi dialog..
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Maj 13, 2012, 12:22:13 POSLE PODNE od Gigov.so