AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin doen't recognize me as a admin or admin with admin_rcon (https://forums.alliedmods.net/showthread.php?t=154482)

Sp@jk 04-09-2011 07:45

Plugin doen't recognize me as a admin or admin with admin_rcon
 
I have a problem, plugin doesn't recognize me as a admin:
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <amxmisc>

#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

new user_speed
new user_gravity
new user_hp
new admin_speed
new admin_gravity
new admin_hp
new head_speed
new head_gravity
new head_hp

public plugin_init()
{
    
register_plugin("Player values changer","1.0","Sp@k")
    
RegisterHam(Ham_Spawn"player""Spawn"1)
    
RegisterHam(Ham_Player_ResetMaxSpeed,"player","playerResetMaxSpeed",1)

    
user_speed=register_cvar("user_speed","300")
    
admin_speed=register_cvar("admin_speed","350")
    
head_speed=register_cvar("head_speed","400")

    
user_gravity=register_cvar("user_gravity","0.75")
    
admin_gravity=register_cvar("admin_gravity","0.5")
    
head_gravity=register_cvar("head_gracity","0.35")

    
user_hp=register_cvar("user_hp","150")
    
admin_hp=register_cvar("admin_hp","200")
    
head_hp=register_cvar("head_hp","225")
}
public 
plugin_cfg()
{
    
server_cmd("sv_maxspeed 9999")
}
public 
Spawn(id)
{
    if(
get_user_flags(id) & ADMIN_RCON)
    {
        
set_user_maxspeed(id,float(get_pcvar_num(head_speed)))
        
set_user_gravity(id,get_pcvar_float(head_gravity))
        
set_user_health(id,get_pcvar_num(head_hp))
    }
    else
    {
        if(
is_user_admin(id))
        {
            
set_user_maxspeed(id,float(get_pcvar_num(admin_speed)))
            
set_user_gravity(id,get_pcvar_float(admin_gravity))
            
set_user_health(id,get_pcvar_num(admin_hp))
        }
        else
        {
            
set_user_maxspeed(id,float(get_pcvar_num(user_speed)))
            
set_user_gravity(id,get_pcvar_float(user_gravity))
            
set_user_health(id,get_pcvar_num(user_hp))
        }
    }
}
public 
playerResetMaxSpeed(id)
{
    if(
get_user_flags(id) & ADMIN_RCON)
    {
        
set_user_maxspeed(id,float(get_pcvar_num(head_speed)))
    }
    else
    {
        if(
is_user_admin(id))
        {
            
set_user_maxspeed(id,float(get_pcvar_num(admin_speed)))
        }
        else
        {
            
set_user_maxspeed(id,float(get_pcvar_num(user_speed)))
        }
    }


[IMG]http://img638.**************/img638/1139/helpmp.jpg[/IMG]

Nyuszy 04-09-2011 08:51

Re: Plugin doen't recognize me as a admin or admin with admin_rcon
 
are you sure you have admin?
i tried and it works for me :)

Arkshine 04-09-2011 09:17

Re: Plugin doen't recognize me as a admin or admin with admin_rcon
 
Make sure users.ini file is well filled.

Sp@jk 04-09-2011 10:49

Re: Plugin doen't recognize me as a admin or admin with admin_rcon
 
I am sure, I have accses to other commands like amx_mapmenu and other :)

http://slike.milf-cs.info/images/1302360648.jpg

And here is my users.ini:

Code:

; Users configuration file
; File location: $moddir/addons/amxmodx/configs/users.ini

; Line starting with ; is a comment

; Access flags:
; a - immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
; b - reservation (can join on reserved slots)
; c - amx_kick command
; d - amx_ban and amx_unban commands
; e - amx_slay and amx_slap commands
; f - amx_map command
; g - amx_cvar command (not all cvars will be available)
; h - amx_cfg command
; i - amx_chat and other chat commands
; j - amx_vote and other vote commands
; k - access to sv_password cvar (by amx_cvar command)
; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)
; m - custom level A (for additional plugins)
; n - custom level B
; o - custom level C
; p - custom level D
; q - custom level E
; r - custom level F
; s - custom level G
; t - custom level H
; u - menu access
; z - user (no admin)

; Account flags:
; a - disconnect player on invalid password
; b - clan tag
; c - this is steamid/wonid
; d - this is ip
; e - password is not checked (only name/ip/steamid needed)
; k - name or tag is case sensitive.  eg: if you set it so the name "Ham"
;    is protected and case sensitive (flags "k" only), then anybody
;    can use the names "haM", "HAM", "ham", etc, but not "Ham"

; Password:
; Add to your autoexec.cfg: setinfo _pw "<password>"
; Change _pw to the value of amx_password_field

; Format of admin account:
; <name|ip|steamid> <password> <access flags> <account flags>

; Examples of admin accounts:
; "STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"
; "123.45.67.89" "" "abcdefghijklmnopqrstu" "de"
; "My Name" "my_password" "abcdefghijklmnopqrstu" "a"

"STEAM_0:0:1874740808" "" "abcdefghijklmnopqrstu" "ce"


Sp@jk 04-09-2011 13:55

Re: Plugin doen't recognize me as a admin or admin with admin_rcon
 
Sorry for Double post :)
Problem solved, I tested it on the online server and it's working without a problem :)


All times are GMT -4. The time now is 20:09.

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