A Question
#1

Well how can i do if somebody is near
pawn Код:
OrgInfo[i][CP]
by 100 distance, it will show
pawn Код:
format(str,sizeof(str),"You have entered %s territory",OrgInfo[i][CP]);\
SendClientMEssage...
Reply
#2

Hi!

Simply use the function "IsPlayerInRangeOfPoint"!

Here a little example:

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Hope I could help usefully!
Reply
#3

Lol never thinked of that...
Reply
#4

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;
            }
        }
    }
Reply
#5

What do you mean with a "load of spam"? What happens?
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)