AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TS Spawning (https://forums.alliedmods.net/showthread.php?t=57376)

gfwgtt 07-03-2007 15:31

TS Spawning
 
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 ?

Timoses 02-03-2009 01:53

Re: TS Spawning
 
Hi, I'm trying to figure out the same problem. Have you come to a solution?


All times are GMT -4. The time now is 21:34.

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