Raised This Month: $ Target: $400
 0% 

CVAR ERROR


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
totalcsscripting
BANNED
Join Date: Jul 2010
Old 08-17-2010 , 18:56   CVAR ERROR
Reply With Quote #1

Please someone help me with this!

PHP Code:
new test

public plugin_init()
{
test register_cvar("active","1")
register_concmd("mix""function"ADMIN_SLAY"")
}


public function(
id) {
    if(
test==1){
        
client_print(idprint_chat"Is 1"
    }
        if(
test==0){
        
client_print(idprint_chat"Is 0"
    }

totalcsscripting is offline
totalcsscripting
BANNED
Join Date: Jul 2010
Old 08-17-2010 , 18:57   Re: CVAR ERROR
Reply With Quote #2

Obviously my problem is that it doesnĄt work
totalcsscripting is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 08-17-2010 , 19:03   Re: CVAR ERROR
Reply With Quote #3

PHP Code:
if(get_pcvar_num(test))
    
//it doesn't equal 0
if(!get_pcvar_num(test))
    
//it equals 0 
RedRobster is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 08-17-2010 , 19:07   Re: CVAR ERROR
Reply With Quote #4

Its because it doesnt work that way.
PHP Code:
#include<amxmodx> //hope you did this part
new test

public plugin_init()
{
test register_cvar("active","1")
register_concmd("mix""function"ADMIN_SLAY"")
}


public function(
id) {
    if(
get_pcvar_num(test) == 1//get_pcvar_num is the command
    
{
        
client_print(idprint_chat"Its 1"
    }
        else if(
get_pcvar_num(test) == 1)  client_print(idprint_chat"Its 0"
//if you cant modify the cvar to a value 
//greater than 1 then set the this part to :
//else client_print(id, print_chat, "Its 0")

SpeeDeeR is offline
Old 08-18-2010, 10:32
nikhilgupta345
This message has been deleted by nikhilgupta345.
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 21:57.


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