30.10.2010, 16:27
SHIT NOT WORKING!
pawn Код:
#define FORBIDZONE1_X_MAX -864.1628
#define FORBIDZONE1_X_MIN -4087.256
#define FORBIDZONE1_Y_MAX 4063.901
#define FORBIDZONE1_Y_MIN 2989.536
#define FORBIDZONE2_X_MAX 2627.522
#define FORBIDZONE2_X_MIN -2977.858
#define FORBIDZONE2_Y_MAX 2977.858
#define FORBIDZONE2_Y_MIN 2837.724
#define FORBIDZONE3_X_MAX -2989.536 //-3316.517
#define FORBIDZONE3_X_MIN -3316.517 //-2989.536
#define FORBIDZONE3_Y_MAX 2989.536
#define FORBIDZONE3_Y_MIN -2662.556
#define FORBIDZONE4_X_MAX -2966.18 //-3012.892
#define FORBIDZONE4_X_MIN -3012.892 //-2966.18
#define FORBIDZONE4_Y_MAX 3082.959 //58.38938
#define FORBIDZONE4_Y_MIN 58.38938 // 3082.959
#define FORBIDZONE5_X_MAX -2989.536 //-3188.06
#define FORBIDZONE5_X_MIN -3188.06 //-2989.536
#define FORBIDZONE5_Y_MAX 934.23 //934.23
#define FORBIDZONE5_Y_MIN -1996.917 //-1996.917
// you can ignore the commented lines above
pawn Код:
public OnGameModeInit()
{
SetTimer("IsPlayerInArea", 1000, true);
Forbidzone1 = GangZoneCreate(-864.1628, -4087.256, 4063.901, 2989.536);
Forbidzone2 = GangZoneCreate(-2977.858, 2627.522, 2837.724, 2977.858);
Forbidzone3 = GangZoneCreate(-2989.536, -3316.517, -2662.556, 2989.536);
Forbidzone4 = GangZoneCreate(-2966.18, -3012.892, 3082.959, 58.38938);
Forbidzone5 = GangZoneCreate(-2989.536, -3188.06, -1996.917, 934.23);
GangZoneShowForAll(Forbidzone1, COLOR_BLACK);
GangZoneShowForAll(Forbidzone2, COLOR_BLACK);
GangZoneShowForAll(Forbidzone3, COLOR_BLACK);
GangZoneShowForAll(Forbidzone4, COLOR_BLACK);
GangZoneShowForAll(Forbidzone5, COLOR_BLACK);
// other shit
pawn Код:
public IsPlayerInArea()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(i, x, y, z);
if (x > FORBIDZONE1_X_MIN && x < FORBIDZONE1_X_MAX && y > FORBIDZONE1_Y_MIN && y < FORBIDZONE1_Y_MAX)
{
SendClientMessage(i,COLOR_WHITE,"Your in the area lol");
}
if (x > FORBIDZONE2_X_MIN && x < FORBIDZONE2_X_MAX && y > FORBIDZONE2_Y_MIN && y < FORBIDZONE2_Y_MAX)
{
SendClientMessage(i,COLOR_WHITE,"Your in the area lol");
}
if (x > FORBIDZONE3_X_MIN && x < FORBIDZONE3_X_MAX && y > FORBIDZONE3_Y_MIN && y < FORBIDZONE3_Y_MAX)
{
SendClientMessage(i,COLOR_WHITE,"Your in the area lol");
}
if (x > FORBIDZONE4_X_MIN && x < FORBIDZONE4_X_MAX && y > FORBIDZONE4_Y_MIN && y < FORBIDZONE4_Y_MAX)
{
SendClientMessage(i,COLOR_WHITE,"Your in the area lol");
}
if (x > FORBIDZONE5_X_MIN && x < FORBIDZONE5_X_MAX && y > FORBIDZONE5_Y_MIN && y < FORBIDZONE5_Y_MAX)
{
SendClientMessage(i,COLOR_WHITE,"Your in the area lol");
}
}
}
}

