SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 14/11/2009, 04:17 AM   #1
cdcyborg
Little Clucker
 
Join Date: Oct 2008
Posts: 9
Reputation: 0
Default error 001: expected token: "-string end-", but found "-identifier-"

Code:
C:\Network Game Servers\GTA\DEBUG\gamemodes\lvcrs.pwn(3789) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Network Game Servers\GTA\DEBUG\gamemodes\lvcrs.pwn(3790) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Network Game Servers\GTA\DEBUG\gamemodes\lvcrs.pwn(3796) : error 001: expected token: "-string end-", but found "-identifier-"
Whats wrong with this anyone please, Thanks in advance.


Code:
new EchoChan[23] = "#GTA2";
new EchoChana[23] = "#GTA-admin";

public ircOnUserJoin(conn, channel[], user[]) {
line:3789		if (user == "gta" || user == "gta2") {
line:3790	  		 if ("channel" == EchoChan) {
			ircSay(EchoConnection, EchoChan,"4,15____________6,15 St0rmNet San Andreas Server 4,15____________");
			ircSay(EchoConnection, EchoChan,"15,15################7Cops 'n' Criminals15,15###################");
			ircSay(EchoConnection, EchoChan,"15,15############7Server Started Succesfully15,15###############");
			ircSay(EchoConnection, EchoChan,"4,15__________________ 4Version 1.0.84,15 ____________________");
		}
line:3796		else if ("channel" == EchoChana) {
			ircSay(EchoConnection, EchoChana,"4,15____________6,15 St0rmNet San Andreas Server 4,15____________");
			ircSay(EchoConnection, EchoChana,"15,15################7Cops 'n' Criminals15,15###################");
			ircSay(EchoConnection, EchoChana,"15,15############7Server Started Succesfully15,15###############");
			ircSay(EchoConnection, EchoChana,"4,15__________________ 4Version 1.0.84,15 ____________________");
		}
	}
	return 1;
}
cdcyborg is offline  
Old 14/11/2009, 06:22 AM   #2
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,593
Reputation: 379
Default Re: error 001: expected token: "-string end-", but found "-identifier-"

You cannot compare an array with a string directly, you have to use a function (strcmp)

USAGE:
pawn Code:
if( strcmp(EchoChan,"channel",true,7) == 0 )
the 'true' is stating that it's going to ignore caps, so it can be 'Channel', 'CHANNEL', or 'channel', doesn't matter. The '7' is how far into either string (EchoChan or "channel") it's going to compare (if it were '4' it would only compare up until "chan"). We're seeing if it equals '0' because 'strcmp' will return 0 when the strings match.
Joe Staff is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Run time error 19: "File or function is not found" TouR Help Archive 2 18/06/2010 10:04 AM
expected token: "-identifier-", but found "-integer value-" Torran Help Archive 17 07/03/2010 05:10 PM
expected token: "]", but found "-identifier-" _Ben_[Fux-c.co.il RP] Help Archive 7 06/10/2009 02:12 PM
NO servers found when I click "Internet tab" or "official tab" need help plzzz! Jmaster543 Server Support 1 03/05/2009 12:27 AM


All times are GMT. The time now is 08:14 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.