SA-MP Forums Archive
I need help with dialog.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need help with dialog.. (/showthread.php?tid=203651)



I need help with dialog.. - MonkZemun - 27.12.2010

I've created a dialog and when I click 'Cancel' throw me out of the game (kick). Please help me a lot I mean.


Re: I need help with dialog.. - admantis - 27.12.2010

How the hell we would know if you dont post the lines codes?


Re: I need help with dialog.. - MonkZemun - 27.12.2010

Here for example:

Quote:

if(strcmp(cmd, "/pravila", true) == 0)
{
if(IsPlayerConnected(playerid))
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX, "Pravila RolePlay-a", "Zabranjen je DeathMatch \nNemojte da koristite Banny Hop \nDrive-By nije dozvoljen \nNemojte da hodate sa oruzijem u ruci \nPostujte Admine i Pravila \nPonasajte se kao u stvarnom zivotu \nDrzite se RolePlay-a", "Ok", "Cancel");
}
return 1;
}




Re: I need help with dialog.. - Anthonyx3' - 27.12.2010

Your going to have to post the ondialogresponse, what im guessing is you have Kick(playerid); on the response


Re: I need help with dialog.. - MonkZemun - 27.12.2010

Here's the whole ondilogresponse:

Quote:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new sendername[MAX_PLAYER_NAME];
new string[128];
if(response)
{
if(dialogid == 12346 || dialogid == 12347)
{
if(strlen(inputtext))
{
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
//Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
else
{
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname) );
format(loginstring,sizeof(loginstring),"POGRESNA LOZINKA\nUkucajte tacnu lozinku:",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT ,"Prijava vaseg naloga",loginstring,"Prijava","Izlaz");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 5) { Ban(playerid); }
}
}
if(dialogid == 12345)
{
if(strlen(inputtext))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "To ime vec koristi neka druga osoba,mozimo vas da izaberete neko drugo.");
fclose(hFile);
return 1;
}
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
//Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
else
{
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Doborodosli, %s\nVi nemate vas nalog.\nRegistrujte se:",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Registracija vaseg naloga",regstring,"Registruj","Izlaz");
}
}
}
else
{
Kick(playerid);
}
if(dialogid == GPS)
{
if(response)
{
if(listitem == 0) // Burg1
{
SetPlayerCheckpoint(playerid, 1199.1937,-918.5539,43.1205, 3.0);
}
if(listitem == 1) // Burg2
{
SetPlayerCheckpoint(playerid, 793.7313,-1625.1881,13.3828, 3.0);
}
if(listitem == 2) // Banka
{
SetPlayerCheckpoint(playerid, 1462.3324,-1012.3792,26.8438, 3.0);
}
if(listitem == 3) // Auto Skola
{
SetPlayerCheckpoint(playerid, 2045.6823,-1907.9747,13.5469, 3.0);
}
if(listitem == 4) // Ammu-Nation
{
SetPlayerCheckpoint(playerid, 1367.1969,-1279.8051,13.5469, 3.0);
}
if(listitem == 5) // Opstina
{
SetPlayerCheckpoint(playerid, 1481.1489,-1769.3906,18.7958, 3.0);
}
if(listitem == 6) // Hitna Pomoc
{
SetPlayerCheckpoint(playerid, 1178.3746,-1323.2477,14.1169, 3.0);
}
if(listitem == 7) // Policijska Stanica
{
SetPlayerCheckpoint(playerid, 1545.4523,-1675.6234,13.5604, 3.0);
}
}
return 1;
}
return 1;
}




Re: I need help with dialog.. - Anthonyx3' - 27.12.2010

I dont see your dialog response number 4, did you make it?


Re: I need help with dialog.. - MonkZemun - 27.12.2010

Maybe, i don't know, can you tell me how to do it?


Re: I need help with dialog.. - Anthonyx3' - 27.12.2010

pawn Код:
if (dialogid == 4) // dialogid
    {
        if(response)
            {
                        //Your codes and shit here, First button, left
            }
        if(!response)
            {
                        //Your codes shit here, Second button, right
            }
    }



Re: I need help with dialog.. - MonkZemun - 27.12.2010

So,what to put in first and second button to not kick me?


Re: I need help with dialog.. - MonkZemun - 27.12.2010

Give me an example...please