SA-MP Forums Archive
I need some help - 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: I need some help (/showthread.php?tid=388842)



I need some help - Private200 - 30.10.2012

I wanna do something like .

IsOnPlayerRange so if someone is in range of something , that thing will open .

IDk how to do it . Help please


AW: I need some help - Skimmer - 30.10.2012

Try this

Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z);



Re: I need some help - Private200 - 30.10.2012

and after it , i mean like IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z);
but i wanna do something , if someone is in range of this point , SetObjectPos , i need the coords of it , i mean i do it SetObjectPos(objectid, etc); or SetObjectPos(playerid, etc); ?


AW: I need some help - Skimmer - 30.10.2012

Join your server or goto Rockstar Games\GTA_SA\ and open the program samp_debug.exe click on Launch Debug. Use /v [vehicleid] to spawn a car and drive to the post that you wanna check. Type /save yourcomment(optional) and quit your game. Go to My Files\GTA San Andreas User Files\SAMP open the savedpositions.txt file and copy the X, Y, Z Coordinats there.

Here is an example:

Код:
AddPlayerClass(1,264.5497,86.5918,1001.0391,268.1924,0,0,0,0,0,0); // yourcomment(optional)
The floats with big and red colored are the X, Y, Z Coordinats. You can use it now on your script.

Код:
IsPlayerInRangeOfPoint(playerid, 5.0, 264.5497,86.5918,1001.0391)



Re: I need some help - Private200 - 30.10.2012

I know that -.-' I just wanna know how to move that object when player is on player range of that object


AW: I need some help - Skimmer - 30.10.2012

Код:
MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0);
https://sampwiki.blast.hk/wiki/MoveObject


Re: I need some help - gtakillerIV - 30.10.2012

pawn Код:
if(IsPlayerInRangeOfPoint(playerid,6.0, F:x, F:y, F:z))
{
     //Code here.
}
F = Float


Re: I need some help - Bakr - 30.10.2012

As people have stated, use the suggested functions. As far as where to use them, you can try under OnPlayerUpdate or through a timer. If you decide to use OnPlayerUpdate, you may want to add some type of delay to the object getting re-positioned, as OnPlayerUpdate is called many times per second.