Something wrong happened when I read bullet sync data with RakNet - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Something wrong happened when I read bullet sync data with RakNet (
/showthread.php?tid=656766)
Something wrong happened when I read bullet sync data with RakNet -
DuyDang2412 - 23.07.2018
I'm learning about RakNet and I was trying to read bullet sync data but the data was not exactly what I want. It gives me strange value and in the code and the video below, you can see that I don't change my weapon but the bulletSyncData[PR_weaponId] value changes. I need a help to solve this.
My English is not good so I cannot have more words.
PHP код:
const ID_BULLET_SYNC = 206;
public OnIncomingPacket(playerid, packetid, BitStream:bs)
{
if(packetid == ID_BULLET_SYNC)
{
new bulletSyncData[PR_BulletSync],
Packed:string[128];
BS_ReadBulletSync(bs, bulletSyncData);
format(string, sizeof(string), !"hittype: %d, hitid: %d, weaponid: %d", bulletSyncData[PR_hitType],
bulletSyncData[PR_hitId], bulletSyncData[PR_weaponId]);
msg(playerid, -1, string);
}
return 1;
}
More at
this video.
Re: Something wrong happened when I read bullet sync data with RakNet -
Calisthenics - 23.07.2018
before BS_ReadBulletSync function.
Re: Something wrong happened when I read bullet sync data with RakNet -
DuyDang2412 - 24.07.2018
Quote:
Originally Posted by Calisthenics
before BS_ReadBulletSync function.
|
I don't know what BS_IgnoreBits does but It works now! Thank you [REP++]
So everytime I use BS_ReadBulletSync, I must put BS_IgnoreBits before it, right?
Re: Something wrong happened when I read bullet sync data with RakNet -
Calisthenics - 24.07.2018
https://sampforum.blast.hk/showthread.php?tid=652400