SA-MP Forums Archive
[HELP] OMG ! - 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: [HELP] OMG ! (/showthread.php?tid=67491)



[HELP] OMG ! - Hot - 01.03.2009

Код:
#include <a_samp>

#define COLOR_LIGHTBLUE 0x33CCFFAA

#pragma tabsize 0

new ACP;

public OnPlayerSpawn(playerid)
{
	ACP = SetPlayerCheckpoint(playerid, 1874.2103, -1642.0880, 31.8047, 3.00);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/airport", cmdtext, true) == 0)
	{
		if(IsPlayerInCheckpoint(playerid) == ACP)
		{
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Teleported.");
		}
		else if(IsPlayerInCheckpoint(playerid) != ACP)
		{
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are not in the checkpoint");
		}
		return 1;
	}

public OnPlayerEnterCheckpoint(playerid)
{
	if (IsPlayerInCheckpoint(playerid)) {
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Type /airport to teleport you to your airport");
}
	return 1;
}
Код:
C:\Documents and Settings\Gustavo\Desktop\samp02Xserver.win32\filterscripts\Checkpoint.pwn(31) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gustavo\Desktop\samp02Xserver.win32\filterscripts\Checkpoint.pwn(31) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Documents and Settings\Gustavo\Desktop\samp02Xserver.win32\filterscripts\Checkpoint.pwn(38) : error 030: compound statement not closed at the end of file (started at line 18)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.

HELP ME! PLEASEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE !



Re: [HELP] OMG ! - Hot - 01.03.2009

Help ?

P.S: Sorry double post, but is the unique way to you read

See ? YOU READ IT !


Re: [HELP] OMG ! - Nubotron - 01.03.2009

Calm down, and read about your error codes in the Pawn documentation.


Re: [HELP] OMG ! - Hot - 01.03.2009

... I still needing help .


Re: [HELP] OMG ! - Serbish - 01.03.2009

Quote:
Originally Posted by Hot
... I still needing help .
Search next time...

Код:
#include <a_samp>

#define COLOR_LIGHTBLUE 0x33CCFFAA

#pragma tabsize 0

new ACP;

public OnPlayerSpawn(playerid)
{
	ACP = SetPlayerCheckpoint(playerid, 1874.2103, -1642.0880, 31.8047, 3.00);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/airport", cmdtext, true) == 0)
	{
		if(IsPlayerInCheckpoint(playerid) == ACP)
		{
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Teleported.");
		}
		else if(IsPlayerInCheckpoint(playerid) != ACP)
		{
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are not in the checkpoint");
		}
		return 1;
	}
}

public OnPlayerEnterCheckpoint(playerid)
{
	if (IsPlayerInCheckpoint(playerid))
{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Type /airport to teleport you to your airport");
}
	return 1;
}



Re: [HELP] OMG ! - Hot - 01.03.2009

The checkpoint don't appear, I can't see it, even in map.


Re: [HELP] OMG ! - member - 01.03.2009

remove new ACP;

and ACP =
and the other ACP

You can't have more than one checkpoint unless your using a checkpoint streamer

pawn Код:
if (strcmp("/airport", cmdtext, true) == 0)
    {
        if(IsPlayerInCheckpoint(playerid))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Teleported.");
        }
        else if(!IsPlayerInCheckpoint(playerid))
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are not in the checkpoint");
        }
        return 1;
    }



Re: [HELP] OMG ! - 1337pr0 - 01.03.2009

@Hot

Код:
#include <a_samp>

#define COLOR_LIGHTBLUE 0x33CCFFAA

#pragma tabsize 0

public OnPlayerSpawn(playerid)
{
	SetPlayerCheckpoint(playerid, 1874.2103, -1642.0880, 31.8047, 3.00);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/airport", cmdtext, true) == 0)
	{
		if(IsPlayerInCheckpoint(playerid))
		{
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Teleported.");
		}
		else
		{
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are not in the checkpoint");
		}
		return 1;
	}
}

public OnPlayerEnterCheckpoint(playerid)
{
  if (IsPlayerInCheckpoint(playerid))
  {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Type /airport to teleport you to your airport");
  }
  return 1;
}
If you'd read the wiki before coming here and posting, you'd know that SetPlayerCheckpoint does not return a value.

The "else if" that you had in there was pointless, I've removed it.

IsPlayerInCheckpoint(playerid) == ACP is also useless, because IsPlayerInCheckpoint only returns true, or false.

It should work now.