SA-MP Forums Archive
need help with ondialogresponse - 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)
+--- Thread: need help with ondialogresponse (/showthread.php?tid=498841)



need help with ondialogresponse - karolis11234 - 05.03.2014

the lines are:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_KEVENT)
{
/////////////////////////////////////////////////////
if(response)
{
////////////////////////////////
if(listitem == 0)
{
new string[200];
new vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid, vardas, sizeof(vardas));
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Medziokles Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
}
else if(listitem == 1)
{
new string[200];
new vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid, vardas, sizeof(vardas));
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Lenktyniu Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 2)
{
new string[200];
new vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid, vardas, sizeof(vardas));
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Drift Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 3)
{
new string[200];
new vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid, vardas, sizeof(vardas));
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Issilaikimo Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 4)
{
new string[200];
new vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid, vardas, sizeof(vardas));
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia DM Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 5)
{
new string[200];
new vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid, vardas, sizeof(vardas));
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Box Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
///////////////////////////////////////////////////////
}
return 1;
}
return 1;
}
the are no errors or warnings
the problem is only the 6 and 5 works, does anybody knows whats wrong ?


Re: need help with ondialogresponse - [XST]O_x - 05.03.2014

Change the last return 1; to return 0;
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_KEVENT)
{
/////////////////////////////////////////////////////
if(response)
{
////////////////////////////////
new string[200];
new vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid, vardas, sizeof(vardas));
if(listitem == 0)
{
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Medziokles Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
}
else if(listitem == 1)
{
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Lenktyniu Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 2)
{

format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Drift Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 3)
{

format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Issilaikimo Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 4)
{

format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia DM Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 5)
{

format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Box Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
///////////////////////////////////////////////////////
}
return 1;
}
return 0;
}



Re: need help with ondialogresponse - karolis11234 - 05.03.2014

still the same. can anyone help ?


Re: need help with ondialogresponse - Keyhead - 05.03.2014

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_KEVENT)
{
/////////////////////////////////////////////////////
if(response)
{
////////////////////////////////
new string[200];
new vardas[MAX_PLAYER_NAME];
GetPlayerName(playerid, vardas, sizeof(vardas));
if(listitem == 0)
{
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Medziokles Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
}
else if(listitem == 1)
{
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Lenktyniu Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 2)
{

format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Drift Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 3)
{

format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Issilaikimo Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 4)
{

format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia DM Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
return 1;
}
else if(listitem == 5)
{
format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Box Eventa! Prisijungimas Prie Evento /ievent !", vardas);
SendClientMessageToAll(GREEN, string);
event = 1;
GetPlayerPos(playerid, xev, yev, zev);
}
///////////////////////////////////////////////////////
}

}
return 1;
}

Try this one.


Re: need help with ondialogresponse - HolyScripter - 05.03.2014

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_KEVENT)
    {
        if(response)
        {
                if(listitem == 0)
                {
                    new string[200];
                    new vardas[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, vardas, sizeof(vardas));
                    format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Medziokles Eventa! Prisijungimas Prie Evento /ievent !", vardas);
                    SendClientMessageToAll(GREEN, string);
                    event = 1;
                    GetPlayerPos(playerid, xev, yev, zev);
                    return 1;
                }
                if(listitem == 1)
                {
                    new string[200];
                    new vardas[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, vardas, sizeof(vardas));
                    format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Lenktyniu Eventa! Prisijungimas Prie Evento /ievent !", vardas);
                    SendClientMessageToAll(GREEN, string);
                    event = 1;
                    GetPlayerPos(playerid, xev, yev, zev);
                    return 1;
                }
                if(listitem == 2)
                {
                    new string[200];
                    new vardas[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, vardas, sizeof(vardas));
                    format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Drift Eventa! Prisijungimas Prie Evento /ievent !", vardas);
                    SendClientMessageToAll(GREEN, string);
                    event = 1;
                    GetPlayerPos(playerid, xev, yev, zev);
                    return 1;
                }
                if(listitem == 3)
                {
                    new string[200];
                    new vardas[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, vardas, sizeof(vardas));
                    format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Issilaikimo Eventa! Prisijungimas Prie Evento /ievent !", vardas);
                    SendClientMessageToAll(GREEN, string);
                    event = 1;
                    GetPlayerPos(playerid, xev, yev, zev);
                    return 1;
                }
                if(listitem == 4)
                {
                    new string[200];
                    new vardas[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, vardas, sizeof(vardas));
                    format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia DM Eventa! Prisijungimas Prie Evento /ievent !", vardas);
                    SendClientMessageToAll(GREEN, string);
                    event = 1;
                    GetPlayerPos(playerid, xev, yev, zev);
                    return 1;
                }
                if(listitem == 5)
                {
                    new string[200];
                    new vardas[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, vardas, sizeof(vardas));
                    format(string,sizeof(string),"{FFFFFF}[{FF0000}Event{FFFFFF}]{00FF00}Administratorius {FF0000}%s{00FF00} Rengia Box Eventa! Prisijungimas Prie Evento /ievent !", vardas);
                    SendClientMessageToAll(GREEN, string);
                    event = 1;
                    GetPlayerPos(playerid, xev, yev, zev);
                    return 1;
                }
        }
    }
    return 1;
}
here you go.