Raised This Month: $ Target: $400
 0% 

drop weapon damage- crash to desktop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
noob cannon lol
SourceMod Donor
Join Date: Sep 2005
Old 10-26-2005 , 00:34   drop weapon damage- crash to desktop
Reply With Quote #1

Whenever I try to use this plugin I always crash to the desktop with no error log and no indication of what is wrong.

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

#define PLUGIN "ZP Weapon Drop Damage"
#define VERSION "1.0"
#define AUTHOR "noob cannon lol"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("drop","handle_drop"); 
}

public handle_drop(id) {
	new targetid, body
	if (get_user_aiming(id, targetid, body) <= 100.0)
	{
		if(is_valid_ent(targetid) && is_user_connected(targetid))
		{
			if(is_user_alive(targetid))
			{
				emit_sound(targetid, CHAN_WEAPON, "sound/punch.wav", 1.5, ATTN_NORM, 0, PITCH_NORM );
				set_user_health(targetid, get_user_health(targetid) - 20)
			}
		}
	}
	return PLUGIN_CONTINUE
}
Perhaps someone knows the error in this?
noob cannon lol is offline
Send a message via AIM to noob cannon lol Send a message via MSN to noob cannon lol
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-26-2005 , 01:30  
Reply With Quote #2

Volume can't be less than 0.1 (0.0 maybe?) or more than 1.0
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-26-2005 , 07:23  
Reply With Quote #3

He never precached the sound:

Code:
emit_sound(targetid, CHAN_WEAPON, "sound/punch.wav", 1.5, ATTN_NORM, 0, PITCH_NORM );

Add this function:

Code:
public plugin_precache() {     precache_sound("punch.wav") }

Also I think you should remove sound/ from emit_sound, I'm pretty sure it already assumes you're in the sound dir.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-26-2005 , 15:14  
Reply With Quote #4

What he said as well, but I'm pretty darn sure volume can't be over 1.0 and I needed to tell someone.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
noob cannon lol
SourceMod Donor
Join Date: Sep 2005
Old 10-26-2005 , 21:05  
Reply With Quote #5

Tried both and still doesn't work.
noob cannon lol is offline
Send a message via AIM to noob cannon lol Send a message via MSN to noob cannon lol
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 10-26-2005 , 22:46  
Reply With Quote #6

What size is the sound file?
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
noob cannon lol
SourceMod Donor
Join Date: Sep 2005
Old 10-26-2005 , 23:02  
Reply With Quote #7

11.4 kb
noob cannon lol is offline
Send a message via AIM to noob cannon lol Send a message via MSN to noob cannon lol
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 10-26-2005 , 23:04  
Reply With Quote #8

I've had sound problems in the past, and Im pretty sure your file is too big.
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
Reply


Thread Tools
Display Modes

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 23:36.


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