OnDialogResponse
#1

Hello guy,
I have some problem with OnDialogResponse i cant make it and i asked a lot of people to help me with it but no one want to help so i hope today i find any one can help me to make OnDialogResponse for my cmd:ads

Ads Commands:

PHP код:
CMD:ads(playeridparams[]) {
    return 
cmd_advertisements(playeridparams);
}
CMD:advertisements(playeridparams[]) {
    if(
gPlayerLogged{playerid} == 0) {
        
SendClientMessageEx(playeridCOLOR_GREY"You're not logged in.");
    }
    else if(
GetPVarType(playerid"Injured")) {
        
SendClientMessageEx(playeridCOLOR_GREY"You can't use advertisements while injured.");
    }
    else if(
PlayerCuffed[playerid] != 0) {
        
SendClientMessageEx(playeridCOLOR_GREY"You can't use advertisements right now.");
    }
    else if(
PlayerInfo[playerid][pJailTime] > 0) {
        
SendClientMessageEx(playeridCOLOR_GREY"You can't use advertisements while in jail.");
    }
    else 
ShowPlayerDialog(playeridDIALOG_ADMAINDIALOG_STYLE_LIST"Advertisements""List Advertisements\nSearch Advertisements\nPlace Advertisement\nPlace Priority Advertisement""Select""Cancel");
 return 
1;

But i lost OnDialogResponse and i cant make one for it :/
please help, because i closed my server for this reason.
Reply
#2

Quote:
Originally Posted by aDo7
Посмотреть сообщение
Hello guy,
I have some problem with OnDialogResponse i cant make it and i asked a lot of people to help me with it but no one want to help so i hope today i find any one can help me to make OnDialogResponse for my cmd:ads

Ads Commands:

PHP код:
CMD:ads(playeridparams[]) 
{
    return 
cmd_advertisements(playeridparams);
}
[
code]CMD:advertisements(playeridparams[]) {
    if(
gPlayerLogged{playerid} == 0) {
        
SendClientMessageEx(playeridCOLOR_GREY"You're not logged in.");
    }
    else if(
GetPVarType(playerid"Injured")) {
        
SendClientMessageEx(playeridCOLOR_GREY"You can't use advertisements while injured.");
    }
    else if(
PlayerCuffed[playerid] != 0) {
        
SendClientMessageEx(playeridCOLOR_GREY"You can't use advertisements right now.");
    }
    else if(
PlayerInfo[playerid][pJailTime] > 0) {
        
SendClientMessageEx(playeridCOLOR_GREY"You can't use advertisements while in jail.");
    }
    else 
ShowPlayerDialog(playeridDIALOG_ADMAINDIALOG_STYLE_LIST"Advertisements""List Advertisements\nSearch Advertisements\nPlace Advertisement\nPlace Priority Advertisement""Select""Cancel");
 return 
1;
}[/
code
Код:
But i lost OnDialogResponse and i cant make one for it :/ please help, because i closed my server for this reason.
Код:

CMD:ads(playerid, params[]) { 
    return cmd_advertisements(playerid, params); 
} 

CMD:advertisements(playerid, params[]) 
{ 
    if(gPlayerLogged{playerid} == 0) 
    { 
        ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_MSGBOX, "Notice", "You are not logged in", "Close", "");
    } 
    else if(GetPVarType(playerid, "Injured")) 
    { 
        ShowPlayerDialog(playerid, 1338, DIALOG_STYLE_MSGBOX, "Notice", "You can't use advertisements while injured", "Close", "");
    } 
    else if(PlayerCuffed[playerid] != 0) 
    { 
        ShowPlayerDialog(playerid, 1339, DIALOG_STYLE_MSGBOX, "Notice", "You can't use advertisement right now", "Close", "");
    } 
    else if(PlayerInfo[playerid][pJailTime] > 0) 
    { 
        ShowPlayerDialog(playerid, 1340, DIALOG_STYLE_MSGBOX, "Notice", "You can't use advertisements while in jailed, "Close", "");
    } 
    else ShowPlayerDialog(playerid, DIALOG_ADMAIN, DIALOG_STYLE_LIST, "Advertisements", "List Advertisements\nSearch Advertisements\nPlace Advertisement\nPlace Priority Advertisement", "Select", "Cancel"); 
    return 1; 
}
Edit im not yet finish just wait

Код:
 	if(dialogid == DIALOG_ADMAIN)
	{
		if(response)
		{
			switch(listitem)
			{
				case 0:
				{
					ShowPlayerDialog(playerid, 1441, DIALOG_STYLE_MSGBOX, "List Advertisements", "Change this", "Close", "");
				}
				case 1:
				{
					ShowPlayerDialog(playerid, 1442, DIALOG_STYLE_MSGBOX, "Search Advertisements", "Change this", "Close", "");
				}
				case 2:
				{
					ShowPlayerDialog(playerid, 1443, DIALOG_STYLE_MSGBOX, "Place Advertisement", "Change this", "Close", "");
				}
				case 3:
				{
					ShowPlayerDialog(playerid, 1444, DIALOG_STYLE_MSGBOX, "Place Priority Advertisement", "Change this", "Close", "");
				}
			}
		}
	}
Reply
#3

Quote:

Edit im not yet finish just wait

Thank you too much you're friendly and helpful too +Rep you
Reply
#4

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}
u lost this code??
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == your dialog name the one u defined)
    {
        if(response)
        {
            if(listitem == 0) // if he clicked the 1st option
            {
                // what you want to show him
            }
            if(listitem == 1)
            {
            // what you want to show him
            }
            if(listitem == 2)
            {
             // what you want to show him // u can use case if u want
            }
        }
        return 1;
    }
    return 0; // return 0 as per samp wiki
}
Reply
#5

Quote:

u lost this code??


Yes,
and i cant make this :/ i tried so hard
Reply
#6

Bumb any one?
Reply
#7

Quote:

ShowPlayerDialog(playerid, 1340, DIALOG_STYLE_MSGBOX, "Notice", "You can't use advertisements while in jailed, "Close", "");

After i add CMD you told me to add i got this error
Reply
#8

what error
Reply
#9

Quote:

if(dialogid == DIALOG_ADMAIN)
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 1441, DIALOG_STYLE_MSGBOX, "List Advertisements", "Change this", "Close", "");
}
case 1:
{
ShowPlayerDialog(playerid, 1442, DIALOG_STYLE_MSGBOX, "Search Advertisements", "Change this", "Close", "");
}
case 2:
{
ShowPlayerDialog(playerid, 1443, DIALOG_STYLE_MSGBOX, "Place Advertisement", "Change this", "Close", "");
}
case 3:
{
ShowPlayerDialog(playerid, 1444, DIALOG_STYLE_MSGBOX, "Place Priority Advertisement", "Change this", "Close", "");
}
}
}
}

Dude i told you that i cant make this codes , what i should add on this places
Quote:

"Change this", "Close"

Reply
#10

change "change this" to the text u want to show to the player

EDIT: "close" is the text in button 1. Click me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)