Raised This Month: $ Target: $400
 0% 

[Req] /Spec switch for admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Levels
Member
Join Date: Dec 2011
Old 01-02-2012 , 10:52   Re: [Req] /Spec switch for admins
Reply With Quote #1

oh my bad i dont see that sorry.
Levels is offline
yOou Know Me
BANNED
Join Date: Oct 2009
Old 01-02-2012 , 14:01   Re: [Req] /Spec switch for admins
Reply With Quote #2

No it's still wrong. When i type /back i get back but alive.. i must be dead and wait a new round.. and if you can do it to say "you must be dead to use this command" for the command /spec i mean.
yOou Know Me is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 01-02-2012 , 14:06   Re: [Req] /Spec switch for admins
Reply With Quote #3

Quote:
Originally Posted by yOou Know Me View Post
No it's still wrong. When i type /back i get back but alive.. i must be dead and wait a new round.. and if you can do it to say "you must be dead to use this command" for the command /spec i mean.
I update, download now
__________________
kramesa is offline
yOou Know Me
BANNED
Join Date: Oct 2009
Old 01-02-2012 , 14:50   Re: [Req] /Spec switch for admins
Reply With Quote #4

One problem, when i'm Terrorist and i type /spec i go spectator, but when i type /back i go Counter Terrorist i tried it 4-5 times. When i'm CT and i got Spec and /back i'm CT but with the Terrorist is bugged.
yOou Know Me is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 01-02-2012 , 15:09   Re: [Req] /Spec switch for admins
Reply With Quote #5

Quote:
Originally Posted by yOou Know Me View Post
One problem, when i'm Terrorist and i type /spec i go spectator, but when i type /back i go Counter Terrorist i tried it 4-5 times. When i'm CT and i got Spec and /back i'm CT but with the Terrorist is bugged.
Quote:
Originally Posted by Levels View Post
kramesa you have bug to.

here a fixed plugin:

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

#define PLUGIN    "Spec"
#define AUTHOR    "kramesa"
#define VERSION    "v1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"/spec""Spec" )
    
register_clcmd"/back""Back" 
    
    
register_clcmd"say /spec""Spec" )
    
register_clcmd"say /back""Back" )  
}

public 
Spec(id)
{
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"You are dead and cant use this command.")
        return 
PLUGIN_HANDLED
    
}
    
    if(
is_user_admin(id))
    {
        if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        {
            
client_print(idprint_center"You already in SPEC.")
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
cs_set_user_team(idCS_TEAM_SPECTATOR)
            
user_kill(id1)
            
client_print(idprint_center"You going to SPEC.")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED
}

public 
Back(id)
{
    if(
is_user_admin(id))
    {
        if(
cs_get_user_team(id) == CS_TEAM_CT && CS_TEAM_T)
        {
            
client_print(idprint_center"You already in CT/T.")
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
cs_set_user_team(idCS_TEAM_CT)
            
client_print(idprint_center"You back to CT.")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED

you do if( is_user_alive( id ) ) , thats mean if is user alive and you forget !is_user_alive( id ) = !
Fixed the two bugs.
Attached Files
File Type: sma Get Plugin or Get Source (SpecBack.sma - 338 views - 1.6 KB)
__________________

Last edited by kramesa; 01-02-2012 at 15:24.
kramesa is offline
Levels
Member
Join Date: Dec 2011
Old 01-02-2012 , 15:08   Re: [Req] /Spec switch for admins
Reply With Quote #6

kramesa you have bug to.

here a fixed plugin:

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

#define PLUGIN    "Spec"
#define AUTHOR    "kramesa"
#define VERSION    "v1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"/spec""Spec" )
    
register_clcmd"/back""Back" 
    
    
register_clcmd"say /spec""Spec" )
    
register_clcmd"say /back""Back" )  
}

public 
Spec(id)
{
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"You are dead and cant use this command.")
        return 
PLUGIN_HANDLED
    
}
    
    if(
is_user_admin(id))
    {
        if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        {
            
client_print(idprint_center"You already in SPEC.")
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
cs_set_user_team(idCS_TEAM_SPECTATOR)
            
user_kill(id1)
            
client_print(idprint_center"You going to SPEC.")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED
}

public 
Back(id)
{
    if(
is_user_admin(id))
    {
        if(
cs_get_user_team(id) == CS_TEAM_CT && CS_TEAM_T)
        {
            
client_print(idprint_center"You already in CT/T.")
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
cs_set_user_team(idCS_TEAM_CT)
            
client_print(idprint_center"You back to CT.")
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED

you do if( is_user_alive( id ) ) , thats mean if is user alive and you forget !is_user_alive( id ) = !

Last edited by Levels; 01-02-2012 at 15:09.
Levels is offline
yOou Know Me
BANNED
Join Date: Oct 2009
Old 01-02-2012 , 16:50   Re: [Req] /Spec switch for admins
Reply With Quote #7

It's working fine now 10x 2 all
What admin flag does it require ?

Last edited by yOou Know Me; 01-02-2012 at 16:53.
yOou Know Me is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 01-02-2012 , 16:54   Re: [Req] /Spec switch for admins
Reply With Quote #8

Quote:
Originally Posted by yOou Know Me View Post
It's working fine now 10x 2 all
What admin flag does it require ?
Any one.
__________________
kramesa is offline
yOou Know Me
BANNED
Join Date: Oct 2009
Old 01-02-2012 , 17:33   Re: [Req] /Spec switch for admins
Reply With Quote #9

Ok thanks, i'm thinking to make a respawn server too. Can you do it when you type /back to respawn you alive too ?
yOou Know Me is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 01-02-2012 , 17:40   Re: [Req] /Spec switch for admins
Reply With Quote #10

PHP Code:
public Back(id)
{
    if(
is_user_admin(id))
    {
        if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        {
            if(
cs_get_user_team(id) == CS_TEAM_CT && CS_TEAM_T)
            {
                
client_print(idprint_chat"You already in CT/T.");
                return 
PLUGIN_HANDLED;
            }
            
            if(
TerroristTeam[id] == true)
            {
                
cs_set_user_team(idCS_TEAM_T);
                
client_print(idprint_chat"You going to T.");
                return 
PLUGIN_HANDLED;
            }
            
            if(
TerroristTeam[id] == false)
            {
                
cs_set_user_team(idCS_TEAM_CT);
                
client_print(idprint_chat"You going to CT.");
                return 
PLUGIN_HANDLED;
            }
        }
    }
    return 
PLUGIN_HANDLED;

=>

PHP Code:
public Back(id)
{
    if(
is_user_admin(id))
    {
        if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        {
            if(
cs_get_user_team(id) == CS_TEAM_CT && CS_TEAM_T)
            {
                
client_print(idprint_chat"You already in CT/T.");
                return 
PLUGIN_HANDLED;
            }
            
            
ExecuteHamB(Ham_CS_RoundRespawnid)
            
            if(
TerroristTeam[id] == true)
            {
                
cs_set_user_team(idCS_TEAM_T);
                
client_print(idprint_chat"You going to T.");
                return 
PLUGIN_HANDLED;
            }
            
            if(
TerroristTeam[id] == false)
            {
                
cs_set_user_team(idCS_TEAM_CT);
                
client_print(idprint_chat"You going to CT.");
                return 
PLUGIN_HANDLED;
            }
        }
    }
    return 
PLUGIN_HANDLED;

__________________
kramesa 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 00:28.


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