{ Problem - 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: { Problem (
/showthread.php?tid=219442)
{ Problem -
New Ilyass - 01.02.2011
D:\DOC ILYASS\SAMP Server\gamemodes\LSGW.pwn(203) : error 001: expected token: ")", but found "{"
D:\DOC ILYASS\SAMP Server\gamemodes\LSGW.pwn(20
![Cool](images/smilies/cool.gif)
: error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Код:
if (strcmp("/weapons", cmdtext, true, 10 == 3)
{
ShowPlayerDialog(playerid, Weapons, DIALOG_STYLE_LIST, "Weapons", "Deagle Price :2000$ \n Sawn-Off Price :1200$ \n Uzi Price :720$ \n M4 :2000$", "Buy", "Cancel");
return 1;
}
if (strcmp("/admincommands", cmdtext, true, 10 == 4)
{
Re: { Problem -
JaTochNietDan - 01.02.2011
You have a problem with your if statement syntax, I recommend reading through the Pawn documentation for more information on its syntax, here is the fixed version:
pawn Код:
if (strcmp("/weapons", cmdtext, true, 10) == 3)
{
ShowPlayerDialog(playerid, Weapons, DIALOG_STYLE_LIST, "Weapons", "Deagle Price :2000$ \n Sawn-Off Price :1200$ \n Uzi Price :720$ \n M4 :2000$", "Buy", "Cancel");
return 1;
}
if (strcmp("/admincommands", cmdtext, true, 10) == 4)
{
Additionally I'm not sure what you're trying to achieve with the == 3/4, I assume you're confused there too, also with the setting of the command length to 10 each time, which is not needed at all. So here is what I think you're looking for really:
pawn Код:
if (strcmp("/weapons", cmdtext, true) == 0)
{
ShowPlayerDialog(playerid, Weapons, DIALOG_STYLE_LIST, "Weapons", "Deagle Price :2000$ \n Sawn-Off Price :1200$ \n Uzi Price :720$ \n M4 :2000$", "Buy", "Cancel");
return 1;
}
if (strcmp("/admincommands", cmdtext, true) == 0)
{