AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Req] /Spec switch for admins (https://forums.alliedmods.net/showthread.php?t=174897)

yOou Know Me 12-27-2011 06:44

[Req] /Spec switch for admins
 
I need plugin for admins, when they type "/spec" to be transfered to spectators and when they type "/back" to be transfered to the team they were at the first place.

This plugin is almost what i need https://forums.alliedmods.net/showthread.php?t=64340
But it's unnaproved and when it turns you back you are alive.. you must be dead and wait a new round always..

Levels 12-27-2011 07:10

Re: [Req] /Spec switch for admins
 
He Should works fine.


PHP Code:

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta_util >
#include < hamsandwich >

new bool:userspec33 ]

public 
plugin_init( ) {
    
register_plugin"Spec Admin""0.2""Levels" // :D 
    
    
register_clcmd"/spec""ActionSpec" )
    
register_clcmd"/back""ActionBack" )
}

public 
client_putinserverid )
{
    
userspecid ] = false

public ActionSpecid ) {
    if( 
is_user_adminid ) )
    {
        
cs_set_user_teamidCS_TEAM_SPECTATOR )
        
userspecid ] = true
    
} else {
        
console_printid"You Already in the Spectator Team." )
    }
}

public 
ActionBackid ) {
    if( 
userspecid ] && is_user_adminid )
    {
        
set_task1.0"Respawn" )
        
userspecid ] = false
    
}
}

public 
Respawnid )
{
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    if( 
cs_get_user_teamid ) == CS_TEAM_T )
    {
        
fm_strip_user_weaponsid )
        
fm_give_itemid"weapon_knife" )
        
fm_give_itemid"weapon_glock18" )
        
        
cs_set_user_bpammoidCSW_GLOCK1840 )
    }
    if( 
cs_get_user_teamid ) == CS_TEAM_CT )
    {
        
fm_strip_user_weaponsid )
        
fm_give_itemid"weapon_knife" )
        
fm_give_itemid"weapon_usp" )
        
        
cs_set_user_bpammoidCSW_USP24 )
    }



yOou Know Me 12-28-2011 02:19

Re: [Req] /Spec switch for admins
 
1 Attachment(s)
I get error, when i try to compile.

yOou Know Me 12-30-2011 08:36

Re: [Req] /Spec switch for admins
 
Anyone ?

Levels 12-30-2011 17:35

Re: [Req] /Spec switch for admins
 
can't be for me it complie without erors or warnings

pacheco 12-30-2011 18:03

Re: [Req] /Spec switch for admins
 
PHP Code:

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta_util >
#include < hamsandwich >

new bool:userspec33 ]

public 
plugin_init( ) {
    
register_plugin"Spec Admin""0.2""Levels" // :D 
    
    
register_clcmd"/spec""ActionSpec" )
    
register_clcmd"/back""ActionBack" )
}

public 
client_putinserverid )
{
    
userspecid ] = false
}

public 
ActionSpecid ) {
    if( 
is_user_adminid ) )
    {
        
cs_set_user_teamidCS_TEAM_SPECTATOR )
        
userspecid ] = true
    
} else {
        
console_printid"You Already in the Spectator Team." )
    }
}

public 
ActionBackid )
{
    if( 
userspecid ] && is_user_adminid ))
    {
        
set_task1.0"Respawn" )
        
userspecid ] = false
    
}
}

public 
Respawnid )
{
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    if( 
cs_get_user_teamid ) == CS_TEAM_T )
    {
        
fm_strip_user_weaponsid )
        
fm_give_itemid"weapon_knife" )
        
fm_give_itemid"weapon_glock18" )
        
        
cs_set_user_bpammoidCSW_GLOCK1840 )
    }
    if( 
cs_get_user_teamid ) == CS_TEAM_CT )
    {
        
fm_strip_user_weaponsid )
        
fm_give_itemid"weapon_knife" )
        
fm_give_itemid"weapon_usp" )
        
        
cs_set_user_bpammoidCSW_USP24 )
    }



yOou Know Me 01-02-2012 05:48

Re: [Req] /Spec switch for admins
 
This time i compiled it, when i type "amx_plugins" in the console i can see that the plugin is running, but when i type "/spec" in the say chat nothing happens..

pacheco 01-02-2012 09:35

Re: [Req] /Spec switch for admins
 
Do you see it????
PHP Code:

    register_clcmd"/spec""ActionSpec" )
    
register_clcmd"/back""ActionBack" 

Commands in console.
For say:

PHP Code:

    register_clcmd"say /spec""ActionSpec" )
    
register_clcmd"say /back""ActionBack" 



yOou Know Me 01-02-2012 10:30

Re: [Req] /Spec switch for admins
 
This plugin has many bugs. I tried it in the console but there are many bugs..
1. When i'm alive when i type /spec i'm still in play but my nick goes to Spectators and my Radar is gone.. cuz the game thinks i'm spectator..
2. The next round i'm spectator.. when i type /back i don't get back i'm still spectator even the next round. This plugin is so wrong.. can you look at the code ?

Levels 01-02-2012 10:52

Re: [Req] /Spec switch for admins
 
oh my bad i dont see that sorry.


All times are GMT -4. The time now is 00:29.

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