A Question - 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: A Question (
/showthread.php?tid=317284)
A Question -
Tanush123 - 10.02.2012
Well how can i do if somebody is near
by 100 distance, it will show
pawn Код:
format(str,sizeof(str),"You have entered %s territory",OrgInfo[i][CP]);\
SendClientMEssage...
Re: A Question -
Twisted_Insane - 10.02.2012
Hi!
Simply use the function "IsPlayerInRangeOfPoint"!
Here a little example:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Hope I could help usefully!
Re: A Question -
Tanush123 - 10.02.2012
Lol never thinked of that...
Re: A Question -
Tanush123 - 10.02.2012
For some reason i get "You have entered territory" with a load of spam and while im not near a organization cp,
i entered this under OnPlayerUpdate
pawn Код:
foreach(Player,i)
{
for(new oi=0; oi<MAX_ORGS; oi++)
{
if(IsPlayerInRangeOfPoint(i, 100,OrgInfo[oi][CPX],OrgInfo[oi][CPY],OrgInfo[oi][CPZ]))
{
if(enteredterr[playerid] == 0)
{
format(str,sizeof(str),"You have entered %s territory",OrgInfo[oi][Orgname]);
SCM(playerid,COLOR_LIGHTBLUE,str);
enteredterr[playerid] = 1;
}
}
else
{
enteredterr[playerid] = 0;
}
}
}
Re: A Question -
Twisted_Insane - 10.02.2012
What do you mean with a "load of spam"? What happens?
Re: A Question -
IceCube! - 10.02.2012
That wont work you need to do somthing simaler to Mabako's 'Zones Script' but with the Gang / what ever it is, Then edit his commands to check the location but in your case check the territory.