mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-02-15 08:18:51 +03:00
Add native arraycompare
.
This commit is contained in:
parent
6b9d82fa60
commit
a0d6570d31
@ -4453,6 +4453,20 @@ static cell AMX_NATIVE_CALL arrayset(AMX *amx, cell *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// native bool:arraycompare(const any:what[], const any:with[], const size);
|
||||
static cell AMX_NATIVE_CALL arraycompare(AMX *amx, cell *params)
|
||||
{
|
||||
cell *what = get_amxaddr(amx, params[1]);
|
||||
cell *with = get_amxaddr(amx, params[2]);
|
||||
int size = params[3];
|
||||
|
||||
while (size--)
|
||||
if (*with++ != *what++)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL CreateLangKey(AMX *amx, cell *params)
|
||||
{
|
||||
int len;
|
||||
@ -4682,6 +4696,7 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"admins_push", admins_push},
|
||||
{"amxclient_cmd", amxclient_cmd},
|
||||
{"arrayset", arrayset},
|
||||
{"arraycompare", arraycompare},
|
||||
{"get_addr_val", get_addr_val},
|
||||
{"get_var_addr", get_var_addr},
|
||||
{"set_addr_val", set_addr_val},
|
||||
|
@ -3309,6 +3309,17 @@ native DestroyForward(forward_handle);
|
||||
*/
|
||||
native arrayset(any:array[], any:value, size);
|
||||
|
||||
/**
|
||||
* Compares two arrays.
|
||||
*
|
||||
* @param what First array
|
||||
* @param with Second array
|
||||
* @param size Size of array
|
||||
*
|
||||
* @return Returns true if arrays are equaly, false otherwise.
|
||||
*/
|
||||
native bool:arraycompare(const any:what[], const any:with[], const size);
|
||||
|
||||
/**
|
||||
* Returns the weapon id associated with a weapon name.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user