Problem with message in area
#1

PHP код:
forward CheckArea();
public 
CheckArea()
{
foreach(
Playeri)
{
if(
IsPlayerConnected(i))
{
if(
GetClanId(Hq1) != -1)
{
GangZoneShowForPlayer(i,GangZoneHq[0],ClanInfo[GetClanId(Hq1)][ClanColorR] == -COLOR_BLACK rgba2hex(ClanInfo[GetClanId(Hq1)][ClanColorR], ClanInfo[GetClanId(Hq1)][ClanColorG], ClanInfo[GetClanId(Hq1)][ClanColorB], 100));
}
new 
count[MAX_PLAYERS],string[100];
if(
isPlayerInArea(i,HqAreas[0]) && count[i] == 0)
{
count[i] = 1;
if(
equal(PlayerInfo[i][Clan], ClanInfo[GetClanId(Hq1)][ClanName]))
{
format(string,sizeof(string),"Welcome to your hq");
SendClientMessage(iCOLOR_YELLOWstring);
}
else
{
SendClientMessage(iCOLOR_YELLOW"."Welcome to ""Hq1"" Hq ");
format(string,sizeof(string),"
!! фмщ мофчгъ дчмап %**", GetName(i));
SendClanMessage(ClanInfo[GetClanId(Hq1)][ClanName],COLOR_PINK, string);
}
if(!isPlayerInArea(i,HqAreas[0]) && count[i] == 1) count[i] = 0;
}
}
}
return true;

Why it's didn't send only one message when i in area?
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
I would guess because this is on a timer so called repeatedly.
Yes,but i want to do when player in area he will get only one message and not many.



sorry for english..
Reply
#3

Some one help?
Reply
#4

Reply
#5

You need to create the variable that checks if they were in the area or not global to keep track each timer call.
Reply
#6

Try this
Код HTML:
if(some[playerid] == 0)
{
     /put here the message
     some[playerid] = 1;
}
Reply
#7

Quote:
Originally Posted by Bakr
Посмотреть сообщение
You need to create the variable that checks if they were in the area or not global to keep track each timer call.
How to do that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)