Raised This Month: $ Target: $400
 0% 

NS health and ammo drop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rorthic
Junior Member
Join Date: Apr 2005
Old 04-30-2005 , 23:35   NS health and ammo drop
Reply With Quote #1

im trying to create a plugin that will drop health and ammo and take away the appropriate amount of res from the marine team. Im new at this, first plugin. Heres what i have so far:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> //#include <ns> public plugin_init() {     register_plugin("Ns_medpack Giver","1.0","Rorthic")     register_cvar("ns_medpack_enable","1")     register_clcmd("say_team /medpack", "med")     register_clcmd("say /medpack", "med")     register_clcmd("say_team /health", "med")     register_clcmd("say /health", "med")     register_clcmd("say_team /ammo", "ammo")     register_clcmd("say /ammo", "ammo")     } public plugin_modules() {     require_module("fun") } public ammo(id) //not working for some reason, dosent give the ammo {         if(get_cvar_num("ns_medpack_enable")==1)     {             new item[33]             item = "item_genericammo"   //             give_item(id,item)             return PLUGIN_HANDLED             }     else if(get_cvar_num("ns_medpack_enable")==0)         client_print(id,print_console,"[NS Give medpack]This plugin is disable. Set ns_medpack_enable to 1 to re-enable.")     return PLUGIN_CONTINUE } public med(id) {         if(get_cvar_num("ns_medpack_enable")==1)     {             new item[33]             item = "item_health"                give_item(id,item)             return PLUGIN_HANDLED             }     else if(get_cvar_num("ns_medpack_enable")==0)         client_print(id,print_console,"[NS Give medpack]This plugin is disable. Set ns_medpack_enable to 1 to re-enable.")     return PLUGIN_CONTINUE }

it drops the meds but not the ammo.
questions
1: why dosent the ammo work when its identical to the med?
2: how would i get the current res amount for the marine team, then change it to a new value?

i tried ns_give_item in place of five item and in game nothing happens for either meds or ammo. there is no errors in either case.

also if there is already one that does something like this let me know, may not need to build my own.

Thanks
Rorthic 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 16:50.


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