Raised This Month: $51 Target: $400
 12% 

amx_uberslap and sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TacoBell
New Member
Join Date: Mar 2006
Old 03-20-2006 , 03:45   amx_uberslap and sound
Reply With Quote #1

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 
}
TacoBell is offline
kinsprite2
Junior Member
Join Date: Mar 2006
Old 03-20-2006 , 08:14  
Reply With Quote #2

try this:
Code:
client_cmd(0,"spk ^"misc/knockedout.wav^"")
kinsprite2 is offline
TacoBell
New Member
Join Date: Mar 2006
Old 03-20-2006 , 12:24  
Reply With Quote #3

Quote:
Originally Posted by kinsprite2
try this:
Code:
client_cmd(0,"spk ^"misc/knockedout.wav^"")
That didn't fix it.
TacoBell is offline
kinsprite2
Junior Member
Join Date: Mar 2006
Old 03-20-2006 , 23:05  
Reply With Quote #4

check
Code:
set_task(11.5, "last_words", 0, ids, 1, "a", 0)
set_task ( Float:time,const function[],id = 0,parameter[]="",len = 0,flags[]="", repeat = 0 )
Flags:
"a" - repeat.
"b" - loop task.
"c" - do task on time after a map timeleft.
"d" - do task on time before a map timelimit

try
Code:
set_task(1.5, "last_words", 0, ids, 1)
kinsprite2 is offline
TacoBell
New Member
Join Date: Mar 2006
Old 03-21-2006 , 13:03  
Reply With Quote #5

Quote:
Originally Posted by kinsprite2
check
Code:
set_task(11.5, "last_words", 0, ids, 1, "a", 0)
set_task ( Float:time,const function[],id = 0,parameter[]="",len = 0,flags[]="", repeat = 0 )
Flags:
"a" - repeat.
"b" - loop task.
"c" - do task on time after a map timeleft.
"d" - do task on time before a map timelimit

try
Code:
set_task(1.5, "last_words", 0, ids, 1)
No luck, that did not fix it.

The sound file is supposed to play after the player is done getting slaped 100 times and then falls out of the sky.
TacoBell is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode