Raised This Month: $ Target: $400
 0% 

Is it possible fail state ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-27-2015 , 06:05   Re: Is it possible fail state ?
Reply With Quote #9

Try this:

Code:
/** AMX Mod X Script  *  *  This program is free software; you can redistribute it and/or modify it  *  under the terms of the GNU General Public License as published by the  *  Free Software Foundation; either version 2 of the License, or ( at  *  your option ) any later version.  *  *  This program is distributed in the hope that it will be useful, but  *  WITHOUT ANY WARRANTY; without even the implied warranty of  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  *  See the GNU General Public License for more details.  *  *  You should have received a copy of the GNU General Public License  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.  *  * ***********************************************************    */ #include <amxmodx> #include <amxmisc> new Trie:g_black_list /*  * Called just after server activation.  */ public plugin_init() {     register_plugin( "Cool Plugin", "1.0", "Addons zz" )         g_black_list = TrieCreate()         TrieSetCell( g_black_list, "STEAM_0:1:xxxxxxxx", 1 )     TrieSetCell( g_black_list, "STEAM_0:1:xxxxxxxx", 1 )     TrieSetCell( g_black_list, "STEAM_0:1:xxxxxxxx", 1 )     TrieSetCell( g_black_list, "STEAM_0:1:xxxxxxxx", 1 )     TrieSetCell( g_black_list, "STEAM_0:1:xxxxxxxx", 1 )     TrieSetCell( g_black_list, "STEAM_0:1:xxxxxxxx", 1 )     TrieSetCell( g_black_list, "STEAM_0:1:xxxxxxxx", 1 ) } /*  * Called when all plugins went through plugin_init()  */ public plugin_cfg() {     new string_steam_ID[ 32 ]         copy( string_steam_ID, charsmax( string_steam_ID ), "STEAM_0:1:xxxxxxxx" )         if( TrieKeyExists( g_black_list, string_steam_ID ) )     {         pause( "d", "my_bad_pluing.amxx" );         pause( "d", "my_more_bad_pluing.amxx" );     } } /*  * Called just before server deactivation and subsequent unloading of the  * plugin.  */ public plugin_end() {     TrieDestroy( g_black_list ) }

Here is a function from the default plugin AMXX "admin.sma" to load admins from "users.ini":
Code:
loadSettings(szFilename[]) {     new File=fopen(szFilename,"r");         if (File)     {         new Text[512];         new Flags[32];         new Access[32]         new AuthData[44];         new Password[32];                 while (!feof(File))         {             fgets(File,Text,sizeof(Text)-1);                         trim(Text);                         // comment             if (Text[0]==';')             {                 continue;             }                         Flags[0]=0;             Access[0]=0;             AuthData[0]=0;             Password[0]=0;                         // not enough parameters             if (parse(Text,AuthData,sizeof(AuthData)-1,Password,sizeof(Password)-1,Access,sizeof(Access)-1,Flags,sizeof(Flags)-1) < 2)             {                 continue;             }                         admins_push(AuthData,Password,read_flags(Access),read_flags(Flags));             AdminCount++;         }                 fclose(File);     }     if (AdminCount == 1)     {         server_print("[AMXX] %L", LANG_SERVER, "LOADED_ADMIN");     }     else     {         server_print("[AMXX] %L", LANG_SERVER, "LOADED_ADMINS", AdminCount);     }         return 1; }
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 12-27-2015 at 07:15. Reason: new better info
addons_zz is offline
 



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 18:13.


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