PDA

View Full Version : IsPlayerInZone


Visio
07/05/2012, 12:16 PM
SetTimer("pezona",500, true);

forward pezona();
public pezona()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
for(new i=0; i<sizeof(ZoneInfo); i++)
{
if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 12)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
return 1;
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 13)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
return 1;
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 14)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
return 1;
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 15)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
return 1;
}
}
return 1;// héhé
}


the problem is: if i am id 0 is show to me that message"bla bla" but i'am id 0+..(1,2.....)isn't show it!

Jonny5
07/05/2012, 12:19 PM
SetTimer("pezona",500, true);

forward pezona();
public pezona()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
for(new i=0; i<sizeof(ZoneInfo); i++)
{
if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 12)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
return 1;
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 13)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
return 1;
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 14)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
return 1;
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 15)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
return 1;
}
}
}
return 1;// héhé
}


try this

Visio
07/05/2012, 12:20 PM
thx,i try now to see that is working[rep + for you]
edit
is idem
is show only i'm id 0

Jonny5
07/05/2012, 12:33 PM
i dont understand what your saying.

Visio
07/05/2012, 12:37 PM
I used your script but still does not work
if i am id 0 is working
work only for id 0

Visio
07/05/2012, 01:50 PM
bump

ViniBorn
07/05/2012, 01:52 PM
Delete the return


public pezona()
{
for(new playerid; playerid != MAX_PLAYERS; playerid++)
for(new i; i<sizeof(ZoneInfo); i++)
{
if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 12)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 13)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 14)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
}
else if(IsPlayerInZone(playerid, i) && ZoneInfo[i][zTeam] == 15)
{
GameTextForPlayer(playerid, "bla bla",5000, 1);
}
}

return 1;// héhé
}

Visio
07/05/2012, 02:13 PM
error 010: invalid function or declaration
return 1;// héhé

ViniBorn
07/05/2012, 02:17 PM
Try again

Visio
07/05/2012, 02:19 PM
perfect working,thx man
i have 1 questions
how can i do sho message only time per teritory?

ViniBorn
07/05/2012, 02:21 PM
Add one space in the last 'GameTextForPlayer'