Advertisement
ykos

Untitled

Aug 19th, 2024
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. public OnIncomingPacket(playerid, packetid, BitStream:bs) {
  2.  
  3. if (!(0 <= playerid < MAX_PLAYERS)) {
  4.  
  5. return 1;
  6. }
  7.  
  8. // if(!IsLauncherConnected(playerid) && !IsMobileConnected(playerid) && !IsTrilogyConnected(playerid)) {
  9.  
  10. // return 1;
  11. // }
  12.  
  13. DebugSend(playerid, "OnIncomingPacket packetid: %d", packetid);
  14. if(packetid == 220) {
  15.  
  16. BS_IgnoreBits(bs, 8);
  17.  
  18. new g_action_id = 0;
  19. new g_cheat_id = 0;
  20. new bool: g_status = false;
  21.  
  22. BS_ReadValue(bs, PR_UINT8, g_action_id);
  23. BS_ReadValue(bs, PR_UINT8, g_cheat_id);
  24. BS_ReadValue(bs, PR_BOOL, g_status);
  25.  
  26. BS_ResetReadPointer(bs);
  27.  
  28. DebugSend(playerid, "packetid: %d, action_id: %d, cheat_id: %d, status: %d", packetid, g_action_id, g_cheat_id, g_status);
  29.  
  30. if(g_action_id == 179) {
  31.  
  32. if(0 <= g_cheat_id < MAX_CHEAT_IDS) {
  33.  
  34. g_player_status_cheat[playerid][g_cheat_id] = g_status;
  35. DebugSend(playerid, "Set cheat status (%s): status %d", g_cheat_name[g_cheat_id], g_status);
  36. }
  37. }
  38. }
  39. return 1;
  40. }
  41. #if defined _ALS_OnIncomingPacket
  42. #undef OnIncomingPacket
  43. #else
  44. #define _ALS_OnIncomingPacket
  45. #endif
  46. #define OnIncomingPacket sobeit_OnIncomingPacket
  47. #if defined sobeit_OnIncomingPacket
  48. forward sobeit_OnIncomingPacket(playerid, packetid, BitStream:bs);
  49. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement