SA-MP Forums Archive
Why does this return unknown command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why does this return unknown command (/showthread.php?tid=174248)



Why does this return unknown command - mrcoolballs - 05.09.2010

im trying to make a weapon menu but this annoying command always returns unknown command:

pawn Код:
CMD:buygun(playerid,params[])
{
    ShowPlayerDialog(playerid,WEP_LIST,DIALOG_STYLE_LIST,"Weapons","Pistols\nAutomatic Weapons\nShotguns\nAssault\nSpecial","Select","Leave");
    return 1;
}
would it be because i have to many dialog menus?


Re: Why does this return unknown command - [UG]Scripter - 05.09.2010

Try This
Код:
CMD:buygun(playerid,params[])
{    
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Weapons","Pistols\nAutomatic Weapons\nShotguns\nAssault\nSpecial","Select","Leave");  
 return 1;
}



Re: Why does this return unknown command - mrcoolballs - 05.09.2010

I defined WEP_LIST as 321 at the top of my script


Re: Why does this return unknown command - [UG]Scripter - 05.09.2010

So, Its a Dialog ID. Not That, The variable needs to use. This as a Dialog. Unless your making a menu.


Re: Why does this return unknown command - mrcoolballs - 05.09.2010

listen, I have defined heaps of menus with Register and Login type IDs so please, dont answer unless you know what your talking about


Re: Why does this return unknown command - mmrk - 05.09.2010

Maybe works, i dunno
pawn Код:
CMD:buygun(playerid,params[])
{
    #pragma unused params
    ShowPlayerDialog(playerid,WEP_LIST,DIALOG_STYLE_LIST,"Weapons","Pistols\nAutomatic Weapons\nShotguns\nAssault\nSpecial","Select","Leave");
    return 1;
}
You should add this too if you haven't..
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{

    if(!success) SendClientMessage(playerid,RED,"Server: Unknown command.");
    return 1;
}



Re: Why does this return unknown command - iggy1 - 05.09.2010

You dont need to use #pragma unused params with ZCMD btw.
You may have a command that comes before /buygun that is messing this command up, thats happened to me a couple of times.