SA-MP Forums Archive
Error while compile - 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: Error while compile (/showthread.php?tid=661831)



error 001: expected token: ")", but found "-string-" - ZigGamerx - 16.12.2018

Код:
resources/cmds.pwn(1153) : error 001: expected token: ")", but found "-string-"
resources/cmds.pwn(1153) : warning 215: expression has no effect
resources/cmds.pwn(1153) : warning 215: expression has no effect
resources/cmds.pwn(1153) : error 001: expected token: ";", but found ")"
resources/cmds.pwn(1153) : error 029: invalid expression, assumed zero
resources/cmds.pwn(1153) : fatal error 107: too many error messages on one line

Compilation aborted.

Pawn compiler 3.10.8	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
CODE

Код:
new targetname[MAX_PLAYER_NAME];
	if(sscanf(params, "s["#MAX_PLAYER_NAME"]", targetname))
		return SendClientMessage(playerid, COLOR_TOMATO, "[USAGE]: /unban [playerName]");



Re: Error while compile - Kaliber - 17.12.2018

2 Things:

1. You could write it:
PHP код:
if(sscanf(params"s[24]"targetname)) 
2. You should use params directly:

PHP код:
if(isNull(params)) return SendClientMessage(playeridCOLOR_TOMATO"[USAGE]: /unban [playerName]");
//and in params is the playerName