SA-MP Forums Archive
How to get the player range - 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: How to get the player range (/showthread.php?tid=403422)



How to get the player range - Stefan_Merce - 30.12.2012

Hi i need to get the player range point for the fuel station i tried to do /save and take that code and put it in but dident work any way to get IsPlayerInRangeOfPoint(playerid


Re: How to get the player range - Konstantinos - 30.12.2012

pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z);
Look the parameters, show us what it saved on the saved position on My Documents and where did you use that.


Re: How to get the player range - Stefan_Merce - 30.12.2012

0,69.0161,1219.9005,18.8061,144.4481,0,0,0,0,0,0 this is what saved
this is where i want to put it want to change location of it
if(!IsPlayerInRangeOfPoint(playerid, 5, 2254.8438,30.5055,26.4135)


Re: How to get the player range - Konstantinos - 30.12.2012

The x, y, z are the 2nd, 3rd and 4th parameter.
pawn Код:
if( !IsPlayerInRangeOfPoint( playerid, 5, 69.0161, 1219.9005, 18.8061 ) )
{
    // code;
}



Re: How to get the player range - Stefan_Merce - 30.12.2012

Now i get this
warning 217: loose indentation
: error 017: undefined symbol "FuelVar"
) : warning 215: expression has no effect
PCRP.pwn(25129) : error 001: expected token: ";", but found "]"
PCRP.pwn(25129) : error 029: invalid expression, assumed zero


Re: How to get the player range - Konstantinos - 30.12.2012

Can you show us lines 25125 to 25130, please?


Re: How to get the player range - Stefan_Merce - 30.12.2012

for(new vehid=0; vehid < MAX_VEHICLES; vehid++)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine && Fuel[vehid])
{
FuelVar[vehid] ++;
if(GetVehicleSpeed(vehid, 0) != 0 && FuelVar[vehid] >= 72/2)
{


Re: How to get the player range - Konstantinos - 30.12.2012

Have you defined the FuelVar?
pawn Код:
// As global variable
new
   FuelVar[ MAX_VEHICLES ]
;