SA-MP Forums Archive
Need help on making /trace command - 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: Need help on making /trace command (/showthread.php?tid=81832)



Need help on making /trace command - Ghorian - 14.06.2009

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.



Re: Need help on making /trace command - Grim_ - 14.06.2009

Which lines are which?


Re: Need help on making /trace command - Ghorian - 14.06.2009

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


Re: Need help on making /trace command - Grim_ - 14.06.2009

Not sure about it, maybe left out a bracket?


Re: Need help on making /trace command - Correlli - 14.06.2009

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;
}