Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. new FakePing = 1;
  2. new playerRakNetScore[MAX_PLAYERS];
  3. new playerRakNetPing[MAX_PLAYERS];
  4.  
  5. ORPC:RPC_UpdateScorePingIP(playerid, BitStream:bs) {
  6. printf("1");
  7. new bytes;
  8. BS_GetNumberOfBytesUsed(bs, bytes);
  9.  
  10. for(new i = (bytes / 10) - 1; i >= 0; i--) {
  11. new otherids, scores, ping;
  12. BS_ReadValue(bs, PR_UINT16, otherids, PR_INT32, scores, PR_UINT32, ping);
  13. if(!IsPlayerConnected(otherids)) continue;
  14. playerRakNetScore[otherids] = scores;
  15. playerRakNetPing[otherids] = ping;
  16. }
  17.  
  18. new BitStream:stream = BS_New();
  19. for(new otherids = GetPlayerPoolSize(); otherids >= 0; otherids--) {
  20. if(!IsPlayerConnected(otherids)) continue;
  21. BS_WriteValue(stream, PR_UINT16, otherids, PR_INT32, playerRakNetScore[otherids], PR_UINT32, otherids ? playerRakNetPing[otherids] : FakePing);
  22. }
  23.  
  24. BS_RPC(stream, playerid, 155, PR_LOW_PRIORITY, PR_RELIABLE_ORDERED);
  25. BS_Delete(stream);
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement