SA-MP Forums Archive
1 small error - 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: 1 small error (/showthread.php?tid=85889)



1 small error - Black Souls - 10.07.2009

I wanted to make a /takedrugs command so that it gives the player drugs, to sell later on

but I get this error

Код:
C:\Users\Decoster Joeri\Desktop\World RPG\gamemodes\WRPGv1.0-1.pwn(7107) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And when I change the { with a ) , the compiler crashes

the piece, line 7107 is the line with the { under the 2nd IF

Код:
	if(strcmp(cmd, "/takedrugs", true) == 0)
	{
		if(PlayerToPoint(4, playerid, 2552.4688,-1294.3380,1060.9844)
		{
      PlayerInfo[giveplayerid][pDrugs] = 500;
	  }
	  else
   	{
		SendClientMessage(playerid, COLOR_RED, "You cannot use this command because you are not at the Crack factory.");
	  }
		return 1;
	}
Thanks for helping


Re: 1 small error - Weirdosport - 10.07.2009

Maybe read the error and check again:

if(PlayerToPoint(4, playerid, 2552.4688,-1294.3380,1060.9844)

if(PlayerToPoint(4, playerid, 2552.4688,-1294.3380,1060.9844))