Raised This Month: $ Target: $400
 0% 

respawn player before next round?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MadMaurice
Junior Member
Join Date: Apr 2007
Old 04-27-2007 , 08:35   respawn player before next round?
Reply With Quote #1

I'm working on my first Plugin for AMX.

Because my friends die too early in CS (newbies)
I thought of a plugin that let players respawn without much wait.

I tried the following Tutorial: http://forums.alliedmods.net/showthread.php?p=466787

but it didn't work because the compiler doesn't find "cs_user_respawn"

Here my code:

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

public plugin_init() {
    register_plugin("Auto_Respawn", "0.2", "MadMaurice")
    register_event("DeathMsg","Death","a");
    register_cvar("respawn_power","0");
}

public Death() {
    if(get_cvar_num("respawn_power") == 1) {
        new victim = read_data(2);
        cs_user_respawn(victim);
    }
}
is there any other function or what do i need for this?
MadMaurice is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-27-2007 , 08:42   Re: respawn player before next round?
Reply With Quote #2

Try this :

Code:
#include <amxmodx> #include <cstrike> new p_respawn; public plugin_init( ) {     register_plugin( "Auto_Respawn", "0.2", "MadMaurice" )         register_event( "DeathMsg", "eDeath", "a" );       p_respawn = register_cvar( "respawn_power", "1" ); } public eDeath( ) {     if( !get_pcvar_num( p_respawn) )         return;         new iVictim = read_data( 2 );         cs_user_spawn( iVictim ); }
__________________

Last edited by Arkshine; 04-27-2007 at 08:45.
Arkshine is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 04-27-2007 , 11:32   Re: respawn player before next round?
Reply With Quote #3

sorry I didnt note on the tut that you need to include cstrike did I? Will be added next update

[EDIT] Just updated it: UPDATED
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 04-27-2007 at 11:38.
Rolnaaba is offline
MadMaurice
Junior Member
Join Date: Apr 2007
Old 04-27-2007 , 17:13   Re: respawn player before next round?
Reply With Quote #4

thx arkshine but i tried cs_user_spawn several times WITH cstrike ;)

when i tried yours, arkshine, my cs 1.6 hang up

edit: @ rolnaaba: thx for updating

Last edited by MadMaurice; 04-27-2007 at 17:23.
MadMaurice is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-27-2007 , 17:22   Re: respawn player before next round?
Reply With Quote #5

Put a delay. Tested and it works fine.

Code:
#include <amxmodx> #include <cstrike> new p_respawn; public plugin_init( ) {     register_plugin( "Auto_Respawn", "0.2", "MadMaurice" )         register_event( "DeathMsg", "eDeath", "a" );       p_respawn = register_cvar( "respawn_power", "1" ); } public eDeath( ) {     if( !get_pcvar_num( p_respawn) )         return;         new iVictim = read_data( 2 );         if( !is_user_connected( iVictim ) )         return;             set_task( 0.1, "spawn_players", iVictim ); } public spawn_players( id ) {     cs_user_spawn( id ); }
__________________

Last edited by Arkshine; 04-27-2007 at 17:25.
Arkshine is offline
MadMaurice
Junior Member
Join Date: Apr 2007
Old 04-28-2007 , 01:19   Re: respawn player before next round?
Reply With Quote #6

now the overflow fatal error (when cs hand up) didn't come again, but i also didn't respawn in the next 10 seconds after i died.

i don't know what it is but i use the newest AMX Mod X. Maybe because in the wiki of amxmodx.org there they say, that it is experimental (cs_user_spawn) and you should better use spawn() ?

btw: spawn() didn't work either.

Last edited by MadMaurice; 04-28-2007 at 01:21.
MadMaurice is offline
MadMaurice
Junior Member
Join Date: Apr 2007
Old 04-28-2007 , 04:24   Re: respawn player before next round?
Reply With Quote #7

i just recognized that i forgot to turn on respawn_power
but now the fatal error comes again.

edit: the fatal error msg:
SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Reliable Datagram

Last edited by MadMaurice; 04-28-2007 at 04:27.
MadMaurice is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2007 , 08:16   Re: respawn player before next round?
Reply With Quote #8

Quote:
Originally Posted by MadMaurice View Post
i just recognized that i forgot to turn on respawn_power
but now the fatal error comes again.

edit: the fatal error msg:
SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Reliable Datagram
With just exactly the same code above ? Otherwise post your complete code.
__________________
Arkshine is offline
MadMaurice
Junior Member
Join Date: Apr 2007
Old 04-28-2007 , 09:53   Re: respawn player before next round?
Reply With Quote #9

once with your code above

and once with these changings:

respawn_power -> sv_auto_respawn (cvar)

0.1 -> 5.0 (set_task)

both times this message came
MadMaurice is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2007 , 10:25   Re: respawn player before next round?
Reply With Quote #10

Are you running others plugins with this 'little code' ? Strange because It works fine with me.
__________________
Arkshine is offline
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 06:44.


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