diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index f41b5833..3e7bb866 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -2771,6 +2771,18 @@ static cell AMX_NATIVE_CALL lang_phrase(AMX *amx, cell *params) return 1; } +static cell AMX_NATIVE_CALL amx_mkdir(AMX *amx, cell *params) +{ + int len = 0; + char *path = get_amxstring(amx, params[1], 0, len); + +#ifdef __linux__ + return mkdir(path, 0700); +#else + return mkdir(path); +#endif +} + AMX_NATIVE_INFO amxmod_Natives[] = { { "client_cmd", client_cmd }, { "client_print", client_print }, @@ -2934,5 +2946,6 @@ AMX_NATIVE_INFO amxmod_Natives[] = { { "md5_file", amx_md5_file }, { "plugin_flags", plugin_flags}, { "lang_phrase", lang_phrase}, + { "mkdir", amx_mkdir}, { NULL, NULL } }; diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index 3536df25..eb479c87 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -677,4 +677,7 @@ forward plugin_modules(); native require_module(const module[]); -native is_amd64_server(); \ No newline at end of file +native is_amd64_server(); + +/* Returns 0 on success, like the POSIX specification */ +native mkdir(const dirname[]); \ No newline at end of file