AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need help compiling (https://forums.alliedmods.net/showthread.php?t=26054)

bogus_55412 03-26-2006 09:32

need help compiling
 
I need help compiling this old plugin, because I can't do it myself. :oops:


#include <amxmodx>
#include <amxmisc>
#include <fun>

public plugin_init()
{
register_plugin("EntManager","2.0","DahVid")
register_clcmd("addme","add_ent_admin")
register_clcmd("amx_showenters","show_entmodd ers",ADMIN_BAN)
register_clcmd("amx_blacklist","blacklist",AD MIN_BAN)
register_clcmd("amx_unblacklist","unblacklist ",ADMIN_BAN)
//hooking entmod commands for entprint!/Block cmds for blacklist
register_clcmd("e_add","hook_cmds",0," Say something after it explaining the command")
register_clcmd("e_classname","hook_cmds",0," Say something after it explaining the command")
register_clcmd("e_render","hook_cmds",0," Say something after it explaining the command")
register_clcmd("e_rotate","hook_cmds",0," Say something after it explaining the command")
register_clcmd("e_stack","hook_cmds",0," Say something after it explaining the command")
register_clcmd("weapon_entmover","hook_cmds", 0,"Say something after it explaining the command")
register_clcmd("entmod_quickmake","hook_cmds" ,0," Say something after it explaining the command")
register_clcmd("entmod_keyvalue","hook_cmds", 0," Say something after it explaining the command")
register_clcmd("mm_grab","hook_cmds",0," Say something after it explaining the command")
register_clcmd("mm_start","hook_cmds",0," Say something after it explaining the command")
register_clcmd("mm_end","hook_cmds",0," Say something after it explaining the command")
register_clcmd("es_start","hook_cmds",0," Say something after it explaining the command")
register_clcmd("es_save","hook_cmds",0," Say something after it explaining the command")
register_clcmd("es_load","hook_cmds",0," Say something after it explaining the command")
register_clcmd("grabtype","hook_cmds",0," Say something after it explaining the command")
// /menu commands
register_clcmd("say /menu","entmod_menu")
register_menu("EntMod Menu:",1023,"EntModMenuCommand")
//Entguide and MotD commands.
register_clcmd("say /entguide","entguide")
register_clcmd("say /entguide2","entguide2")
register_clcmd("say /motd","motd")
//Cvars
register_cvar("EM_entprint","1",ADMIN_BAN)
register_cvar("EM_entfree","1",ADMIN_BAN)
}

new g_EntlistLocation[]="addons/EntMod/DF_admins.txt"
new g_ConfigsDir[64]
new g_BlackListLocation[]="addons/amxmodx/configs/EM/BlackList.txt"
new name[33],authid[33]
new line,text[64],txtlen

public hook_cmds(id, cid, level)
{
get_user_authid(id,authid,32)
while((line = read_file(g_BlackListLocation,line,text,63,tx tlen)) != 0) {
if(equali(text,authid)) {
client_print(id,print_chat,"[EntManagement] You are on the EntMod Blacklist!")
client_print(id,print_console,"[EntManagement] You are on the EntMod Blacklist!")
client_cmd(id,"kill")

return PLUGIN_HANDLED
}
}

if(get_cvar_num("EM_entprint"))
{
new args[256]
new cmd[35]
get_user_name(id,name,32)
read_args(args,255)
read_argv(0,cmd,34)
replace_all(args,255,"%","%%")
client_print(0,print_chat,"[EntPrint] %s did cmd: %s %s",name,cmd,args) //print the output publicly.
}
return PLUGIN_CONTINUE
}

stock replace_all(string[],len,what[],with[])
{
new withlen,charnum = 0
withlen = strlen(with)
while ( replace( string[charnum],len,what,with) != 0) {
charnum += contain(string[charnum],with) + withlen
}
}

public blacklist(id)
{
if(is_user_admin(id)) {
new BLTxt[64],player[33]
read_argv(1,player,32)
new target=cmd_target(id,player,9)

get_user_authid(target,authid,32)
client_cmd(target,"kill")

get_user_name(target,name,32)
client_print(0,print_console,"[EntManagement] %s has been EntMod blacklisted!",name)
client_print(0,print_chat,"[EntManagement] %s has been EntMod blacklisted!",name)

format(BLTxt,63,"%s",authid)

while((line = read_file(g_BlackListLocation,line,text,63,tx tlen)) != 0) {
if(equali(text,authid)) {
client_print(id,print_console,"[EntManagement] %s is already blacklisted.",target)
client_print(id,print_chat,"[EntManagement] %s is already blacklisted.",target)

client_cmd(id,"kill")

return PLUGIN_HANDLED
}
}
write_file(g_BlackListLocation,BLTxt,-1)
}
return PLUGIN_CONTINUE
}

public unblacklist(id)
{
if(is_user_admin(id)) {
new player[33]
read_argv(1,player,32)
new target=cmd_target(id,player,9)

get_user_authid(target,authid,32)
get_user_name(target,name,32)

while((line = read_file(g_BlackListLocation,line,text,63,tx tlen)) != 0) {
if(equali(text,authid)) {
write_file(g_BlackListLocation,"",line-1)
client_print(id,print_chat,"%s has been taken off of the blacklist!",name)
client_print(target,print_chat,"You have been taken off of the blacklist!")
client_print(id,print_console,"%s has been taken off of the blacklist!",name)
client_print(target,print_console,"You have been taken off of the blacklist!")
}
}
}
}

public entmod_menu(id)
{
new szMenuBody[256]
new keys
format(szMenuBody,255,"EntMod Menu:^n")
add(szMenuBody,255,"^n 1. Quick InstaSetup")
add(szMenuBody,255,"^n 2. Toggle GodMode")
add(szMenuBody,255,"^n 3. EntGuide")
add(szMenuBody,255,"^n 4. EntGuide 2")
add(szMenuBody,255,"^n 5. MOTD")
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8 |1<<9)
show_menu(id,keys,szMenuBody,-1)
return PLUGIN_CONTINUE
}

public EntModMenuCommand(id,key) {
switch(key)
{
case 0: {
client_cmd(id,"addme instasetup")
client_cmd(id,"setinfo _entpass instasetup")
client_cmd(id,"bind v weapon_entmover")
client_cmd(id,"weapon_entmover")
set_task(2.0,"showsetup",id)
}
case 1: {
new godmode=get_user_godmode(id)
if(godmode == 1) {
set_user_godmode(id,0)
}
if(godmode == 0) {
set_user_godmode(id,1)
}
}
case 2: client_cmd(id,"say /entguide")
case 3: client_cmd(id,"say /entguide2")
case 4: client_cmd(id,"say /motd")
}
}

public showsetup(id)
{
new location[]="addons/amxmodx/configs/EM/instasetup.txt"
show_motd(id,location,"[EntManagement] Warning:")
}

public add_ent_admin(id,level,cid)
{
if(!get_cvar_num("EM_entfree")) {
client_print(id,print_console,"[EntManagement] Sorry, FreeEnt is off right now!")
client_print(id,print_chat,"[EntManagement] Sorry, FreeEnt is off right now!")
return PLUGIN_HANDLED
}

get_configsdir(g_ConfigsDir,63)

if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED

new Pass[24]
read_argv(1,Pass,23)

if(containi(Pass,";") != -1) {
client_print(id,print_console,"[EntManagement] This will result in recrashing of the server, don't use an ;!")
client_print(id,print_chat,"[EntManagement] This will result in recrashing of the server, don't use an ;!")
return PLUGIN_HANDLED
}

if(!strlen(Pass))
{
client_print(id,print_console,"[EntManagement] You must enter a password!")
client_print(id,print_chat,"[EntManagement] You must enter a password!")
return PLUGIN_HANDLED
}


if(strlen(Pass) > 12)
{
client_print(id,print_console,"[EntManagement] Password is too long, must be less than 12 characters!")
client_print(id,print_chat,"[EntManagement] You must enter a password!")
return PLUGIN_HANDLED
}

get_user_authid(id,authid,63)

new fileTxt[64]
get_user_name(id,name,33)
format(fileTxt,63,"%s;%s;1 //%s",authid,Pass,name)

write_file(g_EntlistLocation,fileTxt,-1)

console_print(id,"[EntManagement] EntModder successfully added!")
return PLUGIN_HANDLED
}

public show_entmodders(id)
{
show_motd(id,g_EntlistLocation,"EntModders List:")

return PLUGIN_HANDLED
}

public entguide(id)
{
new location[]="addons/amxmodx/configs/EM/EntGuide.txt"
show_motd(id,location,"[EntManagement] EntGuide:")
return PLUGIN_HANDLED
}

public entguide2(id)
{
new location[]="addons/amxmodx/configs/EM/EntGuide2.txt"
show_motd(id,location,"[EntManagement] EntGuide:")
return PLUGIN_HANDLED
}

public motd(id)
{
new motd[]="motd.txt"
show_motd(id,motd,"[EntManagement] MOTD")
return PLUGIN_HANDLED
}

Hawk552 03-26-2006 09:54

1 Attachment(s)
:arrow:

http://wiki.tcwonline.org/index.php/...28AMX_Mod_X%29
http://www.amxmodx.org/webcompiler.cgi


All times are GMT -4. The time now is 16:48.

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