Raised This Month: $ Target: $400
 0% 

Help with in-game admin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
joecaprini
Junior Member
Join Date: Jul 2004
Location: In a blackhole
Old 03-07-2005 , 21:28   Help with in-game admin
Reply With Quote #1

Does anyone know what is wrong with this code?

Code:
/* Admin Access by JoeCaprini Add access by amx_addadmin <steamid> <levels> To do: + Add remove function */ #include <amxmodx> new gFileLocation = "addons/amxmodx/configs/users.ini" new gTextName public plugin_init() {     register_plugin("Admin Access","1.1","JoeCaprini")     register_clcmd("amx_addadmin","addadmin",ADMIN_BAN,"- Adds an admin") } public addadmin(id) {     new adminid[32]     new accesslvls[32]     if(read_argc() == 0)     {         client_print(id,print_console,"Usage: amx_addadmin <steamid> <access levels>")         return PLUGIN_HANDLED     }     if(read_argc() < 2)     {         client_print(id,print_console,"[AMX] Must have an ID and the ACCESS LEVELS!")         return PLUGIN_HANDLED     }     read_argv(1,adminid,31)     read_argv(2,accesslvls,31)     if(containi(gFileLocation,adminid)     {         client_print(id,print_console,"[AMX] User is already an admin")         return PLUGIN_HANDLED     }     format(gTextName,"^"%s^" ^"^" ^"%s^"",adminid,accesslvls)     write_file(gFileLocation,gTextName,-1)     return PLUGIN_CONTINUE } public removeadmin(id) {     new adminremove[32]     new getline     new adminlook[32]     read_argv(1,adminremove,31)     if(read_argc() == 0)     {         client_print(id,print_console,"[AMX] Must specify a user")         return PLUGIN_HANDLED     }     format(gTextName,";")     read_file(gFileLocation,getline,adminlook,31)     if(adminlook == adminremove)     {         write_file(gFileLocation,gTextName,getline)         return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE }

I know there is already a plugin like this but I'm trying to learn how to do it.
__________________
-JOECAPRINI-
joecaprini is offline
Send a message via AIM to joecaprini
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:13.


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