|
Veteran Member
Join Date: Jul 2011
Location: Magyarország
|
04-02-2013
, 06:57
Re: [Code Help] Nextmap
|
#2
|
Quote:
Originally Posted by smekeru
Hello.
I try wrote a code that allows me to set the next map by console command.
What i did wrong ?
PHP Code:
#include <amxmodx> #include <amxmisc>
new const NAME[] = "Nextmap" new const VERSION[] = "1.0" new const AUTHOR[] = "Bogdan"
public plugin_init() { register_plugin(NAME, VERSION, AUTHOR) register_concmd("amx_nextmap","nextmap_code",ADMIN_BAN,"Set nextmap")
} public nextmap_code(id,level,cid) { if(!cmd_access(id, level, cid, 2)) { return PLUGIN_HANDLED } new insert, name[32] get_user_name(id, name, 31) set_cvar_num("amx_nextmap", insert) client_print(0,print_chat,"[AMXX] Admin %s : Set next map to %s", name, insert) return PLUGIN_HANDLED }
|
Insert variable is empty. Try:
PHP Code:
#include <amxmodx> #include <amxmisc>
new const NAME[] = "Nextmap" new const VERSION[] = "1.0" new const AUTHOR[] = "Bogdan"
public plugin_init() { register_plugin(NAME, VERSION, AUTHOR) register_concmd("amx_nextmap","nextmap_code",ADMIN_BAN,"Set nextmap")
} public nextmap_code(id,level,cid) { if(!cmd_access(id, level, cid, 2)) { return PLUGIN_HANDLED } new insert[120], name[32] get_user_name(id, name, 31) read_argv(1, insert, 119) set_cvar_num("amx_nextmap", insert) client_print(0,print_chat,"[AMXX] Admin %s : Set next map to %s", name, insert) return PLUGIN_HANDLED }
__________________
|
|
|
|