Raised This Month: $ Target: $400
 0% 

if, elseif, bool?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 03-19-2014 , 20:43   Re: if, elseif, bool?
Reply With Quote #6

Quote:
Originally Posted by YamiKaitou View Post
Code:
    if (g_mute[i]) { 
        set_user_info(i, "mute", "off") 
    } 
    else { 
        set_user_info(i, "mute", "on") 
    }
See if this makes a difference


Code:
set_user_info(i, "mute", g_mute[i] ? "off" : "on")
PHP Code:
new maxplbool:g_mute[33]; 

public 
plugin_init() {
    
register_clcmd("say /us""cmdToggle")

    
set_task(120.0"ShowMessage")
    
maxpl get_maxplayers()


public 
cmdToggle(id) {
    
g_mute[i] = !g_mute[i]
    
set_user_info(id"mute"g_mute[i] ? "on" "off")
    
ColorChat(id"You have ^3%sable^1 sounds."g_mute[id] ? "en" "dis")
}

public 
ShowMessage() {
    for(new 
1<= maxpli++) {
        (!
is_user_connected(i)) continue

        
ColorChat(i"To turn^3 O%s^1 sounds - say ^4/us"g_mute[i] ? "FF" "N")
    }


Last edited by OnePL; 03-19-2014 at 20:51.
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
 



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 06:00.


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