[Plugin] Pawn.RakNet

Код:
SetPlayerDisableKeysSync(playerid, (KEY_FIRE & KEY_SPRINT & KEY_CROUCH));
I'm pretty sure you wanted to type OR instead of AND
Reply

Quote:
Originally Posted by sniper-termit
Посмотреть сообщение
silent aim sends to server fake bullet data, you need check coords in OnPlayerWeaponShot to fix that cheat.
I don't understand how can I check coords to fix silent aim. This coords is already incorrect when they come to server

Can you explain more accurate please?
Reply

Quote:
Originally Posted by Spmn
Посмотреть сообщение
Код:
SetPlayerDisableKeysSync(playerid, (KEY_FIRE & KEY_SPRINT & KEY_CROUCH));
I'm pretty sure you wanted to type OR instead of AND
Thanks for correcting.
Reply

I am trying to get some informations about 3D text labels. After searching RPC arguments, I tried this code

Код:
new lLabelID, lColorID, Float:lX, Float:lY, Float:lZ, Float:lDrawDistance, lUseLOS, lPlayerID, lVehicleID;

BS_ReadValue
(
	bs,
	PR_UINT16, lLabelID,
	PR_INT32, lColorID,
	PR_FLOAT, lX,
	PR_FLOAT, lY,
	PR_FLOAT, lZ,
	PR_FLOAT, lDrawDistance,
	PR_BOOL, lUseLOS,
	PR_UINT16, lPlayerID,
	PR_UINT16, lVehicleID
);
SendClientMessageEx(lString, 200, playerid, -1, "label [%d %d %.1f %.1f %.1f %.2f %d %d %d]", lLabelID, lColorID, lX, lY, lZ, lDrawDistance, lUseLOS, lPlayerID, lVehicleID);
Output
Код:
[18:06:04] label [1025 16777215 0.0 0.0 0.0 15.00 0 -253 9983]
label's ID, color ID, position and draw distance are good, but after draw distance data is false. Arguments to RPC I found there: https://github.com/P3ti/RakSAMP/blob...src/netrpc.cpp

Код:
void ScrCreate3DTextLabel(RPCParameters *rpcParams)
{
	PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
	int iBitLength = rpcParams->numberOfBitsOfData;

	RakNet::BitStream bsData((unsigned char *)Data,(iBitLength/8)+1,false);

	WORD ID;
	CHAR Text[256];
	DWORD dwColor;
	FLOAT vecPos[3];
	FLOAT DrawDistance;
	BYTE UseLOS;
	WORD PlayerID;
	WORD VehicleID;

	bsData.Read((WORD)ID);
	bsData.Read((DWORD)dwColor);
	bsData.Read((FLOAT)vecPos[0]);
	bsData.Read((FLOAT)vecPos[1]);
	bsData.Read((FLOAT)vecPos[2]);
	bsData.Read((FLOAT)DrawDistance);
	bsData.Read((BYTE)UseLOS);
	bsData.Read((WORD)PlayerID);
	bsData.Read((WORD)VehicleID);

	stringCompressor->DecodeString(Text, 256, &bsData);

	if(settings.uiTextLabelsLogging != 0)
	{
		char szCreate3DTextLabelAlert[256];
		sprintf_s(szCreate3DTextLabelAlert, sizeof(szCreate3DTextLabelAlert), "[TEXTLABEL] %d - %s (%X, %.3f, %.3f, %.3f, %.2f, %i, %d, %d)", ID, Text, dwColor, vecPos[0], vecPos[1], vecPos[2], DrawDistance, UseLOS, PlayerID, VehicleID);
		Log(szCreate3DTextLabelAlert);
	}
}
Where I can find actual parameters to most of RPC? I saw Jelly's list of RPC, but there is nothing on Create3DTextLabel.
Reply

`uselos` type is `byte`, so you have to parse it as `PR_UINT8`.

LE: I don't get why don't you simply hook `Create(Player)3DTextLabel` function instead of going so lowlevel.
Reply

Thanks, now all data is true.

Quote:

LE: I don't get why don't you simply hook `Create(Player)3DTextLabel` function instead of going so lowlevel.

I use dynamic labels (label's id id 1025 as you can see above). Simply I wanted to create option for players to hide certain labels if they want, I can't achieve this with function hook. To hide labels (for example, all attached to vehicles) is returning 0 in OnOutcomingRPC when rpcid is 36 (Create3DTextLabel) is the simplest way, I think.

Anyway, thanks for help.
Reply

PHP код:
//RPCs
#define RPC_ServerJoin (137)
#define RPC_ServerQuit (138)
ShowPlayerOnScoreBoard(playeridtoplayeridbool:show)
{
    if(!
IsPlayerConnected(playerid) || !IsPlayerConnected(toplayerid)) return 0;
    
    new 
BitStream:bs BS_New(), name[MAX_PLAYER_NAME];
    
    
BS_WriteValue(
        
bs,
        
PR_UINT16playerid,
        
PR_UINT81
    
);
    
BS_RPC(bstoplayeridRPC_ServerQuit);
    
BS_Reset(bs);
    
    
GetPlayerName(playeridnamesizeof(name));
    
    
BS_WriteValue(
        
bs,
        
PR_UINT16playerid,
        
PR_INT320,
        
PR_UINT8, !show,
        
PR_UINT8strlen(name),
        
PR_STRINGname
    
);
    
    
BS_RPC(bstoplayeridRPC_ServerJoin);
    
BS_Delete(bs);
    return 
1;

Function snippet. This will show/hide a player from score-board (In-Game) by adding them back as a NPC for 'toplayerid'.

Take into account that hidden players will have their name tags removed for 'toplayerid', that is because they are added back as NPCs. Other than that, everything works fine.
Reply

Added a new tutorial by BrunoBM23.
Reply

Is it possible to execute actors with this plugin?
Reply

How do I read packets data? Like how would I know that data this packet has, what type of bits(8,16, etc).
Pretty confused, I would like to print out a packet example;
const RCON_CALL = 201;

This packet is called when player enter's /rcon
So how do I read data for it?

I would like to know how can I extract RPC id's.
Reply

Quote:
Originally Posted by AroseKhanNiazi
Посмотреть сообщение
How do I read packets data? Like how would I know that data this packet has, what type of bits(8,16, etc).
Pretty confused, I would like to print out a packet example;
const RCON_CALL = 201;

This packet is called when player enter's /rcon
So how do I read data for it?

I would like to know how can I extract RPC id's.
https://sampforum.blast.hk/showthread.php?tid=652400
Reply

That doesn't help, like how would I know this function has what data type?
Reply

Here you go most of them: https://sampforum.blast.hk/showthread.php?tid=649570
It is in spanish/portugese, I can't find this thread in english, although the most important info is readable.

Код:
ID_RCON_COMMAND (ID: 201)
text_length,
cmdtext
I also want to know how to get packet's data from ID_SPECTATOR_SYNC (212), but I can't find anything how to do it.
Reply

Quote:
Originally Posted by ball
Посмотреть сообщение
Here you go most of them: https://sampforum.blast.hk/showthread.php?tid=649570
It is in spanish/portugese, I can't find this thread in english, although the most important info is readable.

Код:
ID_RCON_COMMAND (ID: 201)
text_length,
cmdtext
I also want to know how to get packet's data from ID_SPECTATOR_SYNC (212), but I can't find anything how to do it.
It's structure:

UINT16 - lrKey
UINT16 - udKey
UINT16 - keys
FLOAT - Position X
FLOAT - Position Y
FLOAT - Position Z

Anyway, the latest include file already has read/write functions for spectator sync packet (https://github.com/urShadow/Pawn.Rak...awn.RakNet.inc):

PHP код:
enum PR_SpectatingSync
{
    
PR_lrKey,
    
PR_udKey,
    
PR_keys,
    
Float:PR_position[3]
};
stock BS_ReadSpectatingSync(BitStream:bsdata[PR_SpectatingSync])
{
    
BS_ReadValue(
        
bs,
        
PR_UINT16data[PR_lrKey],
        
PR_UINT16data[PR_udKey],
        
PR_UINT16data[PR_keys],
        
PR_FLOATdata[PR_position][0],
        
PR_FLOATdata[PR_position][1],
        
PR_FLOATdata[PR_position][2]
    );
}
stock BS_WriteSpectatingSync(BitStream:bsdata[PR_SpectatingSync])
{
    
BS_WriteValue(
        
bs,
        
PR_UINT16data[PR_lrKey],
        
PR_UINT16data[PR_udKey],
        
PR_UINT16data[PR_keys],
        
PR_FLOATdata[PR_position][0],
        
PR_FLOATdata[PR_position][1],
        
PR_FLOATdata[PR_position][2]
    );

Reply

Thank you very much, now its working like a charm! I took the parameters from there and I thought it is correct.
Reply

Why is there no information about OPacket?
Reply

How can i Show or hide players using this plugin?
Reply

Is there any chance to get this plugin for windows xp? because i saw its only for windows > 7, halo peoples
Reply

Можно ли JoyPad обнаружить с помощью этого?
Reply

1.3.0:
  • Added new types: PR_FLOAT3, PR_FLOAT4, PR_VECTOR, PR_NORM_QUAT
  • Added BS_ReadWeaponsUpdate, BS_WriteWeaponsUpdate
  • Added BS_EmulateIncomingPacket, BS_EmulateIncomingRPC
  • Added optional 3rd argument 'outcoming' in BS_ReadOnFootSync, BS_ReadInCarSync, BS_WriteOnFootSync, BS_WriteInCarSync
  • Fixed ID_TIMESTAMP vulnerability
  • Fixed negative playerid in OnIncomingPacket, OnIncomingRPC
  • Added CR:MP (0.3e) adaptation
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)