From 7e97156fc4c664fdff9f0de0b95de99d11877cab Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Thu, 16 Mar 2006 00:13:13 +0000 Subject: [PATCH] added arrayset native --- amxmodx/amxmodx.cpp | 8 ++++++++ plugins/include/amxmodx.inc | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 768ac3ce..9d05ef9c 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -4042,9 +4042,17 @@ static cell AMX_NATIVE_CALL ShowSyncHudMsg(AMX *amx, cell *params) return len; } +static cell AMX_NATIVE_CALL arrayset(AMX *amx, cell *params) +{ + memset(get_amxaddr(amx, params[1]), params[2], params[3] * sizeof(cell)); + + return 1; +} + AMX_NATIVE_INFO amxmodx_Natives[] = { {"abort", amx_abort}, + {"arrayset", arrayset}, {"get_addr_val", get_addr_val}, {"get_var_addr", get_var_addr}, {"set_addr_val", set_addr_val}, diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index ee5cee4d..51a42386 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -1036,3 +1036,8 @@ native set_pcvar_num(pcvar, num); native Float:get_pcvar_float(pcvar); native set_pcvar_float(pcvar, Float:num); native get_pcvar_string(pcvar, string[], maxlen); + +/** + * Sets a whole array to a certain value. + */ +native arrayset(array[], value, size);