IsPlayerInRangeOfPoint help -
yllo - 23.08.2018
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 = 0; id < sizeof(factionInfo); id++)
if(factionInfo[id][fID] >= 1)
{
if(!IsPlayerInRangeOfPoint(playerid,3, factionInfo[id][facX], factionInfo[id][facY],factionInfo[id][facZ]))
{
TextDrawShowForPlayer(playerid, EMPTYINFOBOX);
TextDrawShowForPlayer(playerid, PROPNAME);
TextDrawShowForPlayer(playerid, STRINGNAME);
TextDrawShowForPlayer(playerid, PROPADD);
TextDrawShowForPlayer(playerid, PROPOWNER);
TextDrawShowForPlayer(playerid, STRINGNAME);
TextDrawShowForPlayer(playerid, STRINGPROP);
TextDrawShowForPlayer(playerid, STRINGOWNER);
TextDrawShowForPlayer(playerid, PROPINFO);
TextDrawShowForPlayer(playerid, TEXTBOT);
}
}
return 1;
}
Re: IsPlayerInRangeOfPoint help -
GaMiX - 23.08.2018
hmm use foreach
Re: IsPlayerInRangeOfPoint help -
solstice_ - 23.08.2018
Quote:
Originally Posted by GaMiX
hmm use foreach
|
How can he use foreach in a faction loop? Are you blind or what?
Re: IsPlayerInRangeOfPoint help -
Shinja - 24.08.2018
You are checking the opposite : !IsPlayerInRangeOfPoint
PHP код:
if(IsPlayerInRangeOfPoint(playerid,3, factionInfo[id][facX], factionInfo[id][facY],factionInfo[id][facZ]))
Re: IsPlayerInRangeOfPoint help -
yllo - 24.08.2018
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
Re: IsPlayerInRangeOfPoint help -
Shinja - 24.08.2018
How do you call your PlayerInfoRange function?
Re: IsPlayerInRangeOfPoint help -
GaMiX - 24.08.2018
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
Re: IsPlayerInRangeOfPoint help -
yllo - 24.08.2018
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?
Re: IsPlayerInRangeOfPoint help -
Beckett - 24.08.2018
Quote:
Originally Posted by willbedie
How can he use foreach in a faction loop? Are you blind or what?
|
Why can't he?
Re: IsPlayerInRangeOfPoint help -
Rufio - 27.08.2018
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.