The Lab
MISC native

COMPARE_STRINGS

returns int4 paramsbuild 1207

Compares str1 and str2 up to maxLength characters, honoring matchCase. Returns 0 if they match, or a negative or positive value otherwise.

Signature

C
int COMPARE_STRINGS(const char* str1, const char* str2, BOOL matchCase, int maxLength); // 0xBFBB74A15EFC149B b1207

Parameters

#NameType
1str1const char*
2str2const char*
3matchCaseBOOL
4maxLengthint

Facts

Facts about COMPARE_STRINGS
Name
COMPARE_STRINGS
Hash
0xBFBB74A15EFC149B
Namespace
Returns
int
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result = Citizen.InvokeNative(0xBFBB74A15EFC149B, -- COMPARE_STRINGS
  "text", -- const char* str1
  "text", -- const char* str2
  false, -- BOOL matchCase
  0, -- int maxLength
  Citizen.ResultAsInteger()
)
print(result)
JavaScript
const result = Citizen.invokeNative("0xBFBB74A15EFC149B", // COMPARE_STRINGS
  "text", // const char* str1
  "text", // const char* str2
  false, // BOOL matchCase
  0, // int maxLength
  Citizen.resultAsInteger()
);
console.log(result)
C#
int result = Function.Call<int>((Hash)0xBFBB74A15EFC149B, // COMPARE_STRINGS
  "text", // const char* str1
  "text", // const char* str2
  false, // BOOL matchCase
  0 // int maxLength
);
All MISC natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.