AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spawn = instant crash (https://forums.alliedmods.net/showthread.php?t=144302)

Jelle 12-01-2010 20:42

Spawn = instant crash
 
Hi. I made this simple plugin:

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <superheromod>


public plugin_init()
{
    
register_plugin("Respawn""1.0""Jelle")
    
    
register_event("DeathMsg""hook_death""a""1>0"
}

public 
hook_death()
{
    new 
victim read_data(2)
    
    
client_print(victimprint_chat"You have been killed!")
    
    
spawn(victim)
    
spawn(victim)


Each time I get killed, or anyone else gets killed, the game closes and I get the message:

SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Reliable Datagram

I have also tried using ham to respawn. That just closes my game and no error comes.

It is a condition zero listen server I have made.

Am I doing it wrong?

EDIT:
If I delete the spawn stuff so it just prints to the client that it has been killed then it works. Then I get the message "You have been killed!" in my chat as I should, so it has to be the respawn stuff which doesn't work.
It has superheromod on, and it does have respawn heroes running which uses ham to respawn with so I really don't get it.

Arkshine 12-01-2010 20:50

Re: Spawn = instant crash
 
You should aware now that's a really bad method. You should use either DEAD_RESPAWNABLE + think, either Ham_CS_RoundRespawn.

Jelle 12-01-2010 20:52

Re: Spawn = instant crash
 
Quote:

Originally Posted by Jelle (Post 1361205)
Hi. I made this simple plugin:

PHP Code:

//code 

Each time I get killed, or anyone else gets killed, the game closes and I get the message:

SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Reliable Datagram

I have also tried using ham to respawn. That just closes my game and no error comes.

It is a condition zero listen server I have made.

Am I doing it wrong?

EDIT:
If I delete the spawn stuff so it just prints to the client that it has been killed then it works. Then I get the message "You have been killed!" in my chat as I should, so it has to be the respawn stuff which doesn't work.
It has superheromod on, and it does have respawn heroes running which uses ham to respawn with so I really don't get it.

With that I mean I have tried Ham_CS_RoundRespawn.

Arkshine 12-01-2010 20:54

Re: Spawn = instant crash
 
So try the first.

Jelle 12-01-2010 20:58

Re: Spawn = instant crash
 
Never heard of that method. Not sure I understand what you mean with "+ think"?

fysiks 12-01-2010 21:06

Re: Spawn = instant crash
 
I believe he means do Ham_Think on the player.

Jelle 12-01-2010 21:12

Re: Spawn = instant crash
 
Never used it. How do I do that?

Bugsy 12-01-2010 21:50

Re: Spawn = instant crash
 
Plenty of discussion regarding both methods and probably more:

http://forums.alliedmods.net/showthread.php?t=76179

abdul-rehman 12-02-2010 05:36

Re: Spawn = instant crash
 
I also had this problem before
to prevent it, you need to delay spawning by atleast 0.5 seconds

Jelle 12-02-2010 10:53

Re: Spawn = instant crash
 
I see. I did this:

PHP Code:

#include <superheromod>

public plugin_init()
{
    
register_plugin("Respawn""1.0""Jelle")
}

public 
sh_client_death(victim)
{
    if ( 
is_user_connected(victim) )
    {
        
//Make engine think the player is respawned:
        
set_pev(victimpev_deadflagDEAD_RESPAWNABLE)
        
set_pev(victimpev_iuser10)
        
dllfunc(DLLFunc_Thinkvictim)
        
        
//Move corpse out of map
        
engfunc(EngFunc_SetOriginvictimFloat:{-4800.0, -4800.0, -4800.0})
        
        
//now spawn
        
set_task(0.5"spawned"victim)
    }
}

public 
spawned(victim)
{
    
//did he disconnect during those 0.5 seconds?
    
if ( is_user_connected(victim) )
    {
        
ExecuteHam(Ham_CS_RoundRespawnvictim)
        
dllfunc(DLLFunc_Spawnvictim)
        
        
client_print(victimprint_chat"You have been respawned!")
    }


Not sure if it works thou. I can't test it before tomorrow.


All times are GMT -4. The time now is 11:26.

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