28.10.2011, 22:10
pequena mudanзa nos cуdigos:
pawn Код:
public GangZonesCheck()
{
new string[256];
for(new i = 0; 42 > i; i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i, ZoneName[i]);
if(GetPlayerZone(i) == -1)
{
format(string,256,"~n~~g~Brasil Mata-Mata 2012 Participe da Nossa comunidade no orkut ~g~http://www.orkut.com.br/Main#Community?cmm=110617106");
TextDrawSetString(ZoneName[i], string);
TextDrawShowForPlayer(i, ZoneName[i]);
return 1;
}
format(string,128,"~n~~p~Territ¦rio - %s -", gZonesCoordinates[pZone][gZoneName]);
TextDrawSetString(ZoneName[i], string);
TextDrawShowForPlayer(i, ZoneName[i]);
}
}
return 1;
}
stock GetPlayerZone(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING ||GetPlayerInterior(playerid) != 0 || GetPlayerVirtualWorld(playerid) != 0)
return -1;
for (new i = 0 ; i < 42; i++)
{
//if (playerX >= zone_minX && playerX <= zone_maxX && playerY >= zone_minY && playerY <= zone_maxY)
if(isPlayerGangZone(pid, gZonesCoordinates[i][ZArea][2], gZonesCoordinates[i][ZArea][0], gZonesCoordinates[i][ZArea][3], gZonesCoordinates[i][ZArea][1]))
{
LastZone[playerid] = i;
return LastZone[playerid];
}
}
return -1;
}
isPlayerGangZone(pid, Float: gz_x, Float: gz_y, Float: gz_x2, Float: gz_y2)
{
static Float:X, Float:Y, Float:Z;
GetPlayerPos(pid, X, Y, Z);
if (X > gz_x && X < gz_x2 && Y > gz_y && Y < gz_y2)
return true;
return 0;
}