Raised This Month: $ Target: $400
 0% 

Need Help Modifying a code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bcmorgue
Junior Member
Join Date: Apr 2004
Old 04-22-2004 , 14:24   Need Help Modifying a code
Reply With Quote #1

I just upgraded to AMX Mod X on my CS Server about 4 days ago, and I must say it runs way better than AMX MOD!

Thank's so much!!

Ok, here's my problem. I am trying to modify an AMXMod Plugin, that will automatically take a screen shot of your kills. I compiled it with AMX Mod X, and it works just fine, but I wanted to tweak it a bit.

The plugin takes a screen shot right when the player dies, but I wanted to change it to wait about 1/2 second after the player dies, to get a better screen shot (I run amx_gore enhancements, so the screen shots look better)

Here is the code:

Code:
/*
* Kill Cam
*  v 0.1
*
*  by ImJust2Nasty
*   [email protected]
*
* Cvars: say /killcamon - enable killcam
*	 say /killcamoff - disable killcam
* 
*/

#include <amxmod>

new kc_on[33]

public kill_event() {
	new kname[32]
	new killer_id = read_data(1)
	new victim_id = read_data(2)
	if (kc_on[killer_id] == 1)
		if (killer_id != victim_id && killer_id)
			{
			get_user_name(killer_id,kname,31)
			new kcmsg[128], kclol[128]
			format(kcmsg,127,"Killcam took snapshot")
			format(kclol,127,"%s took a pic of your death",kname)
			set_hudmessage(255, 255, 0, 0.02, 0.9, 2, 0.02, 10.0, 0.01, 0.1, 2)
			show_hudmessage(killer_id,kcmsg)
			show_hudmessage(victim_id,kclol)
			client_cmd(killer_id,"snapshot")
		}
	return PLUGIN_HANDLED
}

public kcon(id) {
	new kcmsgon[128]
	kc_on[id] = 1
	format(kcmsgon,127,"Killcam is on")
	set_hudmessage(255, 255, 0, 0.02, 0.9, 2, 0.02, 10.0, 0.01, 0.1, 2)
	show_hudmessage(id,kcmsgon)
}

public kcoff(id) {
	new kcmsgoff[128]
	kc_on[id] = 0
	format(kcmsgoff,127,"Killcam is off")
	set_hudmessage(255, 255, 0, 0.02, 0.9, 2, 0.02, 10.0, 0.01, 0.1, 2)
	show_hudmessage(id,kcmsgoff)
}

public client_connect(id){
	kc_on[id] = 0
	return PLUGIN_CONTINUE
}

public plugin_init(){
	register_plugin("KillCam","0.1","ImJust2Nasty")
	register_event("DeathMsg","kill_event","a")
	register_clcmd("say /killcamon","kcon",0,"- enable killcam")
	register_clcmd("say /killcamoff","kcoff",0,"- disable killcam")
	return PLUGIN_CONTINUE
}
I'm still new to scripting, so I think this would be cool learning experience in itself!

Thanks for the help!
bcmorgue is offline
 



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 16:29.


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