4 errors when using ZCMD
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    COMMAND:buyweapons(playerid, params[])
    {
        ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "AK47 - $400\nM4 - $400 \nSniper Rifle - $600", "Buy", "Cancel");
    }
}
I get the following errors:

pawn Код:
C:\Users\Denis\Desktop\Scripting\Server 0.3x\gamemodes\TDM.pwn(226) : error 029: invalid expression, assumed zero
C:\Users\Denis\Desktop\Scripting\Server 0.3x\gamemodes\TDM.pwn(226) : error 017: undefined symbol "cmd_buyweapons"
C:\Users\Denis\Desktop\Scripting\Server 0.3x\gamemodes\TDM.pwn(226) : error 029: invalid expression, assumed zero
C:\Users\Denis\Desktop\Scripting\Server 0.3x\gamemodes\TDM.pwn(226) : fatal error 107: too many error messages on one line
Can someone fix this for me, please? I'd like to say that this is the first time I use ZCMD as my main command processor.
Reply
#2

I'm pretty sure ZCMD needs to be outside any callback ^^
Reply
#3

Yeah, I've just read that thread again and fixed the problem.
Reply
#4

Lol, use this :-
pawn Код:
COMMAND:buyweapons(playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "AK47 - $400\nM4 - $400 \nSniper Rifle - $600", "Buy", "Cancel");
    return 1;
}
Reply
#5

It NEEDS to be outside a callback. Since itself is a function (cmd_commandname)
Reply
#6

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
It NEEDS to be outside a callback. Since itself is a function (cmd_commandname)
Haven't you read my second reply? I have fixed the problem shortly after I posted this thread, but since your message is much more detailed, I'll rep you positively.

Thanks guys.
Reply
#7

Oh, sorry, I hadn't refreshed the thread and replied after 2 minutes the thread sitting open, sorry for that. Cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)