why doesn't this work?
#1

why doesn't this work?
Код:
public isPlayerInArea2()
{
	new Float:X, Float:Y, Float:Z;
	for(new i=0; i < MAX_PLAYERS; i++)
	{
		GetPlayerPos(i, X, Y, Z);
        if (X <= 2858 && X >= 2342 && Y <= -2319 && Y >= -2742)
        if (X <= -576 && X >= -763 && Y <= 1039 && Y >= 845 && Z <= 20 && Z >= 0)
		{
		}
		else
		{
             ResetPlayerWeapons(i);
		}
	}
}
Reply
#2

This doesn't make any sense to me. Describe in words, what you are trying to do.
Reply
#3

i am trying to make two deathmatches.
Reply
#4

And what do want this code to do? If you want it to check if a player is near an area then why do you have two x,y and z co-ordinates?
Reply
#5

Try this:

Код:
#include <a_samp>
#define green 0x33AA33AA
#define red 0xAA3333AA
new IsIn[MAX_PLAYERS], IsOut[MAX_PLAYERS];
forward Areacheck();
public Areacheck()
{
	for(new i=0; i < MAX_PLAYERS; i++)
	{
	if (IsPlayerInArea(i, 2858,2342,-2319,-2742) && IsIn[i] == 0)
	{
	IsIn[i] = 1;
	IsOut[i] = 1;
	SendClientMessage(i,green, "Welcome to the Dm area!");
	}
	if (!IsPlayerInArea(i, 2858,2342,-2319,-2742) && IsOut[i] == 1)
	{
	IsIn[i] = 0;
	IsOut[i] = 0;
	SendClientMessage(i,red, "You left the Dm area!");
	}
	}
	return 1;
}
// IsPlayerInArea Function.
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
	new Float:X, Float:Y, Float:Z;
	GetPlayerPos(playerid, X, Y, Z);
	if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
	return 0;
}
You also need to set a timer to use this though..
Reply
#6

but how can i add another one deathmatch to this?
Reply
#7

Like u want 2 deathmatch zones?
Reply
#8

yes that is what i want.
Reply
#9

does anybody know how to make that?
Reply
#10

Tell us what is that suppost to do and then well probadly fix this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)