AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple Respawn (https://forums.alliedmods.net/showthread.php?t=171558)

joshknifer 11-07-2011 13:49

Simple Respawn
 
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)
    
     }    



m0skVi4a 11-07-2011 14:03

Re: Simple Respawn
 
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)
        }



Sylwester 11-07-2011 14:08

Re: Simple Respawn
 
You forgot to add space between say and /respawn

m0skVi4a 11-07-2011 14:12

Re: Simple Respawn
 
I do not see that.
But yes @Sylwester is right

joshknifer 11-07-2011 15:03

Re: Simple Respawn
 
Ah thanks. and it was supposed to work when the player is not alive. Thanks!!

Devil259 11-09-2011 07:07

Re: Simple Respawn
 
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 )      } }

ConnorMcLeod 11-09-2011 08:19

Re: Simple Respawn
 
( 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 )

dFF 11-09-2011 09:06

Re: Simple Respawn
 
Not necessary to check is_user_connected if You used is_user_alive() because is_user_alive() already check if user is connected.

ConnorMcLeod 11-10-2011 06:20

Re: Simple Respawn
 
Quote:

Originally Posted by dFF (Post 1593283)
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 ;)

dFF 11-10-2011 11:26

Re: Simple Respawn
 
Ahhh ^_o


All times are GMT -4. The time now is 14:17.

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