I can't figure out some annoying errors
#1

Hi guys, can anyone help me to finish my script to make it work, i have a few errors i can't figure out

here is what i want it to do:

Commands:
/tag "playerid" (done by anybody, it should be active again when the "tagged player" left the server or died)
/tag off (done by anybody except the one that is tagged)

Only one tagged player at a time. When this is activated it should show a message in the lower part of the screen the message: "%s is the tagged player, go find him." (and even better his car should be colored yellow or add a distinctive, clearly visible item on the car)

The tagged player should run after the others to catch them, and when he touches somebody, that player should become the new tagged person.
If the player exits vehicle, he should still be it until he dies.


I would like to thank cj101 for his help
Reply
#2

And where are your errors?..
Reply
#3

Those are the errors:

E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(180) : warning 235: public function lacks forward declaration (symbol "Check")
E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(183) : error 017: undefined symbol "PlayerToPoint"
E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(185) : error 017: undefined symbol "TaggedPlayer"
E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(185) : warning 215: expression has no effect
E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(18 : warning 217: loose indentation
E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(213) : warning 203: symbol is never used: "dcmd_tagplayer"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


I have also attached the pwn file, here is the code:

Код:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	new TaggedMatch;
new TaggedPlayer;
new Float: TPX;
new Float: TPY;
new Float: TPZ;

	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerPrivmsg(playerid, recieverid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}

public OnPlayerInfoChange(playerid)
{
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public Check(playerid)
{
#define COLOR_YELLOW 0xFFFF00AA
 if(PlayerToPoint(1, playerid, TPX,TPY,TPZ)
 {
 TaggedPlayer = 0;
 SendClientMessageToAll(COLOR_YELLOW,"The tagged player was found.");
 }
return 1;
}

dcmd_tagplayer(playerid,params[])
{
	new tmp[300], Index;
    tmp = strtok(params,Index);
	new id = strval(tmp);

	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"That Player Is Not Connected");
    GetPlayerPos(id,TPX,TPY,TPZ);
    new string[256],pName[90];
    GetPlayerName(id,pName,90);
    format(string, sizeof(string), "%s is the tagged player, go find him.",pName);
    SendClientMessageToAll(,string);
    TaggedPlayer = id;


	return 1; }

public OnPlayerExitedMenu(playerid)
{
	return 1;
}
Thank you
Reply
#4

//top of script
forward Check(playerid);

Get the playertopoint function.

Reply
#5

Now it looks like this:

Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}
PlayerToPoint(1, playerid, TPX,TPY,TPZ)
forward Check(playerid)
{
#define COLOR_YELLOW 0xFFFF00AA
 if(PlayerToPoint(1, playerid, TPX,TPY,TPZ)
 {
 TaggedPlayer = 0;
 SendClientMessageToAll(COLOR_YELLOW,"The tagged player was found.");
 }
return 1;
}
And i get this:

E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(179) : error 010: invalid function or declaration
E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(213) : warning 203: symbol is never used: "Check"
E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(213) : warning 203: symbol is never used: "PlayerToPoint"
E:\GTA SA\GTA San Andreas\! samp02Xserver.win32\! samp02Xserver.win32\pawno\tagmode.pwn(213) : warning 203: symbol is never used: "dcmd_tagplayer"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)