Raised This Month: $ Target: $400
 0% 

changing health plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 12-29-2005 , 00:06  
Reply With Quote #2

You need to give Arg2 a specified length. Some other minor fixes. Also, you should use cmd_access instead of:
Code:
  if (!(get_user_flags(id)&ADMIN_KICK)) {     console_print(id,"No access to amx_health - Sorry.")     return PLUGIN_HANDLED   }   if (read_argc() == 0) {     console_print(id,"No user given.")     return PLUGIN_HANDLED   }

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "AMX Health" #define VERSION "1.0" #define AUTHOR "Sonic" public plugin_init() {          register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("amx_health", "change_health", ADMIN_KICK, "admin changes a users health ")       } public change_health(id){   if (!(get_user_flags(id)&ADMIN_KICK)) {     console_print(id,"No access to amx_health - Sorry.")     return PLUGIN_HANDLED   }   if (read_argc() == 0) {     console_print(id,"No user given.")     return PLUGIN_HANDLED   }   new user[32], uid, Arg2[4];       read_argv(1,user,32)   read_argv(2,Arg2,3)   new hp = str_to_num(Arg2)   uid = find_player("bh",user)   if (uid == 0) {     console_print(id,"Couldn't find user.")     return PLUGIN_HANDLED   }       set_user_health(uid, hp)   console_print(id,"User's health has been set to %i!")   return PLUGIN_HANDLED }
__________________
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
 



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


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