View Single Post
[RED-Designs]
Senior Member
Join Date: Mar 2004
Location: .us
Old 03-21-2004 , 00:47  
Reply With Quote #27

Quote:
Originally Posted by Peli
Can you help me a bit more. I think I know how to do it. Would it be like this ?
Code:
public plugin_init() { register_plugin("sethealth","0.1","Peli") register_concmd("amx_sethealth,ADMIN_LEVEL_A") return PLUGIN_CONTINUE } public reset_hud { set_user_health(500) return PLUGIN_HANDLED }

Okay , things I didn't understand or know :
1. How would I write the "reset_hud" event? I just guessed sorry...
2. Do I just "set_user_health(500)" ? Or do I have to do more?

Okay , if you can please help me...
Here is how it should be, or close to it.

Code:
/*  * Plugin by Peli and [RED-Designs]  */ #include <amxmod> #include <amxmisc> public plugin_init() { register_plugin("sethealth","0.1","Peli") register_concmd("amx_set500hp","admin_setHP",ADMIN_LEVEL_A,"<name>") return PLUGIN_CONTINUE } public admin_setHP(id,level,cid) {     if (!cmd_access(id,level,cid,3))         return PLUGIN_HANDLED     new arg[32], arg2[8], name2[32]     read_argv(1,arg,31)     read_argv(2,arg2,7)     get_user_name(id,name2,31)     if (arg[0]=='@'){         new players[32], inum         get_players(players,inum,"ae",arg[1])         if (inum==0){             console_print(id,"No clients in such team")             return PLUGIN_HANDLED         }         for(new a=0;a<inum;++a) {                         if(str_to_num(arg2)==1){                         set_user_health(players[a],500)                         }         }                switch(get_cvar_num("amx_show_activity"))   {             case 2:   client_print(0,print_chat,"ADMIN %s: set 500 hp on all %s",name2,arg[1])             case 1:   client_print(0,print_chat,"ADMIN: set 500 hp on all %s",arg[1])            }         console_print(id,"All clients have set noclip")     }     else {         new player = cmd_target(id,arg,7)         if (!player) return PLUGIN_HANDLED                 if(str_to_num(arg2)==1){                 set_user_health(player,500)         }         new name[32]         get_user_name(player,name,31)         switch(get_cvar_num("amx_show_activity"))   {             case 2:   client_print(0,print_chat,"ADMIN %s: set 500 hp on %s",name2,name)             case 1:   client_print(0,print_chat,"ADMIN: set 500 hp on %s",name)            }         console_print(id,"Client ^"%s^" has set noclip",name)     }     return PLUGIN_HANDLED  }

I havent tested it but I think it should work
__________________
.My personal Blog
."If the country were open on its borders, new
forms would certainly immigrate, and this also
would seriously disturb the relations of some
of the former inhabitants." - Charles Darwin
[RED-Designs] is offline
Send a message via AIM to [RED-Designs] Send a message via MSN to [RED-Designs] Send a message via Yahoo to [RED-Designs]