Skripta: CLRP
Problem: Znam radit dialoge,,, ali mi slabo ide input ? Znaci nezz napravit da sad igrac kad kuca /bizname da mu izbaci dialog u inputu i da tu kuca ime biznisa...... ako moze neko pomoc
Dio skripte: http://pastebin.com/dc0sLrch
Slike// Video//
Jbg obnova ....
http://wiki.sa-mp.com/wiki/ShowPlayerDialog
eto ti to
napravi komandu ovako npr
if(strcmp(cmd, "/bizname", true) == 0)
{
if(IsPlayerConnected(playerid))
{
ShowPlayerDialog(playerid, 1325, DIALOG_STYLE_INPUT, "Firma", "Unesi ime firme", "Uredu", "Zatvori");
return 1;
}
}
I pod OnDialogResponse
if(dialogid == 1325)
{
if(response)
{
//Tu moras iz ove komande tvoje da prenes ono sto je potrebno i to
}
}
Pa to sma i ja znao nego iz komande sta treba dodat neka 2-3 reda..........
Ima gore aj evo ponov0....
if(strcmp(cmd, "/bizname", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new bouse = PlayerInfo[playerid][pPbiskey];
if (bouse == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "Ne posedujete biznis");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "Koristi: /bizname [Ime]");
}
if (bouse >= 100)
{
strmid(SBizzInfo[bouse-100][sbMessage], result, 0, 64, 255);
format(string, sizeof(string), "Ime biznisa je postavljeno na: %s",SBizzInfo[bouse-100][sbMessage]);
}
else
{
strmid(BizzInfo[bouse][bMessage], result, 0, 64, 255);
format(string, sizeof(string), "Ime biznisa je postavljeno na: %s",BizzInfo[bouse][bMessage]);
}
OnPropUpdate();
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
Mozel neko u if strmpc ??
Ma nisi nista rijesio sta ce se desit kad kuca /bizname sta ce se desit kad promjeni u input ime
Da ti pojasnim znaci.... kad kucam /bizname sve radi otvori mi dialog i unesem ali kad unesem ne promjeni se cak ni poslije resarta fali ti sta ce se desiti kada kucas input text jel razumijes?
Jbg obnova....
Probaj ovako...
if(strcmp(cmd, "/bizname", true) == 0)
{
new bouse = PlayerInfo[playerid][pPbiskey];
if(bouse == 255) return SCM(playerid, COLOR_GRAD2, "Ne posedujete biznis");
ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_INPUT, "Biz Ime", "Unesite novo ime biza ", "Promeni", "Izlaz");
return 1;
}
if(dialogid == 10000)
{
if(!response) return SCM(playerid,-1, "Izasli ste.");
if(response)
{
new bouse = PlayerInfo[playerid][pPbiskey];
new ime[40],string[80],i = PlayerInfo[playerid][pPbiskey];
if(bouse == 255 ) return SCM(playerid,-1, "Nemate biznis!");
if(sscanf(inputtext, "s[40]", ime)) return SPD(playerid, DIALOG_IBiz, DIALOG_STYLE_INPUT, "Biz Ime", "Unesite novo ime biz", "Promeni", "Izlaz");
if(strlen(ime) > 40) return SCM(playerid,-1,"Ime biza ne sme sadrzati vise od 40 znakova!");
strmid(BizzInfo[bouse][bMessage],,ime,0,strlen(ime),255);
format(string,sizeof(string),"Vase ime biza je postavljano na %s!",ime);
SendClientMessage(playerid,-1,string);
OnPropUpdate();
}
}
Ne radi ponovo ;)
Jbg obnova
Ja sam zajebao, trebalo bi sda raditi -.-
if(strcmp(cmd, "/bizname", true) == 0)
{
new bouse = PlayerInfo[playerid][pPbiskey];
if(bouse == 255) return SCM(playerid, COLOR_GRAD2, "Ne posedujete biznis");
ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_INPUT, "Biz Ime", "Unesite novo ime biza ", "Promeni", "Izlaz");
return 1;
}
if(dialogid == 10000)
{
if(!response) return SCM(playerid,-1, "Izasli ste.");
if(response)
{
new bouse = PlayerInfo[playerid][pPbiskey];
new ime[40],string[80],i = PlayerInfo[playerid][pPbiskey];
if(bouse == 255 ) return SCM(playerid,-1, "Nemate biznis!");
if(sscanf(inputtext, "s[40]", ime)) return ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_INPUT, "Biz Ime", "Unesite novo ime biz", "Promeni", "Izlaz");
if(strlen(ime) > 40) return SCM(playerid,-1,"Ime biza ne sme sadrzati vise od 40 znakova!");
strmid(BizzInfo[bouse][bMessage],,ime,0,strlen(ime),255);
format(string,sizeof(string),"Vase ime biza je postavljano na %s!",ime);
SendClientMessage(playerid,-1,string);
OnPropUpdate();
}
}