Forcing update?
#1

Hey guys, currently when player is not moving he sends one update once a second. But when he starts moving well than its about 10 updates per second (depending on ping). Anyone has some idea of forcing player sending updates more frequently while idle?

At the moment i only have two. Dropping player from sky or putting him in a vehicle and changing vehicle velocity. Nether satisfy my needs as i need player to stay on same position (saving and restoring position is out of question)
Reply
#2

What exactly do you want to do with updates? I might have understood your need wrong but if you need reliable updates to check stuff you should use a timer (lets say 200 ms so 5 times a sec), It's way easier to use that than relying on OPU.
If you are looking for more sync requests between client and server I doubt it's easily achievable.
Reply
#3

I need reliable Camera Front Vector updates.

If i understand right, calling a timer wont help me since there is no updates. I can use functions and timer but it will return me last known info (and that is "outdated"). So i need to somehow force those updates.
Reply
#4

Maybe if you send updates to playerid, he will send back updates to server, so try to put something like this under OPU:

Код:
SetPlayerHealth(playerid, currentHP[playerid]);
Reply
#5

Quote:
Originally Posted by Spmn
Посмотреть сообщение
Maybe if you send updates to playerid, he will send back updates to server, so try to put something like this under OPU:

Код:
SetPlayerHealth(playerid, currentHP[playerid]);
Nice idea, but i just tried, doesnt work...
Reply
#6

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
I need reliable Camera Front Vector updates.

If i understand right, calling a timer wont help me since there is no updates. I can use functions and timer but it will return me last known info (and that is "outdated"). So i need to somehow force those updates.
AFAIK the camera sends updates to server once every second unless the player is aiming, you can't force that packet of data in any way unless player aims ( ? ) which isn't something server controls.
Reply
#7

I'm just gonna say a timer is the way to look at this.... I don't know why you're trying to say there are no updates on it...
Reply
#8

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
I'm just gonna say a timer is the way to look at this.... I don't know why you're trying to say there are no updates on it...
You probably didn't get what OP needs right.
https://sampwiki.blast.hk/wiki/GetPlayerCameraPos
Quote:
Originally Posted by Important Note
Player's camera positions are only updated once a second, unless aiming.
It is recommended to set a 1 second timer if you wish to take action that relies on a player's camera position.
Basically GetPlayerCameraFrontVector is part of player camera position, getting updated once a sec, OP needs it to be more than that which you can't force it to be twice a sec by server-back end AFAIK.
Reply
#9

Ahhhh... So you'd need some formula freak to come and make another function to calculate the position of what should be the camera, which you could then verify the against the actual position.
Reply
#10

@Swe_Sumi no, i just need a way to increase number of camera vector updates (not position)

Anyway, evryone thx for help, i kind-a figure out a dirty way to solve my problem.
Here are some possible solutions if someone need same thing in future.

1.Put player in a vehicle with turret (fire truck, swat, rhino)
2.Player must aim in order to send few updates per second
3.Put player in spectator mode, and attach camera to some object.

Since i needed player to stay on same position, spectator mode is fine for me, and i could fake player for everyone else by spawning actor.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)