Problem with message in area - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with message in area (
/showthread.php?tid=418905)
Problem with message in area -
NeyMar96 - 26.02.2013
PHP код:
forward CheckArea();
public CheckArea()
{
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
if(GetClanId(Hq1) != -1)
{
GangZoneShowForPlayer(i,GangZoneHq[0],ClanInfo[GetClanId(Hq1)][ClanColorR] == -1 ? 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(i, COLOR_YELLOW, string);
}
else
{
SendClientMessage(i, COLOR_YELLOW, "."Welcome to ""Hq1"" Hq ");
format(string,sizeof(string),"!! фмщ мофчгъ дчмап %s **", 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?
Re: Problem with message in area -
NeyMar96 - 26.02.2013
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..
Re: Problem with message in area -
NeyMar96 - 27.02.2013
Some one help?
Re: Problem with message in area -
NeyMar96 - 01.03.2013
Re: Problem with message in area -
Bakr - 01.03.2013
You need to create the variable that checks if they were in the area or not global to keep track each timer call.
Re: Problem with message in area -
Kenway - 01.03.2013
Try this
Код HTML:
if(some[playerid] == 0)
{
/put here the message
some[playerid] = 1;
}
Re: Problem with message in area -
NeyMar96 - 01.03.2013
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?