Re: Pawn.RakNet -
Spmn - 17.02.2018
Код:
SetPlayerDisableKeysSync(playerid, (KEY_FIRE & KEY_SPRINT & KEY_CROUCH));
I'm pretty sure you wanted to type OR instead of AND
Re: Pawn.RakNet -
Splav - 17.02.2018
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?
Re: Pawn.RakNet -
Kaperstone - 17.02.2018
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.
Re: Pawn.RakNet -
ball - 26.02.2018
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.
Re: Pawn.RakNet -
Spmn - 26.02.2018
`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.
Re: Pawn.RakNet -
ball - 27.02.2018
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.
Re: Pawn.RakNet - Jelly23 - 10.03.2018
PHP код:
//RPCs
#define RPC_ServerJoin (137)
#define RPC_ServerQuit (138)
ShowPlayerOnScoreBoard(playerid, toplayerid, bool:show)
{
if(!IsPlayerConnected(playerid) || !IsPlayerConnected(toplayerid)) return 0;
new BitStream:bs = BS_New(), name[MAX_PLAYER_NAME];
BS_WriteValue(
bs,
PR_UINT16, playerid,
PR_UINT8, 1
);
BS_RPC(bs, toplayerid, RPC_ServerQuit);
BS_Reset(bs);
GetPlayerName(playerid, name, sizeof(name));
BS_WriteValue(
bs,
PR_UINT16, playerid,
PR_INT32, 0,
PR_UINT8, !show,
PR_UINT8, strlen(name),
PR_STRING, name
);
BS_RPC(bs, toplayerid, RPC_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.
Re: Pawn.RakNet -
YourShadow - 11.04.2018
Added a new tutorial by BrunoBM23.
Re: Pawn.RakNet -
sampkinq - 11.04.2018
Is it possible to execute actors with this plugin?
Re: Pawn.RakNet -
AroseKhanNiazi - 13.04.2018
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.
Re: Pawn.RakNet -
narwn - 13.04.2018
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
Re: Pawn.RakNet -
AroseKhanNiazi - 13.04.2018
That doesn't help, like how would I know this function has what data type?
Re: Pawn.RakNet -
ball - 13.04.2018
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.
Re: Pawn.RakNet -
BrunoBM23 - 13.04.2018
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:bs, data[PR_SpectatingSync])
{
BS_ReadValue(
bs,
PR_UINT16, data[PR_lrKey],
PR_UINT16, data[PR_udKey],
PR_UINT16, data[PR_keys],
PR_FLOAT, data[PR_position][0],
PR_FLOAT, data[PR_position][1],
PR_FLOAT, data[PR_position][2]
);
}
stock BS_WriteSpectatingSync(BitStream:bs, data[PR_SpectatingSync])
{
BS_WriteValue(
bs,
PR_UINT16, data[PR_lrKey],
PR_UINT16, data[PR_udKey],
PR_UINT16, data[PR_keys],
PR_FLOAT, data[PR_position][0],
PR_FLOAT, data[PR_position][1],
PR_FLOAT, data[PR_position][2]
);
}
Re: Pawn.RakNet -
ball - 31.05.2018
Thank you very much, now its working like a charm! I took the parameters from
there and I thought it is correct.
Re: Pawn.RakNet -
Jasno - 03.08.2018
Why is there no information about OPacket?
Re: Pawn.RakNet -
Amagida - 08.12.2018
How can i Show or hide players using this plugin?
Re: Pawn.RakNet -
Jefff - 13.12.2018
Is there any chance to get this plugin for windows xp? because i saw its only for windows > 7, halo peoples
Re: Pawn.RakNet -
makarevich - 28.12.2018
Можно ли JoyPad обнаружить с помощью этого?
Re: Pawn.RakNet -
YourShadow - 25.02.2019
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