Why doesnt command work?
#1

Код:
CMD:activatetrucker(playerid, params[])
{
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_LIGHTRED, "INFO: You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "INFO: You are not authorized to use this command.");
	new Float:X, Float:Y, Float:Z; //We use this to store player position
	GetPlayerPos(playerid, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
	if (X >= -466 && X <= -505 && Y >= -468 && Y <= -507)
	{
		SendClientMessage(playerid, COLOR_YELLOW, "Success!");
	}
	else
	{
		SendClientMessage(playerid, COLOR_RED, "Failed!");
	}
	return 1;
}
Its a test for me to get areas working, how the heck do I do it though? Its not working. This is supposed to be an area just north of the truck depot west of LS.
Also, How do I post my code in pawno here on the forum. Thanks heaps guys!
Reply
#2

pawn Код:
if (X >= -466 && X <= -505 && Y >= -468 && Y <= -507)
// o.O
// Use IsPlayerInRangeOfPoint
By the way, use [pawn ] [/pawn]
Reply
#3

Thanks for the quick reply dude. Ill checkout IsPlayerInRangeOfPoint. It seems straightforward. Cheers for both.
... wtf. Im hell stupid thanks man..
Reply
#4

although there is isplayerinrange, is there still a way to get wether the player is within a box area?
Reply
#5

Get streamer plugin
pawn Код:
native CreateDynamicRectangle();
then use
public OnPlayerEnterArea
Reply
#6

Cool thanks for that, I use the streamer for checkpoints and stuff but ill look into it. Thanks alot
Reply
#7

X must be bigger than min X and smaller than max X

min X: -505
max X: -466

same with Y

pawn Код:
if (X >= -505 && X <= -466 && Y >= -507 && Y <= -468)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)