Raised This Month: $ Target: $400
 0% 

New Scripter: Help Needed with simple code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eXist
Member
Join Date: Apr 2005
Old 07-16-2006 , 22:37   New Scripter: Help Needed with simple code
Reply With Quote #1

Well, I've tried editing my code multiple times to try to make it functional, but it still seems not to work in game.

What I want to happen is, when a player dies, force him to join spectator in DoD.

Here's my code:
Code:
// Includes
#include <amxmodx>
#include <fun>

// Plugin Start Woot!
public plugin_init() {
	register_plugin ("Send2Spec","1.0","Avatar <eXist`>")
	register_cvar ("amxx_sendtospec","1")
	register_event ("JoinSpectator","makespec","d")
}

// Change player to spectator after Death
public makespec(id) {
	if (!is_user_alive(id) && get_cvar_num( "amxx_sendtospec" ) == 1) {
		console_cmd (id,"jointeam 3")
		return PLUGIN_CONTINUE
	}
	return PLUGIN_HANDLED
}
eXist is offline
diamond-optic
Veteran Member
Join Date: May 2005
Old 07-16-2006 , 23:40   Re: New Scripter: Help Needed with simple code
Reply With Quote #2

isnt working cuase of this:
Code:
register_event ("JoinSpectator","makespec","d")

for dod, include the <dodx> module and use this event:

Code:
register_statsfwd(XMF_DEATH)

then do your code in this function:

Code:
public client_death(killer,victim,wpnindex,hitplace,TK) { //code here }
__________________
diamond-optic is offline
eXist
Member
Join Date: Apr 2005
Old 07-16-2006 , 23:55   Re: New Scripter: Help Needed with simple code
Reply With Quote #3

Thanks a hell of alot man, works perfect now. Would have never gotten that without you .
+Karma for you babe

P.S. I want your bod

Last edited by eXist; 07-17-2006 at 00:06.
eXist is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 07-17-2006 , 21:16   Re: New Scripter: Help Needed with simple code
Reply With Quote #4

one suggestion

user
Code:
client_cmd (id,"jointeam 3")

not
Code:
console_cmd (id,"jointeam 3")
k007 is offline
Send a message via MSN to k007
eXist
Member
Join Date: Apr 2005
Old 07-18-2006 , 00:34   Re: New Scripter: Help Needed with simple code
Reply With Quote #5

Thanks for the suggestion, updated my code. +Karma
eXist is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 07-18-2006 , 01:47   Re: New Scripter: Help Needed with simple code
Reply With Quote #6

no problem thanks +karma to you too 2mr i think when i get mine back again
k007 is offline
Send a message via MSN to k007
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 07:58.


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