AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Amount choices within cvars (https://forums.alliedmods.net/showthread.php?t=22948)

Unidentified 01-07-2006 13:00

Amount choices within cvars
 
When you create a cvar, how would you make It so that It gives however many you desire? For example, If I had a cvar for 30 xp per kill. How would I do this?

Brad 01-07-2006 13:07

Change your subject to be more indicative of the purpose of your thread. Subjects should always be descriptive. Failure to do so may result in the thread being trashed.

Hawk552 01-07-2006 13:28

Not sure what you mean, like this?:

Code:
#include <amxmodx> #include <amxmisc> new xp[33]; public plugin_init() {     register_plugin("spam","hat","pants");         register_cvar("amx_xp_per_kill","30");         register_event("DeathMsg","CheckDeath","a"); } public CheckDeath() {     new atk = read_data(1), vic = read_data(2);     if(!atk)     {         return;     }         xp[atk] += get_cvar_num("amx_xp_per_kill");         return; } public client_disconnect(id) {     xp[id] = 0; }


All times are GMT -4. The time now is 15:50.

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