Raised This Month: $ Target: $400
 0% 

Working on a plugin. Little help please :)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
rompom7
Senior Member
Join Date: May 2004
Old 06-11-2004 , 09:33  
Reply With Quote #4

Ok, it works now, except that when you put in the correct name and password it says you have admin status, but you don't. Secondly if you get the password or username wrong, it crashes the HLDS. Any ideas anyone?

Code:
/* AMX-X Login Script Commands: -     amx_login <user> <password> MUCH Thanks to Johnny got his gun. (c) 2003, James Romeril This file is provided as is (no warranties). */ #include <amxmodx> #include <amxmisc> #define max_admins 64 public login(id) {     new usercfg[64]     new linestring[255]     new linesize = 0     new i = 0     new arguser[32]     new argpass[32]     new username[32]     new password[32]     new flags[32]         read_argv(1,arguser,31)     read_argv(2,argpass,31)         if((arguser[0] > 0)&&(argpass[0] > 0)){         get_customdir(usercfg, 63)         format(usercfg, 63, "%s/amx_login/loginusers.ini", usercfg)         if (file_exists(usercfg)){             while(read_file(usercfg, i,linestring,254,linesize)&& i < max_admins){                 if(linestring[0] == ';'){                     continue                 }                       parse(linestring, username, 31, password, 31, flags, 31)                 if((equal(username, arguser))&&(equal(password, argpass))){                     set_user_flags(0, ADMIN_LEVEL_A, id)                     new text[128]                     format(text, 128, "[AMXX AUTH] You are now logged in, with the flags: %s.", flags)                      client_print(id, print_console, text)                     return PLUGIN_HANDLED                 }             }             client_print(id, print_console, "[AMXX AUTH] Incorrect username and/or password.")         }     }     return PLUGIN_HANDLED } public plugin_init(){     register_plugin("Admin Login","1.0","James Romeril")     register_clcmd("amx_login","login",-1,"amx_login <username> <password>") }
__________________
Forgive your enimies, but never forget their name.
rompom7 is offline
Send a message via MSN to rompom7
 



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:48.


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