Need help on making /trace command
#1

Im trying to make /trace command (similiar to /find) but i get 10 errors could someone say whats wrong?
Код:
	if(strcmp(cmd, "/trace", true) == 0)
	{
	  if(PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 8)
	  {
  	    tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
		  SendClienMessage(playerid, COLOR_GREY, "USAGE: /trace [playerid or part of name");
		  return 1;
 		}
		giveplayerid = ReturnUser(tmp);
		if(IsPlayerConnected(giveplayerid))
		{
		     new Float:rpx,Float:rpy,Float:rpz;
			GetPlayerPos(giveplayerid, rpx,rpy,rpz);
			SetPlayerCheckPoint(playerid, rpx,rpy,rpz 3.0);
			SendClientMessage(playerid, COLOR_BLUE, "Marker on map has been set");
		}
		else
		{
			format(string, sizeof(string), "	%d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_GRAD1, string);
		}
	}
     return 1;
And the errors:
Код:
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26940) : error 010: invalid function or declaration
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26942) : error 010: invalid function or declaration
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26945) : error 010: invalid function or declaration
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26948) : error 010: invalid function or declaration
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26951) : error 010: invalid function or declaration
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26954) : error 021: symbol already defined: "GetPlayerPos"
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26955) : error 010: invalid function or declaration
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26955 -- 26958) : error 010: invalid function or declaration
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26955 -- 26964) : error 010: invalid function or declaration
C:\samp02Xserver.win32\gamemodes\WC-RP1.pwn(26955 -- 26964) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.
Reply
#2

Which lines are which?
Reply
#3

if(strcmp(cmd, "/trace", true) == 0) line is 26940 and it goes down
Reply
#4

Not sure about it, maybe left out a bracket?
Reply
#5

It's not hard to see that there is a bracket missing.
pawn Код:
if(strcmp(cmd, "/trace", true) == 0)
{
if(PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 8)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClienMessage(playerid, COLOR_GREY, "USAGE: /trace [playerid or part of name");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
new Float:rpx,Float:rpy,Float:rpz;
GetPlayerPos(giveplayerid, rpx,rpy,rpz);
SetPlayerCheckPoint(playerid, rpx,rpy,rpz 3.0);
SendClientMessage(playerid, COLOR_BLUE, "Marker on map has been set");
}
else
{
format(string, sizeof(string), "    %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)