SA-MP Forums Archive
Playerrecievedmessage - 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: Playerrecievedmessage (/showthread.php?tid=136568)



Playerrecievedmessage - cozza123456 - 25.03.2010

what have i done wrong here? I want it so that it sends the message (once) every time i go near the coordinates.

Код:
new playerReceivedMessage[MAX_PLAYERS] = 0;

public liftcheck(playerid)
{
	if(IsPlayerInRangeOfPoint([playerid], 15, -2464.9296875,1522.9167480469,27.570457458496)){
		if(playerReceivedMessage[playerid] == 0)
			{
			SendClientMessage([playerid], 0x99FF66AA, "Use /lift to bring the lift up and /lift to take it back down");
			GameTextForPlayer([playerid], "/lift to bring the lift up and /lift to take it back down", 5000, 5);

			playerReceivedMessage[playerid] = 1;
		}
	} else {
		playerReceivedMessage[playerid] = 0;
	}
}
I get these errors:

Код:
C:\Users\Corran\Desktop\Samp Server Latest Latest (RC5)\gamemodes\CJfreeroam.pwn(3607) : error 029: invalid expression, assumed zero
C:\Users\Corran\Desktop\Samp Server Latest Latest (RC5)\gamemodes\CJfreeroam.pwn(3607) : warning 215: expression has no effect
C:\Users\Corran\Desktop\Samp Server Latest Latest (RC5)\gamemodes\CJfreeroam.pwn(3607) : error 001: expected token: ";", but found "]"
C:\Users\Corran\Desktop\Samp Server Latest Latest (RC5)\gamemodes\CJfreeroam.pwn(3607) : error 029: invalid expression, assumed zero
C:\Users\Corran\Desktop\Samp Server Latest Latest (RC5)\gamemodes\CJfreeroam.pwn(3607) : fatal error 107: too many error messages on one line
3607 = this line:

Код:
if(IsPlayerInRangeOfPoint([playerid], 15, -2464.9296875,1522.9167480469,27.570457458496)){



Re: Playerrecievedmessage - Drake1994 - 25.03.2010

try this:

Код:
public liftcheck(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 15, -2464.9296875,1522.9167480469,27.570457458496)){
		if(playerReceivedMessage[playerid] == 0)
			{
			SendClientMessage(playerid, 0x99FF66AA, "Use /lift to bring the lift up and /lift to take it back down");
			GameTextForPlayer(playerid, "/lift to bring the lift up and /lift to take it back down", 5000, 5);

			playerReceivedMessage[playerid] = 1;
		}
	} else {
		playerReceivedMessage[playerid] = 0;
	}
}



Re: Playerrecievedmessage - Torran - 25.03.2010

Why do you have [playerid], Thats whats bringing errors, It should be playerid


Re: Playerrecievedmessage - cozza123456 - 25.03.2010

but its MAX_PLAYERS


Re: Playerrecievedmessage - cozza123456 - 25.03.2010

This should work?

Код:
new playerReceivedMessage = 0;

public liftcheck(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 15, -2464.9296875,1522.9167480469,27.570457458496)){
		if(playerReceivedMessage == 0)
			{
			SendClientMessage(playerid, 0x99FF66AA, "Use /lift to bring the lift up and /lift to take it back down");
			GameTextForPlayer(playerid, "/lift to bring the lift up and /lift to take it back down", 5000, 5);

			playerReceivedMessage = 1;
		}
	} else {
		playerReceivedMessage = 0;
	}
}



Re: Playerrecievedmessage - MadeMan - 26.03.2010

Quote:
Originally Posted by Drake1994
try this:

Код:
public liftcheck(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 15, -2464.9296875,1522.9167480469,27.570457458496)){
		if(playerReceivedMessage[playerid] == 0)
			{
			SendClientMessage(playerid, 0x99FF66AA, "Use /lift to bring the lift up and /lift to take it back down");
			GameTextForPlayer(playerid, "/lift to bring the lift up and /lift to take it back down", 5000, 5);

			playerReceivedMessage[playerid] = 1;
		}
	} else {
		playerReceivedMessage[playerid] = 0;
	}
}