I need some help
#1

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
Reply
#2

Try this

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

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); ?
Reply
#4

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)
Reply
#5

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

Код:
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
Reply
#7

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)