Hi all, I am trying to get this plugin to work but I can not get the sound file to play. It used to work with AMXX 1.0 but I recently upgraded to 1.70 and the sound file no longer plays. I have the sound file in the right directory, sound/misc/knockedout.wav but for some reason with this newer version of AMXX the sound file does not play.
I suspect it has something to do with this part of the code:
Code:
set_task(11.5, "last_words", 0, ids, 1, "a", 0)
Code:
public last_words(ids[]) {
client_cmd(0,"spk misc/knockedout")
return PLUGIN_HANDLED
Can someone please try and help with this, it would be greatly appreciated.
Thank you.
Code:
/* AMXMOD X script.
* (c) Copyright 2003, BarMan
* This file is provided as is (no warranties).
*
* Inspired by the Holy Slap plugin on
* http://www.warcrygamers.com CS Server
*
* 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 all that helped!!!
*
*/
#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], name2[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)
udisarm_player(id,player)
set_task(0.1, "slap_player", 0, ids, 1, "a", 100)
set_task(11.5, "last_words", 0, ids, 1, "a", 0)
get_user_name(id,name2,31)
log_amx("ADMIN UBERSLAP - this command was issued by %s. Admin has uberslapped %s",name2,name)
return PLUGIN_HANDLED
}
public udisarm_player(id,victim){
new name[32], origin[3]
get_user_origin(victim,origin)
origin[2] -= 2000
set_user_origin(victim,origin)
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")
origin[2] += 2005
set_user_origin(victim,origin)
get_user_name(victim,name,31)
return PLUGIN_CONTINUE
}
public last_words(ids[]) {
client_cmd(0,"spk misc/knockedout")
return PLUGIN_HANDLED
}
public slap_player(ids[]) {
new id = ids[0]
new upower = 1,nopower= 0
if (get_user_health(id) > 1){
user_slap(id,upower)
} else {
user_slap(id,nopower)
}
return PLUGIN_CONTINUE
}
public plugin_precache() {
precache_sound("misc/knockedout.wav") // Forces client to download wav if not already present
return PLUGIN_CONTINUE
}
public plugin_init(){
register_plugin("Admin Uberslap","0.9.3","Skullz.NET")
register_concmd("amx_uberslap","admin_slap",ADMIN_LEVEL_A,"<authid, nick or #userid>")
return PLUGIN_CONTINUE
}