Thread: [Plugin] Pawn.RakNet
View Single Post
Old 26/02/2018, 04:33 PM   #181
ball
Huge Clucker
 
ball's Avatar
 
Join Date: Jul 2012
Location: Poznan, Poland
Posts: 289
Reputation: 33
Default Re: Pawn.RakNet

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

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
Code:
[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

Code:
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.
ball is offline   Reply With Quote