Raised This Month: $ Target: $400
 0% 

Stimpack


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DarlD
Senior Member
Join Date: Aug 2004
Old 04-24-2007 , 14:37   Stimpack
Reply With Quote #1

/home/groups/amxmodx/tmp3/phpwENvvC.sma(45) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp3/phpwENvvC.sma(73) : warning 209: function "stimpack_action" should return a value
/home/groups/amxmodx/tmp3/phpwENvvC.sma(78 ) : warning 203: symbol is never used: "Player"

This plugin is a replica of the stimpack in starcraft. When you use a stimpack theres a cool starcraft marine sound and it takes 10hp from ya. what it is supposed to do as well is make you go faster and do double the damage. I'm having a little bit of trouble with that.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> new Player[32] new bool:UsedStimpack[32] public plugin_precache() {     precache_sound("StimPack/tmaSti01.wav")     return PLUGIN_CONTINUE } public plugin_init() {         register_plugin("Stim Pack", "01", "DarlD")     register_clcmd("stimpack","stimpack_action",ADMIN_ALL,"Bind to use the Stim Pack")     register_cvar("stim_speed","200")// this is the default speed to be added each dose     register_cvar("stim_pack","1")// this is the on off cmd     register_cvar("stim_DD","1")// enable or disable the double damage that comes with the stim pack (default on)     register_cvar("stim_DD_time","10")// time for the Double Damage to last (default 10 seconds)         if ( get_cvar_num("stim_pack") == 1 && get_cvar_num("stim_DD") == 1 ) {                 register_event("Damage","DD","b")     } }       public DD(id) {         new Dmg = read_data(2)     new Weap, NewDmg, PartHit     new Attacker = get_user_attacker(id, Weap, PartHit)     new Health = get_user_health(id)     new alive = is_user_alive(id)     if (alive) {                 NewDmg = (Health - Dmg)         if(NewDmg < 1) {                         set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE);             message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0)                 write_byte(Attacker)             write_byte(id)             write_byte(random_num(0,1))             write_string(Weap)             message_end()         }         set_user_health(id, NewDmg)     }     return PLUGIN_CONTINUE } public stimpack_action(id) {         new onoff = get_cvar_num("stim_pack")     if (onoff==0)         return PLUGIN_HANDLED         new health = get_user_health(id)     if ( health <= 10) {                 client_print(id,print_chat,"[Stim Pack] You don't have enough health left!")         return PLUGIN_HANDLED         }else if ( health >= 11 && !UsedStimpack[id]) {                 client_cmd(id,"spk StimPack/tmaSti01.wav", "c")         set_task(1.5,"stopsound")         client_print(id,print_chat,"[Stim Pack] Awwww yeah... You have used a Stim Pack")         set_user_health(id, health - 10)                 }else{         return PLUGIN_HANDLED     } } public stopsound(id) {     client_cmd(id,"stopsound")     return PLUGIN_HANDLED }
__________________

Last edited by DarlD; 04-24-2007 at 14:43.
DarlD is offline
Send a message via MSN to DarlD
 


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


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