SA-MP Forums Archive
Something like AttachPlayerToVehicle - 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: Something like AttachPlayerToVehicle (/showthread.php?tid=347287)



Something like AttachPlayerToVehicle - zgintasz - 01.06.2012

Hi guys,

I'll try to explain my problem. I'm making fishing system in boat(vehicle model 453). So, if I'm on boat and I freeze player(TogglePlayerControllable), vehicle moves forward(by inertia or affecting waves), but player stays in "air"... Is there a way to fix it? AttachPlayerToVehicle would be awesome, but it doesn't exist :/.

Thanks guys.


Re: Something like AttachPlayerToVehicle - TzAkS. - 01.06.2012

PutPlayerInVehicle?
Maybe with a timer..


Re: Something like AttachPlayerToVehicle - Sandiel - 01.06.2012

Are you tryina make a command to freeze the player or what?


Re: Something like AttachPlayerToVehicle - MadeMan - 01.06.2012

Why do you want to freeze the player?


Re: Something like AttachPlayerToVehicle - zgintasz - 01.06.2012

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
PutPlayerInVehicle?
Maybe with a timer..
I'm trying to make fishing standing on boat's surface.


Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Why do you want to freeze the player?
Because I'm attaching object and applying animation.


Re: Something like AttachPlayerToVehicle - TzAkS. - 01.06.2012

Try like i said..it`s need to work and with a timer.
Or if he is just on boat,not like driver or passanger,try to GetVehiclePos and SetPlayerPos


Re: Something like AttachPlayerToVehicle - zgintasz - 01.06.2012

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
Try like i said..it`s need to work and with a timer.
Or if he is just on boat,not like driver or passanger,try to GetVehiclePos and SetPlayerPos
Yeah, that's my plan B, but it doesn't look very good to eye...


Re: Something like AttachPlayerToVehicle - TzAkS. - 01.06.2012

Why not?
with a short timer will work.
Or put the boat on x y z.


Re: Something like AttachPlayerToVehicle - pasha97 - 01.06.2012

1.Create global variable "fishing" which is "1" when player is in fishing and "0" when player is not in fishing
2.Creare global variable "boatid" and put there id of a boat.
3.Use this:

pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:x, Float:y, Float:z;
if(fishing == 1)
{
GetVehiclePos(boatid,x,y,z);
SetPlayerPos(playerid, x,y,z+0.3);
}
}