Raised This Month: $ Target: $400
 0% 

need some help with a line


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
card
Member
Join Date: Jun 2008
Old 12-22-2008 , 10:46   need some help with a line
Reply With Quote #1

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.
card is offline
hzqst
Senior Member
Join Date: Jul 2008
Old 12-22-2008 , 10:52   Re: need some help with a line
Reply With Quote #2

delete "g_iBestClimber != id || g_fStartTime[id]"and test
hzqst is offline
Old 12-22-2008, 10:59
vato loco [GE-S]
This message has been deleted by vato loco [GE-S].
card
Member
Join Date: Jun 2008
Old 12-22-2008 , 11:05   Re: need some help with a line
Reply With Quote #3

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.
card is offline
shine771
Senior Member
Join Date: Jun 2007
Old 12-22-2008 , 11:25   Re: need some help with a line
Reply With Quote #4

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)) 

Last edited by shine771; 12-22-2008 at 11:29.
shine771 is offline
card
Member
Join Date: Jun 2008
Old 12-22-2008 , 12:22   Re: need some help with a line
Reply With Quote #5

Quote:
Originally Posted by shine771 View Post
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.

Last edited by card; 12-22-2008 at 12:33.
card is offline
Old 12-22-2008, 12:27
SnoW
This message has been deleted by SnoW. Reason: lol...
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 09:10.


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