SA-MP Forums Archive
Object moving problem [+rep] - 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: Object moving problem [+rep] (/showthread.php?tid=331910)



Object moving problem [+rep] - Faisal_khan - 06.04.2012

Hi SA-MP Community,

I assembeld a ship with many parts like the hull, alfa objects, crates, ......... Now the deal is when a player calls for that ship from a dock, the ship must come to the player 5 meters away in one piece. Is it possible? If yes, show me how.


Re: Object moving problem [+rep] - MadeMan - 06.04.2012

You need to attach the parts to the ship

https://sampwiki.blast.hk/wiki/AttachObjectToObject


Re: Object moving problem [+rep] - Faisal_khan - 06.04.2012

Done that +reped. Now how to code for the ship to be some distance away from the player when called?


Re: Object moving problem [+rep] - Jack.7331 - 06.04.2012

You'd do something like
pawn Код:
CMD:callship(playerid, params[])
{
     if(IsPlayerInRangeOfPoint(playerid, DISTANCE, X, Y, Z))
     MoveObject(shipname, X, Y, Z, SPEED);
}



Re: Object moving problem [+rep] - Faisal_khan - 07.04.2012

Quote:
Originally Posted by Jack.7331
Посмотреть сообщение
You'd do something like
pawn Код:
CMD:callship(playerid, params[])
{
     if(IsPlayerInRangeOfPoint(playerid, DISTANCE, X, Y, Z))
     MoveObject(shipname, X, Y, Z, SPEED);
}
So what should be my X, Y, Z co-ordinates? The co-ordinate from where the player is calling?


Re: Object moving problem [+rep] - Aira - 07.04.2012

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
So what should be my X, Y, Z co-ordinates? The co-ordinate from where the player is calling?
The First line, the XYZ lines are for the Location of where the player is calling, the MoveObject XYZ is for where the Ship would "row" to


Re: Object moving problem [+rep] - Faisal_khan - 07.04.2012

arghhh!!!
Код:
This forum requires that you wait 120 seconds between posts. Please try again in 8 seconds.
Then what about the DISTANCE?
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, DISTANCE, X, Y, Z))



Re: Object moving problem [+rep] - Aira - 07.04.2012

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
arghhh!!!
Код:
This forum requires that you wait 120 seconds between posts. Please try again in 8 seconds.
Then what about the DISTANCE?
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, DISTANCE, X, Y, Z))
Meters away from the XYZ?
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: Object moving problem [+rep] - Faisal_khan - 07.04.2012

Ok +reped you


Re: Object moving problem [+rep] - Jack.7331 - 07.04.2012

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Ok +reped you
Did it work?