IsPlayerInRangeOfPoint help
#1

Hi,

Im trying to write a bit of code that every time a player goes through an info checkpoint they get a textdraw shown on their screen. Its not working but compiles properly. Any ideas?

PHP код:
forward PlayerInfoRange(playerid);
public 
PlayerInfoRange(playerid)
{
    for(new 
id 0id sizeof(factionInfo); id++)
    if(
factionInfo[id][fID] >= 1)
    {
        if(!
IsPlayerInRangeOfPoint(playerid,3factionInfo[id][facX], factionInfo[id][facY],factionInfo[id][facZ]))
        {
            
TextDrawShowForPlayer(playeridEMPTYINFOBOX);
            
TextDrawShowForPlayer(playeridPROPNAME);
            
TextDrawShowForPlayer(playeridSTRINGNAME);
            
TextDrawShowForPlayer(playeridPROPADD);
            
TextDrawShowForPlayer(playeridPROPOWNER);
            
TextDrawShowForPlayer(playeridSTRINGNAME);
            
TextDrawShowForPlayer(playeridSTRINGPROP);
            
TextDrawShowForPlayer(playeridSTRINGOWNER);
            
TextDrawShowForPlayer(playeridPROPINFO);
            
TextDrawShowForPlayer(playeridTEXTBOT);
        }
    }
    return 
1;

Reply
#2

hmm use foreach
Reply
#3

Quote:
Originally Posted by GaMiX
Посмотреть сообщение
hmm use foreach
How can he use foreach in a faction loop? Are you blind or what?
Reply
#4

You are checking the opposite : !IsPlayerInRangeOfPoint
PHP код:
if(IsPlayerInRangeOfPoint(playerid,3factionInfo[id][facX], factionInfo[id][facY],factionInfo[id][facZ])) 
Reply
#5

I tried that, but still nothing comes up. The only way I could get it to come up is with a timer, but then it repeatedly comes up even though no one is near a faction
Reply
#6

How do you call your PlayerInfoRange function?
Reply
#7

Quote:
Originally Posted by willbedie
Посмотреть сообщение
How can he use foreach in a faction loop? Are you blind or what?
ey man cmoon , iam new :P
Reply
#8

Quote:
Originally Posted by Shinja
Посмотреть сообщение
How do you call your PlayerInfoRange function?
I call it under a settimer function in ongamemodeinit. It kept spamming my players however. How should I lay it out?
Reply
#9

Quote:
Originally Posted by willbedie
Посмотреть сообщение
How can he use foreach in a faction loop? Are you blind or what?
Why can't he?
Reply
#10

Quote:
Originally Posted by willbedie
Посмотреть сообщение
How can he use foreach in a faction loop? Are you blind or what?
He can, with iterators. Don't be rude to people if you are clueless yourself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)