SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   not sure what went wrong (https://forum.sa-mp.com/showthread.php?t=616110)

donhu789 31/08/2016 04:04 PM

not sure what went wrong
 
HTML Code:

C:\Documents and Settings\All Users\Desktop\BufFixes\gamemodes\ngcgm.pwn(3459) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\All Users\Desktop\BufFixes\gamemodes\ngcgm.pwn(3460) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\All Users\Desktop\BufFixes\gamemodes\ngcgm.pwn(3461) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\All Users\Desktop\BufFixes\gamemodes\ngcgm.pwn(3463) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\All Users\Desktop\BufFixes\gamemodes\ngcgm.pwn(3464) : error 035: argument type mismatch (argument 2)

Code:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_WEAPONS)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            switch(listitem)
            {
                case 0: return cmd_sf(playerid, "");
                case 1: return cmd_lv(playerid, "");
                case 2: return cmd_ls(playerid, "");
                case 3: return cmd_sfa(playerid, "");
                case 4: return cmd_lva(playerid, "");
                case 5: return cmd_lsa(playerid, "");
            }
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }

    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}


Shinja 31/08/2016 04:22 PM

Re: not sure what went wrong
 
If those commands have no params remove the "", and you don't need the return btw
PHP Code:

switch(listitem)
            {
                case 
0cmd_sf(playerid);
                case 
1cmd_lv(playerid);
                case 
2cmd_ls(playerid);
                case 
3cmd_sfa(playerid);
                case 
4cmd_lva(playerid);
                case 
5cmd_lsa(playerid);
            } 



All times are GMT. The time now is 06:18 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.