Skip to content

Commit

Permalink
📝 update commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldrin-John-Olaer-Manalansan committed Feb 28, 2025
1 parent a71311e commit 2fcd762
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 37 deletions.
78 changes: 42 additions & 36 deletions sa/sa.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"meta": {
"last_update": 1740733697391,
"version": "0.868",
"last_update": 1740773262767,
"version": "0.869",
"url": "https://library.sannybuilder.com/#/sa"
},
"extensions": [
Expand Down Expand Up @@ -60630,64 +60630,70 @@
"short_desc": "Writes a specified value with datatype and datasize at the \"write pointer\" of the specified bitstream, then advances its \"write pointer\" by the same size"
},
{
"id": "0B41",
"name": "RAKNET_SEND_RPC_EXTENDED",
"num_params": 6,
"attrs": {
"is_condition": true
},
"input": [
{
"name": "_p1",
"type": "int"
"name": "rpcid",
"type": "SampRpc"
},
{
"name": "_p2",
"type": "int"
"name": "self",
"type": "Bitstream"
},
{
"name": "_p3",
"type": "int"
"name": "priorityid",
"type": "SampPriority"
},
{
"name": "_p4",
"type": "int"
"name": "reliabilityid",
"type": "SampReliability"
},
{
"name": "_p5",
"name": "orderingchannel",
"type": "int"
},
{
"name": "_p6",
"name": "shifttimestamp",
"type": "int"
}
]
},
{
"id": "0B42",
"name": "RAKNET_SEND_BIT_STREAM_EXTENDED",
"num_params": 4,
],
"id": "0B41",
"name": "SAMP_RAKNET_SEND_BITSTREAM_AS_RPC_TO_SERVER",
"num_params": 6,
"attrs": {
"is_condition": true
},
"short_desc": "Sends a BitStream as an RPC with the specified parameters",
"class": "Bitstream",
"member": "SendAsRpc"
},
{
"input": [
{
"name": "_p1",
"type": "int"
"name": "self",
"type": "Bitstream"
},
{
"name": "_p2",
"type": "int"
"name": "priorityid",
"type": "SampPriority"
},
{
"name": "_p3",
"type": "int"
"name": "reliabilityid",
"type": "SampReliability"
},
{
"name": "_p4",
"name": "orderingchannel",
"type": "int"
}
]
],
"id": "0B42",
"name": "SAMP_RAKNET_SEND_RAW_BITSTREAM_TO_SERVER",
"num_params": 4,
"attrs": {
"is_condition": true
},
"class": "Bitstream",
"member": "SendRaw",
"short_desc": "Sends a Raw BitStream with the specified parameters. Commonly used to send dacket data to server"
},
{
"id": "0B43",
Expand Down Expand Up @@ -64506,9 +64512,6 @@
]
},
{
"id": "0C17",
"name": "SAMP_STRLEN",
"num_params": 2,
"input": [
{
"name": "_p1",
Expand All @@ -64518,7 +64521,10 @@
"name": "_p2",
"type": "int"
}
]
],
"id": "0C17",
"name": "SF_STRLEN",
"num_params": 2
},
{
"id": "0C18",
Expand Down
15 changes: 15 additions & 0 deletions sa/snippets/SAMPFUNCS/0B41.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if IS_CHAR_SITTING_IN_ANY_CAR $scplayer
then
int myCar = STORE_CAR_CHAR_IS_IN_NO_SAVE $scplayer
int myCarID = SAMP_GET_CAR_ID myCar
// Construct a Bitstream holding a SampRpc.DamageCar data
int myBitStream = SAMP_RAKNET_CREATE_BITSTREAM // create bitstream object with class Bitstream
SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} myCarID {datatype} SampBitStreamDataType.Short {datasize} DataTypeSize.Short // CarID
SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} 0xFFFFFFFF {datatype} SampBitStreamDataType.Int {datasize} DataTypeSize.Int // bodyflags
SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} 0xFFFFFFFF {datatype} SampBitStreamDataType.Int {datasize} DataTypeSize.Int // doorflags
SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} 0xFF {datatype} SampBitStreamDataType.Byte {datasize} DataTypeSize.Byte // lightflags
SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} 0xFF {datatype} SampBitStreamDataType.Byte {datasize} DataTypeSize.Byte // wheelflags
//
// Bitstream is ready to be transmitted
SAMP_RAKNET_SEND_BITSTREAM_AS_RPC_TO_SERVER {rpcid} SampRpc.DamageCar {bitstream} myBitStream {priorityid} SampPriority.Medium {reliabilityid} SampReliability.ReliableOrdered {orderingchannel} 0 {shifttimestamp} 0
end
12 changes: 12 additions & 0 deletions sa/snippets/SAMPFUNCS/0B42.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
int myRCONCommand = ALLOCATE_MEMORY 58
myRCONCommand = STRING_FORMAT "This_is_a_very_long_String_Example_we_will_send_to_Server"
int textLength = SF_STRLEN myRCONCommand
// Construct a Bitstream holding a SampRpc.RconCommand data
int myBitStream = SAMP_RAKNET_CREATE_BITSTREAM // create bitstream object with class Bitstream
SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} SampRpc.RconCommand {datatype} SampBitStreamDataType.Byte {datasize} DataTypeSize.Byte // PacketID
SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} textLength {datatype} SampBitStreamDataType.Int {datasize} DataTypeSize.Int // TextLength
SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} myRCONCommand {datatype} SampBitStreamDataType.Array {datasize} textLength // CMDText
//
// Bitstream is ready to be transmitted
SAMP_RAKNET_SEND_RAW_BITSTREAM_TO_SERVER {bitstream} myBitStream {priorityid} SampPriority.Medium {reliabilityid} SampReliability.ReliableOrdered {orderingchannel} 0
FREE_MEMORY myRCONCommand
2 changes: 1 addition & 1 deletion sa/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.868
0.869

0 comments on commit 2fcd762

Please sign in to comment.