Raised This Month: $ Target: $400
 0% 

creating a cvar


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-16-2009 , 01:10   Re: creating a cvar
Reply With Quote #4

I don't know how much do you know about what that code you wrote does because you didn't say anything else... but I am going to write a complete plugin using cvars just as an example:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
 
new pcvar_enable
new pcvar_saywhat
 
public plugin_init()
{
    
register_plugin("Say something on spawn""sample""-")
 
    
pcvar_enable register_cvar("amx_sayonspawn""1")
    
pcvar_saywhat register_cvar("amx_saywhat""Hello :-h")
 
    
RegisterHam(Ham_Spawn"player""fwHam_playerSpawn"1)
}
 
public 
fwHam_playerSpawn(id)
{
   if(
get_pcvar_num(pcvar_enable))
   {
        new 
szSay[96]
 
        
get_pcvar_string(pcvar_saywhatszSaycharsmax(szSay))
 
        
client_print(idprint_chat"A message on spawn: %s"szSay)
   }

__________________

Last edited by Hunter-Digital; 08-16-2009 at 16:32. Reason: shortened the array
Hunter-Digital is offline
 



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


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