Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new FakePing = 1;
- new playerRakNetScore[MAX_PLAYERS];
- new playerRakNetPing[MAX_PLAYERS];
- ORPC:RPC_UpdateScorePingIP(playerid, BitStream:bs) {
- printf("1");
- new bytes;
- BS_GetNumberOfBytesUsed(bs, bytes);
- for(new i = (bytes / 10) - 1; i >= 0; i--) {
- new otherids, scores, ping;
- BS_ReadValue(bs, PR_UINT16, otherids, PR_INT32, scores, PR_UINT32, ping);
- if(!IsPlayerConnected(otherids)) continue;
- playerRakNetScore[otherids] = scores;
- playerRakNetPing[otherids] = ping;
- }
- new BitStream:stream = BS_New();
- for(new otherids = GetPlayerPoolSize(); otherids >= 0; otherids--) {
- if(!IsPlayerConnected(otherids)) continue;
- BS_WriteValue(stream, PR_UINT16, otherids, PR_INT32, playerRakNetScore[otherids], PR_UINT32, otherids ? playerRakNetPing[otherids] : FakePing);
- }
- BS_RPC(stream, playerid, 155, PR_LOW_PRIORITY, PR_RELIABLE_ORDERED);
- BS_Delete(stream);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement