SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 09/12/2017, 06:20 AM   #21
Aliassassin123456
Banned
 
Join Date: Apr 2013
Location: 0x7f000001
Posts: 232
Reputation: 67
Default Re: RPC - Pawn.RakNet

Nice tutorial, it will surely help people understand how server communicate with client using RakNet and how to work with Pawn.RakNet.

Quote:
Originally Posted by Jelly23 View Post
I will be updating the list as I can, I know some RPCs are missing, but won't be for long.

Information about reliability updated.
I looked into samp-server, it looks like RPC ID 44 (CreateObject) contains all these stuff.
If object is attached to a vehicle or another object it will write to BitStream those stuff you wrote in your RPC List.
Code:
float AttachOffsetX, float AttachOffsetY, float AttachOffsetZ, float AttachRotX, float AttachRotY, float AttachRotZ, BYTE SyncRotation
If it is not attached, it won't contain these parameters.

About materials, both MaterialText and Material are being used with the same CreateObject RPC.
All 16 materials slots will be stored in the same RPC.

Parameters:
If it is Material:
Code:
BYTE byteMethod; // (always 1 here, because it is material)
BYTE byteSlot;
WORD wModelID;
char szTXDName[65];
char szTextureName[65];
DWORD dwMaterialColor;
Else if it is MaterialText:
Code:
BYTE byteMethod; // (always 2 here, because it is materialtext)
BYTE byteSlot;
BYTE byteMaterialSize;
char szFont[65];
BYTE byteFontSize;
BYTE byteBold;
DWORD dwFontColor;
DWORD dwBackgroundColor;
BYTE byteAlign;
And your ShowTextDraw - ID: 134 is not correct.
Correct parameters:
Code:
BYTE byteFlags;
float fLetterWidth;
float fLetterHeight;
DWORD dwLetterColor;
float fLineWidth;
float fLineHeight;
DWORD dwBoxColor;
BYTE byteShadow;
BYTE byteOutline;
DWORD dwBackgroundColor;
BYTE byteStyle;
BYTE byteSelectable;
float fX;
float fY;
WORD wModelID;
float fRotX;
float fRotY;
float fRotZ;
float fZoom;
WORD wColor1;
WORD wColor2;
char szText[1024];
Hope that helps.

Last edited by Aliassassin123456; 11/03/2018 at 11:00 PM.
Aliassassin123456 is offline   Reply With Quote
Old 13/12/2017, 09:51 PM   #22
Jelly23
Guest
 
Posts: n/a
Default Re: RPC - Pawn.RakNet

Quote:
Originally Posted by Aliassassin123456 View Post
Nice tutorial, it will surely help people understand how server communicate with client using RakNet and how to work with Pawn.RakNet.



I looked into samp-server, it looks like RPC ID 44 (CreateObject) contains all these stuff.
If object is attached to a vehicle or another object it will write to BitStream those stuff you wrote in your RPC List.
Code:
float AttachOffsetX, float AttachOffsetY, float AttachOffsetZ, float AttachRotX, float AttachRotY, float AttachRotZ, BYTE SyncRotation
If it is not attached, it won't contain these parameters.
I already mentioned on the list to just make sure WORD attachedObject/WORD attachedVehicle is -1 in case you don't plan on attaching it on anything, which means to simply not make use of the other parameters.

Quote:
Originally Posted by Aliassassin123456 View Post
About materials, both MaterialText and Material are being used with the same CreateObject RPC.
All 16 materials slots will be stored in the same RPC.

Parameters:
If it is Material:
Code:
BYTE byteMethod; // (always 1 here, because it is material)
BYTE byteUsed; // Boolean, Non-zero true zero false
BYTE byteSlot;
WORD wModelID;
char szTXDName[65];
char szTextureName[65];
DWORD dwMaterialColor;
Else if it is MaterialText:
Code:
BYTE byteMethod; // (always 2 here, because it is materialtext)
BYTE byteUsed; // Boolean, Non-zero true zero false
BYTE byteMaterialSize;
char szFont[65];
BYTE byteFontSize;
BYTE byteBold;
DWORD dwFontColor;
DWORD dwBackgroundColor;
BYTE byteAlign;
I didn't put much time into looking for RPC parameters or re-checking, I said I would update the list when I could. Thanks anyway.

Quote:
Originally Posted by Aliassassin123456 View Post
And your ShowTextDraw - ID: 134 is not correct.
Correct parameters:
Code:
BYTE byteFlags;
float fLetterWidth;
float fLetterHeight;
DWORD dwLetterColor;
float fLineWidth;
float fLineHeight;
DWORD dwBoxColor;
BYTE byteShadow;
BYTE byteOutline;
DWORD dwBackgroundColor;
BYTE byteStyle;
BYTE byteSelectable;
float fX;
float fY;
WORD wModelID;
float fRotX;
float fRotY;
float fRotZ;
float fZoom;
WORD wColor1;
WORD wColor2;
char szText[1024];
Hope that helps.
I just noticed what is wrong and I changed it, thanks.
  Reply With Quote
Old 05/05/2020, 04:24 PM   #23
PRoleplay
Big Clucker
 
Join Date: Nov 2012
Posts: 142
Reputation: 0
Default Re: RPC - Pawn.RakNet

PHP Code:
[00:13:10] [debugServer crashed due to an unknown error
[00:13:10] [debugNative backtrace:
[
00:13:10] [debug#0 6a82b9d8 in ?? () from plugins\pawnraknet.dll
[00:13:10] [debug#1 00457e32 in ?? () from samp-server.exe
[00:13:10] [debug#2 004583ca in ?? () from samp-server.exe
[00:13:10] [debug#3 0045abda in ?? () from samp-server.exe
[00:13:10] [debug#4 0049104c in ?? () from samp-server.exe
[00:13:10] [debug#5 0049125c in ?? () from samp-server.exe
[00:13:10] [debug#6 0048d4db in ?? () from samp-server.exe
[00:13:10] [debug#7 0049b531 in ?? () from samp-server.exe
[00:13:10] [debug#8 0049b541 in ?? () from samp-server.exe 
Help.
PRoleplay is offline   Reply With Quote
Old 12/05/2020, 08:57 AM   #24
JasonTheMan
Big Clucker
 
JasonTheMan's Avatar
 
Join Date: Apr 2020
Posts: 54
Reputation: 2
Default Re: RPC - Pawn.RakNet

Thanks
__________________
Owner/Founder - DesignUX
New Project - RedWood High
JasonTheMan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] Pawn.RakNet YourShadow Plugin Development 258 29/06/2020 01:39 PM
[Tutorial] Pacotes - Pawn.RakNet Jelly23 Lançamentos/Releases 33 23/06/2018 09:49 PM
VC:MP RakNet Version? Christopher. Everything and Nothing 1 27/01/2010 09:17 PM


All times are GMT. The time now is 05:17 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.