AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   deathmsg events (https://forums.alliedmods.net/showthread.php?t=25509)

Ricky 03-15-2006 10:17

deathmsg events
 
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))

v3x 03-15-2006 10:20

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..

pixel3 03-15-2006 10:22

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         }     }


All times are GMT -4. The time now is 00:21.

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