Raised This Month: $12 Target: $400
 3% 

Steam id check and grant access


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-11-2019 , 12:23   Steam id check and grant access
Reply With Quote #1

I want plugin to check steam id using steamid.ini file and plugin should check ini for steam id if player steam id mated with listed steam id in fille, then he will be allowed else other traffic will be kicked.

Thanks
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
Old 01-12-2019, 16:53
OciXCrom
This message has been deleted by OciXCrom.
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 01-15-2019 , 09:21   Re: Steam id check and grant access
Reply With Quote #2

Check THis Code I guess it will work fine run on debugging if getting error share error code

PHP Code:
/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
#include <fun>
// #include <xs>
// #include <sqlx>

new const PLUGIN[] = "New Plug-In";
new const 
VERSION[] = "1.0";
new const 
AUTHOR[] = "Author";

new const 
g_steamidfile[] = "steamid.ini";
new Array: 
g_steamid;
new 
g_iSteamIdCount;

//new array_output[MAX_AUTHID_LENGTH];

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
iniGetData();


}

public 
client_putinserver(id)
{
    new 
authid[MAX_AUTHID_LENGTH];

    
get_user_authid(idauthidcharsmax(authid));
    
    
//ArrayFindString(g_steamid, id);

    
if( ArrayFindString(g_steamidauthid) )
    {
        
server_cmd("amx_kick %s"authid);
    }

}


iniGetData()
{
    new 
szConfigsDir[64], szFile[96];

    
get_configsdir(szConfigsDircharsmax(szConfigsDir));
    
formatex(szFilecharsmax(szFile), "%s/%s"szConfigsDirg_steamidfile);

    new 
hFile fopen(szFile"rt");

    if (!
hFile)
        return;

    new 
szLine[35];

    while (!
feof(hFile) && g_iSteamIdCount MAX_PLAYERS)
    {
        
fgets(hFileszLinecharsmax(szLine));
        
trim(szLine);

        if (!
szLine[0] || szLine[0] == ';' || (szLine[0] == '/' && szLine[2] == '/'))
            continue;

        
g_iSteamIdCount++;
        
ArrayPushString(g_steamidszLine);
    }

    
fclose(hFile);

__________________
Let's Help Each Other
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
Reply


Thread Tools
Display Modes

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 02:10.


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