Raised This Month: $ Target: $400
 0% 

Give Health and Armor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MOBOB
Member
Join Date: Dec 2004
Old 12-29-2005 , 23:27   Give Health and Armor
Reply With Quote #1

i am trying to write another plugin that is similar to my freegun plugin (http://forums.alliedmods.net/showthread.php?t=22492) except it works with health and armor. If a player says "give armor" they get 100 armor and if a player says "give health" it gives them 200 health. And this can only be done once per map. I compiled and loaded the plugin and it loads fine but the commands do not work. Can someone take a look at my code and tell me what i am doing wrong?

Code:
#include <amxmodx>   #include <amxmisc>   #include <cstrike>   #include <fun>   #define PLUGIN "Health/Armor"   #define VERSION "1.0"   #define AUTHOR "|sXe| Mr. Foster"   new bool:user_tookhealth[33] public plugin_init() {       register_plugin(PLUGIN, VERSION, AUTHOR)       register_clcmd("give", "cmd_weapon", ADMIN_LEVEL_H, "<weapon(health, armor)>")             set_task(300.0, "sayplugin", _,_,_, "b") }   public client_putinserver(id) {     user_tookhealth[id] = false } public cmd_weapon(id, level, cid) {       if(!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED     if(user_tookhealth[id])         return PLUGIN_HANDLED             new whatwassaid[32]       read_argv(1, whatwassaid, 31)           new name[32]     get_user_name(id, name, 31)         if(equali(whatwassaid,"health", 5))     {       set_user_health(id, 200)         client_print(0,print_chat, "%s used his Health/Armor power to give himself an 200 health", name)     client_print(0,print_chat, "Please visit <a href="http://www.sXeGaming.cjb.net" target="_blank" rel="nofollow noopener">www.sXeGaming.cjb.net</a> to learn about donating to our server and receiving Freegun and Health/Armor access.", name)           user_tookhealth[id] = true     }     else if(equali(whatwassaid,"armor", 5))     {       set_user_armor(id, 100)         client_print(0,print_chat, "%s used his Health/Armor power to give himself an 100 armor.", name)     client_print(0,print_chat, "Please visit <a href="http://www.sXeGaming.cjb.net" target="_blank" rel="nofollow noopener">www.sXeGaming.cjb.net</a> to learn about donating to our server and receiving Freegun and Health/Armor access.", name)           user_tookhealth[id] = true     }     return PLUGIN_HANDLED }   public sayplugin() {     for(new id = 1; id <= get_maxplayers(); id++)     {         client_print(id, print_chat, "<|sXe| Clan Pub Server> If you have Health/Armor access type <give health> or <give armor> in console to receive health or armor.")         set_hudmessage(0, 0, 0, 0.57, 0.93, 0, 6.0, 12.0)           show_hudmessage(id, "If you have Health/Armor access type <give health> or <give armor> in console to receive health or armor.")     } }
__________________
MOBOB is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 12-29-2005 , 23:57  
Reply With Quote #2

Try taking the '5' out.
Code:
if(equali(whatwassaid,"health"))
And the other one as well.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
MOBOB
Member
Join Date: Dec 2004
Old 12-30-2005 , 00:46  
Reply With Quote #3

alright ill try it now... dont ask me why it was there in teh first place i took that section of code from a different plugin.

thanks
__________________
MOBOB 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 16:03.


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