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 Mar 3, 2025
1 parent dffd55e commit 59b935d
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 68 deletions.
115 changes: 59 additions & 56 deletions sa/sa.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"meta": {
"last_update": 1741008902287,
"version": "0.873",
"last_update": 1741016623724,
"version": "0.874",
"url": "https://library.sannybuilder.com/#/sa"
},
"extensions": [
Expand Down Expand Up @@ -60457,12 +60457,14 @@
"short_desc": "Connects to the specified samp server information"
},
{
"output": [
"input": [
{
"name": "stringbufferserverip",
"type": "int",
"name": "bufferserverip",
"type": "string",
"source": "var_any"
},
}
],
"output": [
{
"name": "port",
"type": "int",
Expand All @@ -60475,9 +60477,9 @@
"short_desc": "Returns the server's IP address and port"
},
{
"output": [
"input": [
{
"name": "stringbufferservername",
"name": "buffer",
"type": "int",
"source": "var_any"
}
Expand Down Expand Up @@ -60534,7 +60536,7 @@
"type": "int"
},
{
"name": "inputtextwritetostringbuffer",
"name": "bufferinputtext",
"type": "int"
}
],
Expand Down Expand Up @@ -60657,14 +60659,14 @@
}
],
"id": "0B41",
"name": "SAMP_RAKNET_SEND_BITSTREAM_AS_RPC_TO_SERVER",
"name": "SAMP_RAKNET_SEND_RPC_WITH_PARAMS_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"
"member": "SendAsRpcWithParams"
},
{
"input": [
Expand All @@ -60686,14 +60688,14 @@
}
],
"id": "0B42",
"name": "SAMP_RAKNET_SEND_RAW_BITSTREAM_TO_SERVER",
"name": "SAMP_RAKNET_SEND_PACKET_WITH_PARAMS_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"
"member": "SendAsPacketWithParams",
"short_desc": "Sends a Packet BitStream with the specified parameters. Commonly used to send dacket data to server"
},
{
"id": "0B43",
Expand Down Expand Up @@ -60832,9 +60834,9 @@
"short_desc": "Selects the id of an element in the dialog list"
},
{
"output": [
"input": [
{
"name": "stringbuffer",
"name": "buffer",
"type": "int",
"source": "var_any"
}
Expand Down Expand Up @@ -61175,11 +61177,9 @@
{
"name": "itemid",
"type": "int"
}
],
"output": [
},
{
"name": "stringbufferitemtext",
"name": "buffer",
"type": "int",
"source": "var_any"
}
Expand All @@ -61190,7 +61190,7 @@
"attrs": {
"is_condition": true
},
"short_desc": "Writes the text of an item from the currently opened dialog's list"
"short_desc": "Writes the text of an item with specific id from the currently opened dialog's list, to buffer"
},
{
"input": [
Expand Down Expand Up @@ -61816,19 +61816,17 @@
{
"name": "chatlineid",
"type": "int"
}
],
"output": [
{
"name": "stringbuffertext",
"type": "int",
"source": "var_any"
},
{
"name": "stringbufferprefix",
"type": "int",
"source": "var_any"
"name": "buffertext",
"type": "int"
},
{
"name": "bufferprefix",
"type": "int"
}
],
"output": [
{
"name": "textcolor",
"type": "int",
Expand Down Expand Up @@ -61861,11 +61859,10 @@
"short_desc": "Overwrites the content written at the chat input box"
},
{
"output": [
"input": [
{
"name": "stringbuffertext",
"type": "int",
"source": "var_any"
"name": "buffer",
"type": "int"
}
],
"id": "0B77",
Expand Down Expand Up @@ -62298,36 +62295,42 @@
"member": "GetControlText"
},
{
"input": [
{
"name": "rpcid",
"type": "SampRpc"
},
{
"name": "self",
"type": "Bitstream"
}
],
"id": "0B8A",
"name": "RAKNET_SEND_RPC",
"name": "SAMP_RAKNET_SEND_RPC_TO_SERVER",
"num_params": 2,
"attrs": {
"is_condition": true
},
"short_desc": "Sends BitStream as RPC to Server",
"class": "Bitstream",
"member": "SendAsRpc"
},
{
"input": [
{
"name": "_p1",
"type": "int"
},
{
"name": "_p2",
"type": "int"
"name": "self",
"type": "Bitstream"
}
]
},
{
],
"id": "0B8B",
"name": "RAKNET_SEND_BIT_STREAM",
"name": "SAMP_RAKNET_SEND_PACKET_TO_SERVER",
"num_params": 1,
"attrs": {
"is_condition": true
},
"input": [
{
"name": "_p1",
"type": "int"
}
]
"class": "Bitstream",
"member": "SendAsPacket",
"short_desc": "Sends Packet BitStream to Server"
},
{
"id": "0B8C",
Expand Down Expand Up @@ -62367,9 +62370,6 @@
"short_desc": "Returns the current mouse cursor mode"
},
{
"id": "0B8F",
"name": "SAMP_CONVERT_SCREEN_COORDS_TO_WORLD_3D",
"num_params": 6,
"input": [
{
"name": "_p1",
Expand All @@ -62395,7 +62395,10 @@
"name": "_p6",
"type": "int"
}
]
],
"id": "0B8F",
"name": "SF_CONVERT_WINDOW_SCREEN_COORDS_TO_WORLD_COORDS",
"num_params": 6
},
{
"id": "0B90",
Expand Down
2 changes: 1 addition & 1 deletion sa/snippets/SAMPFUNCS/0B39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ strBuf, port = SAMP_GET_CURRENT_SERVER_ADDRESS
// Example 2, write server IP to a temporarily allocated memory
int strBuf, port
strBuf = ALLOCATE_MEMORY {size} 16
strBuf, port = SAMP_GET_CURRENT_SERVER_ADDRESS
port = SAMP_GET_CURRENT_SERVER_ADDRESS {bufferserverip} strBuf
// server ip in string format has been written at the allocated memory region strBuf
// do something to strBuf and port
FREE_MEMORY {address} strBuf // free this temporary memory region to avoid memory leak
4 changes: 2 additions & 2 deletions sa/snippets/SAMPFUNCS/0B3A.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
int strBuf = ALLOCATE_MEMORY {size} 256
strBuf = SAMP_GET_CURRENT_SERVER_NAME
// do something to strBuf
SAMP_GET_CURRENT_SERVER_NAME strBuf
// do something to {buffer} strBuf
FREE_MEMORY strBuf
2 changes: 1 addition & 1 deletion sa/snippets/SAMPFUNCS/0B3C.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end
// Example 2: Get Pressed Button ID, Selected Item ID, and the Input Text
int whichButton, whichItem
int inputtedText = ALLOCATE_MEMORY {size} 300
if SAMP_HAS_DIALOG_RESPONDED {dialogid} 117 {buttonidstore} whichButton {buttonidstore} whichItem {inputtextwritetostringbuffer} inputtedText
if SAMP_HAS_DIALOG_RESPONDED {dialogid} 117 {buttonidstore} whichButton {buttonidstore} whichItem {bufferinputtext} inputtedText
then // we have responded to dialog 117
do something to whichButton, whichItem, and inputtedText
else // we are still interacting with dialog 117, or dialog 117 still hasn't shown up.
Expand Down
2 changes: 1 addition & 1 deletion sa/snippets/SAMPFUNCS/0B41.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ then
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
SAMP_RAKNET_SEND_RPC_WITH_PARAMS_TO_SERVER {rpcid} SampRpc.DamageCar {bitstream} myBitStream {priorityid} SampPriority.Medium {reliabilityid} SampReliability.ReliableOrdered {orderingchannel} 0 {shifttimestamp} 0
end
2 changes: 1 addition & 1 deletion sa/snippets/SAMPFUNCS/0B42.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ SAMP_RAKNET_BITSTREAM_WRITE myBitStream {value} textLength {datatype} SampBitStr
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
SAMP_RAKNET_SEND_PACKET_WITH_PARAMS_TO_SERVER {bitstream} myBitStream {priorityid} SampPriority.Medium {reliabilityid} SampReliability.ReliableOrdered {orderingchannel} 0
FREE_MEMORY myRCONCommand
2 changes: 1 addition & 1 deletion sa/snippets/SAMPFUNCS/0B4A.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
int strbuf = ALLOCATE_MEMORY {size} 300
if strbuf = SAMP_GET_CURRENT_DIALOG_EDITBOX_TEXT
if SAMP_GET_CURRENT_DIALOG_EDITBOX_TEXT {buffer} strbuf
then
// do something to strbuf
else
Expand Down
2 changes: 1 addition & 1 deletion sa/snippets/SAMPFUNCS/0B5B.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
int strBufItemText = ALLOCATE_MEMORY {size} 300
if strBufItemText = SAMP_GET_LISTBOX_ITEM_TEXT_OF_DIALOG {itemid} 3
if SAMP_GET_LISTBOX_ITEM_TEXT_OF_DIALOG {itemid} 3 {buffer} strBufItemText
then // opened dialog has itemid 3
// do something to strBufItemText
else // dialog or itemid 3 not found
Expand Down
8 changes: 6 additions & 2 deletions sa/snippets/SAMPFUNCS/0B75.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
int textColor, prefixColor
strBufText = ALLOCATE_MEMORY {size} 256
strBufPrefix = ALLOCATE_MEMORY {size} 256
if int strBufText, strBufPrefix, textColor, prefixColor = SAMP_GET_CHAT_LINE_PARAMS {chatlineid} 0 // test a valid chatlineid

if textColor, prefixColor = SAMP_GET_CHAT_LINE_PARAMS {chatlineid} 0 {buffertext} strBufText {bufferprefix} strBufPrefix // test a valid chatlineid
then
// do something to strBufText, strBufPrefix, textColor, prefixColor
else
// this section will not execute
end
if int strBufText, strBufPrefix, textColor, prefixColor = SAMP_GET_CHAT_LINE_PARAMS {chatlineid} 100 // test an invalid chatlineid

if textColor, prefixColor = SAMP_GET_CHAT_LINE_PARAMS {chatlineid} 100 {buffertext} strBufText {bufferprefix} strBufPrefix // test an invalid chatlineid
then
// this section will not execute
else
// chatlineid is not valid
end

FREE_MEMORY {address} strBufText
FREE_MEMORY {address} strBufPrefix
2 changes: 1 addition & 1 deletion sa/snippets/SAMPFUNCS/0B77.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
int strBufText = ALLOCATE_MEMORY {size} 256
if strBufText = SAMP_GET_CHAT_INPUT_TEXT
if SAMP_GET_CHAT_INPUT_TEXT {buffer} strBufText
then // do something to strBufText
else // strBufText is unwritable
end
Expand Down
15 changes: 15 additions & 0 deletions sa/snippets/SAMPFUNCS/0B8A.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_RPC_TO_SERVER {rpcid} SampRpc.DamageCar {bitstream} myBitStream
end
12 changes: 12 additions & 0 deletions sa/snippets/SAMPFUNCS/0B8B.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
RAKNET_SEND_BIT_STREAM {bitstream} myBitStream {priorityid}
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.873
0.874

0 comments on commit 59b935d

Please sign in to comment.