Since i am on the roll with making small plugins i am making a new one.
But i got an few warnings again. And i dont know how to fix them. So please help me out a little bit. :D
Code:
/********************************************************************
* AMXMOD X script. *
* *
* Discription: You can set hitpoints on a player. *
* For example the head. Now every player that shoots. *
* The player will only get headshots. *
********************************************************************/
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <amxmisc>
new PLUGIN[]="Pwned"
new AUTHOR[]="B0oGeYm4n"
new VERSION[]="1.00"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_pwn", "cmd_pwn", ADMIN_SLAY, "<Target> <hitzone>")
}
public cmd_pwn(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new Arg1[24]
new Arg2[4]
read_argv(1, Arg1, 23)
read_argv(2, Arg2, 3)
new Float:Hitzones = floatstr(Arg2)
if (Arg1[0] == '@')
{
new Team = 0
if (equali(Arg1[1], "CT"))
{
Team = 2
} else if (equali(Arg1[1], "T")) {
Team = 1
}
new players[32], num
get_players(players, num)
new i
for (i=0; i<num; i++)
{
if (!Team)
{
set_user_hitzones(players[i], Hitzones)
} else {
if (get_user_team(players[i]) == Team)
{
set_user_hitzones(players[i], Hitzones)
}
}
}
} else {
new player = cmd_target(id, Arg1, 1)
if (!player)
{
console_print(id, "[AMXX] The player could not be found", Arg1)
return PLUGIN_HANDLED
} else {
set_user_hitzones(player, Hitzones)
}
}
return PLUGIN_HANDLED
}