Raised This Month: $ Target: $400
 0% 

The Specialists - Brass Knuckles (Melee_Attack Usage)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
stupok
Veteran Member
Join Date: Feb 2006
Old 12-31-2006 , 04:08   Re: The Specialists - Brass Knuckles (Melee_Attack Usage)
Reply With Quote #2

Here's the progress I've made so far. It displays the message (5 times, anyone know why?) when the user presses the attack button and is using Kung Fu.

Code:
#include <amxmodx> #include <fakemeta> #include <tsfun> #define PLUGIN "Brass Knuckles" #define VERSION "1.0" #define AUTHOR "Calimaw/stupok69" new bool:g_brassknuckles[33] new bool:g_is_in_kungfu[33] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_message(get_user_msgid("WeaponInfo"), "WeaponInfo_function")         register_forward(FM_PlayerPreThink, "PlayerPreThink")         register_clcmd("say /brassknuckles", "cmdBrassKnuckles") } public client_connect(id) {     g_brassknuckles[id] = false     g_is_in_kungfu[id] = true } public Event_Death() {     new id = read_data(2)     g_brassknuckles[id] = false     g_is_in_kungfu[id] = true } public WeaponInfo_function(msg_id, msg_dest, msg_entity) {     if(!get_msg_arg_int(1))     {         g_is_in_kungfu[msg_dest] = true     }     else     {         g_is_in_kungfu[msg_dest] = false     } }   public cmdBrassKnuckles(id) {         if(!is_user_alive(id))                 client_print(id, print_chat, "The dead cannot buy items!")         else if(g_brassknuckles[id])                 client_print(id, print_chat, "What good would that do?")         else         {                 g_brassknuckles[id] = true                 client_print(id, print_chat, "You bought a pair of brass knuckles!")         }         return PLUGIN_HANDLED } public PlayerPreThink(id) {     if(!is_user_alive(id))         return FMRES_IGNORED         if(pev(id,pev_button) & IN_ATTACK && g_is_in_kungfu[id])     {         client_print(id, print_chat, "You attack like viper! Rrrrr")     }         return FMRES_HANDLED }

Last edited by stupok; 12-31-2006 at 04:18.
stupok is offline
 



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


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