Raised This Month: $ Target: $400
 0% 

zspawn coding (using old code)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thebro
Senior Member
Join Date: Jan 2011
Old 06-13-2011 , 23:24   zspawn coding (using old code)
Reply With Quote #1

1st. Idk if this is right area.
Im Using Biohazard2.00 beta or something. and i came upon this old code.
At first it didnt work.

but i changed one of the return values to 1 and it respawned zombies. I Thought it worked at first cause it spawned me to T, but then i noticed some dead people when they typed /zspawn itll put them as CT as a zombie.

Help please?


Heres my slightly edited one of it, just changed the Return 0 to 1. Located at very bottom
Code:
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < biohazard >

public plugin_init( )
{
    register_plugin( "zspawn", "12.1", "tuty" );
    
    register_clcmd( "say /zspawn", "CommandZSpawn" );
}

public CommandZSpawn( id )
{
    if( is_user_connected( id ) && !is_user_alive( id ) && InTeam( id ) )
    {
        cs_set_user_team ( id , CS_TEAM_T )
        ExecuteHamB( Ham_CS_RoundRespawn, id );
        infect_user( id, id );
    }
}

stock InTeam(id)
{
    switch(cs_get_user_team(id))
    {
        case CS_TEAM_T:
        {
            return 1
        }
        case CS_TEAM_CT:
        {
            return 1
        }
    }
    return 1
}
thebro is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 06-14-2011 , 10:07   Re: zspawn coding (using old code)
Reply With Quote #2

Code:
stock InTeam(id)
{
    switch(cs_get_user_team(id))
    {
        case CS_TEAM_T:
        {
            return 1
        }
        case CS_TEAM_CT:
        {
            return 1
        }
    }
    return 1
}
you could just do:
Code:
stock InTeam(id)
{
    return 1
}
jimaway is offline
thebro
Senior Member
Join Date: Jan 2011
Old 06-14-2011 , 15:08   Re: zspawn coding (using old code)
Reply With Quote #3

tried it

Code:
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < biohazard >

public plugin_init( )
{
    register_plugin( "zspawn", "12.1", "tuty" );
    
    register_clcmd( "say /zspawn", "CommandZSpawn" );
}

public CommandZSpawn( id )
{
    if( is_user_connected( id ) && !is_user_alive( id ) && InTeam( id ) )
    {
        cs_set_user_team ( id , CS_TEAM_T )
        ExecuteHamB( Ham_CS_RoundRespawn, id );
        infect_user( id, id );
    }
}

stock InTeam(id)
{
    return 1
}
Zombie still spawns on CT side D:
thebro is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-14-2011 , 15:40   Re: zspawn coding (using old code)
Reply With Quote #4

Why are you adding a stock if you don't use it ?!

Code:
stock InTeam(id) {     switch(cs_get_user_team(id))     {         case CS_TEAM_T:         {             return 1         }         case CS_TEAM_CT:         {             return 2         }     }     return 0 }
__________________
You can do anything you set your mind to, man.

Devil259 is offline
slice231`SD
Senior Member
Join Date: Mar 2009
Location: Location: Location:
Old 06-15-2011 , 18:17   Re: zspawn coding (using old code)
Reply With Quote #5

is_user_connected and InTeam are not needed, and create set_task
__________________

slice231`SD is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 06-16-2011 , 12:43   Re: zspawn coding (using old code)
Reply With Quote #6

Quote:
Originally Posted by slice231`SD View Post
is_user_connected and InTeam are not needed, and create set_task
WHAT?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
slice231`SD
Senior Member
Join Date: Mar 2009
Location: Location: Location:
Old 06-16-2011 , 20:34   Re: zspawn coding (using old code)
Reply With Quote #7

if(!is_user_alive(id))
{
cs_set_user_team(id, CS_TEAM_T);
set_task(1.0, "", id);

return plugin_handled
__________________

slice231`SD is offline
thebro
Senior Member
Join Date: Jan 2011
Old 06-16-2011 , 22:22   Re: zspawn coding (using old code)
Reply With Quote #8

Resolved, Close please.
thebro 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 15:10.


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