Raised This Month: $ Target: $400
 0% 

TS Spawning


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
gfwgtt
New Member
Join Date: Dec 2006
Old 07-03-2007 , 15:31   TS Spawning
Reply With Quote #1

How can I prevent a player from spawning in The Specialists dm ?

I tried:

Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

#define BEEP "misc/beep2.wav"
public plugin_precache()
{
    precache_sound(BEEP)
    register_forward (FM_PlayerPreThink, "fn_hookprethink")
    return PLUGIN_HANDLED
}

public plugin_init() {
    register_plugin("Block Spawn Test", "1", "...")
    register_concmd("tog_atk", "toggle_attack")
}

new bool:allow_spawn = true;

public toggle_attack(id,level,cid)
{
    allow_spawn = !allow_spawn
    emit_sound(id,0,BEEP,1.0,ATTN_NORM,0,PITCH_NORM)
    return PLUGIN_HANDLED
}

public fn_hookprethink(id)
{
    if(!is_user_alive(id) && !allow_spawn && (get_user_button (id) & IN_ATTACK))
    {
        entity_set_int (id,EV_INT_button,get_user_button (id) & ~IN_ATTACK)
        client_print(id,print_chat,"You may not spawn.")
        return FMRES_SUPERCEDE
    }
    
    return FMRES_IGNORED
}
The toggle function works, and right after death, if I +attack I get the "You may not spawn." message, but I can still respawn.

What should I do to block respawning in ts ?
gfwgtt 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 21:34.


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