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

if flag b use cvar1 value if flag c use cvar2 value


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
brlight
Senior Member
Join Date: Jun 2011
Old 03-15-2014 , 12:31   if flag b use cvar1 value if flag c use cvar2 value
Reply With Quote #1

Hi, could pls someone post here the code to something like this:

if user has flag B use --->the value specified in cvar1
if user has flag C use --->the value specified in cvar2

thank you.
brlight is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-15-2014 , 12:48   Re: if flag b use cvar1 value if flag c use cvar2 value
Reply With Quote #2

This belongs to Scripting Help, but here you go :

PHP Code:
public CheckCakeAccess(id)
{
    if(
get_user_flagsid ) & ADMIN_KICK )
        
GiveCakeType(idget_pcvar_num(cake_cvar_admin))
    else
        
GiveCakeType(idget_pcvar_num(cvar_cvar_normal))

__________________
Kia is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-15-2014 , 14:58   Re: if flag b use cvar1 value if flag c use cvar2 value
Reply With Quote #3

Quote:
Originally Posted by Kia View Post
This belongs to Scripting Help, but here you go :

PHP Code:
public CheckCakeAccess(id)
{
    if(
get_user_flagsid ) & ADMIN_KICK )
        
GiveCakeType(idget_pcvar_num(cake_cvar_admin))
    else
        
GiveCakeType(idget_pcvar_num(cvar_cvar_normal))

That will not satisfy his request. You have to check both flags.

PHP Code:
new flags get_user_flags(id)
if( 
flags ADMIN_RESERVATION )
{
    
// Use cvar 1
}
else if( 
flags ADMIN_KICK )
{
    
// Use cvar 2
}
else
{
    
// Use defaut value

__________________

Last edited by fysiks; 03-15-2014 at 14:59.
fysiks is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-15-2014 , 15:18   Re: if flag b use cvar1 value if flag c use cvar2 value
Reply With Quote #4

I thought he could do the second check himself..
__________________
Kia is offline
brlight
Senior Member
Join Date: Jun 2011
Old 03-16-2014 , 05:03   Re: if flag b use cvar1 value if flag c use cvar2 value
Reply With Quote #5

Many thanks, IŽll try.
brlight 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 20:22.


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