Raised This Month: $ Target: $400
 0% 

add cvar number in message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Burnzy
Veteran Member
Join Date: Apr 2004
Old 07-17-2004 , 10:56   add cvar number in message
Reply With Quote #1

How would u add a cvar number in a text message

Code:
new WAITTIME[32]

Code:
    if( waiting_time[id]==true )     {         get_cvar_num("sv_tmine_wait",WAITTIME,31)         client_print( id, print_chat, "You have to wait %s seconds before you can plant another mine.",WAITTIME)         return PLUGIN_HANDLED     }

Code:
    register_cvar("sv_tmine_wait","10")

when i compiled it, it would give me arguments
Attached Files
File Type: sma Get Plugin or Get Source (amx_tripmine.sma - 187 views - 9.7 KB)
__________________
Burnzy is offline
Send a message via AIM to Burnzy
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-17-2004 , 10:58  
Reply With Quote #2

Try this to get the cvar:
Code:
num_to_str(get_cvar_num("sv_tmine_wait"), WAITTIME, 31)
__________________
hello, i am pm
PM is offline
Burnzy
Veteran Member
Join Date: Apr 2004
Old 07-17-2004 , 11:40  
Reply With Quote #3

thanx PM, your always there for screw ups
__________________
Burnzy is offline
Send a message via AIM to Burnzy
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 07-18-2004 , 12:09  
Reply With Quote #4

Code:
/* Reads a cvar value. */ native get_cvar_string(const cvarname[],output[],iLen);
Johnny got his gun is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-18-2004 , 12:13  
Reply With Quote #5

Quote:
Originally Posted by Johnny got his gun
Code:
/* Reads a cvar value. */ native get_cvar_string(const cvarname[],output[],iLen);
That one can also return 0.1 or even "blabla".

Using num_to_str on get_cvar_string always ensures the output string will be a plain whole number.
__________________
hello, i am pm
PM is offline
Reply


Thread Tools
Display Modes

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 14:45.


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