Raised This Month: $ Target: $400
 0% 

get_pcvar_num


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-27-2013 , 14:41   get_pcvar_num
Reply With Quote #1

Hey, when I try compile this, I got this error:
Code:
 admins.sma(31) : error 035: argument type mismatch (argument 1)
So how I should do this?
PHP Code:
if (get_pcvar_num ("amx_adminnotify") == 1
PHP Code:
public client_putinserver(id) {

    new 
g_maxplayers get_maxplayers();

        if (
get_user_flags(id) & ADMIN) {
            
AdminCount++;
        }
    
        if (
get_user_flags(id) & HIDDEN) {
            return 
PLUGIN_HANDLED
        
}

    if (
get_pcvar_num ("amx_adminnotify") == 1) {
        for(
id 1;id <= g_maxplayers;id++){
            
client_print  (idprint_chat"Admin connected to server");

        }
    }
    return 
PLUGIN_HANDLED;

__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-27-2013 , 14:46   Re: get_pcvar_num
Reply With Quote #2

PHP Code:
new p_sth

public plugin_init()
{
     
p_sth register_cvar("cvar""1");
}

public 
func()
{
     if(
get_pcvar_num(p_sth) == 1)
     {
           
// do sth
     
}


Last edited by didoWEE; 04-27-2013 at 14:46.
didoWEE is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-27-2013 , 14:48   Re: get_pcvar_num
Reply With Quote #3

You are using pcvars incorrectly.

Code:
new cvar;

public plugin_init()
    cvar = register_cvar("amx_adminnotify", "1");

public client_putinserver(id)
    if (get_pcvar_num(cvar))
        console_print("amx_adminnotify is 1");
    else
        console_print("amx_adminnotify is 0");
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-27-2013 , 14:50   Re: get_pcvar_num
Reply With Quote #4

Thanks ;D
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus 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:45.


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