[AJUDA] GangZystem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] GangZystem (
/showthread.php?tid=256463)
[AJUDA] GangZystem -
Oddie - 21.05.2011
olб, sou novo no forum e queria saber como verifico se o player estб nessas gangzonas atravйs de um timer?
pawn Код:
gTraficantes = GangZoneCreate(-2153.541015, 98.249694, -1993.541015, 330.249694);
gBoys = GangZoneCreate(-1988.769287, 405.630432, -1828.769287, 597.630432);
gChineses = GangZoneCreate(-2245.090820, 545.718322, -2133.090820, 745.718322);
gCowBoys = GangZoneCreate(-772.280334, 881.634582, -612.280334, 993.634582);
gGirls = GangZoneCreate(-2726.303955, -70.498336, -2590.303955, 49.501663);
gGroove = GangZoneCreate(-1549.412353, 813.364501, -1381.412353, 1029.364501);
gPoliciais = GangZoneCreate(-2718.754394, 296.873840, -2582.754394, 472.873840);
gMilitares = GangZoneCreate(-1633.008300, 264.001068, -1201.008300, 536.001098);
gRappers = GangZoneCreate(-2269.535400, 906.270812, -2117.535400, 1098.270751);
gKillers = GangZoneCreate(-1749.169921, -625.780395, -1293.169921, -169.780395);
Re: [AJUDA] GangZystem -
Shadoww5 - 21.05.2011
PHP код:
forward ChecarGZ(playerid);
public OnGameModeInit()
{
SetTimer("ChecarGZ",750,true);
return 1;
}
public ChecarGZ(playerid)
{
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(Pos[0] >= -2153.541015 && Pos[1] >= 98.249694 && Pos[0] <= -1993.541015 && Pos[1] <= 330.249694)
{
return 1;
}
else if(Pos[0] >= -2245.090820 && Pos[1] >= 545.718322 && Pos[0] <= -2133.090820 && Pos[1] <= 745.718322)
{
return 1;
}
else return 0;
}
Entгo vocк sу precisa adicionar as outras GZ e a funзгo correspondente ao codigo.
Re: [AJUDA] GangZystem -
zbt_Daimyo - 21.05.2011
Postaram isso a cerca de 10min em outro topico
pawn Код:
// OnGameModeInit
SetTimer("OnPlayerInGangZone",1000*2, true);
//qualquer lugar do seugm
public OnPlayerInGangZone(playerid)
{
if(IsPlayerInGZ(playerid,X,Y,X,Y)) --> Verifica se o player estб na GangZone
return 1;
}
stock IsPlayerInGZ(playerid,Float:x,Float:y,Float:z)
{
GetPlayerPos(playerid, x, y, z);
if(cordenadaX>= x && cordenadaXy >= Y &&cordenadaX x <= X && cordenadaY<= Y) return 1;
else return 0;
}