4 errors when using ZCMD - 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: 4 errors when using ZCMD (
/showthread.php?tid=430222)
4 errors when using ZCMD -
Syntax - 13.04.2013
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.
Re: 4 errors when using ZCMD -
Revo - 13.04.2013
I'm pretty sure ZCMD needs to be outside any callback ^^
Re: 4 errors when using ZCMD -
Syntax - 13.04.2013
Yeah, I've just read that thread again and fixed the problem.
Re: 4 errors when using ZCMD -
Avi Raj - 13.04.2013
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;
}
Re: 4 errors when using ZCMD -
RajatPawar - 13.04.2013
It NEEDS to be outside a callback. Since itself is a function (cmd_commandname)
Re: 4 errors when using ZCMD -
Syntax - 13.04.2013
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.
Re: 4 errors when using ZCMD -
RajatPawar - 13.04.2013
Oh, sorry, I hadn't refreshed the thread and replied after 2 minutes the thread sitting open, sorry for that. Cheers