Why does this return unknown command
#1

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?
Reply
#2

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

I defined WEP_LIST as 321 at the top of my script
Reply
#4

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

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

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;
}
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)