AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need some help with a line (https://forums.alliedmods.net/showthread.php?t=82387)

card 12-22-2008 10:46

need some help with a line
 
PHP Code:

public clcmd_noclip(id)
{
    if(!
is_user_alive(id) || g_iBestClimber != id || g_fStartTime[id])
    {
        return 
1;
    }
    if(!
get_user_noclip(id))
    {
        
set_user_noclip(id,1)
        
set_hudmessage(025500.60.0127.08.00.11.0, -1);
        
show_hudmessage(id"Noclip Activated.");
    }
    else
    {
        
set_user_noclip(id,0)
        
set_hudmessage(025500.60.0127.08.00.11.0, -1);
        
show_hudmessage(id"Noclip Disabled.");
    }
    return 
PLUGIN_HANDLED


i need a little help with this line
if(!is_user_alive(id) || g_iBestClimber != id || g_fStartTime[id])

first, it`s verified if the user is alive, than if he is the 1337 climber (bestclimber) than if that player have the timer running. if he pass all conditions, he will recieve noclip reward. i want to use noclip if i am only admin, not necessarly bestclimber. i know that something should be added to that line, something like "&& is_user_admin(id)", i`ve tried, but nothing happened, except all players were allowed to use that reward.

hzqst 12-22-2008 10:52

Re: need some help with a line
 
delete "g_iBestClimber != id || g_fStartTime[id]"and test

card 12-22-2008 11:05

Re: need some help with a line
 
i need that conditions too, why should i delete it ? i want to use noclip if i am bestclimber(1337)/admin(or both) and when i have my timer stopped, and if i am alive.

shine771 12-22-2008 11:25

Re: need some help with a line
 
PHP Code:

if(!is_user_alive(id) || g_iBestClimber != id || g_fStartTime[id] || !(get_user_flags(id) & ADMIN_BAN)) 

Quote:

#define ADMIN_ALL 0 //Everyone
#define ADMIN_IMMUNITY 1 //Flag "a", immunity
#define ADMIN_RESERVATION 2 //Flag "b", reservation
#define ADMIN_KICK 4 //Flag "c", kick
#define ADMIN_BAN 8 //Flag "d", ban
#define ADMIN_SLAY 16 //Flag "e", slay
#define ADMIN_MAP 32 //Flag "f", map change
#define ADMIN_CVAR 64 //Flag "g", cvar change
#define ADMIN_CFG 128 //Flag "h", config execution
#define ADMIN_CHAT 256 //Flag "i", chat
#define ADMIN_VOTE 512 //Flag "j", vote
#define ADMIN_PASSWORD 1024 //Flag "k", sv_password
#define ADMIN_RCON 2048 //Flag "l", rcon access
#define ADMIN_LEVEL_A 4096 //Flag "m", custom
#define ADMIN_LEVEL_B 8192 //Flag "n", custom
#define ADMIN_LEVEL_C 16384 //Flag "o", custom
#define ADMIN_LEVEL_D 32768 //Flag "p", custom
#define ADMIN_LEVEL_E 65536 //Flag "q", custom
#define ADMIN_LEVEL_F 131072 //Flag "r", custom
#define ADMIN_LEVEL_G 262144 //Flag "s", custom
#define ADMIN_LEVEL_H 524288 //Flag "t", custom
#define ADMIN_MENU 1048576 //Flag "u", menus
#define ADMIN_ADMIN 16777216 //Flag "y", default admin
#define ADMIN_USER 33554432 //Flag "z", default user
Or just check if user is an admin(amxmisc must be included):
PHP Code:

if(!is_user_alive(id) || g_iBestClimber != id || g_fStartTime[id] || !is_user_admin(id)) 


card 12-22-2008 12:22

Re: need some help with a line
 
Quote:

Originally Posted by shine771 (Post 731458)
PHP Code:

if(!is_user_alive(id) || g_iBestClimber != id || g_fStartTime[id] || !(get_user_flags(id) & ADMIN_BAN)) 

Or just check if user is an admin(amxmisc must be included):
PHP Code:

if(!is_user_alive(id) || g_iBestClimber != id || g_fStartTime[id] || !is_user_admin(id)) 


i`ve tried both, at first it gives me an warning:
warning 201: redefinition of constant/macro <symbol "ADMIN_BAN">
when i defined level (ADMIN_BAN), and second didn`t worked at all. :|


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

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