Raised This Month: $ Target: $400
 0% 

Name Checker


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-05-2006 , 18:49  
Reply With Quote #3

Bad indentation, but whatever.

Did you really write this? It looks like you grabbed some code from one of the scripts I wrote. I'm like the only person that ever uses the variable name "szLinestr".

Anyways, here:

EDIT: Oh, karlos got to it first, oh well.

Code:
//------------------------ //  Amx Mod X Script //------------------------ // //    Name Checker //       -- Checks a clients name if they were added to the file, changes there name to the one in the file. // //------------------------ // //    Names Stored In: //       --/addons/amxmodx/configs/name_checker.ini // //       This file is created automatically when the plugin is run for the first time. //       The names are loaded on map change. // //------------------------ // //    Cvars: // //       nc_enable < 0=off | 1=on > //              --Enables/Disables map objective showing // // //------------------------ // //    Commands: // //       nc_add <steamid> <name> //              --Adds client to the name checker list. // //       nc_del <steamid> //              --Deletes client from the name checker list. // //------------------------ // //    Changelog: // //        v1.0 - Initial Build // //------------------------ #include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Name Checker","v1.0","Fire")     register_cvar("nc_enable","1")     register_concmd("nc_add","nc_add",ADMIN_IMMUNITY,"Adds a Name To Be Checked -- nc_add <steamid> <name>")     register_concmd("nc_del","nc_del",ADMIN_IMMUNITY,"Deletes a Name That Is Being Checked -- nc_del <steamid>") } public nc_add(id, level, cid) {     if(get_cvar_num("nc_enable") == 0)         return PLUGIN_HANDLED             if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED     new Arg1[32]     new Arg2[32]         read_argv(1, Arg1, 31)     read_argv(2, Arg2, 31)             new szConfigsdir[200]     get_configsdir(szConfigsdir, 199)         new szConfigfile[200]     format(szConfigfile, 199, "%s/name_checker.ini", szConfigsdir)         new iLine, szLinestr[256], iLen     while(read_file(szConfigfile, iLine++, szLinestr, 255, iLen)) {         if(szLinestr[0] == ';' || iLen <= 1 || equal(Arg1, szLinestr)) {         console_print(id,"%s's name is all ready being checked!", Arg2)             } else {                     new szWrite[62]         format(szWrite,61,"^"%s^" ^"%s^"",Arg1,Arg2)         write_file(szConfigfile,szWrite, -1)             }         }     return PLUGIN_HANDLED } public nc_del(id, level, cid) {     if(get_cvar_num("nc_enable") == 0)         return PLUGIN_HANDLED             if (!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED     new Arg1[32]     read_argv(1, Arg1, 31)     new szConfigsdir[200]     get_configsdir(szConfigsdir, 199)         new szConfigfile[200]     format(szConfigfile, 199, "%s/name_checker.ini", szConfigsdir)         new iLine, szLinestr[256], iLen     while(read_file(szConfigfile, iLine++, szLinestr, 255, iLen)) {         if(szLinestr[0] == ';' || iLen <= 1 || equal(Arg1, szLinestr)) {         write_file(szConfigfile, "", iLine)         }     }     return PLUGIN_HANDLED } public client_authorized(id) {     if(get_cvar_num("nc_enable") == 0)         return PLUGIN_HANDLED             new szConfigsdir[200]     get_configsdir(szConfigsdir, 199)         new szConfigfile[200]     add(szConfigsdir, 199, "/name_checker.ini")     if(!file_exists(szConfigsdir)) {         write_file(szConfigfile, "; Name Checker -- By: Fire")         write_file(szConfigfile, "; -- Do Not Edit This --")     }         format(szConfigfile, 199, "%s/name_checker.ini", szConfigsdir)         new szSteamid[35]     get_user_authid(id, szSteamid, 34)         new iLine, szLinestr[256], iLen         new szName[35], szStoredSteamid[35]         while(read_file(szConfigfile, iLine++, szLinestr, 255, iLen)) {         if(szLinestr[0] == ';' || !iLen) continue         parse(szLinestr, szStoredSteamid, 34, szName, 34)         if(equal(szSteamid, szStoredSteamid)) {             client_cmd(id,"name %s", szName)         }     }     return PLUGIN_HANDLED }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 20:21.


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