Hum, iam getting a warning of tag mismatch in the client print:
PHP Code:
#include <amxmodx>
#include <amxmisc>
static const Fdc_Names[][] = {
"Kills",
"Deaths",
"HeadShot Kills",
"HeadShot Deaths"
}
enum WeaponData
{
Data_Kills,
Data_Deaths,
Data_Kills_Hs,
Data_Deaths_Hs
}
new g_WeaponData[CSW_P90 + 1][WeaponData]
public plugin_init()
{
register_concmd("fdc_kills", "AdminCommand_FDC", ADMIN_CVAR, "<weaponname> <0/1>")
register_concmd("fdc_deaths", "AdminCommand_FDC", ADMIN_CVAR, "<weaponname> <0/1>")
register_concmd("fdc_hs_kills", "AdminCommand_FDC", ADMIN_CVAR, "<weaponname> <0/1>")
register_concmd("fdc_hs_deaths", "AdminCommand_FDC", ADMIN_CVAR, "<weaponname> <0/1>")
}
public AdminCommand_FDC(id, lvl, cid)
{
if(cmd_access(id, lvl, cid, 3))
{
new Command[14]
read_argv(0, Command, charsmax(Command))
new WeaponData: DataType
switch(Command[7])
{
case 'l': DataType = Data_Kills
case 't': DataType = Data_Deaths
case 'k': DataType = Data_Kills_Hs
case 'd': DataType = Data_Deaths_Hs
default :
{
client_print(id, print_console, "Usage: fdc_kills/fdc_deaths/fdc_hs_kills/fdc_hs_deaths <weaponname> <amount>")
return PLUGIN_HANDLED
}
}
new Amount[10], szWeapon[20] = "weapon_"
read_argv(1, szWeapon[7], charsmax(szWeapon)-7)
read_argv(2, Amount, charsmax(Amount))
new iId = get_weaponid(szWeapon)
if(iId)
{
g_WeaponData[iId][DataType] = str_to_num(Amount)
// Tag mismatch
client_print(id, print_console, "You have changed %s's %s to %d!", szWeapon[7], Fdc_Names[DataType], Amount)
}
else
client_print(id, print_console, "Sorry, %s is not a valid weapon!", szWeapon[7])
}
return PLUGIN_HANDLED
}
__________________