katursis / Pawn.RakNet

🛡 Plugin for SA:MP 0.3.7 server that allows you to capture and analyze RakNet traffic
https://github.com/katursis/Pawn.RakNet/wiki
MIT License
163 stars 29 forks source link

SendBulletData() ? #4

Closed knife-s closed 6 years ago

knife-s commented 7 years ago

Hello, is possible to make a SendBulletData function using this plugin?

I was trying to do it by myself but I'm not sure if Im doing it well..

Here's what I have... (incomplete, of course, I was trying to do it following the YSF plugin by Kurta99...)

stock SendBulletData(target_id, Float:x,Float:y,Float:z, weaponid)
{

  BS_WriteValue(bs,
                    RNM_INT16, target_id,
                    RNM_CFLOAT, x,
                    RNM_CFLOAT, y,
                    RNM_CFLOAT, z,
                    RNM_UINT8, weaponid);

  new BitStream:bs = BS_New(), RPC_BULLET = 206;

  BS_WriteValue(bs, RNM_UINT8, ID_CONNECTION_LOST);

  BS_Send(bs, player_id);
  BS_Send(bs, -1, PacketPriority:priority = HIGH_PRIORITY, PacketReliability:reliability = RELIABLE_ORDERED);

  BS_Delete(bs);
  //BS_Send(BitStream:bs, player_id, PacketPriority:priority = HIGH_PRIORITY, PacketReliability:reliability = RELIABLE_ORDERED);
  //CSAMPFunctions::Send(&bs, HIGH_PRIORITY, RELIABLE_ORDERED, 0, CSAMPFunctions::GetPlayerIDFromIndex(forplayerid), false);
}
knife-s commented 7 years ago

edit: confusion... It didnt work.

What I am trying to do is to make a NPC RC Goblin shoot. :(

katursis commented 6 years ago

https://github.com/urShadow/Pawn.RakNet/wiki/Send-bullet-data

ghost commented 6 years ago

I think the time has arrived, when I should remove these functions from YSF. If you could made an example how to disable sync of given keypress, then I will sure remove these funcs from ysf.

katursis commented 6 years ago

https://github.com/urShadow/Pawn.RakNet/wiki/SetPlayerDisableKeysSync

ghost commented 6 years ago

Very good! Thanks :)