Raised This Month: $ Target: $400
 0% 

button M go Spec button M again go CT For Ljserver


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sb123
Senior Member
Join Date: Jan 2007
Old 01-04-2012 , 11:01   Re: button M go Spec button M again go CT For Ljserver
Reply With Quote #1

Quote:
Originally Posted by Erox902 View Post
Try if this works the way you want it to.

It's a quite simple plugin, two cvars to use:
  • spec_announcement -Change this to 0 if you don't want to send a chatmsg information about which player did what.
  • spec_deathmessage -Change to 1 if you want the players that turns to spectator to show in the deathmsg. ( Up in the right corner by default )

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

new const gszPrefix[] = "[CTR]"
new gCvarDeathMsg
new gCvarAnnouncement

public plugin_init()
{
    
register_plugin"ChooseteamReplacement""1.0""Rtk.Esc")
    
register_clcmd"chooseteam""replace_function" )
    
gCvarAnnouncement register_cvar"spec_announcement""1" )
    
gCvarDeathMsg register_cvar"spec_deathmessage""0" )
}

public 
replace_function(id)
{
    static 
Name[34]
    
get_user_nameidNamecharsmax(Name) )
    
    new 
iAnnounce get_pcvar_numgCvarAnnouncement )
    
    if ( 
cs_get_user_team(id) != CS_TEAM_CT )
    {
        
cs_set_user_teamidCS_TEAM_CT )
        
ExecuteHamBHam_CS_RoundRespawnid )
        
        if ( 
iAnnounce )
            
client_print0print_chat"%s%s respawned as Ct again"gszPrefixName )
    }
    else
    {
        
cs_set_user_teamidCS_TEAM_SPECTATOR )
        
        if ( 
get_pcvar_numgCvarDeathMsg ) )
            
user_kill(id1)
        else 
        {
            
user_silentkill(id)
        }
        
        if ( 
iAnnounce )
            
client_print0print_chat"%s%s switched team to spectator"gszPrefixName )
    }

    return 
PLUGIN_HANDLED;

work fine now..but have a little problem
1.when go to spec don't drop weapons
2,when go to spec remove dead body or hide body
3,some bad player will keep press M M M M M M
so i want add time limit (15seconds) ever time press M key
__________________

Last edited by sb123; 01-04-2012 at 12:33.
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
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 20:59.


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