Raised This Month: $ Target: $400
 0% 

Simple Respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-07-2011 , 13:49   Simple Respawn
Reply With Quote #1

Hello all! I tried to make a simple respawn plugin with a say command using the Ham respawn method, and was told my code wasn't working. Will you all look at it?

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

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "joshknifer"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say/respawn","CmdRespawn")
}
public 
CmdRespawn(id)
{
    if ( 
is_user_connected(id) && !is_user_alive(id) ) 
        {
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    
     }    

__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
m0skVi4a
Senior Member
Join Date: May 2011
Location: Rousse, Bulgaria
Old 11-07-2011 , 14:03   Re: Simple Respawn
Reply With Quote #2

Your code will work when player is not alive..
cstrike is not necessary..
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "joshknifer"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say/respawn","CmdRespawn")
}

public 
CmdRespawn(id)
{
        if (
is_user_connected(id) && !is_user_alive(id))
        {
            
ExecuteHamB(Ham_CS_RoundRespawn,id)
        }  

here is it without when user is alive
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "joshknifer"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say/respawn","CmdRespawn")
}

public 
CmdRespawn(id)
{
        if (
is_user_connected(id))
        {
            
ExecuteHamB(Ham_CS_RoundRespawn,id)
        }


Last edited by m0skVi4a; 11-07-2011 at 14:05.
m0skVi4a is offline
Send a message via Skype™ to m0skVi4a
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 11-07-2011 , 14:08   Re: Simple Respawn
Reply With Quote #3

You forgot to add space between say and /respawn
__________________
Impossible is Nothing
Sylwester is offline
m0skVi4a
Senior Member
Join Date: May 2011
Location: Rousse, Bulgaria
Old 11-07-2011 , 14:12   Re: Simple Respawn
Reply With Quote #4

I do not see that.
But yes @Sylwester is right
m0skVi4a is offline
Send a message via Skype™ to m0skVi4a
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-07-2011 , 15:03   Re: Simple Respawn
Reply With Quote #5

Ah thanks. and it was supposed to work when the player is not alive. Thanks!!
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-09-2011 , 07:07   Re: Simple Respawn
Reply With Quote #6

Code:
#include < amxmodx > #include < hamsandwich > #define PLUGIN "Respawn" #define VERSION "1.0" #define AUTHOR "joshknifer" public plugin_init( ) {      register_plugin( PLUGIN , VERSION , AUTHOR )      register_clcmd( "say /respawn" , "CmdRespawn" ) } public CmdRespawn( id ) {      if( is_user_connected( id ) && !is_user_alive( id ) && ( cs_get_user_team( id ) == CS_TEAM_T || cs_get_user_team( id ) == CS_TEAM_CT ) )      {           ExecuteHamB( Ham_CS_RoundRespawn , id )      } }
Devil259 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-09-2011 , 08:19   Re: Simple Respawn
Reply With Quote #7

( cs_get_user_team( id ) == CS_TEAM_T || cs_get_user_team( id ) == CS_TEAM_CT )

->

( CS_TEAM_T <= cs_get_user_team( id ) <= CS_TEAM_CT )
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 11-09-2011 , 09:06   Re: Simple Respawn
Reply With Quote #8

Not necessary to check is_user_connected if You used is_user_alive() because is_user_alive() already check if user is connected.
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-10-2011 , 06:20   Re: Simple Respawn
Reply With Quote #9

Quote:
Originally Posted by dFF View Post
Not necessary to check is_user_connected if You used is_user_alive() because is_user_alive() already check if user is connected.
Look closer ;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 11-10-2011 , 11:26   Re: Simple Respawn
Reply With Quote #10

Ahhh ^_o
dFF 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 14:17.


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