Raised This Month: $ Target: $400
 0% 

Scripting with steam id help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ieGaming
Junior Member
Join Date: Nov 2006
Old 10-08-2009 , 03:51   Scripting with steam id help
Reply With Quote #1

I have tried my best and still haven't got it to work. I'm trying make a script that if your steam id is in the steam.ini then it lets you use a certain command. I just need to find out how I can get it to work this is what I think it my be similar to.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

new bool:g_command true
new filepath[64],filename[101],readdata[64],readsteam[32],steamid[32],len=0,line=0

public plugin_init()
{
    
register_plugin("command","1.0","UND3RDAWG")
    
register_clcmd("+command","client_authorized",ADMIN_KICK,"bind [key] +command")
    if (
g_command==true)
    
set_task(1.0,"check")
}

public 
check(id)
{
    
get_configsdir(filepath,63)
    
format(filename,100,"%s/steam.ini",filepath)
}

public 
client_authorized(id)
{
    
get_user_authid(idsteamid31)
    
    while(
read_file(filenameline++, readdata63len))
    {
        
parse(readdata,readsteam,31)
        if(
equali(steamid,readsteam))
        {    
            if(!
is_user_alive(id))
            
//command
            
return PLUGIN_CONTINUE
        
}
    }
    return 
PLUGIN_CONTINUE


Last edited by ieGaming; 10-19-2009 at 01:25.
ieGaming is offline
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-08-2009 , 07:48   Re: Scripting with steam id help
Reply With Quote #2

The overall code doesn't make much sense.
First, preffer using local variables than global ones.
Second, you can use a Trie (search the forums for implementations on these) to store the Steam IDs and look them up.
There's no need to complicate it like you did. If you want an example on any of these, feel free to ask for it.
vitorrd is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-08-2009 , 08:15   Re: Scripting with steam id help
Reply With Quote #3

Why don't you use the users.ini file ? You can put the steamid you want with a custom level like ADMIN_LEVEL_H ( "t" ). And in your plugin, you use ADMIN_LEVEL_H as level needed.
__________________
Arkshine is offline
ieGaming
Junior Member
Join Date: Nov 2006
Old 10-08-2009 , 10:06   Re: Scripting with steam id help
Reply With Quote #4

Quote:
Originally Posted by vitorrd View Post
The overall code doesn't make much sense.
First, preffer using local variables than global ones.
Second, you can use a Trie (search the forums for implementations on these) to store the Steam IDs and look them up.
There's no need to complicate it like you did. If you want an example on any of these, feel free to ask for it.
May I have an example

Quote:
Originally Posted by Arkshine View Post
Why don't you use the users.ini file ? You can put the steamid you want with a custom level like ADMIN_LEVEL_H ( "t" ). And in your plugin, you use ADMIN_LEVEL_H as level needed.
I know but I'm trying to separate it to make it easier on me later on. Also I want to do this without users.ini because I have /admin on my server and want to add people without them showing up as admin
ieGaming is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-08-2009 , 10:17   Re: Scripting with steam id help
Reply With Quote #5

Quote:
Originally Posted by ieGaming View Post
I know but I'm trying to separate it to make it easier on me later on. Also I want to do this without users.ini because I have /admin on my server and want to add people without them showing up as admin
The admin checker does not show all the admins added through users.ini, it displays online admins with a specific flag(check the source of admin checker to change the flag).
__________________
Achievements API - a simple way for you to create your OWN custom achievements!

Last edited by Xellath; 10-08-2009 at 10:21. Reason: typo
Xellath is offline
ieGaming
Junior Member
Join Date: Nov 2006
Old 10-08-2009 , 11:37   Re: Scripting with steam id help
Reply With Quote #6

Quote:
Originally Posted by Xellath View Post
The admin checker does not show all the admins added through users.ini, it displays online admins with a specific flag(check the source of admin checker to change the flag).
I'm still more interested in using trie and the steam.ini
ieGaming is offline
Reply



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 22:32.


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