03.11.2010, 17:52
Hello all well lately I had this really - really creepy problem I have tried everything and It's just not working so I need help witht his. Basically I have a LOOPING TIMER every 1 second that will check if player is in a specific zone. (I have made some gangzones to represent the areas and the coordenates below are based on the gangzones)
Anyways when I go in the area, nothing happens at all.
I have opened many threads about this: but I can't get it working.
If somebody could edit the scripts above so it works i will really kiss their shoes
Regards and thanks for replying !
Anyways when I go in the area, nothing happens at all.
pawn Код:
//OnGameModeInit
//GangZoneCreate(xmin,xmax,ymin,ymax);
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);
pawn Код:
//OnPlayerConnect
SetTimerEx("IsPlayerInArea",500,true,"i",playerid);
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
#define FORBIDZONE3_X_MIN -3316.517
#define FORBIDZONE3_Y_MAX 2989.536
#define FORBIDZONE3_Y_MIN -2662.556
#define FORBIDZONE4_X_MAX -2966.18
#define FORBIDZONE4_X_MIN -3012.892
#define FORBIDZONE4_Y_MAX 3082.959
#define FORBIDZONE4_Y_MIN 58.38938
#define FORBIDZONE5_X_MAX -2989.536
#define FORBIDZONE5_X_MIN -3188.06
#define FORBIDZONE5_Y_MAX 934.23
#define FORBIDZONE5_Y_MIN -1996.917
pawn Код:
forward IsPlayerInArea()
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");
}
else 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");
}
else 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");
}
else 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");
}
else 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");
}
}
}
}
If somebody could edit the scripts above so it works i will really kiss their shoes

Regards and thanks for replying !