I need help with dialog..
#1

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

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

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;
}

Reply
#4

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

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;
}

Reply
#6

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

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

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

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

Give me an example...please
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)