Player info. bug
#1

I don't know if it's reported before,
but I found that you can't get the players' interior,health,armour,etc. instantly after you changing them.
Example:
pawn Код:
SetPlayerInterior(playerid,100);
printf("%d",GetPlayerInterior(playerid));
Same for SetPlayerHealth and SetPlayerArmour.
This problem makes me unable to make a anti lock health,
and it also cause problems on object streamers.
Reply
#2

Don't think that's a bug. afaik it's just a side affect of the afk packet pool. The stat is set AFTER sending the info packet to the client. If the client is AFK, then the packet is put in a pool and the stat isn't changed.
Reply
#3

So you'll need to set a timer to check that on the next client update?
Reply
#4

Quote:
Originally Posted by me
When you set a player's interior a packet will get sent that's basically saying "set interior to x" (obviously not in plain english, lol). When the player recieves that message and is unpaused the interior will change and the player sends a message back saying basically "my interior just changed to x". After that is recieved by the server, GetPlayerInterior will show that new interior.
When you set the interior, OnPlayerInteriorChange will be called when the client changes the interior and sends it back to the server.
If the player is paused, for example, the interior change will be delayed.

Why would you need to read the new interior that fast, anyways?
Reply
#5

Quote:
Originally Posted by Slice
Посмотреть сообщение
When you set the interior, OnPlayerInteriorChange will be called when the client changes the interior and sends it back to the server.
If the player is paused, for example, the interior change will be delayed.

Why would you need to read the new interior that fast, anyways?
He stated the interior as an example
Quote:

This problem makes me unable to make a anti lock health,.......

Reply
#6

Quote:
Originally Posted by admantis
Посмотреть сообщение
He stated the interior as an example
Same goes for health, aswell. Making anti-lock health isn't that easy, sorry.

You have to realize that GetPlayerHealth returns the health value that was most recently sent by the client. Why would you want GetPlayerHealth to show something that it isn't? That's just stupid.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)