AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   New Scripter: Help Needed with simple code (https://forums.alliedmods.net/showthread.php?t=41526)

eXist 07-16-2006 22:37

New Scripter: Help Needed with simple code
 
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
}


diamond-optic 07-16-2006 23:40

Re: New Scripter: Help Needed with simple code
 
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 }

eXist 07-16-2006 23:55

Re: New Scripter: Help Needed with simple code
 
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 :)

k007 07-17-2006 21:16

Re: New Scripter: Help Needed with simple code
 
one suggestion

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

not
Code:
console_cmd (id,"jointeam 3")

eXist 07-18-2006 00:34

Re: New Scripter: Help Needed with simple code
 
Thanks for the suggestion, updated my code. +Karma

k007 07-18-2006 01:47

Re: New Scripter: Help Needed with simple code
 
no problem thanks +karma to you too 2mr i think when i get mine back again


All times are GMT -4. The time now is 07:58.

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