Cerere Modificare Plugin
Posted: 29 Oct 2019, 01:29
by Ykaru
Salut, acest plugin nu functioneaza in totalitate. Adica Playerii nu-si pot schimba numele, dar cand vreau sa le schimb eu numele cu amx_nick sau comanda care e in plugin de /nick nu funtioneaza, adica apare mesajul ca numele a fost schimbat, dar nu s-a schimbat.
- | Afiseaza codul
/* by ZeniX aka lucylucy V 0.1 - Simple message V 0.2 - Colorchat message v 0.3 - Added Admin Change namew | amx_nume <vechi> <nou> */ #include < amxmodx > #include < amxmisc > #include < colorchat > #define PLUGIN "No Name Change" #define VERSION "0.3" #define AUTHOR "ZeniX aka lucylucy" new const bars[] = "/"; new command[][] = { "/nick" }; new FZaccess[] = { ADMIN_SLAY }; public plugin_init ( ) { register_plugin( PLUGIN, VERSION, AUTHOR ) register_message(get_user_msgid("SayText"), "MessageZeniX"); register_concmd("amx_nick", "cmdNick", ADMIN_SLAY, "<nume vechi> <nume nou>") register_clcmd ("say", "hook_say"); } public client_infochanged ( id ) { if (is_user_connected(id )) { new newname [ 32 ], oldname [ 32 ] get_user_info( id, "name", newname, 31 ) get_user_name( id, oldname, 31 ) if (!equal(oldname,newname)) { ColorChat ( id, GREEN, "^x04 Nu ai voie ^x01sa iti schimbi numele ^x04pe server ^x01!"); set_user_info(id,"name",oldname) } } return PLUGIN_CONTINUE } public MessageZeniX ( msgid, dest, receiver ) { static info [ 64 ]; get_msg_arg_string(2, info, sizeof(info) - 1); if( !equali(info, "#Cstrike_Name_Change") ) return PLUGIN_CONTINUE; return PLUGIN_HANDLED; } public hook_say(index) { static arg[192], command2[192]; read_args(arg, charsmax (arg)); if (!arg[0]) return PLUGIN_CONTINUE; remove_quotes(arg[0]); for (new x; x < sizeof command; x++) { if(equal(arg, command[x], strlen(command[x]))) { if(get_user_flags(index) & FZaccess[x]) { replace(arg, charsmax(arg), bars, ""); formatex(command2, charsmax(command2), "amx_%s", arg); client_cmd(index, command2); } break; } } return PLUGIN_CONTINUE; } public cmdNick(id, level, cid) { if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED new arg1[32], arg2[32], authid[32], name[32], authid2[32], name2[32] read_argv(1, arg1, 31) read_argv(2, arg2, 31) new player = cmd_target(id, arg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF) if (!player) return PLUGIN_HANDLED get_user_authid(id, authid, 31) get_user_name(id, name, 31) get_user_authid(player, authid2, 31) get_user_name(player, name2, 31) client_cmd(player, "name ^"%s^"", arg2) ColorChat( id, GREEN, "^x04[Admin]^x03 %s^x01 : A schimbat numele ^x03 %s^x01 in^x03 %s", name, name2, arg2); console_print(id, "[FZ] Changed nick of %s to %s", name2, arg2) return PLUGIN_HANDLED }