Player Around a object co-ordinate fails? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Player Around a object co-ordinate fails? (
/showthread.php?tid=264002)
Player Around a object co-ordinate fails? -
Lorenc_ - 24.06.2011
Solved
Re: Player Around a object co-ordinate fails? -
BaubaS - 24.06.2011
1. Wtf is "IsPlayerAroundNapalm"?
2. Try this:
pawn Код:
IsPlayerAroundFire(playerid)
{
for(new f; f < 21; f++)
{
new Float:oPosition[3];
GetObjectPos(gServerData[E_FIRE][f], oPosition[0], oPosition[1], oPosition[2]);
return IsPlayerInRangeOfPoint(playerid, 3.0, oPosition[0], oPosition[1], oPosition[2]);
}
}
Re: Player Around a object co-ordinate fails? -
Sascha - 24.06.2011
the only thing I see in it is that you are using "IsPlayerAroundNapalm" at OnPlayerUpdate and as stock "IsPlayerAroundFire"..
however I guess this are basicly 2 different functions and has nothing to do with the problem.. I don't see any other mistake though.. what about trying to set the range a little bit higher? (e.g. to 5 -- just to test)
Re: Player Around a object co-ordinate fails? -
Lorenc_ - 25.06.2011
Quote:
Originally Posted by BaubaS
1. Wtf is "IsPlayerAroundNapalm"?
2. Try this:
pawn Код:
IsPlayerAroundFire(playerid) { for(new f; f < 21; f++) { new Float:oPosition[3]; GetObjectPos(gServerData[E_FIRE][f], oPosition[0], oPosition[1], oPosition[2]); return IsPlayerInRangeOfPoint(playerid, 3.0, oPosition[0], oPosition[1], oPosition[2]); } }
|
Sorry about that, just did a mistake, IsPlayerAroundNapalm is the same thing as IsPlayerAroundFire.
Compeletly the same, just theres a define/macro
pawn Код:
#define IsPlayerAroundNapalm(%1) IsPlayerAroundFire(%1)
By the way, the solution isn't working, what the hell is the problem with the code. Code looks fine.
Quote:
Originally Posted by Sascha
the only thing I see in it is that you are using "IsPlayerAroundNapalm" at OnPlayerUpdate and as stock "IsPlayerAroundFire"..
however I guess this are basicly 2 different functions and has nothing to do with the problem.. I don't see any other mistake though.. what about trying to set the range a little bit higher? (e.g. to 5 -- just to test)
|
Sorry I missed your comment lol, it worked when i set it to 5.0 as the distance.
EDIT: It only worked for one object? Wth?