Raised This Month: $ Target: $400
 0% 

Zspawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 08-01-2009 , 00:04   Zspawn
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <colorchat>
#tryinclude <zombiezealots>

new PLUG[] = "Zombie Respawn";
new 
VERS[] = "1.0";
new 
AUTH[] = "LeviN";

public 
plugin_init()
{
    
register_plugin(PLUGVERSAUTH);
    
    
RegisterHam(Ham_DeathNotice"player""player_death"1);
    
    
register_clcmd("say !zspawn""StartSpawn");
    
register_clcmd("say /zspawn""StartSpawn");
}

public 
player_death(id)
{
    
ColorChat(0GREEN"Type ^"^x03/zspawn^x04^" to respawn as a zombie!");
}

public 
StartSpawn(id)
{
    if(!
is_user_alive(id))
    {
        
cs_set_user_team(idCS_TEAM_T);
        
set_task(1.0"spawn_again"id);
    }
    return 
PLUGIN_HANDLED;
}

public 
spawn_again(id)
{
    
ExecuteHamB(Ham_Spawnid);
    
set_task(0.5"make_zombie"id);
}

public 
make_zombie(id)
{
    
infect_user(id);

Quote:
L 07/14/2009 - 18:13:52: [AMXX] Run time error 10 (plugin "zspawn.amxx") (native "cs_set_user_team") - debug not enabled!
L 07/14/2009 - 18:13:52: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
When I enable debug, the server crashes for some apparent reason, any solutions or fixes I should do?
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 08-01-2009 , 00:53   Re: Zspawn
Reply With Quote #2

This is just a remake of biohazard ...or what ??
1)the native cs_get_user_team maybe won't work...Because your plugin set team with another method ...(fm_get_user_team...or what ??)
2) Is there any logs when debug....post here..

Last edited by 5c0r-|3i0; 08-01-2009 at 00:57. Reason: edit
5c0r-|3i0 is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-01-2009 , 06:07   Re: Zspawn
Reply With Quote #3

Usually before checking player team with "cstrike" you must check if it's connected...try it.

if(is_user_alive(id) && is_user_connected(id))
//some ...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 08-01-2009 , 06:28   Re: Zspawn
Reply With Quote #4

I don't know if you have to set the team, infect_user() probably does that.

Also, setting a 1 second task is unnecessary, just call the function directly.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 08-01-2009 , 11:00   Re: Zspawn
Reply With Quote #5

Quote:
Originally Posted by 5c0r-|3i0 View Post
This is just a remake of biohazard ...or what ??
1)the native cs_get_user_team maybe won't work...Because your plugin set team with another method ...(fm_get_user_team...or what ??)
2) Is there any logs when debug....post here..
Quote:
Originally Posted by Alka View Post
Usually before checking player team with "cstrike" you must check if it's connected...try it.

if(is_user_alive(id) && is_user_connected(id))
//some ...
Quote:
Originally Posted by Xellath View Post
I don't know if you have to set the team, infect_user() probably does that.

Also, setting a 1 second task is unnecessary, just call the function directly.

@ 5c0r-|3i0
The issue is I cannot enable debug, it crashes. (Tested on 3 different servers)

@ Alka
I've tried that and like Xellath stated, infect_user does it

@ Xellath
Could you show me an example on how I should directly do it?
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 08-01-2009 , 11:18   Re: Zspawn
Reply With Quote #6

Do what alka said
PHP Code:
if(is_user_connected(id) && !is_user_alive(id)) 
About the enabling of debug are you sure it crashes because of it?
__________________

Last edited by joaquimandrade; 08-01-2009 at 11:21.
joaquimandrade is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 08-01-2009 , 11:29   Re: Zspawn
Reply With Quote #7

Quote:
Originally Posted by joaquimandrade View Post
Do what alka said
PHP Code:
if(is_user_connected(id) && !is_user_alive(id)) 
About the enabling of debug are you sure it crashes because of it?
yea, like I stated above, tested on 3 different servers

I'll test it when I get home (1 week)
__________________

Last edited by DruGzOG; 08-01-2009 at 11:31.
DruGzOG is offline
Send a message via AIM to DruGzOG
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 08-01-2009 , 11:31   Re: Zspawn
Reply With Quote #8

Quote:
Originally Posted by DruGzOG View Post
yea, like I stated above, tested on 3 different servers, that's why

Try with debug just the code:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <colorchat>
#tryinclude <zombiezealots>

new PLUG[] = "Zombie Respawn";
new 
VERS[] = "1.0";
new 
AUTH[] = "LeviN";

public 
plugin_init()
{
    
register_plugin(PLUGVERSAUTH);
    
    
RegisterHam(Ham_DeathNotice"player""player_death"1);
    
    
register_clcmd("say !zspawn""StartSpawn");
    
register_clcmd("say /zspawn""StartSpawn");
}

public 
player_death(id)
{
    
ColorChat(0GREEN"Type ^"^x03/zspawn^x04^" to respawn as a zombie!");
}

public 
StartSpawn(id)
{
    if(!
is_user_alive(id))
    {
        
cs_set_user_team(idCS_TEAM_T);
    }
    return 
PLUGIN_HANDLED;


__________________
joaquimandrade is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 08-01-2009 , 13:54   Re: Zspawn
Reply With Quote #9

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <colorchat>
#include <zombiezealots>

new PLUGIN[ ] = "Zombie Respawn";
new 
VERSION[ ] = "1.0";
new 
AUTHOR[ ] = "LeviN";

public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
RegisterHamHam_DeathNotice"player""player_death");
    
    
register_clcmd"say !zspawn""startSpawn" );
    
register_clcmd"say /zspawn""startSpawn" );
}

public 
player_deathid )
{
    
ColorChatidGREEN"Type ^"^x03/zspawn^x04^" to respawn as a zombie!" );
}

public 
startSpawnid )
{
    if ( 
is_user_connectedid ) && !is_user_aliveid ) )
    {
        
ExecuteHamBHam_Spawnid );
    
        
infect_userid );
    }

I am guessing that infect_user changes the team of the player.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 08-01-2009 , 19:20   Re: Zspawn
Reply With Quote #10

Quote:
Originally Posted by Xellath View Post
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <colorchat>
#include <zombiezealots>

new PLUGIN[ ] = "Zombie Respawn";
new 
VERSION[ ] = "1.0";
new 
AUTHOR[ ] = "LeviN";

public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
RegisterHamHam_DeathNotice"player""player_death");
    
    
register_clcmd"say !zspawn""startSpawn" );
    
register_clcmd"say /zspawn""startSpawn" );
}

public 
player_deathid )
{
    
ColorChatidGREEN"Type ^"^x03/zspawn^x04^" to respawn as a zombie!" );
}

public 
startSpawnid )
{
    if ( 
is_user_connectedid ) && !is_user_aliveid ) )
    {
        
ExecuteHamBHam_Spawnid );
    
        
infect_userid );
    }

I am guessing that infect_user changes the team of the player.
Yes it does, just checked.
zacky is offline
Send a message via Skype™ to zacky
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 18:25.


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