keep player on the roof of the vehicle
#1

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

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

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

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

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 ?
Reply
#6

i try it by setplayervelocity in OnPlayerUpdate but it is need more update and faster
Reply
#7

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

Reply
#8

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

Why not use a timer instead? 100 Miliseconds timer? instead of OnPlayerUpdate..
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)