Raised This Month: $ Target: $400
 0% 

I'm clueless...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-10-2007 , 11:48   Re: I'm clueless...
Reply With Quote #1

Look, like this should look you'r code .

Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
 
new const PLUGIN[] = "Change HP";
new const VERSION[] = "1.0";
new const AUTHOR[] = "Marlon";
 
public plugin_init()
{
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 register_concmd("amx_hp", "CmdHp", ADMIN_SLAY, "<Target/@CT/@T> <hp>");
 
}
 
public CmdHp(id, level, cid)
{
 if (!cmd_access(id, level, cid, 2))
  return PLUGIN_HANDLED;
 
 new Arg1[10], Arg2[3];
 new Team;
 
 read_argv(1, Arg1, sizeof Arg1 - 1);
 read_argv(2, Arg2, sizeof Arg2 - 1);
 
 new Health = str_to_num(Arg2);
 
 if(Arg1[0] == '@')
 {
  if(equali(Arg1[1], "CT"))
   Team = 2;
  else if(equali(Arg1[1], "T"))
   Team = 1;
  else 
   Team = 0;
  
  new Players[32], Num, Player;
  get_players(Players, Num);
  
  for(new i = 0 ; i < Num ; i++)
  {
   Player = Players[i];
   
   if(!Team)
    set_user_health(Player, Health);
   
   else
   {
    if(get_user_team(Player) == Team)
     set_user_health(Player, Health);
   }
  }
 } 
 else
 {
  new Target = cmd_target(id, Arg1, 1);
  
  if(!Target)
   return PLUGIN_HANDLED;
  
  set_user_health(Target, Health);
 }
 return PLUGIN_HANDLED;
}
__________________
Still...lovin' . Connor noob! Hello
Alka 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 01:21.


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