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

Help testing a hero


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oberon
Junior Member
Join Date: Sep 2004
Location: UK
Old 08-18-2005 , 18:10   Help testing a hero
Reply With Quote #1

I started work on making some changes to our uwc3, extra skills and such.. but i've gone off uwc3, so might as well put some of the stuff to use

I dont know too much about the SH plugin tho, so any help/advice welcome

I can and have tested the auto-reload, and that seems to work fine, but cant get anyone to come and stand and be shot for 1 min while i test the steal ammo section of the skill That code pretty much worked in uwc3, so i'm pretty sure its about right..

The things i'd like to do:

add a cvar for the reloadtimer.. no matter how i tried i couldnt get a float out of the cvar (tried float()) to work in the settask()

Another punisher type hero, but not quite as full on as infinite ammo Needs some testing to get the right levels for stealing and reloading too

Code:
// Tequila (Chow Yun Fat in Hard-boiled ( <a href="http://www.imdb.com/title/tt0104684/" target="_blank" rel="nofollow noopener">http://www.imdb.com/title/tt0104684/</a> )) // The guys never seems to run out of bullets! Reloads 2 bullets every 3s until ur backpack is empty /* CVARS - copy and paste to shconfig.cfg //Tequila teq_level 3 teq_stealpercent 0.06         // Percentage of ammo stolen teq_reloadamount 2      // Number of bullets to add to clip every 3 seconds */ // v1.00 - obe - new hero.. my first bash at one at least. #include <amxmod> #include <superheromod> // GLOBAL VARIABLES new gHeroName[]="Tequila" new bool:ghasTeqPowers[SH_MAXSLOTS+1] new gTeqStealPercent, gTeqReloadAmount //---------------------------------------------------------------------------------------------- public plugin_init() {     // Plugin Info     register_plugin("SUPERHERO Tequila","1.17.5","obe")     // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG     register_cvar("teq_level", "3" )     register_cvar("teq_stealpercent", "0.06" )     register_cvar("teq_reloadamount", "2" )     // FIRE THE EVENT TO CREATE THIS SUPERHERO!     shCreateHero(gHeroName, "Auto-Reload & Ammo Steal", "Steal Ammo and Auto-Reload", false, "teq_level" )     // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)     register_srvcmd("teq_init", "teq_init")     shRegHeroInit(gHeroName, "teq_init")     // SET CVARS TO GLOBAL VARS     gTeqStealPercent = get_cvar_num("teq_stealpercent")     gTeqReloadAmount = get_cvar_num("teq_reloadamount")         // RELOAD LOOP (Every 3 Seconds)     set_task(3.0,"teq_loop",0,"",0,"b" )     // STEAL AMMO ON DAMAGE     register_event("Damage", "teq_damage", "b", "2!0") } //---------------------------------------------------------------------------------------------- public teq_init() {     // First Argument is an id     new temp[6]     read_argv(1,temp,5)     new id=str_to_num(temp)     // 2nd Argument is 0 or 1 depending on whether the id has tequila skills     read_argv(2,temp,5)     new hasPowers = str_to_num(temp)     ghasTeqPowers[id] = (hasPowers!=0) } //---------------------------------------------------------------------------------------------- public teq_loop() {     if (!shModActive()) return     for ( new id = 1; id <= SH_MAXSLOTS; id++ ) {         if ( ghasTeqPowers[id] && is_user_alive(id) )   {             // I'd like to comment this bit better, but i dont really             // understand why this is the only way cs_set_weapon_ammo             // will work :s (Taken from the Punisher I think)             new wpn[32], reloadBPAmmoCount, reloadClipCount             new reloadGunID = get_user_weapon(id, reloadClipCount, reloadBPAmmoCount)             if(reloadBPAmmoCount > 0){                 get_weaponname(reloadGunID,wpn,31)                 new teqWPNidx = -1                 while ((teqWPNidx = find_ent_by_class(teqWPNidx, wpn)) != 0) {                 if (id == entity_get_edict(teqWPNidx, EV_ENT_owner)) {                     cs_set_weapon_ammo(teqWPNidx, reloadClipCount+gTeqReloadAmount)                     break                 }                 }                          cs_set_user_bpammo(id, reloadGunID, reloadBPAmmoCount-gTeqReloadAmount)             }         }     } } //---------------------------------------------------------------------------------------------- public teq_damage(id) {     if (!shModActive() || !is_user_alive(id)) return PLUGIN_CONTINUE     new enemy = read_data(2)         // i_ammo and e_ammo are backpack ammo counts     // i_clip and e_clip is current bullets in clip     // id and enemygun is a weapon id         new i_ammo, e_ammo, i_clip, e_clip     new idgun = get_user_weapon(id, i_clip, i_ammo)     new enemygun = get_user_weapon(enemy, e_clip, e_ammo)     // final amount of ammo to add/remove from players     new x_ammo = floatround(float(gTeqStealPercent) * i_ammo)     if ( x_ammo < 1 )      return PLUGIN_CONTINUE         // set the ammo counts     cs_set_user_bpammo(enemy, enemygun, e_ammo-x_ammo)     cs_set_user_bpammo(id, idgun, i_ammo+x_ammo)         // tell players that the stole/were stolen from     new idname[32], ename[32]     get_user_name(id, idname, 31)     get_user_name(enemy, ename, 31)         client_print(id, print_chat, "You stole %d rounds from %s", x_ammo, ename)     client_print(enemy, print_chat, "%d rounds were stolen by %s", x_ammo, idname)            return PLUGIN_CONTINUE } //----------------------------------------------------------------------------------------------

let me know if it works/things i should do differently/etc..
oberon is offline
Send a message via MSN to oberon
notorious-sk8er
Senior Member
Join Date: Jun 2005
Old 08-27-2005 , 05:11  
Reply With Quote #2

thats a new idea.. stealing rounds from ppl
notorious-sk8er is offline
Reply



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


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