(https://i.imgur.com/qZS0VI6.png)
You see, I want to update the ammo of the player's weapon but how could I update it from server to client-side? I tried using a loop with the condition stating if the player's action is ID 16, however, it looped forever. I've a table setup in the client side where I can store the ammo in a variable, so therefore, I can use Script::ScriptProcess to update the text from the image above.
Sending a stream every time a player shoots is very bad. You could play around with the PlayerShoot event (client-side). Decrease one bullet each time that event is called.
However clientside shoot event won't work with shotguns.
Quote from: vitogta on Aug 19, 2018, 08:14 AMHowever clientside shoot event won't work with shotguns.
Yeah, I guess that looses my hope, perhaps I should think about a operation with shotguns. I'd like to know why shotguns are not calling that callback. @Stormeus
It's better to wait when all those methods of player's instance will became clientside than sending tons of data between server and client just for gui.
don't forget about lag of client->server->client will be bad with fast switch (one of basic vc-mp game mechanics).
Quote from: vitogta on Aug 19, 2018, 04:10 PMIt's better to wait when all those methods of player's instance will became clientside than sending tons of data between server and client just for gui.
don't forget about lag of client->server->client will be bad with fast switch (one of basic vc-mp game mechanics).
Well, my only option I can do is make a workaround with
Player::PlayerShoot function.
Quote from: KuRuMi^ on Aug 19, 2018, 06:20 PMWell, my only option I can do is make a workaround with Player::PlayerShoot function.
Good luck.
Getting current player's weapon.
Without data from server with a lag.
Getting ammo in magazine.
Without data from server with a lag.
Getting shoot event for shotguns.
Without data from server with a lag.
Marked solved. Hoping for the new update to add more CPlayer members.