Dialog Help!
#1

I am having a problem. When I type /ghelp, it shows me the dialog it is supposed to show. But when I click on the on the first listitem in the dialog, it doesnt show me the dialog it is supposed to show. Can anybody help me?

PHP код:
#include <a_samp>
#include <zcmd>
#define DIALOGID_RULES                          1
#define DIALOGID_HELP                             DIALOGID_RULES+48
#define DIALOGID_GHELP                             DIALOGID_RULES+49
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
        if (
newkeys KEY_YES)
        {
        new 
string[700];
        
strcat(string"{FFFF00}•{FFFFFF} General Help\t\t\t  {999999}[/ghelp]\t\n{FFFF00}•{FFFFFF} Server Commands\t\t  {999999}[/cmds]\n{FFFF00}•{FFFFFF} Server Teleports\t\t  {999999}[/teles]\n{FFFF00}•{FFFFFF} Vehicle Menu\t\t\t  {999999}[/v]\n");
        
strcat(string"{FFFF00}•{FFFFFF} Premium Features\t\t{999999}  [/premium]\n{FFFF00}•{FFFFFF} Server Credits\t\t  {999999}[/credits]\n{FFFF00}•{FF99FF} My Settings\n{FFFF00}•{FF99FF} My Statistics\n{FFFF00}•{FFFFFF} How do I earn Money / Score?\n{FFFF00}•{FFFFFF} What can I do on this server?\n{FFFF00}•{999999} Server IP");
        
ShowPlayerDialog(playeridDIALOGID_HELPDIALOG_STYLE_LIST"{0000FF}USF: {FFFFFF}Help"string"Select""Cancel");
        }
        return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if (
dialogid == DIALOGID_HELP) {
        if(
response) {
            switch(
listitem) {
                case 
0GHelp(playerid);
            }
        }
    }
    return 
1;
}
CMD:ghelp(playerid)
{
    
GHelp(playerid);
    return 
1;
}
stock GHelp (playerid)
{
    new 
string[1000];
    
strcat(string"{0000FF}Commands and Teleports\n{FFFFFF}You can access Commands using /cmds and Teleports using /teles.\n\n");
    
strcat(string"{0000FF}Vehicles\n{FFFFFF}You can spawn a vehicle anytime using /v.\n");
    
strcat(string"{FFFFFF}You can use /car to spawn a vehicle by name.\n");
    
strcat(string"{FFFFFF}Type /vcmds to access Vehicle commands.\n\n");
    
strcat(string"{0000FF}Minigames\n{FFFFFF}This server features many minigames such as:\n{FFFFFF}/CnR /Fallout /Event\n\n");
    
strcat(string"{0000FF}Premium and VIP\n{FFFFFF}You can access premium commands through donating.\n");
    
strcat(string"{FFFFFF}Commands and Features are listed on /premium, visit our website for more info.\n\n");
    
strcat(string"{0000FF}Gangs\n{FFFFFF}A Gang System with capturable zones will be added soon.\n\n");
    
strcat(string"{0000FF}Houses\n{FFFFFF}You can buy house by going on the House icon and doing /buyhouse.\n\n");
    
strcat(string"{9999FF}Need more help? Visit our forums at www.comingsoon.com!");
    
ShowPlayerDialog(playeridDIALOGID_GHELPDIALOG_STYLE_MSGBOX"{0000FF}USF: {FFFFFF}General Help"string"Ok""");

Reply
#2

Hi! Try to edit your stock function like this:

Код:
stock GHelp (playerid)
{
    new string[1000];

    strcat(string, "{0000FF}Commands and Teleports\n{FFFFFF}You can access Commands using /cmds and Teleports using /teles.\n\n");
    strcat(string, "{0000FF}Vehicles\n{FFFFFF}You can spawn a vehicle anytime using /v.\n");
    strcat(string, "{FFFFFF}You can use /car to spawn a vehicle by name.\n");
    strcat(string, "{FFFFFF}Type /vcmds to access Vehicle commands.\n\n");
    strcat(string, "{0000FF}Minigames\n{FFFFFF}This server features many minigames such as:\n{FFFFFF}/CnR /Fallout /Event\n\n");
    strcat(string, "{0000FF}Premium and VIP\n{FFFFFF}You can access premium commands through donating.\n");
    strcat(string, "{FFFFFF}Commands and Features are listed on /premium, visit our website for more info.\n\n");
    strcat(string, "{0000FF}Gangs\n{FFFFFF}A Gang System with capturable zones will be added soon.\n\n");
    strcat(string, "{0000FF}Houses\n{FFFFFF}You can buy house by going on the House icon and doing /buyhouse.\n\n");
    strcat(string, "{9999FF}Need more help? Visit our forums at www.comingsoon.com!");

    return string;
}
and the /ghelp command like this:

Код:
CMD:ghelp(playerid)
{
    ShowPlayerDialog(playerid, DIALOGID_GHELP, DIALOG_STYLE_MSGBOX, "{0000FF}USF: {FFFFFF}General Help", GHelp(playerid), ”Ok”, ”Close”);
    return 1;
}
Hope it helps!
Reply
#3

If honnor's solution didn't work try this:

if(response)
{
if(listitem == 0)
{
GHelp(playerid);

return 1;
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)