Playerrecievedmessage
#1

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)){
Reply
#2

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;
	}
}
Reply
#3

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

but its MAX_PLAYERS
Reply
#5

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;
	}
}
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)