Hello,
Nice work.
I've done little upgrade for my own needs. No wave file download required, this version uses gordon sounds included in hl1 package. The sounds are played before slapping and right after it. I've also changed the interval of slapping and added new name of cvar called by admin (amx_holyslap and amx_uberslap).
Oh, I almost forgot about i've changed the style of disarming the player because of the weapons (and c4package too) disappearing - now player is simply dropping down all weapons (excluding the grenades).
Maybe someone will need it as well. Any bug-finders reports required
Regards,
dhair
Code:
/* AMXMODX script.
* (c) Copyright 2004, TaL
* This file is provided as is (no warranties).
*
* AMX Holy Slap Plugin
*
* Slaps user 100 times 1HP at a time, then plays
* the attached sound as they fall out of the air
*
*
* usage: amx_holyslap authid, nick, or #userid
*
* Thanks to BarMan origonal Code
* Little upgrades made by dhair [PL]
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
public admin_slap(id,level,cid)
{
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new name[32]
new arg[32]
read_argv(1,arg,31)
new player = cmd_target(id,arg,5)
if (!player)
return PLUGIN_HANDLED
new ids[2]
ids[0] = player
get_user_name(player,name,32)
disarm_player(id,player)
set_task(0.1, "first_words", 0, ids, 1, "a", 1)
set_task(23.0, "last_words")
return PLUGIN_HANDLED
}
public disarm_player(id,victim){
new name[32]
new iweapons[32], wpname[32], inum
get_user_weapons(victim,iweapons,inum)
for(new a=0;a<inum;++a){
get_weaponname(iweapons[a],wpname,31)
engclient_cmd(victim,"drop",wpname)
}
engclient_cmd(victim,"weapon_knife")
get_user_name(victim,name,31)
return PLUGIN_CONTINUE
}
public first_words(ids[]) {
client_cmd(0,"spk barney/badfeeling")
set_task(3.0, "slapper", 0, ids, 1, "a", 1)
return PLUGIN_HANDLED
}
public slapper(ids[]) {
set_task(0.2, "slap_player", 0, ids, 1, "a", 100)
return PLUGIN_HANDLED
}
public last_words() {
client_cmd(0,"spk hgrunt/c2a3_hg_laugh")
return PLUGIN_HANDLED
}
public slap_player(ids[]) {
new id = ids[0]
new power1 = 1,nopower= 0
if (get_user_health(id) > 1){
user_slap(id,power1)
} else {
user_slap(id,nopower)
}
return PLUGIN_CONTINUE
}
public plugin_init(){
register_plugin("AMXMODX Holy/Uber Slap","0.1.5","Ms-Proxy, upgrade by dhair [PL]")
register_concmd("amx_holyslap","admin_slap",ADMIN_SLAY,"<authid, nick or #userid>")
register_concmd("amx_uberslap","admin_slap",ADMIN_SLAY,"<authid, nick or #userid>")
return PLUGIN_CONTINUE
}