[Ajuda] Problema com GangZona -
cotonete - 14.10.2011
Porque isto nгo funciona?
Код:
#define MAX_GZS 1
new Float:checkGzs[MAX_GZS][4] =
{
{2079.9426,1539.2587, 2321.6956,1766.2577}
};
forward checarareaGz();
public checarareaGz()
{
for(new i = 0; i < MAX_PLAYERS; ++i)
{
if(IsPlayerInArea(i, checkGzs[i][0],checkGzs[i][1],checkGzs[i][2],checkGzs[i][3]))
{
SendClientMessage(i,0x000000ff,"aaaaaaaaaaaaaaa");
}
}
return 1;
}
new gzteste;
//OnGameModeInit()
for(new i =0; i < MAX_GZS; ++i)
{
gzteste = GangZoneCreate(checkGzs[i][0],checkGzs[i][1],checkGzs[i][2],checkGzs[i][3]);
}
SetTimer("checarareaGz",1000,true);
...
eu chego na бrea e nгo acontece nada
Re: [Ajuda] Problema com GangZona -
WLSF - 14.10.2011
https://sampwiki.blast.hk/wiki/GangZoneCreate
Eu tava lendo, acho que faltou GangZoneShowForPlayer
Re: [Ajuda] Problema com GangZona -
cotonete - 14.10.2011
Код:
#define GZ_COR_PADRAO 0xffffff49
#define MAX_GZS 2
new Float:gzsChecks[MAX_GZS][4] = {
{-72.7639,2476.5984, 436.3150,2526.0474}, // GangZona Aeroporto Abandonado
{1176.9095,1223.9652, 1038.0834,1362.3284} // GangZona AutoEscola LV
};
new gzsNames[MAX_GZS][28] = {
"Aeroporto Abandonado LV",
"Auto-Escola LV"
};
forward checkGz();
public checkGz()
{
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new h = 0; h < MAX_GZS; i++)
{
if(IsPlayerInArea(i, gzsChecks[h][0],gzsChecks[h][1],gzsChecks[h][2],gzsChecks[h][3]))
{
format(string,sizeof(string),"%s",gzsNames[h]);
SendClientMessage(i,0xffff5494,string);
}
}
}
return 1;
}
new gzsteste[2];
// Mode init
for(new h =0; h < MAX_GZS; h++)
{
gzsteste[h] = GangZoneCreate(gzsChecks[h][0],gzsChecks[h][1],gzsChecks[h][2],gzsChecks[h][3]);
}
SetTimer("checkGz", 1000, true);
// Onplayerspawn
for(new i =0; i < MAX_GZS; i++)
{
GangZoneShowForAll(gzsteste[i], GZ_COR_PADRAO);
}
fiz isso, mas nгo conecta no servidor, sу fica tentando, oque serб?
Re: [Ajuda] Problema com GangZona -
[O.z]Caroline - 14.10.2011
pawn Код:
public checarareaGz()
{
for(new i = 0; i < MAX_PLAYERS; ++i)
{
//if(IsPlayerInArea(i, checkGzs[i][0],checkGzs[i][1],checkGzs[i][2],checkGzs[i][3]))
if(IsPlayerConnected(i))
{
for(new h = 0; h < MAX_GZS; i++)
{
if(isPlayerGangZone(i, heckGzs[h][0],checkGzs[h][1],checkGzs[h][2],checkGzs[h][3]))
{
SendClientMessage(i,0x000000ff,"aaaaaaaaaaaaaaa");
}
}
}
}
return 1;
}
isPlayerGangZone(pid, Float: gz_x, Float: gz_y, Float: gz_x2, Float: gz_y2)
{
new 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;
}