not sure what went wrong - 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: not sure what went wrong (
/showthread.php?tid=616110)
not sure what went wrong -
donhu789 - 31.08.2016
Код HTML:
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)
Код:
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.
}
Re: not sure what went wrong -
Shinja - 31.08.2016
If those commands have no params remove the "", and you don't need the
return btw
PHP код:
switch(listitem)
{
case 0: cmd_sf(playerid);
case 1: cmd_lv(playerid);
case 2: cmd_ls(playerid);
case 3: cmd_sfa(playerid);
case 4: cmd_lva(playerid);
case 5: cmd_lsa(playerid);
}