Raised This Month: $ Target: $400
 0% 

Need help with function - tfc_isgrenade


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Lt Llama
Senior Member
Join Date: Aug 2004
Old 05-05-2005 , 08:53   Need help with function - tfc_isgrenade
Reply With Quote #1

Im trying to learn small by making a very simple plugin for TFC.
I want the plugin to detect
_ if a player has nail grenades
_ send a print message that nail grenades cant be used
_ empty the players ammo bag from nail grenades

I probably do some very stupid things while coding, but im very new to it.

I looked at pizzahuts sniper plugin to see how to detect a weapon.

It works for switchable weapons but not for grenades. I have this now, it compiles but i dont get any message that nail grenades are carried

Code:
/* AMX Mod X *  Anti Nail Grenade Plugin for Team Fortress Classic * *  Created by Lt Llama *  based on pizzahut's Anti-Sniper AMX script. */ #include <amxmodx> #include <engine> #include <tfcx> #include <tfcconst> new announced[33] public plugin_init() {   register_plugin("Anti-Nail", "0.1", "Lt Llama") } public client_authorized(id){    announced[id] = 0 } public client_PreThink(id) {    if (is_user_alive(id)) {       new grenade       if (tfc_isgrenade(grenade) == TFC_WPN_NAILGRENADE ) {           announce(id)       } else {           announced[id] = 0       }     }     return PLUGIN_CONTINUE } public announce(id){   if (announced[id]==0) {      client_print(id, print_chat,"You carry nail grenades")      announced[id] = 1   } }

I tried get_user_weapon and get_user_ammo, but i cant get them to work.
I would be very greatful for any hints in the right direction.

Thx
Lt Llama is offline
 


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 16:48.


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