View Single Post
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 02-18-2020 , 09:35   Re: Request plugin /spec , /ct , /t
Reply With Quote #2

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

#define PLUGIN "Slash Command"
#define VERSION "1.0"
#define AUTHOR "AlferD"

#define ADMINLEVEL ADMIN_CVAR

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /spec","spec",ADMINLEVEL);
    
register_clcmd("say /ct""ct",ADMINLEVEL);
    
register_clcmd("say /t","t",ADMINLEVEL);
}

public 
spec(idlevelcid)
{
    if(
cmd_access(id,levelcid1))
    {
    {    
         new 
players[32], pnumtempid
         get_players
(playerspnum)

         for( new 
ii<pnumi++ ) 
         {
         
tempid players[i]
         
user_kill(tempid)
         
cs_set_user_team(tempidCS_TEAM_SPECTATOR)
         }
       }
      }
}

public 
ct(idlevelcid)
{
    if(
cmd_access(id,levelcid1))
    {
    {    
         new 
players[32], pnumtempid
         get_players
(playerspnum)

         for( new 
ii<pnumi++ ) 
         {
         
tempid players[i]
         
user_kill(tempid)
         
cs_set_user_team(tempidCS_TEAM_CT)
         }
       }
      }
}

public 
t(idlevelcid)
{
    if(
cmd_access(id,levelcid1))
    {
    {    
         new 
players[32], pnumtempid
         get_players
(playerspnum)

         for( new 
ii<pnumi++ ) 
         {
         
tempid players[i]
         
user_kill(tempid)
         
cs_set_user_team(tempidCS_TEAM_T)
         }
       }
      }

alferd is offline