Raised This Month: $12 Target: $400
 3% 

deathmsg events


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ricky
Senior Member
Join Date: Jul 2005
Old 03-15-2006 , 10:17   deathmsg events
Reply With Quote #1

I have two different cvars that I want to register within deathmsg but can only get one to work. Can anyone help?

example
if(get_cvar_num (amode))
if(get_cvar_num (bmode))
Ricky is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-15-2006 , 10:20  
Reply With Quote #2

In plugin_init:
Code:
register_cvar("cvar_a" , "0"); register_cvar("cvar_b" , "0");
Input your own values, of course.

Then in your DeathMsg function:
Code:
if(get_cvar_num("cvar_a") == 0) {   // do something if it's 0 }
etc..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
pixel3
Senior Member
Join Date: Dec 2005
Old 03-15-2006 , 10:22  
Reply With Quote #3

Well.. I think you could use switch. maybe something like this :

Code:
new mode = get_cvar_num(cvarname)         switch(mode) {         default:         {             // If mode is not 1 or 2 then             // this code will be executed         }         case 1:         {             // Your code here         }         case 2:         {             // Your code here         }     }
__________________
pixel3 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 18:40.


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