17.02.2012, 23:18
Hi Scripters!
Well i was using IsPlayerInArea, to show a GangZone for a player who is passing in that area. But i have some problems, I read a Tutorial and in the Tutorial it don't show where should i use that Function so i decide it to put it on OnPlayerUpdate.
I have this
The problems i check are:
I spawn in grove Street and i see the grove street territory, And everyother territory. When i'm in GS Territory i see the GameText of Ballas. And when i exit GS Area it disapear but when i change to balla it desapear too, the same happend in the other territoryes. What is wrong?
I have defined every Gangzone and i also have this
More info added:
I have this on the Callback
Well i was using IsPlayerInArea, to show a GangZone for a player who is passing in that area. But i have some problems, I read a Tutorial and in the Tutorial it don't show where should i use that Function so i decide it to put it on OnPlayerUpdate.
I have this
pawn Код:
if(IsPlayerInArea(playerid, 2220, 2607, -1970, -1571)) //Grove
{
GameTextForPlayer(playerid,"Grove Street Territory",1000,1);
GangZoneShowForPlayer(playerid, GroveStreetZone, 0x00FF0081);
}
else
{
GangZoneHideForPlayer(playerid, GroveStreetZone);
}
if(IsPlayerInArea(playerid, 1832, 2166, -1748, -1141)) //Aztecas
{
GameTextForPlayer(playerid,"Aztecas Territory",1000,1);
GangZoneShowForPlayer(playerid, AztecasZone,0x00FFFF96);
}
else
{
GangZoneHideForPlayer(playerid, AztecasZone);
}
if(IsPlayerInArea(playerid, 2121, 2607, -1970, -1571)) //Ballas1
{
GameTextForPlayer(playerid,"Ballas Territory",1000,1);
GangZoneShowForPlayer(playerid, BallasZone1, 0x8080FF96);
}
else
{
GangZoneHideForPlayer(playerid, BallasZone1);
}
if(IsPlayerInArea(playerid, 2121, 2585, -1523, -1200)) //Ballas2
{
GameTextForPlayer(playerid,"Ballas Territory",1000,1);
GangZoneShowForPlayer(playerid, BallasZone2, 0x8080FF96);
}
else
{
GangZoneHideForPlayer(playerid, BallasZone2);
}
if(IsPlayerInArea(playerid, 2630, 2893, -2234, -1050)) //Vagos1
{
GameTextForPlayer(playerid,"Vagos Territory",1000,1);
GangZoneShowForPlayer(playerid, VagosZone1, 0xFFFF0096);
}
else
{
GangZoneHideForPlayer(playerid, VagosZone1);
}
if(IsPlayerInArea(playerid, 1969, 2790, -1121, -979)) //Vagos2
{
GameTextForPlayer(playerid,"Vagos Territory",1000,1);
GangZoneShowForPlayer(playerid, VagosZone2, 0xFFFF0096);
}
else
{
GangZoneHideForPlayer(playerid, VagosZone2);
}
I spawn in grove Street and i see the grove street territory, And everyother territory. When i'm in GS Territory i see the GameText of Ballas. And when i exit GS Area it disapear but when i change to balla it desapear too, the same happend in the other territoryes. What is wrong?
I have defined every Gangzone and i also have this
pawn Код:
IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}
I have this on the Callback
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInArea(playerid, 2220, 2607, -1970, -1571)) //Grove
{
GameTextForPlayer(playerid,"Grove Street Territory",1000,1);
GangZoneShowForPlayer(playerid, GroveStreetZone, 0x00FF0081);
}
else
{
GangZoneHideForPlayer(playerid, GroveStreetZone);
}
if(IsPlayerInArea(playerid, 1832, 2166, -1748, -1141)) //Aztecas
{
GameTextForPlayer(playerid,"Aztecas Territory",1000,1);
GangZoneShowForPlayer(playerid, AztecasZone,0x00FFFF96);
}
else
{
GangZoneHideForPlayer(playerid, AztecasZone);
}
if(IsPlayerInArea(playerid, 2121, 2607, -1970, -1571)) //Ballas1
{
GameTextForPlayer(playerid,"Ballas Territory",1000,1);
GangZoneShowForPlayer(playerid, BallasZone1, 0x8080FF96);
}
else
{
GangZoneHideForPlayer(playerid, BallasZone1);
}
if(IsPlayerInArea(playerid, 2121, 2585, -1523, -1200)) //Ballas2
{
GameTextForPlayer(playerid,"Ballas Territory",1000,1);
GangZoneShowForPlayer(playerid, BallasZone2, 0x8080FF96);
}
else
{
GangZoneHideForPlayer(playerid, BallasZone2);
}
if(IsPlayerInArea(playerid, 2630, 2893, -2234, -1050)) //Vagos1
{
GameTextForPlayer(playerid,"Vagos Territory",1000,1);
GangZoneShowForPlayer(playerid, VagosZone1, 0xFFFF0096);
}
else
{
GangZoneHideForPlayer(playerid, VagosZone1);
}
if(IsPlayerInArea(playerid, 1969, 2790, -1121, -979)) //Vagos2
{
GameTextForPlayer(playerid,"Vagos Territory",1000,1);
GangZoneShowForPlayer(playerid, VagosZone2, 0xFFFF0096);
}
else
{
GangZoneHideForPlayer(playerid, VagosZone2);
}
if(!IsPlayerConnected(playerid)) return 0;
if(IsPlayerNPC(playerid)) return 1;
if(GetPlayerInterior(playerid) == 17)
{
if(IsPlayerInRangeOfPoint(playerid,70.0,489.5824,-14.7563,1000.6797)) { // alhambra middle
if(!GetPVarInt(playerid,"alhambra")) {
SetPVarInt(playerid,"alhambra",1);
PlayAudioStreamForPlayer(playerid, "https://dl-web.dropbox.com/get/sak%20noel%20-%20loca%20people%20%28la%20gente%20esta%20muy%20loca%29%20%5Bofficial%20videoclip%5D.mp3");
}
}
}
else
{
if(GetPVarInt(playerid,"alhambra"))
{
DeletePVar(playerid,"alhambra");
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}