Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
|
09-24-2007
, 20:54
Player Helper 1.2 (UPDATE!)
|
#1
|
This Plugin Allows Users to use /commands in chat to get info
Credits:
Original Idea: Me( Reaper2331)
Supporters and Helpers:
connorr - finished the Code to fix the /abuse, /website and /serverip
Alka - Tried to fix the /abuse , /website and /serverip
X-Script - Helped fix the rest of the coding
arkshine - Helped fix the Coding As well
M249-M4A1 - helped fix the error in 1.1
OneEyed - Used The Code from his Admin Check for /admin(got his permission)
For The Player Helper MOTD to work You MUST add the PlayerHelper.txt to your mods directory
Example:
1.6 is cstrike
Commands:
/website - Gets Clans or Admins Website(Check Cvar amx_clanwebsite)
/serverip - Gets Server IP(Check Cvar amx_serverip)
/abuse - Gets Admins Email to Report Abuse (Check Cvar amx_adminemail)
/steamid - Gets Users Steam Id for them(Easy to use to add admin)
/myip - Gets the Users IP Adress for them
/playerhelper - Opens up the Player Helper Help MOTD
/admin - Gets Admins Online
Cvars:
amx_serverip "127.0.0.1 :27015"
amx_adminemail " [email protected]"
amx_clanwebsite " http://mywebsite.com"
amx_advertisetime "30.0"
amx_contactinfo "" - Server Owners Contact Information(Email)
To Do: - /record Name of demo to record demos e.g. /record Reaper2331
- /demo Name of demo to record demos eg. /demo Reaper2331
PHP Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Player Helper" #define VERSION "1.2" #define AUTHOR "Reaper2331" #define _charsmax(%1) sizeof( %1 ) - 1 #define ADMIN_CHECK ADMIN_ADMIN static const COLOR[] = "^x04" //green static const CONTACT[] = "" new p_serverip, p_email, p_advertisetime, p_clanwebsite; new maxplayers new gmsgSayText public plugin_init() { register_plugin( PLUGIN, VERSION, AUTHOR ); p_serverip = register_cvar( "amx_serverip" , "127.0.0.1 :27015" ); p_email = register_cvar( "amx_adminemail" , "[email protected]" ); p_clanwebsite = register_cvar( "amx_clanwebsite", "http://mywebsite.com" ); p_advertisetime = register_cvar( "amx_advertisetime", "30.0" ); maxplayers = get_maxplayers() gmsgSayText = get_user_msgid("SayText") register_saycmd( "steamid" ,"PrintText" , ADMIN_ALL, "- gets your steam id for you" ); register_saycmd( "myip" ,"PrintText2", ADMIN_ALL, "- gets your IP Adress for you" ); register_saycmd( "serverip","PrintText3", ADMIN_ALL, "- gets the Servers IP Adress for you" ); register_saycmd( "abuse" ,"PrintText4", ADMIN_ALL, "- Report Abuse" ); register_saycmd( "website" ,"PrintText5", ADMIN_ALL, "- Website" ); register_saycmd( "playerhelper" ,"ShowMotd", ADMIN_ALL, "- Opens The Player Helper MOTD" ); register_clcmd("say", "handle_say") register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER) } public PrintText( id ) { new steamid[32]; get_user_authid( id, steamid, _charsmax( steamid ) ); client_print( id, print_chat, "[AMXX] Your Steam ID is %s" , steamid ); return PLUGIN_HANDLED; } public PrintText2( id ) { new ip[32]; get_user_ip( id, ip, _charsmax( ip ) ); client_print (id, print_chat, "[AMXX] Your IP Adress is %s" , ip ); return PLUGIN_HANDLED; } public PrintText3( id ) { new serverip[128]; get_pcvar_string( p_serverip, serverip, _charsmax( serverip ) ); client_print( id, print_chat, "[AMXX] This Server IP is %s" , serverip ); return PLUGIN_HANDLED; } public PrintText4(id) { new email[128]; get_pcvar_string( p_email, email, _charsmax( email ) ); client_print( id, print_chat, "[AMXX] The Admins Email is %s" , email ); return PLUGIN_HANDLED; } public PrintText5(id) { new website[128]; get_pcvar_string( p_clanwebsite, website, _charsmax( website ) ); client_print( id, print_chat, "[AMXX] The Clans Website is %s" , website ); return PLUGIN_HANDLED; } public client_putinserver(id) { set_task(float(get_pcvar_num(p_advertisetime)),"advertise",id) } public client_disconnect(id) { remove_task(id) } public advertise(id) { if (!is_user_connected(id)) return client_print(id, print_chat, "[AMXX] Say /playerhelper to Open Up The PlayerHelper MOTD") } public ShowMotd(id) { show_motd(id, "PlayerHelper.txt") } public print_adminlist(user) { new adminnames[33][32] new message[256] new contactinfo[256], contact[112] new id, count, x, len for(id = 1 ; id <= maxplayers ; id++) if(is_user_connected(id)) if(get_user_flags(id) & ADMIN_CHECK) get_user_name(id, adminnames[count++], 31) len = format(message, 255, "%s ADMINS ONLINE: ",COLOR) if(count > 0) { for(x = 0 ; x < count ; x++) { len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"") if(len > 96 ) { print_message(user, message) len = format(message, 255, "%s ",COLOR) } } print_message(user, message) } else { len += format(message[len], 255-len, "No admins online.") print_message(user, message) } get_cvar_string("amx_contactinfo", contact, 63) if(contact[0]) { format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact) print_message(user, contactinfo) } } print_message(id, msg[]) { message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id) write_byte(id) write_string(msg) message_end() } public handle_say(id) { new said[192] read_args(said,192) if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 ) set_task(0.1,"print_adminlist",id) return PLUGIN_CONTINUE } stock register_saycmd(saycommand[], function[], flags, info[]) { new temp[64]; format(temp, 63, "say /%s", saycommand); register_clcmd(temp, function, flags, info); format(temp, 63, "say .%s", saycommand); register_clcmd(temp, function, flags, info); format(temp, 63, "say_team /%s", saycommand); register_clcmd(temp, function, flags, info); format(temp, 63, "say_team .%s", saycommand); register_clcmd(temp, function, flags, info); format(temp, 63, ".%s", saycommand); register_clcmd(temp, function, flags, info); format(temp, 63, "/%s", saycommand); register_clcmd(temp, function, flags, info); }
__________________
Last edited by Reaper2331; 09-28-2007 at 23:41.
|
|