Ok, basically I want to write a plugin that will set a mode where only headshots count that works with CSDM and amx_respawn.
Here's what I have so far
Code:
#pragma tabsize 0
/*
Headshot Mode
AMXX Plugin
By: Dakana
Free for public use
Description: This plugin, when enabled, makes it so damage will only be done when they hit the head hitzone.
Commands: "amx_hsmode 1" turns HS Mode on. "amx_hsmode 0" turns HS Mode off.
Commands can only be used by admins with ADMIN_KICK level.
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init()
{
register_plugin("Headshot Mode", "1.00", "Dakana")
register_concmd("amx_hsmode", "hsmode", ADMIN_KICK, "Sets 0/1")
}
public hsmode(id, level, cid)
{
if(!cmd_access(id, level, cid, 0)) {
console_print(id, "[HS Mode] You do not have access to this command.")
} else {
new i
new players[33]
new players2[33]
for (i=0; i<33; i++)
{
for (new j=0; j<33; j++)
{
set_user_hitzones(players[i], players2[j], 2)
}
}
console_print(id, "[HS Mode] HS Mode ENABLED")
client_print(0, print_chat, "[HS Mode] HS Mode ENABLED")
}
return PLUGIN_HANDLED
}
I'm running TP4, and apparently there is a syntax change in set_user_hitzones. I've tried (players[i], 0, 2) and (0, 0, 2). Neither turned on the headshot-only mode.
By the way, this is my first plugin, so please be patient if I don't understand a reply. I've some programming background, but not much
Thanks in advance!