keep player on the roof of the vehicle -
AmirHossaiN - 23.06.2015
hi.
i'll make a cmd for keep (dont fall) player on (from) vehicle roof.
i try it by setplayerpos but this dont work correctly.
if maybe help me with setplayervelocity
Re: keep player on the roof of the vehicle -
AlonzoTorres - 23.06.2015
You want the player to surf on a vehicle without falling? Using setplayerposition would work but it would look like crap because even if you update every 10th of a second it would still lag. Using playervelocity does not change anything since you would have to update the velocity positioning if the vehicle change direction and also based on speed... Why do you even want a player to be able to do this? There is no native way to attach players to objects/vehicles.
Re: keep player on the roof of the vehicle -
AmirHossaiN - 23.06.2015
i see this in a server.
player by a cmd keeps on vehicle when vehicle has speed , player is keep on vehicle and dont apart from vehicle
Re: keep player on the roof of the vehicle -
rappy93 - 23.06.2015
I guess you can get the player's position using GetPlayerPos and then get the position of the vehicle he is surfing with GetVehiclePos and then make a timer to set the player's position on top of the vehicle.
Something like :
SetPlayerPos = GetVehiclePos(x, y, z+1)
This is just an idea, not sure if it would work.
Re: keep player on the roof of the vehicle -
AmirHossaiN - 23.06.2015
i try this in OnPlayerUpdate but it dont work correctly. problem with it : player become about freeze and he cant use anims and it is lag.
i saw this in a server correctly.
may i use SetPlayerViceCity for it ?
Re: keep player on the roof of the vehicle -
AmirHossaiN - 23.06.2015
i try it by setplayervelocity in OnPlayerUpdate but it is need more update and faster
Re: keep player on the roof of the vehicle -
AlonzoTorres - 23.06.2015
Quote:
Originally Posted by AmirHossaiN
i try this in OnPlayerUpdate but it dont work correctly. problem with it : player become about freeze and he cant use anims and it is lag.
i saw this in a server correctly.
may i use SetPlayerViceCity for it ?
|
OnPlayerUpdate
Quote:
This callback is called very frequently per second per player; only use it when you know what it's meant for (or more importantly what it's NOT meant for).
|
Re: keep player on the roof of the vehicle -
AmirHossaiN - 23.06.2015
Quote:
Originally Posted by AlonzoTorres
OnPlayerUpdate
|
I dont understand this
I try setplayervicecity By sesettimerex false with 1 nilisecond but player drops down from top of vehicle
Re: keep player on the roof of the vehicle -
Youssef221 - 23.06.2015
Why not use a timer instead? 100 Miliseconds timer? instead of OnPlayerUpdate..
Re: keep player on the roof of the vehicle -
AmirHossaiN - 23.06.2015
Quote:
Originally Posted by Youssef221
Why not use a timer instead? 100 Miliseconds timer? instead of OnPlayerUpdate..
|
I try setplayervicecity By sesettimerex false with 1 nilisecond but player drops down from top of vehicle
Once more i try by settimerex true with 1 milisecond and again top problem