AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amx_kick reason from a txt file (https://forums.alliedmods.net/showthread.php?t=11802)

nightscreem 03-28-2005 19:19

amx_kick reason from a txt file
 
how can i let a plugin take reasons from reason.txt file it should be in configs didn't try because i didn't had a clue
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("kick","1.0","Nightscream")     register_concmd("amx_kick","cmdKick",ADMIN_KICK,"<name or #userid> [reason]")     return PLUGIN_CONTINUE }     public cmdKick(id,level,cid) {   if (!cmd_access(id,level,cid,2))     return PLUGIN_HANDLED   new arg[32]   read_argv(1,arg,31)   new player = cmd_target(id,arg,1)   if (!player) return PLUGIN_HANDLED   new authid[32],authid2[32],name2[32],name[32],userid2,reason[32]   get_user_authid(id,authid,31)   get_user_authid(player,authid2,31)   get_user_name(player,name2,31)   get_user_name(id,name,31)   userid2 = get_user_userid(player)   read_argv(2,reason,31)   remove_quotes(reason)   log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^" (reason ^"%s/configs/^")",     name,get_user_userid(id),authid,name2,userid2,authid2,reason)   switch (get_cvar_num("amx_show_activity")) {     case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_KICK_2",name,name2)     case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_KICK_1",name2)   }   if ( is_user_bot(player) )     server_cmd("kick #%d",userid2)   else   {     if (reason[0])       server_cmd("kick #%d ^"%s^"",userid2,reason)     else       server_cmd("kick #%d",userid2)   }   console_print(id,"[AMXX] Client ^"%s^" kicked",name2)   return PLUGIN_HANDLED }

XxAvalanchexX 03-28-2005 22:11

You want it to randomly select a reason from a list of them in a file?

nightscreem 03-29-2005 06:19

yes i want to let it pick a reason from a file

nightscreem 03-31-2005 07:14

Need help fast plz :up:


All times are GMT -4. The time now is 09:56.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.