1 /**2 * Re-set bot name (resetbotname)3 * There must be at least 32 alternate names in the Botname.lst, or the frying suits4 * Bing Lian Mutual creation | exhibition Hung wrote 2015-1-105 */6 7#include <amxmodx>8 9 ConstMax_name = -;Ten Newg_szbotnames[max_name][ -]; One NewG_icount =1; A - PublicPlugin_precache () - { theRegister_plugin ("Resetbotname","1.0","Suic"); - load_name (); - } - + stock Load_name () - { + Newhfile = fopen ("Addons/amxmodx/configs/botname.lst","RB"); A at if(!hfile) - return; - - Newszdata[ -]; - - while(!feof (hfile)) in { - fgets (hfile, Szdata, Charsmax (szdata)); to trim (szdata); + - if(!szdata[0] || szdata[0] ==';'|| szdata[0] =='/') the Continue; * $Copy (g_szbotnames[g_icount++],sizeofG_szbotnames[]-1, szdata);Panax Notoginseng } - the fclose (hfile); + } A the Publicclient_putinserver (ID) + { - if(!Is_user_bot (ID)) $ return; $ - Newszname[ -]; - the Do{ - getrandomname (SzName, Charsmax (SzName));Wuyi } the while(!CheckName (szName)) - WuSet_user_info (ID,"name", szName); - } About $ stock Getrandomname (szname[], IMax) - { - NewIRandom = Random_num (1, G_icount-1); -Format (SzName, IMax,"%s", G_szbotnames[irandom]); A } + theStock CheckName (Constszname[]) - { $ Newszbuff[ -]; the the for(NewID =1; ID <= +; ++ID) the { the if(!is_user_connected (ID)) - Continue; in the get_user_name (ID, Szbuff, Charsmax (Szbuff)); the if(Equali (SzName, szbuff)) About return false; the } the the return true; +}
Reset bot Name