Raised This Month: $ Target: $400
 0% 

amx_noclip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-03-2007 , 00:16   amx_noclip
Reply With Quote #1

im editing/making a noclip plugin that im trying to show whether noclip was given to a person/team/everyone or was taken away.
my latest try was:
Code:
public admin_noclip(id,level,cid) { 
    if (!cmd_access(id,level,cid,3)) 
        return PLUGIN_HANDLED 
    new arg[32], arg2[8], name2[32] 
    read_argv(1,arg,31) 
    read_argv(2,arg2,7) 
    get_user_name(id,name2,31) 
    new activity = get_cvar_num("amx_show_activity")
    new bool:l_postRound = false;
    if(str_to_num(arg2) == 2)
    {
    arg2 = "1";
    l_postRound = true;
    } 
    
    if (arg[0]=='@'){ 
        new players[32], inum
        if(!(arg[1]=='a' || arg[1]=='A' || arg[1]=='C' || arg[1]=='c' || arg[1]=='T' || arg[1]=='t'))
            inum = 0
        else
            get_players(players,inum,"")
        if (inum==0){
            console_print(id, "%L", LANG_PLAYER, "AINO_NO_CLIENTS")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a)
        {
            if((arg[1]=='a'
            || arg[1]=='A')
            || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T'
            || arg[1]=='t'))
            || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C'
            || arg[1]=='c')))
            {
            set_user_noclip(players[a],str_to_num(arg2))
            g_NoclipMaster[players[a]] = l_postRound;
            }
            if((arg[1]=='a'
            || arg[1]=='A'))
            {
                if((arg2 = "2"))
                {
                    
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on everyone.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on everyone.")
                    }
                    console_print(id,"[AMXX] Everyone has gained noclip privileges.")
                }
                if((arg2 = "1"))
                {
                    
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on everyone.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on everyone.")
                    }
                    console_print(id,"[AMXX] Everyone has gained noclip privileges.")
                }
                if((arg2 = "0"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, took away noclip from everyone.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN took noclip away from everyone.")
                    }
                    console_print(id,"[AMXX] Everyone has lost noclip privileges.")
                }
            }
            if(arg[1]=='t'
            || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T')))
            {
                if((arg2 = "2"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all Ts.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all Ts.")
                    }
                    console_print(id,"[AMXX] All Ts have gained noclip privileges.")
                }
                if((arg2 = "1"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all Ts.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all Ts.")
                    }
                    console_print(id,"[AMXX] All Ts have gained noclip privileges.")
                }
                if((arg2 = "0"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, took noclip from all Ts.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN took noclip from all Ts.")
                    }
                    console_print(id,"[AMXX] All Ts have lost noclip privileges.")
                }
            }
            if(arg[1]=='c'
            || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C')))
            {
                if((arg2 = "2"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all CTs.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all CTs.")
                    }
                    console_print(id,"[AMXX] All CTs have gained noclip privileges.")
                }
                if((arg2 = "1"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all CTs.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all CTs.")
                    }
                    console_print(id,"[AMXX] All CTs have gained noclip privileges.")
                }
                if((arg2 = "0"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, took noclip from all CTs.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN took noclip from all CTs.")
                    }
                    console_print(id,"[AMXX] All CTs have lost noclip privileges.")
                }
            }
        }
        log_amx("ADMIN NOCLIP - this command was issued by %s on all %s",name2,arg[1]) 
    } 
    else
    { 
        new player = cmd_target(id,arg,7) 
        if (!player) return PLUGIN_HANDLED 
        
        set_user_noclip(player,str_to_num(arg2))
        g_NoclipMaster[player] = l_postRound; 
        
        new name[32] 
        get_user_name(player,name,31) 
        if((arg2 = "2"))
        {
            switch(activity)
            {
                case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on %s.",name2,name)
                case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on %s.",name)
            }
            console_print(id,"[AMXX] %s has noclip.",name)
        }
        if((arg2 = "1"))
        {
            switch(activity)
            {
                case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on %s.",name2,name)
                case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on %s.",name)
            }
            console_print(id,"[AMXX] %s has noclip.",name)
        }
        if((arg2 = "0"))
        {
            switch(activity)
            {
                case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, took noclip from %s.",name2,name)
                case 1: client_print(0,print_chat,"[AMXX] ADMIN took noclip from %s.",name)
            }
            console_print(id,"[AMXX] %s no longer has noclip.",name)
        }
        log_amx("ADMIN NOCLIP - this command was issued by %s on %s",name2,name) 
    } 
    return PLUGIN_HANDLED  
}
im tryin to make it to where if i put: amx_noclip exo 2/1
it would say i was given noclip.
but if i put: amx_noclip exo 0
it would say i am no longer noclipping
instead when i give myself or anyone gives themself or someone else noclip, all three come up.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
aer0nz
Junior Member
Join Date: Feb 2007
Old 03-03-2007 , 11:56   Re: amx_noclip
Reply With Quote #2

post all the code plx
aer0nz is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-03-2007 , 14:02   Re: amx_noclip
Reply With Quote #3

its from bmann's amx_super-nohpk but here:
Code:
/* AMXX Mod script.
*
* (c) copyright 2005 by bmann_420/Iceman
* This file is provided as is (no warranties).
*
* SUPER ALLINONE COMMANDS - No HPK Edition
* [2007 / 01 / 06 -- last change]
* [Plugin Count, 36 --  plugins]
*
Support 
* -) Mangrapes for porting admin_slash and letting me add this. 
* -) BigBaller for Porting it Origionally & the AMXX Community 
* -) Zor for the compilation of AdminModX & the DOD Community 
* -) Iceman (Clan Member) Who helped with the additions 
* -) Good Old Kensai 
* -) Sether for Code Update & Additions (#2 for godmode/noclip) 
* -) Bo0m! for Code cleanup/helping in my absence

Plugins 
* -) ADMIN HEAL v0.9.3 by f117bomb 
* -) ADMIN ARMOR v1 by Rav 
* -) ADMIN NO CLIP v0.9.3 by f117bomb 
* -) ADMIN TELEPORT v0.9.3 by f117bomb 
* -) ADMIN STACK v0.9.3 by f117bomb  
* -) ADMIN ALLTALK 1.0 by BigBaller 
* -) ADMIN GRAVITY v0.2 by JustinHoMi 
* -) ADMIN BURY v0.9.3 by f117bomb 
* -) ADMIN DISARM v1.1 by mike_cao 
* -) AMX UBER SLAP v0.9.3 by BarMan (Skullz.NET) 
* -) ADMIN SLAY 2 v0.9.2 by f117bomb 
* -) ADMIN ROCKET v1.3 by f117bomb 
New Additions by bmann_420***======= Some of these were on the last All-in-one, but they did not work, so I replaced and/or Fixed them. 
* -) ADMIN MONEY 1.0 by XxAvalanchexX
* -) ADMIN FIRE v1.0.0 by f117bomb 
* -) ADMIN GLOW v1.3.3 by EKS 
* -) ADMIN LLAMA by SniperBeamer 
* -) ADMIN WEAPON II By SniperBeamer (Replaced Old One) 
* -) ADMIN EXEC 2.3 by v3x 
* -) ADMIN REVIVE by SniperBeamer 
* -) ADMIN UNLIMITED AMMO AssKicR 
* -) ADMIN DEADCHAT by SuiCideDog/Brad 
* -) ADMIN GAG by EKS 
* -) ADMIN GODMODE 
* -) ADMIN QUIT 
* -) ADMIN STATUS 
* -) ADMIN PASSWORD by Sparky 911 
* -) PUBLIC LOADINGSONG 
* -) DAMAGE DONE HUD by Manip, ported and fixed by JTP10181 with additoins by Vittu
* -) SERVER SHUTDOWN by Remo Williams -- Lets people reconnect automatically when you restart the server for quick fixes or additions
* -) SERVER SPECTATOR BUG FIX <-- Are you ducking when you die and the spectator menu pops up? This fixes that issue! 
* -) SHOWNDEAD BUG FIX by Vantage aka Mouse  v.0.9.4
* -) SOUND FIX Fix Echo Sound by Throstur  v. 1.0
* -) DEATHMESSAGE FIX by Simon Logic  v1.0.1 
 
 
***If you need help or have question, visit this page: http://www.amxmodx.org/forums/viewtopic.php?p=172239#172239***
The site above will have all commands and issue questions most likely answered, or if not then post your question there.

//
//////////////////////////////////////////////////////////////////////////////////////////////
//Installation  (Read The DOCUMENTATION ALSO!)
1) Put the amx_super.amxx into your addons/amxmodx/plugins folder. 
2) Go into your addons/amxmodx/configs/plugins.ini, at the very bottom type in amx_super.amxx, save it 
3) Download the allinone.txt and place it in your addons/amxmodx/data/lang Folder 
4) Download the sounds.rar, Unzip them. Place them into your sound/misc Folder 

//FAQ: 
Q, It says bad load and it is not running. 
A, Then Make sure all modules are Enabled for this plugins to work, those are: 
Fun 
Engine 
Cstrike 

-If you have those Enabled, then click on download to get the sma. 
-Then place that into your addons/amxmodx/scripting Folder 
-Double click on Compile with the blue box and wait for all your plugins to compile in the 
-cmd command prompt 
-Then after you hit enter, go into your compiled folder inside your scripting folder and take out amx_super.amxx 
-Place that into your addons/amxmodx/plugins folder by replacing the old one.
*/

new const PLUGIN[]  = "Amx Super";
new const VERSION[] = "2.7 No-HPK"
new const AUTHOR[]  = "Bmann_420";

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <engine>

//======================================================================================================================================
//You are able to Edit some of these values below as you see fit========================================================================

#define USING_STEAM 1 // comment this line if your using WON CS 1.5
#define MESSAGES 4
#define MAX_NAME_LENGTH 32
#define MAX_PLAYERS 32
#define MAX_TEXT_LENGTH 192
#define VoiceCommMute 1        // 0 = Disabled ( no extra module required ) | 1 = Voicecomm muteing enabled. ( requires engine module)
#define BlockNameChange 1    // 0 = Disabled | 1 = Block namechange on gagged clients
#define LogAdminActions 1    // 0 = Disabled | 1 = Admin actions will be logged
#define DefaultGagTime 600.0    // The std gag time if no other time was entered. ( this is 10 min ), Remember the value MUST contain a .0
#define PlaySound 1        // 0 = Disabled | 1 = Play a sound to gagged clients when their trying to talk
#define GagReason 1        // 0 = Disabled | 1 = Gagged clients can see why there where gagged when they try to talk
#define MaxPlayers 32
#define AllowOtherPlugin2Interface 1
#define WhatModule 2             // 1 = Enable glow via the engine module |  2 = Enable glwo via the fun module
#define MaxColorCount 7            // Dont change this one.
#define DAMAGE_RECIEVED

#if WhatModule == 1
#include <engine>
#else
#include <fun>
#endif

new g_ColorNames[MaxColorCount][12] = { "red","green","blue","yellow","purple","aqua","silver" }
new g_ColorR[MaxColorCount] = { 255,0,0,255,255,0,192 }
new g_ColorG[MaxColorCount] = { 0,255,0,255,0,255,192 }
new g_ColorB[MaxColorCount] = { 0,0,255,0,255,255,192 }

new g_Players[33]    // This array contains the color a player is glowing in. ( if any ) -1 means no color

new g_GagPlayers[MaxPlayers+1]    // Used to check if a player is gagged
#if GagReason == 1
new gs_GagReason[MaxPlayers+1][48]
#endif

new enabled, allow
new bool:g_GodMaster[33]
new bool:g_NoclipMaster[33]
new authid [32]
new name [32]
new g_MsgSync
#if defined DAMAGE_RECIEVED
    new g_MsgSync2
#endif

//Shown dead bug fix
new SpecName[16]
new gmsg_TeamInfo


public plugin_init()
    {
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_cvar("amx_super",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
    register_dictionary("Amx_Super.txt")
    register_clcmd("say","block_gagged") 
    register_clcmd("say_team","block_gagged") 
    register_clcmd("say /gravity","check_gravity")
    register_clcmd("say_team /gravity","check_gravity")
    register_event("DeathMsg","death","a") 
    register_event("ResetHUD","alive","b")
    register_event("CurWeapon","changeWeapon","be","1=1")
    register_event("ResetHUD", "newround_event", "b")
    register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
    g_MsgSync = CreateHudSyncObj()
    #if defined DAMAGE_RECIEVED
    g_MsgSync2 = CreateHudSyncObj()
    #endif
    enabled = register_cvar("amx_soundfix","1")
        allow = register_cvar("amx_soundifx_pallow","1")
        set_task(0.1,"fRemove")
        gmsg_TeamInfo = get_user_msgid("TeamInfo")
        copy(SpecName,15,"SPECTATOR")

//Admin Commands===============================================================================================================================================    
    register_clcmd("say /fixsound","cmdStopsound")
    register_concmd("amx_heal","admin_heal",ADMIN_LEVEL_A,"<authid, nick, @team or #userid> <life to give>")
    register_concmd("amx_armor","admin_armor",ADMIN_LEVEL_A,"<part of nick> <amount>")
    register_concmd("amx_godmode","admin_godmode",ADMIN_LEVEL_A,"<authid, nick, @team/all or #userid> <0=OFF 1=ON 2=ON + ON EACH ROUND>")
    register_concmd("amx_godall", "godmode", ADMIN_LEVEL_A, "- Sets all players to god mode")
    register_concmd("amx_noclip","admin_noclip",ADMIN_LEVEL_A,"<authid, nick, @team/all or #userid> <0=OFF 1=ON 2=ON + ON EACH ROUND>")
    register_concmd("amx_teleport","admin_teleport",ADMIN_LEVEL_A,"<authid, nick, @team or #userid> [x] [y] [z]")
    register_concmd("amx_userorigin","admin_userorigin",ADMIN_LEVEL_A,"<authid, nick, or #userid>")
    register_concmd("amx_stack","admin_stack",ADMIN_LEVEL_A,"<authid, nick or #userid> [0|1|2]")
    register_clcmd("amx_givemoney","cmd_givemoney",ADMIN_KICK,"<player> <amount> - gives specified player money");
    register_concmd("amx_gag","CMD_GagPlayer",ADMIN_KICK,"<nick or #userid> <a|b|c> <time>  a == normal say / b == team say / c == voicecomm") 
    register_concmd("amx_ungag","CMD_UnGagPlayer",ADMIN_KICK,"<nick or #userid>")
    register_concmd("amx_alltalk","admin_alltalk",ADMIN_LEVEL_A,"1|0 to enable and disable")
    register_concmd("amx_gravity","admin_gravity",ADMIN_LEVEL_A,"< gravity >")
    register_concmd("amx_glow","CMD_Glow",ADMIN_KICK,"<nick or #userid> <color>")
    register_concmd("amx_unglow","CMD_UnGlow",ADMIN_KICK,"<nick or #userid>")
    register_concmd("amx_bury","admin_bury",ADMIN_LEVEL_B,"<authid, nick, @team or #userid>")
    register_concmd("amx_unbury","admin_unbury",ADMIN_LEVEL_B,"<authid, nick, @team or #userid>")
    register_concmd("amx_disarm","admin_disarm",ADMIN_LEVEL_B,"<authid, nick, @team or #userid>")
    register_concmd("amx_uberslap","admin_slap",ADMIN_LEVEL_B,"<authid, nick or #userid>")
    register_concmd("amx_slay2","admin_slay",ADMIN_LEVEL_B,"<authid, nick, @team or #userid> [1-lightning|2-blood|3-explode]")
    register_concmd("amx_fire","fire_player",ADMIN_LEVEL_B,"<authid, nick or #userid>")
    register_concmd("amx_rocket","rocket_player",ADMIN_LEVEL_B,"<authid, nick, @team or #userid>")
    register_concmd("amx_llama","llama",ADMIN_LEVEL_A,"- <authid, nick, @team or #userid>")
    register_concmd("amx_unllama","unllama",ADMIN_LEVEL_A,"- <authid, nick, @team or #userid>")
    register_concmd("amx_weapon","admin_weapon",ADMIN_LEVEL_C,"<authid, nick, @all, @team, or #userid> <weapon #>")
    register_concmd("amx_weapons","admin_weapon",ADMIN_LEVEL_C,"<authid, nick, @all, @team, or #userid> <weapon #>")
    register_concmd("amx_revive","admin_revive",ADMIN_BAN,"<authid, nick, @team or #userid>")
    register_concmd("amx_quit", "quit", ADMIN_LEVEL_A, "<nick | steam> - Will quit assholes to the desktop")
    register_clcmd("amx_exec","doExec",ADMIN_IMMUNITY,"<nick,@TEAM,*(all),@SERVER>")
    register_concmd("amx_ammo","admin_ammo",ADMIN_LEVEL_A,"<authid, nick, @team or #userid>")  
    register_concmd("amx_unammo","admin_unammo",ADMIN_LEVEL_A,"<authid, nick, @team or #userid>") 
//Server Commands================================================================================================================================================
    register_srvcmd("soundfix","fRemove")
    register_srvcmd("amx_exec","doExec")
    register_concmd("amx_status", "status", ADMIN_KICK, "- This will show you a list of info on each person kinda like the status but more detailed")
    register_concmd("amx_pass", "pass", ADMIN_BAN, "- Sets a server password")
         register_concmd("amx_nopass", "nopass", ADMIN_BAN, "- Removes the server password")
    register_concmd("amx_shutdown","servershutdown",ADMIN_IMMUNITY," - Shuts down server in 10seconds")
//Server Cvars===================================================================================================================================================    
    if (!cvar_exists("sv_dropwpn")) 
    register_cvar("sv_dropwpn", "0")
    register_cvar("bullet_damage","1")
    register_cvar("adminmodx_sounds", "1")
    register_cvar("amx_loadsong","1")
    register_cvar("amx_llamasound","1")
    register_cvar("amx_deadchat","1")
    register_cvar("amx_moneymsg","1")
    register_cvar("amx_revivemsg","1")
    register_cvar("amx_revivewithguns","1")

// Shown Dead Bug Fix
//-----------------------    
    new ModName[11] 
    get_modname(ModName,10)
    
    if( equal("cstrike",ModName,10) ){
        copy(SpecName,15,"SPECTATOR")
    }
    else if( equal("ns",ModName,10) ){
        copy(SpecName,15,"#spectatorteam")
    }
    else if( equal("tfc",ModName,10) ){
        copy(SpecName,15,"")
    }
    
    gmsg_TeamInfo = get_user_msgid("TeamInfo")
    
    return PLUGIN_HANDLED    
}

//Sound Fix
//===================================================================================================================
public fRemove()
{
    if(get_pcvar_num(enabled) != 1)
        return PLUGIN_HANDLED
    
    new Echo = find_ent_by_class(0,"env_sound")
    while(Echo)
    {
        remove_entity(Echo)
        Echo = find_ent_by_class(Echo,"env_sound")
    }
    return PLUGIN_HANDLED
}

public cmdStopsound(id)
{
    if(get_pcvar_num(allow) == 1)
    {
        client_cmd(id,"stopsound;room_type 00")
        client_cmd(id,"stopsound")
        client_print(id,print_chat,"[AMXX] Your sound will no longer echo now.")
    }
    else
    {
        client_print(id,print_chat,"[AMXX] I'm sorry, manual sound fixing is disabled.")
        return PLUGIN_HANDLED
    }
    return PLUGIN_CONTINUE
} 

//Spectator Bug Fix
//=================================================================================================================
public eventDeathMsg() {
 new ids[1]
 ids[0] = read_data(2)
 set_task(1.0,"fixit",0,ids,1)
 return PLUGIN_CONTINUE
}

public fixit(ids[]) {
 client_cmd(ids[0],"+duck;-duck;spec_menu 0")
}


// If a Player has unlimited Godmode and/or unlimited Noclip
//===================================================================================================================

public newround_event(id) { 
   if(g_GodMaster[id]) 
      set_user_godmode(id,1);
   if(g_NoclipMaster[id]) 
      set_user_noclip(id,1);
   return PLUGIN_CONTINUE 
}

//=============================================================================================================================================================
// When a player is auth and the Steam ID is set

public client_authorized(id)
    {
    return PLUGIN_CONTINUE
}

//=============================================================================================================================================================
// When a player disconnects everything is removed from them

public client_disconnect(id) {  
    remove_task(id)  
    
    g_GodMaster[id] = false
    g_NoclipMaster[id] = false
    
    if(g_GagPlayers[id]) // Checks if disconnected player is gagged, and removes flags from his id.
    {
        new Nick[32],Authid[35]
        get_user_name(id,Nick,31)
        get_user_authid(id,Authid,34)
        client_print(0,print_chat,"[AMX] Gagged Player Has Disconnected ( %s <%s> )",Nick,Authid)
        remove_task(id)        // Removes the set_task set to ungag the player
        UnGagPlayer(id)        // This is the function that does the actual removal of the gag info
    }
}

//===================================================================================================================
//Sounds
#define SOUNDFILES 2
new soundName[SOUNDFILES][] =
{
    "ambience/thunder_clap.wav",    // For slays and when something is done to someone
    "misc/choke.wav"        // Choking sound
}

enum
{
    thunder,
    choke
}

// End Sounds used

//====================================================================================================================
//Damage Done 0.4 by Manip with additions by jtp10181 & Vittu
public on_damage(id)
{ 
    if ( get_cvar_float("bullet_damage") && id > 0 ) { //stop invalid player id 0
    new attacker = get_user_attacker(id)
#if defined DAMAGE_RECIEVED
    // id should be connected if this message is sent, but lets check anyway
    if ( is_user_connected(id) && is_user_connected(attacker) )
    {
        new damage = read_data(2)

        set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
        ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
#else
    if ( is_user_connected(attacker) )
    {
        new damage = read_data(2)
#endif
        set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
        ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
    }
}
    return PLUGIN_CONTINUE
}

//Admin Revive by SniperBeamer
//==========================================================================================================
public admin_revive(id,level,cid)
    {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    
    new arg[32]
    read_argv(1,arg,31)
    
    if (arg[0]=='@')
        {
        new plist[32],pnum
        get_players(plist,pnum,"e",arg[1])
        if (pnum==0)
            {
            console_print(id,"[AMXX] No clients in such team")
            return PLUGIN_HANDLED
        }
        for (new i=0; i<pnum; i++)
            {
            if (!(get_user_flags(plist[i])&ADMIN_IMMUNITY))
                {
                new ids[3]
                num_to_str(plist[i],ids,2)
                spawn(plist[i])
                set_task(0.1,"revivePl",0,ids,2)
            }
        }
        console_print(id,"[AMXX] Revived the %ss",arg[1])
        if (get_cvar_num("amx_revivemsg"))
            {
            if (equali(arg[1],"CT")) set_hudmessage(0,20,220,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
            else set_hudmessage(220,20,0,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
            show_hudmessage(0,"The %ss have been revived!",arg[1])
        } 
    }
    else
    {
        new pName[32],player = cmd_target(id,arg,3)
        if (!player) return PLUGIN_HANDLED
        new ids[3]
        num_to_str(player,ids,2)
        spawn(player)
        set_task(0.1,"revivePl",0,ids,2)
        get_user_name(player,pName,31)
        console_print(id,"[AMXX] Revived %s",pName)
        if (get_cvar_num("amx_revivemsg"))
            {
            set_hudmessage(0,200,0,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
            show_hudmessage(0,"%s has been revived!",pName)
        } 
    }
    
    return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public revivePl(ids[]) 
    { 
    if(get_cvar_num("amx_revivewithguns") == 1) 
    { 
        new id = str_to_num(ids) 
        spawn(id) 
        if (get_user_team(id)==1) 
        { 
            give_item(id,"weapon_knife") 
            give_item(id,"weapon_glock18") 
            give_item(id,"ammo_9mm") 
            give_item(id,"ammo_9mm") 
        } 
        else 
        { 
            give_item(id,"weapon_knife") 
            give_item(id,"weapon_usp") 
            give_item(id,"ammo_45acp") 
            give_item(id,"ammo_45acp") 
        } 
    } 
    else 
    { 
        new id = str_to_num(ids) 
        spawn(id) 
        give_item(id,"weapon_knife") 
    } 
}



//ADMIN HEAL v0.9.3 by f117bomb
//==================================================================================================
public admin_heal(id,level,cid){
    if (!cmd_access(id,level,cid,3))
        return PLUGIN_HANDLED
    
    new arg[32], arg2[8], name2[32], amount[33]
    read_argv(1,arg,31)
    read_argv(2,arg2,7)
    read_argv(2,amount,32)
    get_user_name(id,name2,31)
    if (arg[0]=='@'){
        new players[32], inum
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"No clients in such team")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a) {
            new user_health = get_user_health(players[a])
            set_user_health(players[a], str_to_num(arg2) + user_health)
        }
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: set life on all %s",name2,arg[1])
                case 1:    client_print(0,print_chat,"[AMXX] ADMIN: set life on all %s",arg[1])
            }
        console_print(id,"[AMXX] All clients have set life")
        log_amx("ADMIN HEAL - this command was issued by %s on all %s",name2,arg[1])
    }
    else {
        new numamount = str_to_num(amount) // Turn the string into a number
        new player = cmd_target(id,arg,7)
        if (!player) return PLUGIN_HANDLED
        new user_health = get_user_health(player)
        set_user_health(player, str_to_num(arg2) + user_health + numamount)
        new name[32]
        get_user_name(player,name,31)
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN, %s, gave %i health points to %s",name2,name,numamount)
                case 1:    client_print(0,print_chat,"[AMXX] ADMIN: set %i health points on %s",numamount,name)
            }
        console_print(id,"[AMXX] Client ^"%s^" has set life",name)
        log_amx("ADMIN HEAL - this command was issued by %s on %s",name2,name)
    }
    return PLUGIN_HANDLED
}

//ADMIN ARMOR v1 by Rav
//=========================================================

public admin_armor(id) {
    if (!(get_user_flags(id)&ADMIN_LEVEL_A)){
        client_print(id,print_console,"[AMXX] You have no access to that command")
        return PLUGIN_HANDLED
    }
    if (read_argc() <2) {
        client_print(id,print_console,"[AMXX] Usage:  amx_armor <part of nick> <amount> ")
        return PLUGIN_HANDLED
    }
    new name[32]
    new amount[33]
    read_argv(1,name,32)
    read_argv(2,amount,32)
    new toarmor = find_player("bl",name)
    if (toarmor)    {
        if (is_user_alive(toarmor)==0)    {
            client_print(id,print_console,"[AMXX] Client ^"%s^" is dead, armor is useless",name)
            return PLUGIN_HANDLED
        }
        if (str_to_num(amount) > 100){
            client_print(id,print_console,"[AMXX] Clients cannot be given more than 100 armor!")
            return PLUGIN_HANDLED
        }
        set_user_armor(toarmor,str_to_num(amount))
        return PLUGIN_HANDLED
    }
    else {
        client_print(id,print_console,"[AMXX] Client with that part of nick not found")
        return PLUGIN_HANDLED
    }
    
    return PLUGIN_CONTINUE
}



//ADMIN NO CLIP v0.9.3 by f117bomb
//=========================================================

public admin_noclip(id,level,cid) { 
    if (!cmd_access(id,level,cid,3)) 
        return PLUGIN_HANDLED 
    new arg[32], arg2[8], name2[32] 
    read_argv(1,arg,31) 
    read_argv(2,arg2,7) 
    get_user_name(id,name2,31) 
    new activity = get_cvar_num("amx_show_activity")
    new bool:l_postRound = false;
    if(str_to_num(arg2) == 2)
    {
    arg2 = "1";
    l_postRound = true;
    } 
    
    if (arg[0]=='@'){ 
        new players[32], inum
        if(!(arg[1]=='a' || arg[1]=='A' || arg[1]=='C' || arg[1]=='c' || arg[1]=='T' || arg[1]=='t'))
            inum = 0
        else
            get_players(players,inum,"")
        if (inum==0){
            console_print(id, "%L", LANG_PLAYER, "AINO_NO_CLIENTS")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a)
        {
            if((arg[1]=='a'
            || arg[1]=='A')
            || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T'
            || arg[1]=='t'))
            || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C'
            || arg[1]=='c')))
            {
            set_user_noclip(players[a],str_to_num(arg2))
            g_NoclipMaster[players[a]] = l_postRound;
            }
            if((arg[1]=='a'
            || arg[1]=='A'))
            {
                if((arg2 = "2"))
                {
                    
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on everyone.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on everyone.")
                    }
                    console_print(id,"[AMXX] Everyone has gained noclip privileges.")
                }
                if((arg2 = "1"))
                {
                    
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on everyone.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on everyone.")
                    }
                    console_print(id,"[AMXX] Everyone has gained noclip privileges.")
                }
                if((arg2 = "0"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, took away noclip from everyone.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN took noclip away from everyone.")
                    }
                    console_print(id,"[AMXX] Everyone has lost noclip privileges.")
                }
            }
            if(arg[1]=='t'
            || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T')))
            {
                if((arg2 = "2"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all Ts.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all Ts.")
                    }
                    console_print(id,"[AMXX] All Ts have gained noclip privileges.")
                }
                if((arg2 = "1"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all Ts.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all Ts.")
                    }
                    console_print(id,"[AMXX] All Ts have gained noclip privileges.")
                }
                if((arg2 = "0"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, took noclip from all Ts.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN took noclip from all Ts.")
                    }
                    console_print(id,"[AMXX] All Ts have lost noclip privileges.")
                }
            }
            if(arg[1]=='c'
            || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C')))
            {
                if((arg2 = "2"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all CTs.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all CTs.")
                    }
                    console_print(id,"[AMXX] All CTs have gained noclip privileges.")
                }
                if((arg2 = "1"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all CTs.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all CTs.")
                    }
                    console_print(id,"[AMXX] All CTs have gained noclip privileges.")
                }
                if((arg2 = "0"))
                {
                    switch(activity)
                    {
                        case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, took noclip from all CTs.",name2)
                        case 1: client_print(0,print_chat,"[AMXX] ADMIN took noclip from all CTs.")
                    }
                    console_print(id,"[AMXX] All CTs have lost noclip privileges.")
                }
            }
        }
        log_amx("ADMIN NOCLIP - this command was issued by %s on all %s",name2,arg[1]) 
    } 
    else
    { 
        new player = cmd_target(id,arg,7) 
        if (!player) return PLUGIN_HANDLED 
        
        set_user_noclip(player,str_to_num(arg2))
        g_NoclipMaster[player] = l_postRound; 
        
        new name[32] 
        get_user_name(player,name,31) 
        if((arg2 = "2"))
        {
            switch(activity)
            {
                case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on %s.",name2,name)
                case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on %s.",name)
            }
            console_print(id,"[AMXX] %s has noclip.",name)
        }
        if((arg2 = "1"))
        {
            switch(activity)
            {
                case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on %s.",name2,name)
                case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on %s.",name)
            }
            console_print(id,"[AMXX] %s has noclip.",name)
        }
        if((arg2 = "0"))
        {
            switch(activity)
            {
                case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, took noclip from %s.",name2,name)
                case 1: client_print(0,print_chat,"[AMXX] ADMIN took noclip from %s.",name)
            }
            console_print(id,"[AMXX] %s no longer has noclip.",name)
        }
        log_amx("ADMIN NOCLIP - this command was issued by %s on %s",name2,name) 
    } 
    return PLUGIN_HANDLED  
}

//ADMIN TELEPORT v0.9.3 by f117bomb
//=========================================================
new storedorigin[3]

public admin_teleport(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32], sx[8], sy[8], sz[8], origin[3], name2[32]
    new argc = read_argc()
    read_argv(1,arg,31)
    get_user_name(id,name2,31)
    if (argc > 2) {
        read_argv(2,sx,7)
        read_argv(3,sy,7)
        read_argv(4,sz,7)
        origin[0] = str_to_num(sx)
        origin[1] = str_to_num(sy)
        origin[2] = str_to_num(sz)
    }
    else {
        origin = storedorigin
    }
    new player = cmd_target(id,arg,7)
    if (!player) return PLUGIN_HANDLED
    set_user_origin(player, origin)
    new name[32]
    get_user_name(player,name,31)
    switch(get_cvar_num("amx_show_activity"))    {
        case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: teleported %s",name2,name)
        case 1:    client_print(0,print_chat,"[AMXX] ADMIN: teleported %s",name)
    }
    console_print(id,"[AMXX] Client ^"%s^" has been teleported to x:%i y:%i z%i",name,origin[0],origin[1],origin[2])
    log_amx("ADMIN TELEPORT - this command was issued by %s on %s",name2,name)
    return PLUGIN_HANDLED
}

public admin_userorigin(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32], origin[3]
    read_argv(1,arg,31)
    new player = cmd_target(id,arg,3)
    if (!player) return PLUGIN_HANDLED
    get_user_origin(player, origin)
    storedorigin = origin
    new name[32]
    get_user_name(player,name,31)
    console_print(id,"[AMXX] Client ^"%s^" origin, x:%i y:%i z%i stored",name,origin[0],origin[1],origin[2])
    return PLUGIN_HANDLED
}

//ADMIN STACK v0.9.3 by f117bomb
//=========================================================

public admin_stack(id,level,cid){ 
    if (!cmd_access(id,level,cid,2)) 
        return PLUGIN_HANDLED 
    
    new arg[32], name2[32] 
    read_argv(1,arg,31) 
    get_user_name(id,name2,31) 
    new player = cmd_target(id,arg,7) 
    if (!player) return PLUGIN_HANDLED 
    
    new sttype[2], name[32], origin[3], inum, players[32] 
    read_argv(2,sttype,1) 
    get_user_origin(player, origin)  
    get_players(players,inum,"a") 
    
    new offsety = 36, offsetz = 96 
    switch( str_to_num(sttype) ){ 
        case 0: offsety = 0 
        case 1: offsetz = 0 
    } 
    
    for(new a=0 ;a<inum ; ++a) { 
        if ((players[a]==player) || (get_user_flags(players[a])&ADMIN_IMMUNITY) ) 
            continue 
        origin[2] += offsetz 
        origin[1] += offsety 
        set_user_origin(players[a], origin) 
    } 
    
    get_user_name(player,name,32)
    switch(get_cvar_num("amx_show_activity"))    {
        case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: stacked all players on %s",name2,name)
        case 1:    client_print(0,print_chat,"[AMXX] ADMIN: stacked all players on %s",name)
    } 
    console_print(id,"[AMXX] Client ^"%s^" has had all players stacked on top of him",name)
    log_amx("ADMIN STACK - this command was issued by %s and stacked all players on %s",name2,name) 
    return PLUGIN_HANDLED  
}

//ADMIN MONEY 1.0 by XxAvalanchexX
//=========================================================
 public cmd_givemoney(id,level,cid)
 {
    // no access
    if(!cmd_access(id,level,cid,3))
        return PLUGIN_HANDLED;

    // grab arguments
    new arg[32], arg2[32];
    read_argv(1,arg,32);
    read_argv(2,arg2,31);

    // get player and validate
    new player = cmd_target(id,arg,2);
    if(!player) return PLUGIN_HANDLED;

    // get money and set it
    new amount = str_to_num(arg2);
    cs_set_user_money(player,cs_get_user_money(player)+amount);

    // get names
    new playerName[32], adminName[32];
    get_user_name(player,playerName,31);
    get_user_name(id,adminName,31);

    // get authids for log
    new playerAuthid[32], adminAuthid[32];
    get_user_authid(player,playerAuthid,31);
    get_user_authid(id,adminAuthid,31);

    log_amx("Give Money: ^"%s<%d><%s><>^" gave ^"%s<%d><%s><>^" $%i",adminName,get_user_userid(id),adminAuthid,playerName,get_user_userid(player),playerAuthid,amount);

    switch(get_cvar_num("amx_show_activity"))
    {
        case 2: client_print(0,print_chat,"ADMIN %s: give %s $%i",adminName,playerName,amount);
        case 1: client_print(0,print_chat,"ADMIN: give %s $%i",playerName,amount);
    }

    console_print(id,"* Gave %s $%i",playerName,amount);

    return PLUGIN_HANDLED;
 }

//ADMIN ALLTALK v1.0 by BigBaller
//=========================================================

public admin_alltalk(id,level){
    if (!(get_user_flags(id)&level)){
        console_print(id,"[AMXX] You have no access to that command.")
        return PLUGIN_HANDLED
    }
    if (read_argc() < 2){
        new alltalk_cvar = get_cvar_num("sv_alltalk")
        console_print(id,"[AMXX] ^"sv_alltalk^" is ^"%i^"",alltalk_cvar)
        return PLUGIN_HANDLED
    }
    new alltalk[6]
    read_argv(1,alltalk,6)
    server_cmd("sv_alltalk %s",alltalk)
    new name[32]
    get_user_name(id,name,31)
    switch(get_cvar_num("amx_show_activity")){
        case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: set sv_alltalk to %s",name,alltalk)
        case 1:    client_print(0,print_chat,"[AMXX] ADMIN: set sv_alltalk to %s",alltalk)
    }
    log_amx("ADMIN ALLTALK - this command was issued by %s. Admin set sv_alltalk to %s",name,alltalk)
    return PLUGIN_HANDLED
}

// Admin Llama 1.4 by SniperBeamer
//===============================================================================
new llama_msg[MESSAGES][] = {
    "Ooorgle!",
    "Bleeeat!",
    "Brawwrr!",
    "Muuuuuh!"
}
new llama_sound[MESSAGES][] = {
    "misc/ooorgle.wav",
    "misc/bleeeat.wav",
    "misc/brawwrr.wav",
    "misc/cow.wav"
}
new bool:ids[33]
new pName[33][32]
//----------------------------------------------------------------------------------------------
public llama(id,level,cid)
    {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    
    new arg[32]
    read_argv(1,arg,31)
    
    if (arg[0]=='@'){
        new plist[32],pnum
        get_players(plist,pnum,"e",arg[1])
        if (pnum==0){
            console_print(id,"No clients in such team")
            return PLUGIN_HANDLED
        }
        for (new i=0; i<pnum; i++){
            if (!(get_user_flags(plist[i])&ADMIN_IMMUNITY)&&!ids[plist[i]])
                {
                get_user_name(plist[i],pName[plist[i]],31)
                ids[plist[i]] = true
                client_cmd(plist[i],"name Llama")
            }
        }
        console_print(id,"[AMXX] You Llamed %s",arg[1])
    }
    else{
        new target = cmd_target(id,arg,3)
        if (!target || ids[target]) return PLUGIN_HANDLED
        ids[target] = true
        get_user_name(target,pName[target],31)
        console_print(id,"[AMXX] You Llamed %s",pName[target])
        client_cmd(target,"name Llama")
    }
    
    return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public unllama(id,level,cid)
    {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    
    new arg[32]
    read_argv(1,arg,31)
    
    if (arg[0]=='@'){
        new plist[32],pnum
        get_players(plist,pnum,"e",arg[1])
        if (pnum==0){
            console_print(id,"No clients in such team")
            return PLUGIN_HANDLED
        }
        for (new i=0; i<pnum; i++){
            if (!(get_user_flags(plist[i])&ADMIN_IMMUNITY)&&ids[plist[i]])
                {
                ids[plist[i]] = false
                client_cmd(ids[plist[i]],"name %s",pName[plist[i]])
            }
        }
        console_print(id,"[AMXX] You un-Llamed %s",arg[1])
    }
    else{
        new target = cmd_target(id,arg,3)
        if (!target || !ids[target]) return PLUGIN_HANDLED
        ids[target] = false
        client_cmd(target,"name %s",pName[target])
        console_print(id,"[AMXX] un-Llamed %s",pName[target])
    }
    
    return PLUGIN_HANDLED
}
public check_say(id)
{
    if (!ids[id]) return PLUGIN_CONTINUE
    
    new said[32]
    read_args(said,31)
    remove_quotes(said)
    for (new i=0; i<MESSAGES; i++)
        if(equal(said,llama_msg[i]))
        return PLUGIN_CONTINUE
    
    new ran = random_num(0,MESSAGES-1)
    client_cmd(id,"say %s",llama_msg[ran])
    if (get_cvar_num("amx_llamasound")) client_cmd(id,"spk %s",llama_sound[ran])
    
    return PLUGIN_HANDLED
}

//----------------------------------------------------------------------------------------------
#define Maxsounds 27
new soundlist[Maxsounds][] = {"Half-Life01","Half-Life02","Half-Life03","Half-Life04","Half-Life05","Half-Life06","Half-Life07","Half-Life08","Half-Life09","Half-Life10","Half-Life11","Half-Life12","Half-Life13","Half-Life14","Half-Life15","Half-Life16","Half-Life17","Prospero01","Prospero02","Prospero03","Prospero04","Prospero05","Suspense01","Suspense02","Suspense03","Suspense05","Suspense07"}
public client_connect(id)
    {
    
    g_GodMaster[id] = false
    g_NoclipMaster[id] = false
    
    if(get_cvar_num("amx_loadsong") == 0)
    return PLUGIN_HANDLED
    ids[id] = false
    new i
    i = random_num(0,Maxsounds-1)
    client_cmd(id,"mp3 play media/%s",soundlist[i])
    g_Players[id] = -1

    if(!(is_user_bot(id)) ){ 
        message_begin( MSG_ALL, gmsg_TeamInfo) 
        write_byte(id) 
        write_string(SpecName) 
        message_end() 
    } 
    return PLUGIN_CONTINUE 
}

//ADMIN GAG 1.8.3 ( 23.02.2005 ) by EKS
//========================================================================================================================================
public block_gagged(id){  // This function is what check the say / team_say messages & block them if the client is blocked.
    if(!g_GagPlayers[id]) return PLUGIN_CONTINUE // Is true if the client is NOT blocked.
    new cmd[5] 
    read_argv(0,cmd,4) 
    if ( cmd[3] == '_' )
        { 
        if (g_GagPlayers[id] & 2){ 
#if GagReason == 1
            client_print(id,print_chat,"* You are Gagged For The Following Reason: %s",gs_GagReason[id]) 
#else
            client_print(id,print_chat,"* You Have Been Gagged") 
#endif

#if PlaySound == 1
            client_cmd(id,"spk barney/youtalkmuch")
#endif
            return PLUGIN_HANDLED 
            } 
        } 
    else if (g_GagPlayers[id] & 1)   { 
#if GagReason == 1
            client_print(id,print_chat,"* You Are Gagged For The Following Reason: %s",gs_GagReason[id]) 
#else
            client_print(id,print_chat,"* You Have Been Gagged") 
#endif
#if PlaySound == 1
            client_cmd(id,"spk barney/youtalkmuch")
#endif
        return PLUGIN_HANDLED 
        } 
    return PLUGIN_CONTINUE 
    } 
public CMD_GagPlayer(id,level,cid) 
{ 
    if(!cmd_access (id,level,cid,1)) return PLUGIN_HANDLED
    new arg[32],VictimID
    
    read_argv(1,arg,31)              // Arg contains Targets nick or Userid
    VictimID = cmd_target(id,arg,8)        // This code here tryes to find out the player index. Either from a nick or #userid
    if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv
    new s_Flags[4],VictimName[32],AdminName[32],flags,ShowFlags[32],CountFlags,s_GagTime[8],Float:f_GagTime

    read_argv(2,arg,31) 
    if (!arg[0]) // This means amx_gag <nick / userid> and no other flag or time was used.
    {
        f_GagTime = DefaultGagTime
        format(s_Flags,7,"abc")
    }
    else
    {
        if(contain(arg,"m")!=-1 && contain(arg,"!")==-1) // This means the time was entered in minuts and not seconds
        {
            copyc(s_GagTime,7,arg, 'm')
            f_GagTime = floatstr(s_GagTime) * 60
        }
        else if(isdigit(arg[0])&& contain(arg,"!")==-1) // The value was entered in seconds
        {
            format(s_GagTime,7,arg)
            f_GagTime = floatstr(s_GagTime)
        }
        read_argv(3,arg,8)
        if (!arg[0])    // No flag has been entered
            format(s_Flags,7,"abc")
        else if(contain(arg,"!")==-1)        // This means that arg did NOT contain the ! symbot
            format(s_Flags,7,arg)
        else if(contain(arg,"!")!=-1)        // This means that arg did DOES contain the ! symbot
            format(s_Flags,7,"abc")
        if (f_GagTime == 0.0)
        {
            read_argv(2,arg,8)
            if(contain(arg,"!")!=-1)
                format(s_Flags,3,"abc") // Flag was entered.
            else
                format(s_Flags,3,arg) // Flag was entered.
            f_GagTime = DefaultGagTime
        }
#if GagReason == 1
        new GagReasonFound=0
        for(new i=2;i<=4;i++)
        {
            read_argv(i,arg,31)
            if(contain(arg,"!")!=-1)
            {    
                read_args(arg,31)
                new tmp[32]
                copyc(tmp,32,arg,33)
                copy(gs_GagReason[VictimID],47,arg[strlen(tmp)+1])
                GagReasonFound = 1
            }
        }
        if(GagReasonFound == 0)    // If no reason was entered, add the std reason.
            format(gs_GagReason[VictimID],47,"You Were Gagged For Not Following The Rules")
#endif
    }

    flags = read_flags(s_Flags) // Converts the string flags ( a,b or c ) into a int
    g_GagPlayers[VictimID] = flags 
#if VoiceCommMute == 1
    if(flags & 4) // This code checks if the c flag was used ( reprisented by the number 4 ), If pressent it mutes his voicecomm.
        set_speak(VictimID, SPEAK_MUTED)
#endif
    new TaskParm[1]        // For some reason set_task requires a array. So i make a array :)
    TaskParm[0] = VictimID
    set_task( f_GagTime,"task_UnGagPlayer",VictimID,TaskParm,1) 

    CountFlags = 0
    if (flags & 1)
    {
        format(ShowFlags,31,"say")
        CountFlags++
    }
    if (flags & 2)
    {
        if(CountFlags)
            format(ShowFlags,31,"%s / say_team",ShowFlags)
        if(!CountFlags)
            format(ShowFlags,31,"say_team")
    }
#if VoiceCommMute != 0
    if(flags & 4)
    {
        if(CountFlags)
            format(ShowFlags,31,"%s / voicecomm",ShowFlags)
        if(!CountFlags)
            format(ShowFlags,31,"voicecomm")        
    }
#endif
    get_user_name(id,AdminName,31)
    get_user_name(VictimID,VictimName,31)
    switch(get_cvar_num("amx_show_activity"))   
    { 
#if GagReason == 1
        case 2:   client_print(0,print_chat,"ADMIN %s: Has Gagged %s From Speaking For %0.0f Minutes, For: %s ( %s )",AdminName,VictimName,(f_GagTime / 60),gs_GagReason[VictimID],ShowFlags) // debug added
           case 1:   client_print(0,print_chat,"ADMIN: Has Gagged %s From Speaking For %0.0f Minutes, For: %s ( %s )",VictimName,(f_GagTime / 60),gs_GagReason[VictimID],ShowFlags) 
#else
        case 2:   client_print(0,print_chat,"ADMIN %s: Has Gagged %s From Speaking For %0.0f Minutes ( %s )",AdminName,VictimName,(f_GagTime / 60),ShowFlags) // debug added
           case 1:   client_print(0,print_chat,"ADMIN: Has Gagged %s From Speaking For %0.0f Minutes ( %s )",VictimName,(f_GagTime / 60),ShowFlags) 
#endif
     
     }    
#if LogAdminActions == 1
    new parm[5] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a gag or Ungag | 3 = The gag flags | 4  = Length of the gag */
    parm[0] = VictimID
    parm[1] = id
    parm[2] = 0
    parm[3] = flags
    parm[4] = floatround(Float:f_GagTime)
    LogAdminAction(parm)
#endif
    return PLUGIN_HANDLED
} 

public CMD_UnGagPlayer(id,level,cid)   /// Removed gagged player ( done via console command )
{
    new arg[32],VictimID
    read_argv(1,arg,31)              // Arg contains Targets nick
    
    VictimID = cmd_target(id,arg,8)        // This code here tryes to find out the player index. Either from a nick or #userid
    if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv

    new AdminName[32],VictimName[32] 

    get_user_name(id,AdminName,31)        // Gets Admin name
    get_user_name(VictimID,VictimName,31)

    if(!g_GagPlayers[VictimID])        // Checks if player has gagged flag
    {
        console_print(id,"%s Is Not Gagged & Cannot Be Ungagged.",arg)
        return PLUGIN_HANDLED
    }
    switch(get_cvar_num("amx_show_activity"))   
    { 
           case 2:   client_print(0,print_chat,"ADMIN %s: Has Ungagged %s",AdminName,VictimName) 
           case 1:   client_print(0,print_chat,"ADMIN: Has Ungagged %s",VictimName) 
      }

#if LogAdminActions == 1
    new parm[3] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a gag or Ungag | 3 = The gag flags | 4  = Length of the gag */
    parm[0] = VictimID
    parm[1] = id
    parm[2] = 1
    LogAdminAction(parm)
#endif
    remove_task(VictimID)        // Removes the set_task set to ungag the player
    UnGagPlayer(VictimID)        // This is the function that does the actual removal of the gag info
    return PLUGIN_HANDLED
} 

#if BlockNameChange == 1
public client_infochanged(id)
{
    if(g_GagPlayers[id])
    {
        new newname[32], oldname[32]
        get_user_info(id, "name", newname,31)
        get_user_name(id,oldname,31)
    
        if (!equal(oldname,newname))
        {
            client_print(id,print_chat,"* Gagged Clients Cannot Change Their Name")
            set_user_info(id,"name",oldname)
        }
    }
}
#endif
public task_UnGagPlayer(TaskParm[])    // This function is called when the task expires
{
    new VictimName[32]
    get_user_name(TaskParm[0],VictimName,31)
    client_print(0,print_chat,"ADMIN: %s Is No Longer Gagged",VictimName)
    UnGagPlayer(TaskParm[0])
}
#if LogAdminActions == 1
stock LogAdminAction(parm[]) // This code is what logs the admin actions.
{ 
    new VictimName[32],AdminName[32],AdminAuth[35],VictimAuth[35]
    get_user_name(parm[1],AdminName,31)
    get_user_name(parm[0],VictimName,31)
    get_user_authid(parm[1],AdminAuth,34)
    get_user_authid(parm[0],VictimAuth,34)

#if GagReason == 1
    if(parm[2] == 0)
        log_amx("Gag: ^"%s<%s>^" Has Gagged %s <%s> for %d ( %d ) Reason: %s",AdminName,AdminAuth,VictimName,VictimAuth,parm[4],parm[3],gs_GagReason[parm[0]])
#else
    if(parm[2] == 0)
        log_amx("Gag: ^"%s<%s>^" Has Gagged %s <%s> for %d ( %d )",AdminName,AdminAuth,VictimName,VictimAuth,parm[4],parm[3])
#endif
    if(parm[2] == 1)
        log_amx("UnGag: ^"%s<%s>^" Has Ungagged %s<%s>",AdminName,AdminAuth,VictimName,VictimAuth)
}
#endif
stock UnGagPlayer(id) // This code is what removes the gag.
{ 
#if VoiceCommMute == 1
    if(g_GagPlayers[id] & 4)    // Unmutes the player if he had voicecomm muted.
    {
        if(get_cvar_num("sv_alltalk") == 1)
            set_speak(id, SPEAK_ALL)
        else 
            set_speak(id, SPEAK_NORMAL)
    }
#endif
    g_GagPlayers[id] = 0
#if GagReason == 1
    setc(gs_GagReason[id],31,0)
#endif
}
#if AllowOtherPlugin2Interface == 1
public func_AddGag(id)
{
    g_GagPlayers[id] = 7 
    new TaskParm[1]        // For some reason set_task requires a array. So i make a array :)
    TaskParm[0] = id
#if VoiceCommMute == 1
    set_speak(id, SPEAK_MUTED)
#endif
    set_task( DefaultGagTime,"task_UnGagPlayer",id,TaskParm,1)
}

public func_RemoveGag(id)
{
    remove_task(id)        // Removes the set_task set to ungag the player
    UnGagPlayer(id)
}
#endif


//ADMIN GRAVITY v0.2 by JustinHoMi
//============================================================================================================================================

public admin_gravity(id,level){
    if (!(get_user_flags(id)&level)){
        console_print(id,"[AMXX] You have no access to that command.")
        return PLUGIN_HANDLED
    }
    if (read_argc() < 2){
        new gravity_cvar = get_cvar_num("sv_gravity")
        console_print(id,"[AMXX] ^"sv_gravity^" is ^"%i^"",gravity_cvar)
        return PLUGIN_HANDLED
    }
    new gravity[6]
    read_argv(1,gravity,6)
    server_cmd("sv_gravity %s",gravity)
    new name[32]
    get_user_name(id,name,31)
    switch(get_cvar_num("amx_show_activity")){
        case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: set gravity to %s",name,gravity)
        case 1:    client_print(0,print_chat,"[AMXX] ADMIN: set gravity to %s",gravity)
    }
    console_print(id,"[AMXX] Gravity has been set to %s",gravity)
    log_amx("ADMIN GRAVITY - this command was issued by %s. Admin set sv_gravity to %s",name,gravity)
    return PLUGIN_HANDLED
}

public check_gravity(id){
    new gravity = get_cvar_num("sv_gravity")
    client_print(id,print_chat,"[AMXX] The gravity is set at %i",gravity)
    return PLUGIN_HANDLED
}


//ADMIN GLOW v1.3.3 ( 3.11.2004 ) by EKS
//=================================================================================================================================

public CMD_Glow(id,level,cid) // This is the funtion called by amx_glow
{ 
    new  VictimName[32],VictimID
    read_argv(1,VictimName,31)              // This code here reads out the targed.
    VictimID = cmd_target(7,VictimName,32)        // This code here tryes to find out the player index. Either from a nick or #userid
    if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv
    new AdminName[32],Color[12]        // There is no point in starting to make arrays thats not needed, if the above if is true.
    new ColorNR = -1            // This int is made with the value -1 so it can easly be used to check if a valid color has been found & later be used to log what color the admin used.
    read_argv(2,Color,11)
    for(new i = 0;i<MaxColorCount;i++) // This loop is used to check every entry in g_ColorNames
        {
        if (equal(Color,g_ColorNames[i],11))
            {
#if WhatModule == 2
            set_user_rendering(VictimID,kRenderFxGlowShell,g_ColorR[i],g_ColorG[i],g_ColorB[i],kRenderNormal,25)
#else            
            set_rendering(VictimID,kRenderFxGlowShell,g_ColorR[i],g_ColorG[i],g_ColorB[i],kRenderNormal,25)
#endif
            ColorNR = i
            g_Players[VictimID] = i
            }
        }
    if(ColorNR == -1) // If no vaild color has been found, tell the admin and stop the plugin.
        {
        new ColorList[128]
        for(new i = 0;i<MaxColorCount;i++)
            {
            add(ColorList,127,g_ColorNames[i])
            add(ColorList,127," ")    // This is a evil hack, to add spaces.
            }
        console_print(id,"[AMX] %s is not a supported color,vaild colors are:%s",Color,ColorList)
        return PLUGIN_HANDLED
        }
    get_user_name(id,AdminName,31)
    get_user_name(VictimID,VictimName,31)
    switch(get_cvar_num("amx_show_activity"))   { 
           case 2:   client_print(0,print_chat,"ADMIN %s: has made %s glow %s",AdminName,VictimName,g_ColorNames[ColorNR])
           case 1:   client_print(0,print_chat,"ADMIN: %s is now glowing %s",VictimName,g_ColorNames[ColorNR])
           }
#if LogAdminActions == 1
    new parm[4] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a glow or Unglow */
    parm[0] = VictimID
    parm[1] = id
    parm[2] = 0
    parm[3] = ColorNR
    LogAdminAction2(parm)
#endif
    return PLUGIN_HANDLED
} 

public CMD_UnGlow(id,level,cid)  // Removed gaged player ( done via console command )
{
    new VictimName[32],AdminName[32],VictimID 
    read_argv(1,VictimName,31)             // This code here reads out the targed.
    VictimID = cmd_target(7,VictimName,32)     // This code here tryes to find out the player index. Either from a nick or #userid
    if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) || !VictimID ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv

    get_user_name(id,AdminName,31)
    get_user_name(VictimID,VictimName,31)
    if(g_Players[VictimID] == -1)
        {
        console_print(id,"[AMX] %s is not glowing in any color",VictimName)
        return PLUGIN_HANDLED
        }
#if WhatModule == 2
    set_user_rendering(VictimID,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
#else
    set_rendering(VictimID,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
#endif
    switch(get_cvar_num("amx_show_activity"))   { 
           case 2:   client_print(0,print_chat,"ADMIN %s: made %s stop glowing %s",AdminName,VictimName,g_ColorNames[g_Players[VictimID]]) 
           case 1:   client_print(0,print_chat,"ADMIN: %s is no longer glowing %s",VictimName,g_ColorNames[g_Players[VictimID]]) 
           }
    g_Players[VictimID] = -1
#if LogAdminActions == 1
    new parm[4] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a glow or Unglow */
    parm[0] = VictimID
    parm[1] = id
    parm[2] = 1
    LogAdminAction2(parm)
#endif
    return PLUGIN_HANDLED 
} 

#if LogAdminActions == 1
LogAdminAction2(parm[]) // This code is what removes the glow.
{ 
    new VictimName[32],AdminName[32],AdminAuth[35],VictimAuth[35]
    get_user_name(parm[1],AdminName,31)
    get_user_name(parm[0],VictimName,31)
    get_user_authid(parm[1],AdminAuth,34)
    get_user_authid(parm[0],VictimAuth,34)

    if(parm[2] == 0)
        log_amx("Glow: ^"%s<%s>^" has made %s <%s> glow %s",AdminName,AdminAuth,VictimName,VictimAuth,g_ColorNames[parm[3]])
    if(parm[2] == 1)
        log_amx("UnGlow: ^"%s<%s>^" has removed the glow from %s<%s>",AdminName,AdminAuth,VictimName,VictimAuth)
}
#endif


//ADMIN BURY v0.9.3 by f117bomb
//=============================================================================================================

bury_player(id,victim){
    new name[32], iwpns[32], nwpn[32], iwpn
    get_user_name(victim,name,31)
    get_user_weapons(victim,iwpns,iwpn)
    for(new a=0;a<iwpn;++a) {
        get_weaponname(iwpns[a],nwpn,31)
        engclient_cmd(victim,"drop",nwpn)
    }
    engclient_cmd(victim,"weapon_knife")
    new origin[3]
    get_user_origin(victim, origin)
    origin[2] -=    30
    set_user_origin(victim, origin)
    console_print(id,"[AMXX] Client ^"%s^" has been burried",name)
}


public admin_bury(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32], admin_name[32], player_name[32]
    read_argv(1,arg,31)
    get_user_name(id,admin_name,31)
    if (arg[0]=='@'){
        new players[32], inum
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No clients in such team")
            return    PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a){
            if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                get_user_name(players[a],player_name,31)
                console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",player_name)
                continue
            }
            bury_player(id,players[a])
        }
        switch(get_cvar_num("amx_show_activity")) {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: has buried    all %s",admin_name,arg[1])
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: has buried all %s",arg[1])
        }
        log_amx("ADMIN BURY - this command was issued by %s. Admin buried all of the %s",admin_name,arg[1])
    }
    else    {
        new player = cmd_target(id,arg,7)
        if (!player) return PLUGIN_HANDLED
        bury_player(id,player)
        get_user_name(player,player_name,31)
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: has buried    %s",admin_name,player_name)
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: has buried %s",player_name)
        }
        log_amx("ADMIN BURY - this command was issued by %s. Admin has buried %s",admin_name,player_name)
    }
    return PLUGIN_HANDLED
}

unbury_player(id,victim){
    new name[32], origin[3]
    get_user_name(victim,name,31)
    get_user_origin(victim, origin)
    origin[2] +=    35
    set_user_origin(victim, origin)
    console_print(id,"[AMXX] Client ^"%s^" has been unburried",name)
}

public admin_unbury(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32],    player_name[32], name2[32]
    read_argv(1,arg,31)
    get_user_name(id,name2,31)
    if (arg[0]=='@'){
        new players[32], inum , name[32]
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No clients in such team")
            return    PLUGIN_HANDLED
        }
        for(new    a=0;a<inum;++a){
            if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                get_user_name(players[a],name,31)
                console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",name)
                continue
            }
            unbury_player(id,players[a])
        }
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: has unburied all %s",name2,arg[1])
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: has unburied all %s",arg[1])
        }
        log_amx("ADMIN BURY - this command was issued by %s. Admin has buried %s",name2,arg[1])
    }
    else    {
        new player = cmd_target(id,arg,7)
        if (!player) return PLUGIN_HANDLED
        unbury_player(id,player)
        get_user_name(player,player_name,31)
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: has unburied %s",name2,player_name)
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: has unburied %s",player_name)
        }
        log_amx("ADMIN UNBURY - this command was issued by %s. Admin has unburied %s",name2,player_name)
    }
    return PLUGIN_HANDLED
}

//ADMIN DISARM v1.1 by mike_cao
//============================================================================================================================

disarm_player(id,victim){
    
    new name[32], origin[3], name2[32]
    get_user_origin(victim,origin)
    origin[2] -= 2000
    set_user_origin(victim,origin)
    new iweapons[32], wpname[32], inum
    get_user_weapons(victim,iweapons,inum)
    for(new a=0;a<inum;++a){
        get_weaponname(iweapons[a],wpname,31)
        engclient_cmd(victim,"drop",wpname)
    }
    engclient_cmd(victim,"weapon_knife")
    origin[2] += 2005
    set_user_origin(victim,origin)
    get_user_name(victim,name,31)
    console_print(id,"[AMXX] Client ^"%s^" has been disarmed",name)
    get_user_name(id,name2,31)
    log_amx("ADMIN DISARM - this command was issued by %s. Admin has disarmed %s",name2,name)
}

public admin_disarm(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32]
    read_argv(1,arg,31)
    if (arg[0]=='@'){
        new players[32], /*name[32],*/ inum
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No alive clients in such team")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a){
            disarm_player(id,players[a])
        }
    }
    else {
        new player = cmd_target(id,arg,5)
        if (!player) return PLUGIN_HANDLED
        disarm_player(id,player)
    }
    return PLUGIN_HANDLED
}

//AMX UBER SLAP v0.9.3 by BarMan (Skullz.NET)
//=================================================================================================================

public admin_slap(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    
    new name[32], name2[32]
    new arg[32]
    read_argv(1,arg,31)
    new player = cmd_target(id,arg,5)
    if (!player)
        return PLUGIN_HANDLED
    
    new ids[2]
    ids[0] = player
    get_user_name(player,name,32)
    udisarm_player(id,player)
    set_task(0.1, "slap_player", 0, ids, 1, "a", 100)
    set_task(11.5, "last_words", 0, ids, 1, "a", 0)
    get_user_name(id,name2,31)
    log_amx("ADMIN UBERSLAP - this command was issued by %s. Admin has uberslapped %s",name2,name)
    return PLUGIN_HANDLED
}

public udisarm_player(id,victim){
    new name[32], origin[3]
    get_user_origin(victim,origin)
    origin[2] -= 2000
    set_user_origin(victim,origin)
    new iweapons[32], wpname[32], inum
    get_user_weapons(victim,iweapons,inum)
    for(new a=0;a<inum;++a){
        get_weaponname(iweapons[a],wpname,31)
        engclient_cmd(victim,"drop",wpname)
    }
    engclient_cmd(victim,"weapon_knife")
    origin[2] += 2005
    set_user_origin(victim,origin)
    get_user_name(victim,name,31)
    return PLUGIN_CONTINUE
}

public last_words(ids[]) {
    client_cmd(0,"spk misc/knockedout")
    return PLUGIN_HANDLED
}

public slap_player(ids[]) {
    new id = ids[0]
    new upower = 1,nopower= 0
    if (get_user_health(id) > 1){
        user_slap(id,upower)
        } else {
        user_slap(id,nopower)
    }
    return PLUGIN_CONTINUE
}

//ADMIN SLAY 2 v0.9.3 by f117bomb
//====================================================================================================================

new light, s2smoke, s2white

slay_player(id,victim,type) {
    new origin[3], srco[3], name[32], name2[32]
    get_user_name(victim,name,31)
    get_user_name(id,name2,31)
    get_user_origin(victim,origin)
    origin[2] -= 26
    srco[0]=origin[0]+150
    srco[1]=origin[1]+150
    srco[2]=origin[2]+400
    switch(type){
        case 1:{
            lightning(srco,origin)
            emit_sound(victim,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 2:{
            blood(origin)
            emit_sound(victim,CHAN_ITEM, "weapons/headshot2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 3:    explode(origin)
    }
    user_kill(victim,1)
    console_print(id,"[AMXX] Client ^"%s^" has been slayed",name)
    log_amx("ADMIN SLAY 2 - this command was issued by %s. Admin has slayed %s",name2,name)
}

public admin_slay(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32], arg2[3], type
    read_argv(1,arg,31)
    read_argv(2,arg2,2)
    type = str_to_num(arg2)
    if (arg[0]=='@'){
        new players[32], inum , name[32]
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No clients in such team")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a){
            if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                get_user_name(players[a],name,31)
                console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",name)
                continue
            }
            slay_player(id,players[a],type)
        }
    }
    else {
        new player = cmd_target(id,arg,5)
        if (!player) return PLUGIN_HANDLED
        slay_player(id,player,type)
    }
    return PLUGIN_HANDLED
}

explode(vec1[3]) {
    // blast circles
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
    write_byte( 21 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2] + 16)
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2] + 1936)
    write_short( s2white )
    write_byte( 0 ) // startframe
    write_byte( 0 ) // framerate
    write_byte( 2 ) // life
    write_byte( 16 ) // width
    write_byte( 0 ) // noise
    write_byte( 188 ) // r
    write_byte( 220 ) // g
    write_byte( 255 ) // b
    write_byte( 255 ) //brightness
    write_byte( 0 ) // speed
    message_end()
    //Explosion2
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte( 12 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_byte( 188 ) // byte (scale in 0.1's)
    write_byte( 10 ) // byte (framerate)
    message_end()
    //s2smoke
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
    write_byte( 5 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_short( s2smoke )
    write_byte( 2 )
    write_byte( 10 )
    message_end()
}

blood(vec1[3]) {
    //LAVASPLASH
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte( 10 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2])
    message_end()
}

lightning(vec1[3],vec2[3]) {
    //Lightning
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte( 0 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_coord(vec2[0])
    write_coord(vec2[1])
    write_coord(vec2[2])
    write_short( light )
    write_byte( 1 ) // framestart
    write_byte( 5 ) // framerate
    write_byte( 2 ) // life
    write_byte( 20 ) // width
    write_byte( 30 ) // noise
    write_byte( 200 ) // r, g, b
    write_byte( 200 ) // r, g, b
    write_byte( 200 ) // r, g, b
    write_byte( 200 ) // brightness
    write_byte( 200 ) // speed
    message_end()
    //Sparks
    message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
    write_byte( 9 )
    write_coord( vec2[0] )
    write_coord( vec2[1] )
    write_coord( vec2[2] )
    message_end()
    //s2smoke
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
    write_byte( 5 )
    write_coord(vec2[0])
    write_coord(vec2[1])
    write_coord(vec2[2])
    write_short( s2smoke )
    write_byte( 10 )
    write_byte( 10 )
    message_end()
}

//ADMIN FIRE v1.0.0 by f117bomb
//=========================================================
new gmsgDamage,smoke,mflash
new onfire[33]

public ignite_effects(skIndex[])   {
    new kIndex = skIndex[0]
    gmsgDamage = get_user_msgid("Damage")
    
    if (is_user_alive(kIndex) && onfire[kIndex] )    {
        new korigin[3] 
        get_user_origin(kIndex,korigin)
                
        //TE_SPRITE - additive sprite, plays 1 cycle
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY) 
        write_byte( 17 ) 
        write_coord(korigin[0])  // coord, coord, coord (position) 
        write_coord(korigin[1])  
        write_coord(korigin[2]) 
        write_short( mflash ) // short (sprite index) 
        write_byte( 20 ) // byte (scale in 0.1's)  
        write_byte( 200 ) // byte (brightness)
        message_end()
        
        //Smoke
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY,korigin)
        write_byte( 5 )
        write_coord(korigin[0])// coord coord coord (position) 
        write_coord(korigin[1])
        write_coord(korigin[2])
        write_short( smoke )// short (sprite index)
        write_byte( 20 ) // byte (scale in 0.1's)
        write_byte( 15 ) // byte (framerate)
        message_end()
        
        set_task(0.2, "ignite_effects" , 0 , skIndex, 2)        
    }    
    else    {
        if( onfire[kIndex] )   {
            emit_sound(kIndex,CHAN_AUTO, "scientist/scream21.wav", 0.6, ATTN_NORM, 0, PITCH_HIGH)
            onfire[kIndex] = 0
        }
    }    
    return PLUGIN_CONTINUE
}

public ignite_player(skIndex[])   {
    new kIndex = skIndex[0]
        
    if (is_user_alive(kIndex) && onfire[kIndex] )    {
        new korigin[3] 
        new players[32], inum = 0
        new pOrigin[3]        
        new kHeath = get_user_health(kIndex)
        get_user_origin(kIndex,korigin)
        
        //create some damage
        set_user_health(kIndex,kHeath - 10)
        message_begin(MSG_ONE, gmsgDamage, {0,0,0}, kIndex) 
        write_byte(30) // dmg_save
        write_byte(30) // dmg_take 
        write_long(1<<21) // visibleDamageBits 
        write_coord(korigin[0]) // damageOrigin.x 
        write_coord(korigin[1]) // damageOrigin.y
        write_coord(korigin[2]) // damageOrigin.z 
        message_end()
                
        //create some sound
        emit_sound(kIndex,CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM)
                
        //Ignite Others                
        get_players(players,inum,"a")
        for(new i = 0 ;i < inum; ++i)   {                                    
            get_user_origin(players[i],pOrigin)                
            if( get_distance(korigin,pOrigin) < 100  )   {
                if( !onfire[players[i]] )   {
                    new spIndex[2] 
                    spIndex[0] = players[i]
                    new pName[32], kName[32]                    
                    get_user_name(players[i],pName,31)
                    get_user_name(kIndex,kName,31)
                    emit_sound(players[i],CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)
                    client_print(0,3,"* [AMXX] OH! NO! %s has caught %s on fire!",kName,pName)
                    onfire[players[i]] =1
                    ignite_player(players[i])
                    ignite_effects(players[i])    
                }                    
            }
        }            
        players[0] = 0
        pOrigin[0] = 0                    
        korigin[0] = 0        
        
        //Call Again in 2 seconds        
        set_task(2.0, "ignite_player" , 0 , skIndex, 2)        
    }    
        
    return PLUGIN_CONTINUE
}


public fire_player(id,level,cid) { 
    if (!cmd_access(id,level,cid,2)) 
        return PLUGIN_HANDLED 
    
    new arg[32]
    read_argv(1,arg,31)
    
    new victim = cmd_target(id,arg,7) 
    if (!victim) 
        return PLUGIN_HANDLED 

    new skIndex[2]
    skIndex[0] = victim    
    new name[32]
    get_user_name(victim,name,31) 
    
    onfire[victim] = 1
    ignite_effects(skIndex)
    ignite_player(skIndex)
        
    new adminname[32]  
        get_user_name(id,adminname,31)  
    switch(get_cvar_num("amx_show_activity"))   { 
             case 2:   client_print(0,print_chat,"ADMIN %s: set %s on fire.",adminname,name) 
             case 1:   client_print(0,print_chat,"ADMIN: set %s on fire.",name) 
    } 
        
    console_print(id,"Client ^"%s^" has been set on fire...",name) 
    
    return PLUGIN_HANDLED 
}  



//ADMIN ROCKET v1.3 by f117bomb
//=========================================================
new  m_blueflare2,rmflash,rgmsgDamage,white,rsmoke,rocket_z[33]

public rocket_liftoff(svictim[])   {
    new victim = svictim[0]
    
    set_user_gravity(victim,-0.50)
    client_cmd(victim,"+jump;wait;wait;-jump")
    emit_sound(victim, CHAN_VOICE, "weapons/rocket1.wav", 1.0, 0.5, 0, PITCH_NORM)
    rocket_effects(svictim)
    
    return PLUGIN_CONTINUE
}

public rocket_effects(svictim[])   {
    new victim = svictim[0]
    
    if ( is_user_alive(victim) )   {
        new vorigin[3]
        get_user_origin(victim,vorigin)
        
        message_begin(MSG_ONE, rgmsgDamage, {0,0,0}, victim)
        write_byte(30) // dmg_save
        write_byte(30) // dmg_take
        write_long(1<<16) // visibleDamageBits
        write_coord(vorigin[0]) // damageOrigin.x
        write_coord(vorigin[1]) // damageOrigin.y
        write_coord(vorigin[2]) // damageOrigin.z
        message_end()
        
        if(rocket_z[victim] == vorigin[2])
            rocket_explode(svictim)
        
        rocket_z[victim] = vorigin[2]
        
        //Draw Trail and effects
        
        //TE_SPRITETRAIL - line of moving glow sprites with gravity, fadeout, and collisions
        message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
        write_byte( 15 )
        write_coord( vorigin[0]) // coord, coord, coord (start)
        write_coord( vorigin[1])
        write_coord( vorigin[2])
        write_coord( vorigin[0]) // coord, coord, coord (end)
        write_coord( vorigin[1])
        write_coord( vorigin[2] - 30)
        write_short( m_blueflare2 ) // short (sprite index)
        write_byte( 5 ) // byte (count)
        write_byte( 1 ) // byte (life in 0.1's)
        write_byte( 1 )  // byte (scale in 0.1's)
        write_byte( 10 ) // byte (velocity along vector in 10's)
        write_byte( 5 )  // byte (randomness of velocity in 10's)
        message_end()
        
        //TE_SPRITE - additive sprite, plays 1 cycle
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte( 17 )
        write_coord(vorigin[0])  // coord, coord, coord (position)
        write_coord(vorigin[1])
        write_coord(vorigin[2] - 30)
        write_short( rmflash ) // short (sprite index)
        write_byte( 15 ) // byte (scale in 0.1's)
        write_byte( 255 ) // byte (brightness)
        message_end()
        
        set_task(0.2, "rocket_effects" , 0 , svictim, 2)
    }
    
    return PLUGIN_CONTINUE
}

public rocket_explode(svictim[])   {
    new victim = svictim[0]
    
    if ( is_user_alive(victim) )   {   /*If user is alive create effects and user_kill */
        new vec1[3]
        get_user_origin(victim,vec1)
        
        // blast circles
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
        write_byte( 21 )
        write_coord(vec1[0])
        write_coord(vec1[1])
        write_coord(vec1[2] - 10)
        write_coord(vec1[0])
        write_coord(vec1[1])
        write_coord(vec1[2] + 1910)
        write_short( white )
        write_byte( 0 ) // startframe
        write_byte( 0 ) // framerate
        write_byte( 2 ) // life
        write_byte( 16 ) // width
        write_byte( 0 ) // noise
        write_byte( 188 ) // r
        write_byte( 220 ) // g
        write_byte( 255 ) // b
        write_byte( 255 ) //brightness
        write_byte( 0 ) // speed
        message_end()
        
        //Explosion2
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte( 12 )
        write_coord(vec1[0])
        write_coord(vec1[1])
        write_coord(vec1[2])
        write_byte( 188 ) // byte (scale in 0.1's)
        write_byte( 10 ) // byte (framerate)
        message_end()
        
        //rsmoke
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
        write_byte( 5 )
        write_coord(vec1[0])
        write_coord(vec1[1])
        write_coord(vec1[2])
        write_short( rsmoke )
        write_byte( 2 )
        write_byte( 10 )
        message_end()
        
        user_kill(victim,1)
    }
    
    
    //stop_sound
    emit_sound(victim, CHAN_VOICE, "weapons/rocket1.wav", 0.0, 0.0, (1<<5), PITCH_NORM)
    
    set_user_maxspeed(victim,1.0)
    set_user_gravity(victim,1.00)
    
    return PLUGIN_CONTINUE
}


public rocket_player(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32],arg2[3]
    read_argv(1,arg,31)
    read_argv(2,arg2,2)
    if (arg[0]=='@') {
        new players[32], inum , name[32]
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No clients in such team")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a){
            if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                get_user_name(players[a],name,31)
                console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",name)
                continue
            }
            new sPlayer[2]
            sPlayer[0] = players[a]
            emit_sound(players[a],CHAN_WEAPON ,"weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
            set_user_maxspeed(players[a],0.01)
            set_task(1.2, "rocket_liftoff" , 0 , sPlayer, 2)
        }
    }
    else {
        new player = cmd_target(id,arg,5)
        if (!player)
            return PLUGIN_HANDLED
        new sPlayer[2]
        sPlayer[0] = player
        emit_sound(player,CHAN_WEAPON ,"weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
        set_user_maxspeed(player,0.01)
        set_task(1.2, "rocket_liftoff" , 0 , sPlayer, 2)
        
        new playername[32]
        get_user_name(player,playername,31)
        new name[32]
        get_user_name(id,name,31)
        switch(get_cvar_num("amx_show_activity")){
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: created a rocket out of %s",name,playername)
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: created a rocket out of %s",playername)
        }
        console_print(id,"[AMXX] Client ^"%s^" has been set to explode...",playername)
        log_amx("ADMIN ROCKET - this command was issued by %s. Admin has created a rocket out of %s",name,playername)
    }
    rgmsgDamage = get_user_msgid("Damage")
    return PLUGIN_HANDLED
} 


//Admin Weapon II Build 6.4.2 by SniperBeamer
//========================================================================================
public admin_weapon(id,level,cid)
    {
    if ( !cmd_access(id,level,cid,3) )
        return PLUGIN_HANDLED
    
    new arg1[32],arg2[8],weapon
    read_argv(1,arg1,31)
    read_argv(2,arg2,7)
    weapon = str_to_num(arg2)
    if ( equali(arg1,"@all") )
        {
        new plist[32],pnum
        get_players(plist,pnum,"a")
        if (pnum==0)
            {
            console_print(id,"[AMXX] This client is invalid.")
            return PLUGIN_HANDLED
        }
        for (new i=0; i<pnum; i++)
            if ( !give_weapon(plist[i],weapon) )
            {
            console_print(id,"[AMXX] Gave all the players the weapon%d.",weapon)
        }
        console_print(id,"[AMXX] Gave all the players the weapon %d.",weapon)
    }
    else if ( arg1[0]=='@' )
        {
        new plist[32],pnum
        get_players(plist,pnum,"ae",arg1[1])
        if ( pnum==0 )
            {
            console_print(id,"[AMXX] No clients in such team.")
            return PLUGIN_HANDLED 
        }
        for (new i=0; i<pnum; i++) 
            give_weapon(plist[i],weapon)
        console_print(id,"[AMXX] Gave all %ss the weapon %d.",arg1[1],weapon)
    }
    else
    {
        new pName[32] 
        new player = cmd_target(id,arg1,6)
        if (!player) return PLUGIN_HANDLED
        give_weapon(player,weapon)
        get_user_name(player,pName,31)
        console_print(id,"[AMXX] Gave %s the weapon %d.",pName,weapon)
    }
    return PLUGIN_HANDLED
}
give_weapon(id,weapon)
{
    switch (weapon)
    {
        //Secondary weapons
        //Pistols
        case 11:{
            give_item(id,"weapon_glock18")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
        }
        case 12:{
            give_item(id,"weapon_usp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
        }
        case 13:{
            give_item(id,"weapon_p228")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig") 
        }
        case 14:{
            give_item(id,"weapon_deagle")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
        }
        case 15:{
            give_item(id,"weapon_fiveseven")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
        }
        case 16:{
            give_item(id,"weapon_elite")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
        }
        case 17:{
            give_item(id,"weapon_usp")
            give_item(id,"weapon_glock18")
            give_item(id,"weapon_deagle")
            give_item(id,"weapon_p228")
            give_item(id,"weapon_elite")
            give_item(id,"weapon_fiveseven")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
        }
        //Primary weapons
        //Shotguns
        case 21:{
            give_item(id,"weapon_m3")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
        }
        case 22:{
            give_item(id,"weapon_xm1014")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
        }
        //SMGs
        case 31:{
            give_item(id,"weapon_tmp")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
        }
        case 32:{
            give_item(id,"weapon_mac10")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
        }
        case 33:{
            give_item(id,"weapon_mp5navy")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
        }
        case 34:{
            give_item(id,"weapon_p90")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
        }
        
        case 35:{ 
            give_item(id,"weapon_ump45")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
        } 
        //Rifles 
        case 40:{
            give_item(id,"weapon_famas")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 41:{
            give_item(id,"weapon_galil")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 42:{
            give_item(id,"weapon_ak47")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
        }
        case 43:{
            give_item(id,"weapon_m4a1")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 44:{
            give_item(id,"weapon_sg552")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 45:{
            give_item(id,"weapon_aug")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 46:{
            give_item(id,"weapon_scout")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
        }
        case 47:{
            give_item(id,"weapon_sg550")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 48:{
            give_item(id,"weapon_awp")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
        }
        case 49:{
            give_item(id,"weapon_g3sg1")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
        }
        //Machine gun (M249 Para)
        case 51:{
            give_item(id,"weapon_m249") 
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
        }
        //Shield combos
        case 60:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_glock18")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        case 61:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_usp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        case 62:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_p228")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        case 63:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_deagle")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        case 64:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_fiveseven")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        //Equipment 
        case 81:{
            give_item(id,"item_kevlar")
        }
        case 82:{
            give_item(id,"item_assaultsuit")
        }
        case 83:{
            give_item(id,"weapon_hegrenade")
        }
        case 84:{
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
        }
        case 85:{
            give_item(id,"weapon_smokegrenade")
        }
        case 86:{
            give_item(id,"item_thighpack")
        }
        case 87:{
            give_item(id,"weapon_shield")
        }
        //All ammo
        case 88:{
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
        }
        //All grenades
        case 89:{
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_smokegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
        }
        //C4
        case 91:{
            give_item(id,"weapon_c4")
            cs_set_user_plant(id,1,1)
        }
        case 92:{
            cs_set_user_nvg(id, 1)
        }
        //AWM Combo.
        case 100:{
            give_item(id,"weapon_awp")
            give_item(id,"weapon_deagle")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_smokegrenade")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"item_assaultsuit")
        }
        //Money case.
        case 160:{
            cs_set_user_money(id, 16000, 1)
        }
        default: return false
    }
    return true
}

public plugin_precache()
    {
    register_clcmd("say","check_say")
    register_clcmd("say_team","check_say")
    for (new i=0; i<MESSAGES; i++)
        precache_sound(llama_sound[i])
    mflash = precache_model("sprites/muzzleflash.spr") 
    smoke = precache_model("sprites/steam1.spr")
    precache_sound("ambience/flameburst1.wav")
    precache_sound("scientist/scream21.wav")
    precache_sound("scientist/scream07.wav")
    precache_sound("misc/knockedout.wav")
}

// AMX Client Exec 0.03 v3x
//=================================================================================

new bool:isAll
new bool:isTeam
new bool:isServ
// For messages

public doExec(id,level,cid) 
    {
    
    if(!cmd_access(id,level,cid,3)) 
        {
        return PLUGIN_HANDLED
    }
    
    new arg[32]
    new command[64]
    new players[32]
    new player,num,i
    
    read_argv(1,arg,31)
    read_argv(2,command,63)
    
    remove_quotes(command)
    
    while(replace(command,63,"\'","^"")) { } // Credited to OLO
    
    new activity = get_cvar_num("amx_show_activity")
    
    new admin[32]
    get_user_name(id,admin,31)
    
    if(arg[0]=='@') {
        
        if(equali(arg[1],"A") 
        || equali(arg[1],"ALL")) 
        {
            isAll = true
            isTeam = false
            isServ = false
            get_players(players,num,"c")
        }
        
        if(equali(arg[1],"TERRORIST") 
        || equali(arg[1],"T") 
        || equali(arg[1],"TERROR") 
        || equali(arg[1],"TE") 
        || equali(arg[1],"TER")) 
        {
            isAll = false
            isTeam = true
            isServ = false
            get_players(players,num,"ce","TERRORIST")
        }
        
        if(equali(arg[1],"CT")
        || equali(arg[1],"C") 
        || equali(arg[1],"COUNTER")) 
        {
            isAll = false
            isTeam = true
            isServ = false
            get_players(players,num,"ce","CT")
        }
        
        if(equali(arg[1],"S") 
        || equali(arg[1],"SERV") 
        || equali(arg[1],"SERVER")) 
        {
            isAll = false
            isTeam = false
            isServ = true
            server_cmd(command)
        }
        
        if(!(num) && !(isServ)) 
            {
            console_print(id,"[AMXX] No players on such team!")
            return PLUGIN_HANDLED
        }
        
        if(!isServ) 
            {
            
            for(i=0;i<num;i++) 
                {
                
                player = players[i]
                
                if(!is_user_connected(player)) continue
                
                else if(player) 
                    {
                    
                    if(!(get_user_flags(player) & ADMIN_IMMUNITY)) 
                        {
                        client_cmd(player,command)
                    }
                }
            }
        }
        
        if(isAll==true) 
            {
            
            switch(activity) 
            {
                
                case 1: 
                {
                    client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on everyone",command)
                    server_print("ADMIN: Command line ^"%s^" has been used on everyone",command)
                }
                case 2: 
                {
                    client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on everyone",admin,command)
                    server_print("ADMIN %s: Command line ^"%s^" has been used on everyone",admin,command)
                }
            }
        }
        
        if(isTeam==true) 
            {
            
            switch(activity) 
            {
                
                case 1: 
                {
                    client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on the %ss",command,arg[1])
                    server_print("ADMIN: Command line ^"%s^" has been used on the %ss",command,arg[1])
                }
                case 2: 
                {
                    client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on the %ss",admin,command,arg[1])
                    server_print("ADMIN %s: Command line ^"%s^" has been used on the %ss",admin,command,arg[1])
                }
            }
        }
        
        if(isServ==true) 
            {
            
            switch(activity) 
            {
                
                case 1: 
                {
                    client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been exectuted into the server",command)
                    server_print("ADMIN: Command line ^"%s^" has been exectuted into the server",command)
                }
                case 2: 
                {
                    client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been exectuted into the server",admin,command)
                    server_print("ADMIN %s: Command line ^"%s^" has been exectuted into the server",admin,command)
                }
            }
        }
    }
    
    else if(arg[0]=='*') 
        {
        
        get_players(players,num,"c")
        
        for(i=0;i<num;i++) 
            {
            
            player = players[i]
            
            if(!is_user_connected(player)) continue
            
            else if(player) 
                {
                
                if(!(get_user_flags(player) & ADMIN_IMMUNITY)) 
                    {
                    client_cmd(player,command)
                }
            }
        }
        
        
        
        switch(activity) 
        {
            
            case 1: 
            {
                client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on everyone!",command)
                server_print("ADMIN: Command line ^"%s^" has been used on everyone!",command)
            }
            case 2: 
            {
                client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on everyone!",admin,command)
                server_print("ADMIN %s: Command line ^"%s^" has been used on everyone!",admin,command)
            }
        }
    }
    
    else 
    {
        new target = cmd_target(id,arg,3)
        new name[33]
        
        if(!is_user_connected(target)) 
            {
            return PLUGIN_HANDLED
        }
        
        get_user_name(target,name,32)
        
        if(!(get_user_flags(target) & ADMIN_IMMUNITY)) 
            {
            client_cmd(target,command)
        }
        
        switch(activity) 
        {
            case 1: 
            {
                client_print(0,print_chat,"ADMIN: Command Exec has been issued against %s!",name)
                server_print("ADMIN: Command Exec has issued used against %s!",name)
            }
            case 2: 
            {
                client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on %s!",admin,command,name)
                server_print("ADMIN %s: Command line ^"%s^" has been used on %s!",admin,command,name)
            }
        }
    }
    
    return PLUGIN_HANDLED
}

// DeadChat by SuicideDog, Minor revisions by v3x and Brad Jones 
//============================================================================================
 
public death(){ 
    eventDeathMsg() // Sets off spectator bug fix

    if ( get_cvar_num("amx_deadchat")!=1 ) return PLUGIN_CONTINUE 
    new id = read_data(2) 
    if( !is_user_connected(id) || get_speak(id) == SPEAK_MUTED ) return PLUGIN_CONTINUE 
    set_speak(id, SPEAK_LISTENALL) 
    client_print(id,print_center,"You are dead now, you can chat with other team via voice") 
    return PLUGIN_CONTINUE 
}     
public alive(id){ 
    if ( get_cvar_num("amx_deadchat")!=1 ) return PLUGIN_CONTINUE 
    if( !is_user_connected(id) || get_speak(id) == SPEAK_MUTED ) return PLUGIN_CONTINUE 
    set_speak(id, SPEAK_NORMAL) 
    return PLUGIN_CONTINUE 
}

 
//Admin Ammo, By AssKicR 1.0
//===================================================================================================
// VARIABLES 
new bool:AmmoMaster[33] 
 
public admin_ammo(id,level,cid) { 
    if (!cmd_access(id,level,cid,2)) 
        return PLUGIN_HANDLED 
    new arg[32], name2[32] 
    get_user_name(id,name2,31) 
    
    read_argv(1,arg,31) 
    if ((arg[0]=='@') && (arg[1]!='A')) { 
        new players[32], inum 
        get_players(players,inum,"ae",arg[1]) 
        if (inum==0){ 
            console_print(id,"No clients in such team") 
            return PLUGIN_HANDLED 
        } 
        for(new a=0;a<inum;++a) 
            AmmoMaster[players[a]]=true 
        switch(get_cvar_num("amx_show_activity"))   { 
            case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on all %s",name2,arg[1]) 
            case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on all %s",arg[1]) 
        } 
        console_print(id,"All clients on %s have unlimited ammo",arg[1]) 
    }
    else if ((arg[0]=='@') && (arg[1]=='A') && (arg[2]=='L') && (arg[2]=='L')) { 
        new players[32], inum 
        get_players(players,inum,"") 
        
        for(new a=0;a<inum;++a) 
            AmmoMaster[players[a]]=true 
        switch(get_cvar_num("amx_show_activity"))   { 
            case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on all players",name2) 
            case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on all players") 
        } 
        console_print(id,"All clients have unlimited ammo") 
    } 
    else { 
        new player = cmd_target(id,arg,7) 
        if (!player) return PLUGIN_HANDLED 
        AmmoMaster[player]=true 
        new name[32] 
        get_user_name(player,name,31) 
        switch(get_cvar_num("amx_show_activity"))   { 
            case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on %s",name2,name) 
            case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on %s",name) 
        } 
        console_print(id,"Client ^"%s^" has unlimited ammo",name) 
    } 
    return PLUGIN_HANDLED  
} 

public admin_unammo(id,level,cid) { 
   if (!cmd_access(id,level,cid,2)) 
      return PLUGIN_HANDLED 
   new arg[32], name2[32] 
   get_user_name(id,name2,31) 
   read_argv(1,arg,31) 
   if ((arg[0]=='@') && (arg[1]!='A')){ 
      new players[32], inum 
      get_players(players,inum,"ae",arg[1]) 
      if (inum==0){ 
         console_print(id,"No clients in such team") 
         return PLUGIN_HANDLED 
      } 
      for(new a=0;a<inum;++a) 
         AmmoMaster[players[a]]=false 
      switch(get_cvar_num("amx_show_activity"))   { 
   case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from all %s",name2,arg[1]) 
   case 1:   client_print(0,print_chat,"ADMIN: Removed unlimited ammo from all %s",arg[1]) 
      } 
      console_print(id,"No clients on %s have unlimited ammo",arg[1]) 
   } 
   else if ((arg[0]=='@') && (arg[1]=='A') && (arg[2]=='L') && (arg[2]=='L')) { 
      new players[32], inum 
      get_players(players,inum,"") 
        
      for(new a=0;a<inum;++a) 
         AmmoMaster[players[a]]=false 
      switch(get_cvar_num("amx_show_activity"))   { 
   case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from all players",name2) 
   case 1:   client_print(0,print_chat,"ADMIN: removed unlimited ammo from all players") 
      } 
      console_print(id,"No clients have unlimited ammo") 
   } 
   else { 
      new player = cmd_target(id,arg,7) 
      if (!player) return PLUGIN_HANDLED 
      AmmoMaster[player]=false 
      new name[32] 
      get_user_name(player,name,31) 
      switch(get_cvar_num("amx_show_activity"))   { 
   case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from %s",name2,name) 
   case 1:   client_print(0,print_chat,"ADMIN: Removed unlimited ammo from %s",name) 
      } 
      console_print(id,"Client ^"%s^" doesn't have unlimited ammo",name) 
   } 
   return PLUGIN_HANDLED  
} 
//---------------------------------------------------------------------------------------------- 
public changeWeapon(id) 
    { 
    if ( !AmmoMaster[id] ) return PLUGIN_CONTINUE 
    new  clip, ammo 
    new wpn_id=get_user_weapon(id, clip, ammo); 
    new wpn[32] 
    
    if ( wpn_id==CSW_C4 || wpn_id==CSW_HEGRENADE || wpn_id == CSW_SMOKEGRENADE || wpn_id == CSW_FLASHBANG || wpn_id == CSW_KNIFE ) return PLUGIN_CONTINUE 
    
    // Never Run Out of Ammo! 
    //server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id) 
    if ( clip == 0 ) 
        { 
        //server_print("INVOKING PUNISHER MODE! ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id) 
        get_weaponname(wpn_id,wpn,31) 
        //highly recommend dropping weapon - buggy without it! 
        if ( get_cvar_num("sv_dropwpn")!=0 ) engclient_cmd(id,"drop",wpn)  //TEST 
        give_item(id,wpn) 
        engclient_cmd(id, wpn ) 
        engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-( 
        engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-( 
    } 
    return PLUGIN_CONTINUE 
} 

//Sets godmode on people
//================================================================================================================================
public admin_godmode(id,level,cid) {
    if (!cmd_access(id,level,cid,3))
        return PLUGIN_HANDLED
    new arg[32], arg2[8], name2[32]
    read_argv(1,arg,31)
    read_argv(2,arg2,7)
    get_user_name(id,name2,31)
    
    new bool:l_postRound = false;
    if(str_to_num(arg2) == 2)
    {
    arg2 = "1";
    l_postRound = true;
    }
    
    if (arg[0]=='@'){
        new players[32], inum
        if(!(arg[1]=='a' || arg[1]=='A' || arg[1]=='C' || arg[1]=='c' || arg[1]=='T' || arg[1]=='t'))
            inum = 0
        else
            get_players(players,inum,"")
        //get_players(players,inum,"e",arg[1])
        if (inum==0){
            console_print(id, "%L", LANG_PLAYER, "AINO_NO_CLIENTS")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a) {
            if((arg[1]=='a' || arg[1]=='A') || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T' || arg[1]=='t')) || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C' || arg[1]=='c')))
            {
            set_user_godmode(players[a],str_to_num(arg2))
            g_GodMaster[players[a]] = l_postRound;
            }
        }
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_TEAM_CASE2", name2, arg[1])
            case 1:    client_print(0,print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_TEAM_CASE1", arg[1])
              }
        console_print(id, "%L", LANG_PLAYER, "AINO_GODMODE_ALL_SUCCESS")
        log_amx("%L", LANG_SERVER, "AINO_LOG_GODMODE_ALL", name2, arg[1])
    }
    else {
        new player = cmd_target(id,arg,3)
        if (!player) return PLUGIN_HANDLED
        
        set_user_godmode(player,str_to_num(arg2))
        g_GodMaster[player] = l_postRound;
        
        new name[32]
        get_user_name(player,name,31)
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0, print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_CASE2", name2, name)
            case 1:    client_print(0, print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_CASE1", name)
             }
        console_print(id, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_SUCCESS", name)
        log_amx("%L", LANG_SERVER, "AINO_LOG_GODMODE_PLAYER", name2, name)
    }
    return PLUGIN_HANDLED
}


public godmode(id, level, cid)
    {
    if(!cmd_access(id, level, cid, 2))
        return PLUGIN_HANDLED
    
    new cmd[32], counter, players[32], totalPlayers
    read_argv(0, cmd, 32)
    replace(cmd, 32, "amx_god", "")
    
    // Get the info on the caller
    new nameCalled[32], steamCalled[32]
    get_user_name(id, nameCalled, 31)
    get_user_authid(id, steamCalled, 31)
    
    new Red = random(256)
    new Green = random(256)
    new Blue = random(256)
    set_hudmessage(Red, Green, Blue, 0.05, 0.4)
    
    if(equal(cmd, "all"))
        {
        get_players(players, totalPlayers, "a")
        
        for(counter = 0; counter < totalPlayers; counter++)
            {
            set_user_godmode(players[counter], 1 - get_user_godmode(players[counter]))
        }
        
        switch(get_cvar_num("adminmodx_show_activity"))
        {
            case 0: client_print(id, print_console, "%L", LANG_SERVER, "AMX_SUPER_ALLGODED", "On/Off")
            case 1: client_print(0, print_chat, "%L", LANG_SERVER, "AMX_SUPER_ALLGODED", "On/Off")
            case 2: show_hudmessage(0, "%L", LANG_SERVER, "AMX_SUPER_ALLGODED", "On/Off")
        }
        
        // Show it if needed
        switch(get_cvar_num("amx_show_activity"))
        {
            case 1:    client_print(0, print_chat, "%L", LANG_PLAYER, "AMXX_LOGGING_NAMED", nameCalled, "Everyone a GOD", "")
        }
        
        // Tell them it succeded
        if(is_client(id))
            client_print(id, print_console, "%L", LANG_PLAYER, "AMX_SUPER_GODALL_SUC")
        
        // Now Log it
        log_amx("%L", LANG_SERVER, "AMX_SUPER_GODALL", nameCalled, steamCalled)
        
    }
    return PLUGIN_CONTINUE
}


//Quits ppl
//============================================================================================================================================
public quit(id, level, cid)
    {
    if(!cmd_access(id, level, cid, 2))
        return PLUGIN_HANDLED
    
    new playerName[32]
    read_argv(1, playerName, 31)
    
    remove_quotes(playerName)
    
    // Search for the Player
    new player_id = get_player(playerName)
    
    if(player_id == -1)
        {
        // Give out error message
        if(is_client(id))
            client_print(id, print_console, "%L", LANG_PLAYER, "NICK_NOT_FOUND")
        
        return PLUGIN_CONTINUE
    }
    
    if(get_user_flags(player_id) & ADMIN_IMMUNITY)
        {
        client_print(id, print_console, "%L", LANG_PLAYER, "AMX_SUPER_PLAYER_IMMUNE")
        return PLUGIN_HANDLED
    }
    
    new nameCalled[32], nameAgainst[32]
    new steamCalled[32], steamAgainst[32]
    get_user_name(id, nameCalled, 31)
    get_user_authid(id, steamCalled, 31)
    get_user_name(player_id, nameAgainst, 31)
    get_user_authid(player_id, steamAgainst, 31)
    
    client_cmd(player_id, "quit")
    client_print(0, print_center, "%L", LANG_SERVER, "AMX_SUPER_QUITTED", nameAgainst)
    
    if(get_cvar_num("adminmodx_sounds"))
        emit_sound(0, CHAN_VOICE, soundName[thunder], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

    // Show it if needed
    switch(get_cvar_num("amx_show_activity"))
    {
        case 2:    client_print(0, print_chat, "%L", LANG_PLAYER, "AMXX_LOGGING_NAMED", nameCalled, "Removed", "")
    }
    
    // Tell them it succeded
    if(is_client(id))
        client_print(id, print_console, "%L", LANG_PLAYER, "AMX_SUPER_QUIT_SUC")
    
    // Now Log it
    log_amx("%L", LANG_SERVER, "AMX_SUPER_QUIT", nameCalled, steamCalled, nameAgainst, steamAgainst)
    
    return PLUGIN_CONTINUE
}

//Status
//============================================================================================================
public status(id, level, cid)
    {
    if(!cmd_access(id, level, cid, 1))
        return PLUGIN_HANDLED
    
    new len = 0, message[1024], temp[32]
    
    len += format(message[len], (1023-len), "<table>")
    
    new player_id[32], player_num, player_time = 0, ping = 0, loss = 0
    
    get_players(player_id, player_num, "c")
    
    for(new i = 0; i < player_num; i++)
        {
        // ID
        len += format(message[len], (1023-len), "<tr><td>#</td><td>%d</td></tr>", get_user_userid(player_id[i]))
        len += format(message[len], (1023-len), "<tr><td>Edict</td><td>%d</td>", id)
        
        // Name
        get_user_name(player_id[i], temp, 31)
        len += format(message[len], (1023-len), "<tr><td>Nick</td><td>%s</td>", temp)
        
        // Steam ID
        get_user_authid(player_id[i], temp, 31)
        len += format(message[len], (1023-len), "<tr><td>Steam</td><td>%s</td>", temp)
        
        // Ip
        get_user_ip(player_id[i], temp, 31)
        len += format(message[len], (1023-len), "<tr><td>IP</td><td>%s</td>", temp)
        
        // Flags
        get_flags(get_user_flags(player_id[i]), temp, 31)
        len += format(message[len], (1023-len), "<tr><td>Flags</td><td>%s</td>", temp)
        
        // Frags
        len += format(message[len], (1023-len), "<tr><td>Frags</td><td>%d</td>", get_user_frags(player_id[i]))
        
        // Death
        len += format(message[len], (1023-len), "<tr><td>Deaths</td><td>%d</td>", get_user_deaths(player_id[i]))
        
        // Health
        len += format(message[len], (1023-len), "<tr><td>Health</td><td>%d</td>", get_user_health(player_id[i]))
        
        // Ping
        get_user_ping(player_id[i], ping, loss)
        len += format(message[len], (1023-len), "<tr><td>Ping</td><td>%d</td>", ping)
        len += format(message[len], (1023-len), "<tr><td>Loss</td><td>%d</td>", loss)
        
        // Team
        get_user_team(player_id[i], temp, 31)
        len += format(message[len], (1023-len), "<tr><td>Team</td><td>%s</td>", temp)
        
        // Time in Seconds Playing
        player_time = get_user_time(player_id[i])
        len += format(message[len], (1023-len), "<tr><td>Time On</td><td>%d:%d:%d</td>", ((player_time / 60) / 12), (player_time / 60), (player_time % 60))
    }
    
    len += format(message[len], (1023-len), "</table>")
    
    show_motd(id, message, "Status")
    
    return PLUGIN_CONTINUE
}


//Sets a password on the server
//=========================================================================================================================================
public pass(id, level, cid)
{
    if(!cmd_access(id, level, cid, 1))
        return PLUGIN_HANDLED

    new cmd[32], password[128]

    read_argv(0, cmd, 31)
    read_args(password, 127)
    replace(password, 127, cmd, "")
    format(password, 127, "%s", password)

    get_user_name(id, name, 31)
    get_user_authid(id, authid, 31)
    switch (get_cvar_num("amx_show_activity")) {
      case 2: client_print(0,print_chat,"ADMIN %s has set a server password",name)
      case 1: client_print(0,print_chat,"ADMIN: A server password has been set")
    }
    log_amx("Cmd: ^"%s<%d><%s>^" set the server password to %s",name,get_user_userid(id),authid,password)
    set_cvar_string("sv_password", password)

    return PLUGIN_HANDLED
}

public nopass(id, level, cid)
{
    if(!cmd_access(id, level, cid, 1))
        return PLUGIN_HANDLED

    get_user_name(id, name, 31)
    get_user_authid(id, authid, 31)
    switch (get_cvar_num("amx_show_activity")) {
      case 2: client_print(0,print_chat,"ADMIN %s has removed the server password",name)
      case 1: client_print(0,print_chat,"ADMIN: The server password has been removed")
    }
    log_amx("Cmd: ^"%s<%d><%s>^" removed server password", name,get_user_userid(id),authid)
    set_cvar_string("sv_password", "")

    return PLUGIN_HANDLED
}



//Server ShutDown
//===============================================================================================================================================

public servershutdown(id) {
    if (!(get_user_flags(id)&ADMIN_LEVEL_A)) { 
        console_print(id,"[AMXX] No access") 
        return PLUGIN_HANDLED 
    } 
    set_task(5.0,"exit_server")

    return PLUGIN_HANDLED
}


public exit_server() {
    client_cmd(0,"retry",1.5)
    server_cmd("quit")
}

//////////////////////////////////////////////////////////////////////////////////////
//
// Searches for a player given search
//
// @param string - The player search criteria
// @return int - The players id or -1 if not found
//
get_player(search[])
{
    // See if they are there by exact nick
    new player_id = find_player("ahjl", search)
    
    // Try to find them by portion of nick
    if(!player_id)
        player_id = find_player("bhjl", search)
    
    // Try to find them by steam id
    if(!player_id)
        player_id = find_player("chj", search)
    
    // Try to find them by ip
    if(!player_id)
        player_id = find_player("dhj", search)
    
    // Try to find them by userid
    if(!player_id)
        player_id = find_player("khj", search)
    
    if(!player_id)
        return -1
    
    return player_id
}


///////////////////////////////////////////////////////////////////////////////////////
//
// Checks to see if its a client or else it was the server
//
is_client(id)
{
    return (id > 0 && id < 33) ? 1 : 0
}
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 03-03-2007, 14:03
Exolent[jNr]
This message has been deleted by Exolent[jNr].
Old 03-03-2007, 14:04
Exolent[jNr]
This message has been deleted by Exolent[jNr].
Old 03-03-2007, 14:07
Exolent[jNr]
This message has been deleted by Exolent[jNr].
aer0nz
Junior Member
Join Date: Feb 2007
Old 03-03-2007 , 14:23   Re: amx_noclip
Reply With Quote #4

original code pls. :p no edits.
aer0nz is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-03-2007 , 14:32   Re: amx_noclip
Reply With Quote #5

here is the original nohpk
Code:
/* AMXX Mod script.
*
* (c) copyright 2005 by bmann_420/Iceman
* This file is provided as is (no warranties).
*
* SUPER ALLINONE COMMANDS - No HPK Edition
* [2007 / 01 / 06 -- last change]
* [Plugin Count, 36 --  plugins]
*
Support 
* -) Mangrapes for porting admin_slash and letting me add this. 
* -) BigBaller for Porting it Origionally & the AMXX Community 
* -) Zor for the compilation of AdminModX & the DOD Community 
* -) Iceman (Clan Member) Who helped with the additions 
* -) Good Old Kensai 
* -) Sether for Code Update & Additions (#2 for godmode/noclip) 
* -) Bo0m! for Code cleanup/helping in my absence

Plugins 
* -) ADMIN HEAL v0.9.3 by f117bomb 
* -) ADMIN ARMOR v1 by Rav 
* -) ADMIN NO CLIP v0.9.3 by f117bomb 
* -) ADMIN TELEPORT v0.9.3 by f117bomb 
* -) ADMIN STACK v0.9.3 by f117bomb  
* -) ADMIN ALLTALK 1.0 by BigBaller 
* -) ADMIN GRAVITY v0.2 by JustinHoMi 
* -) ADMIN BURY v0.9.3 by f117bomb 
* -) ADMIN DISARM v1.1 by mike_cao 
* -) AMX UBER SLAP v0.9.3 by BarMan (Skullz.NET) 
* -) ADMIN SLAY 2 v0.9.2 by f117bomb 
* -) ADMIN ROCKET v1.3 by f117bomb 
New Additions by bmann_420***======= Some of these were on the last All-in-one, but they did not work, so I replaced and/or Fixed them. 
* -) ADMIN MONEY 1.0 by XxAvalanchexX
* -) ADMIN FIRE v1.0.0 by f117bomb 
* -) ADMIN GLOW v1.3.3 by EKS 
* -) ADMIN LLAMA by SniperBeamer 
* -) ADMIN WEAPON II By SniperBeamer (Replaced Old One) 
* -) ADMIN EXEC 2.3 by v3x 
* -) ADMIN REVIVE by SniperBeamer 
* -) ADMIN UNLIMITED AMMO AssKicR 
* -) ADMIN DEADCHAT by SuiCideDog/Brad 
* -) ADMIN GAG by EKS 
* -) ADMIN GODMODE 
* -) ADMIN QUIT 
* -) ADMIN STATUS 
* -) ADMIN PASSWORD by Sparky 911 
* -) PUBLIC LOADINGSONG 
* -) DAMAGE DONE HUD by Manip, ported and fixed by JTP10181 with additoins by Vittu
* -) SERVER SHUTDOWN by Remo Williams -- Lets people reconnect automatically when you restart the server for quick fixes or additions
* -) SERVER SPECTATOR BUG FIX <-- Are you ducking when you die and the spectator menu pops up? This fixes that issue! 
* -) SHOWNDEAD BUG FIX by Vantage aka Mouse  v.0.9.4
* -) SOUND FIX Fix Echo Sound by Throstur  v. 1.0
* -) DEATHMESSAGE FIX by Simon Logic  v1.0.1 
 
 
***If you need help or have question, visit this page: http://www.amxmodx.org/forums/viewtopic.php?p=172239#172239***
The site above will have all commands and issue questions most likely answered, or if not then post your question there.

//
//////////////////////////////////////////////////////////////////////////////////////////////
//Installation  (Read The DOCUMENTATION ALSO!)
1) Put the amx_super.amxx into your addons/amxmodx/plugins folder. 
2) Go into your addons/amxmodx/configs/plugins.ini, at the very bottom type in amx_super.amxx, save it 
3) Download the allinone.txt and place it in your addons/amxmodx/data/lang Folder 
4) Download the sounds.rar, Unzip them. Place them into your sound/misc Folder 

//FAQ: 
Q, It says bad load and it is not running. 
A, Then Make sure all modules are Enabled for this plugins to work, those are: 
Fun 
Engine 
Cstrike 

-If you have those Enabled, then click on download to get the sma. 
-Then place that into your addons/amxmodx/scripting Folder 
-Double click on Compile with the blue box and wait for all your plugins to compile in the 
-cmd command prompt 
-Then after you hit enter, go into your compiled folder inside your scripting folder and take out amx_super.amxx 
-Place that into your addons/amxmodx/plugins folder by replacing the old one.
*/

new const PLUGIN[]  = "Amx Super";
new const VERSION[] = "2.7 No-HPK"
new const AUTHOR[]  = "Bmann_420";

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <engine>

//======================================================================================================================================
//You are able to Edit some of these values below as you see fit========================================================================

#define USING_STEAM 1 // comment this line if your using WON CS 1.5
#define MESSAGES 4
#define MAX_NAME_LENGTH 32
#define MAX_PLAYERS 32
#define MAX_TEXT_LENGTH 192
#define VoiceCommMute 1        // 0 = Disabled ( no extra module required ) | 1 = Voicecomm muteing enabled. ( requires engine module)
#define BlockNameChange 1    // 0 = Disabled | 1 = Block namechange on gagged clients
#define LogAdminActions 1    // 0 = Disabled | 1 = Admin actions will be logged
#define DefaultGagTime 600.0    // The std gag time if no other time was entered. ( this is 10 min ), Remember the value MUST contain a .0
#define PlaySound 1        // 0 = Disabled | 1 = Play a sound to gagged clients when their trying to talk
#define GagReason 1        // 0 = Disabled | 1 = Gagged clients can see why there where gagged when they try to talk
#define MaxPlayers 32
#define AllowOtherPlugin2Interface 1
#define WhatModule 2             // 1 = Enable glow via the engine module |  2 = Enable glwo via the fun module
#define MaxColorCount 7            // Dont change this one.
#define DAMAGE_RECIEVED

#if WhatModule == 1
#include <engine>
#else
#include <fun>
#endif

new g_ColorNames[MaxColorCount][12] = { "red","green","blue","yellow","purple","aqua","silver" }
new g_ColorR[MaxColorCount] = { 255,0,0,255,255,0,192 }
new g_ColorG[MaxColorCount] = { 0,255,0,255,0,255,192 }
new g_ColorB[MaxColorCount] = { 0,0,255,0,255,255,192 }

new g_Players[33]    // This array contains the color a player is glowing in. ( if any ) -1 means no color

new g_GagPlayers[MaxPlayers+1]    // Used to check if a player is gagged
#if GagReason == 1
new gs_GagReason[MaxPlayers+1][48]
#endif

new enabled, allow
new bool:g_GodMaster[33]
new bool:g_NoclipMaster[33]
new authid [32]
new name [32]
new g_MsgSync
#if defined DAMAGE_RECIEVED
    new g_MsgSync2
#endif

//Shown dead bug fix
new SpecName[16]
new gmsg_TeamInfo


public plugin_init()
    {
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_cvar("amx_super",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
    register_dictionary("Amx_Super.txt")
    register_clcmd("say","block_gagged") 
    register_clcmd("say_team","block_gagged") 
    register_clcmd("say /gravity","check_gravity")
    register_clcmd("say_team /gravity","check_gravity")
    register_event("DeathMsg","death","a") 
    register_event("ResetHUD","alive","b")
    register_event("CurWeapon","changeWeapon","be","1=1")
    register_event("ResetHUD", "newround_event", "b")
    register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
    g_MsgSync = CreateHudSyncObj()
    #if defined DAMAGE_RECIEVED
    g_MsgSync2 = CreateHudSyncObj()
    #endif
    enabled = register_cvar("amx_soundfix","1")
        allow = register_cvar("amx_soundifx_pallow","1")
        set_task(0.1,"fRemove")
        gmsg_TeamInfo = get_user_msgid("TeamInfo")
        copy(SpecName,15,"SPECTATOR")

//Admin Commands===============================================================================================================================================    
    register_clcmd("say /fixsound","cmdStopsound")
    register_concmd("amx_heal","admin_heal",ADMIN_LEVEL_A,"<authid, nick, @team or #userid> <life to give>")
    register_concmd("amx_armor","admin_armor",ADMIN_LEVEL_A,"<part of nick> <amount>")
    register_concmd("amx_godmode","admin_godmode",ADMIN_LEVEL_A,"<authid, nick, @team/all or #userid> <0=OFF 1=ON 2=ON + ON EACH ROUND>")
    register_concmd("amx_godall", "godmode", ADMIN_LEVEL_A, "- Sets all players to god mode")
    register_concmd("amx_noclip","admin_noclip",ADMIN_LEVEL_A,"<authid, nick, @team/all or #userid> <0=OFF 1=ON 2=ON + ON EACH ROUND>")
    register_concmd("amx_teleport","admin_teleport",ADMIN_LEVEL_A,"<authid, nick, @team or #userid> [x] [y] [z]")
    register_concmd("amx_userorigin","admin_userorigin",ADMIN_LEVEL_A,"<authid, nick, or #userid>")
    register_concmd("amx_stack","admin_stack",ADMIN_LEVEL_A,"<authid, nick or #userid> [0|1|2]")
    register_clcmd("amx_givemoney","cmd_givemoney",ADMIN_KICK,"<player> <amount> - gives specified player money");
    register_concmd("amx_gag","CMD_GagPlayer",ADMIN_KICK,"<nick or #userid> <a|b|c> <time>  a == normal say / b == team say / c == voicecomm") 
    register_concmd("amx_ungag","CMD_UnGagPlayer",ADMIN_KICK,"<nick or #userid>")
    register_concmd("amx_alltalk","admin_alltalk",ADMIN_LEVEL_A,"1|0 to enable and disable")
    register_concmd("amx_gravity","admin_gravity",ADMIN_LEVEL_A,"< gravity >")
    register_concmd("amx_glow","CMD_Glow",ADMIN_KICK,"<nick or #userid> <color>")
    register_concmd("amx_unglow","CMD_UnGlow",ADMIN_KICK,"<nick or #userid>")
    register_concmd("amx_bury","admin_bury",ADMIN_LEVEL_B,"<authid, nick, @team or #userid>")
    register_concmd("amx_unbury","admin_unbury",ADMIN_LEVEL_B,"<authid, nick, @team or #userid>")
    register_concmd("amx_disarm","admin_disarm",ADMIN_LEVEL_B,"<authid, nick, @team or #userid>")
    register_concmd("amx_uberslap","admin_slap",ADMIN_LEVEL_B,"<authid, nick or #userid>")
    register_concmd("amx_slay2","admin_slay",ADMIN_LEVEL_B,"<authid, nick, @team or #userid> [1-lightning|2-blood|3-explode]")
    register_concmd("amx_fire","fire_player",ADMIN_LEVEL_B,"<authid, nick or #userid>")
    register_concmd("amx_rocket","rocket_player",ADMIN_LEVEL_B,"<authid, nick, @team or #userid>")
    register_concmd("amx_llama","llama",ADMIN_LEVEL_A,"- <authid, nick, @team or #userid>")
    register_concmd("amx_unllama","unllama",ADMIN_LEVEL_A,"- <authid, nick, @team or #userid>")
    register_concmd("amx_weapon","admin_weapon",ADMIN_LEVEL_C,"<authid, nick, @all, @team, or #userid> <weapon #>")
    register_concmd("amx_weapons","admin_weapon",ADMIN_LEVEL_C,"<authid, nick, @all, @team, or #userid> <weapon #>")
    register_concmd("amx_revive","admin_revive",ADMIN_BAN,"<authid, nick, @team or #userid>")
    register_concmd("amx_quit", "quit", ADMIN_LEVEL_A, "<nick | steam> - Will quit assholes to the desktop")
    register_clcmd("amx_exec","doExec",ADMIN_IMMUNITY,"<nick,@TEAM,*(all),@SERVER>")
    register_concmd("amx_ammo","admin_ammo",ADMIN_LEVEL_A,"<authid, nick, @team or #userid>")  
    register_concmd("amx_unammo","admin_unammo",ADMIN_LEVEL_A,"<authid, nick, @team or #userid>") 
//Server Commands================================================================================================================================================
    register_srvcmd("soundfix","fRemove")
    register_srvcmd("amx_exec","doExec")
    register_concmd("amx_status", "status", ADMIN_KICK, "- This will show you a list of info on each person kinda like the status but more detailed")
    register_concmd("amx_pass", "pass", ADMIN_BAN, "- Sets a server password")
         register_concmd("amx_nopass", "nopass", ADMIN_BAN, "- Removes the server password")
    register_concmd("amx_shutdown","servershutdown",ADMIN_IMMUNITY," - Shuts down server in 10seconds")
//Server Cvars===================================================================================================================================================    
    if (!cvar_exists("sv_dropwpn")) 
    register_cvar("sv_dropwpn", "0")
    register_cvar("bullet_damage","1")
    register_cvar("adminmodx_sounds", "1")
    register_cvar("amx_loadsong","1")
    register_cvar("amx_llamasound","1")
    register_cvar("amx_deadchat","1")
    register_cvar("amx_moneymsg","1")
    register_cvar("amx_revivemsg","1")
    register_cvar("amx_revivewithguns","1")

// Shown Dead Bug Fix
//-----------------------    
    new ModName[11] 
    get_modname(ModName,10)
    
    if( equal("cstrike",ModName,10) ){
        copy(SpecName,15,"SPECTATOR")
    }
    else if( equal("ns",ModName,10) ){
        copy(SpecName,15,"#spectatorteam")
    }
    else if( equal("tfc",ModName,10) ){
        copy(SpecName,15,"")
    }
    
    gmsg_TeamInfo = get_user_msgid("TeamInfo")
    
    return PLUGIN_HANDLED    
}

//Sound Fix
//===================================================================================================================
public fRemove()
{
    if(get_pcvar_num(enabled) != 1)
        return PLUGIN_HANDLED
    
    new Echo = find_ent_by_class(0,"env_sound")
    while(Echo)
    {
        remove_entity(Echo)
        Echo = find_ent_by_class(Echo,"env_sound")
    }
    return PLUGIN_HANDLED
}

public cmdStopsound(id)
{
    if(get_pcvar_num(allow) == 1)
    {
        client_cmd(id,"stopsound;room_type 00")
        client_cmd(id,"stopsound")
        client_print(id,print_chat,"[AMXX] Your sound will no longer echo now.")
    }
    else
    {
        client_print(id,print_chat,"[AMXX] I'm sorry, manual sound fixing is disabled.")
        return PLUGIN_HANDLED
    }
    return PLUGIN_CONTINUE
} 

//Spectator Bug Fix
//=================================================================================================================
public eventDeathMsg() {
 new ids[1]
 ids[0] = read_data(2)
 set_task(1.0,"fixit",0,ids,1)
 return PLUGIN_CONTINUE
}

public fixit(ids[]) {
 client_cmd(ids[0],"+duck;-duck;spec_menu 0")
}


// If a Player has unlimited Godmode and/or unlimited Noclip
//===================================================================================================================

public newround_event(id) { 
   if(g_GodMaster[id]) 
      set_user_godmode(id,1);
   if(g_NoclipMaster[id]) 
      set_user_noclip(id,1);
   return PLUGIN_CONTINUE 
}

//=============================================================================================================================================================
// When a player is auth and the Steam ID is set

public client_authorized(id)
    {
    return PLUGIN_CONTINUE
}

//=============================================================================================================================================================
// When a player disconnects everything is removed from them

public client_disconnect(id) {  
    remove_task(id)  
    
    g_GodMaster[id] = false
    g_NoclipMaster[id] = false
    
    if(g_GagPlayers[id]) // Checks if disconnected player is gagged, and removes flags from his id.
    {
        new Nick[32],Authid[35]
        get_user_name(id,Nick,31)
        get_user_authid(id,Authid,34)
        client_print(0,print_chat,"[AMX] Gagged Player Has Disconnected ( %s <%s> )",Nick,Authid)
        remove_task(id)        // Removes the set_task set to ungag the player
        UnGagPlayer(id)        // This is the function that does the actual removal of the gag info
    }
}

//===================================================================================================================
//Sounds
#define SOUNDFILES 2
new soundName[SOUNDFILES][] =
{
    "ambience/thunder_clap.wav",    // For slays and when something is done to someone
    "misc/choke.wav"        // Choking sound
}

enum
{
    thunder,
    choke
}

// End Sounds used

//====================================================================================================================
//Damage Done 0.4 by Manip with additions by jtp10181 & Vittu
public on_damage(id)
{ 
    if ( get_cvar_float("bullet_damage") && id > 0 ) { //stop invalid player id 0
    new attacker = get_user_attacker(id)
#if defined DAMAGE_RECIEVED
    // id should be connected if this message is sent, but lets check anyway
    if ( is_user_connected(id) && is_user_connected(attacker) )
    {
        new damage = read_data(2)

        set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
        ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
#else
    if ( is_user_connected(attacker) )
    {
        new damage = read_data(2)
#endif
        set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
        ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
    }
}
    return PLUGIN_CONTINUE
}

//Admin Revive by SniperBeamer
//==========================================================================================================
public admin_revive(id,level,cid)
    {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    
    new arg[32]
    read_argv(1,arg,31)
    
    if (arg[0]=='@')
        {
        new plist[32],pnum
        get_players(plist,pnum,"e",arg[1])
        if (pnum==0)
            {
            console_print(id,"[AMXX] No clients in such team")
            return PLUGIN_HANDLED
        }
        for (new i=0; i<pnum; i++)
            {
            if (!(get_user_flags(plist[i])&ADMIN_IMMUNITY))
                {
                new ids[3]
                num_to_str(plist[i],ids,2)
                spawn(plist[i])
                set_task(0.1,"revivePl",0,ids,2)
            }
        }
        console_print(id,"[AMXX] Revived the %ss",arg[1])
        if (get_cvar_num("amx_revivemsg"))
            {
            if (equali(arg[1],"CT")) set_hudmessage(0,20,220,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
            else set_hudmessage(220,20,0,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
            show_hudmessage(0,"The %ss have been revived!",arg[1])
        } 
    }
    else
    {
        new pName[32],player = cmd_target(id,arg,3)
        if (!player) return PLUGIN_HANDLED
        new ids[3]
        num_to_str(player,ids,2)
        spawn(player)
        set_task(0.1,"revivePl",0,ids,2)
        get_user_name(player,pName,31)
        console_print(id,"[AMXX] Revived %s",pName)
        if (get_cvar_num("amx_revivemsg"))
            {
            set_hudmessage(0,200,0,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
            show_hudmessage(0,"%s has been revived!",pName)
        } 
    }
    
    return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public revivePl(ids[]) 
    { 
    if(get_cvar_num("amx_revivewithguns") == 1) 
    { 
        new id = str_to_num(ids) 
        spawn(id) 
        if (get_user_team(id)==1) 
        { 
            give_item(id,"weapon_knife") 
            give_item(id,"weapon_glock18") 
            give_item(id,"ammo_9mm") 
            give_item(id,"ammo_9mm") 
        } 
        else 
        { 
            give_item(id,"weapon_knife") 
            give_item(id,"weapon_usp") 
            give_item(id,"ammo_45acp") 
            give_item(id,"ammo_45acp") 
        } 
    } 
    else 
    { 
        new id = str_to_num(ids) 
        spawn(id) 
        give_item(id,"weapon_knife") 
    } 
}



//ADMIN HEAL v0.9.3 by f117bomb
//==================================================================================================
public admin_heal(id,level,cid){
    if (!cmd_access(id,level,cid,3))
        return PLUGIN_HANDLED
    
    new arg[32], arg2[8], name2[32], amount[33]
    read_argv(1,arg,31)
    read_argv(2,arg2,7)
    read_argv(2,amount,32)
    get_user_name(id,name2,31)
    if (arg[0]=='@'){
        new players[32], inum
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"No clients in such team")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a) {
            new user_health = get_user_health(players[a])
            set_user_health(players[a], str_to_num(arg2) + user_health)
        }
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: set life on all %s",name2,arg[1])
                case 1:    client_print(0,print_chat,"[AMXX] ADMIN: set life on all %s",arg[1])
            }
        console_print(id,"[AMXX] All clients have set life")
        log_amx("ADMIN HEAL - this command was issued by %s on all %s",name2,arg[1])
    }
    else {
        new numamount = str_to_num(amount) // Turn the string into a number
        new player = cmd_target(id,arg,7)
        if (!player) return PLUGIN_HANDLED
        new user_health = get_user_health(player)
        set_user_health(player, str_to_num(arg2) + user_health + numamount)
        new name[32]
        get_user_name(player,name,31)
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN, %s, gave %i health points to %s",name2,name,numamount)
                case 1:    client_print(0,print_chat,"[AMXX] ADMIN: set %i health points on %s",numamount,name)
            }
        console_print(id,"[AMXX] Client ^"%s^" has set life",name)
        log_amx("ADMIN HEAL - this command was issued by %s on %s",name2,name)
    }
    return PLUGIN_HANDLED
}

//ADMIN ARMOR v1 by Rav
//=========================================================

public admin_armor(id) {
    if (!(get_user_flags(id)&ADMIN_LEVEL_A)){
        client_print(id,print_console,"[AMXX] You have no access to that command")
        return PLUGIN_HANDLED
    }
    if (read_argc() <2) {
        client_print(id,print_console,"[AMXX] Usage:  amx_armor <part of nick> <amount> ")
        return PLUGIN_HANDLED
    }
    new name[32]
    new amount[33]
    read_argv(1,name,32)
    read_argv(2,amount,32)
    new toarmor = find_player("bl",name)
    if (toarmor)    {
        if (is_user_alive(toarmor)==0)    {
            client_print(id,print_console,"[AMXX] Client ^"%s^" is dead, armor is useless",name)
            return PLUGIN_HANDLED
        }
        if (str_to_num(amount) > 100){
            client_print(id,print_console,"[AMXX] Clients cannot be given more than 100 armor!")
            return PLUGIN_HANDLED
        }
        set_user_armor(toarmor,str_to_num(amount))
        return PLUGIN_HANDLED
    }
    else {
        client_print(id,print_console,"[AMXX] Client with that part of nick not found")
        return PLUGIN_HANDLED
    }
    
    return PLUGIN_CONTINUE
}



//ADMIN NO CLIP v0.9.3 by f117bomb
//=========================================================

public admin_noclip(id,level,cid) { 
    if (!cmd_access(id,level,cid,3)) 
        return PLUGIN_HANDLED 
    new arg[32], arg2[8], name2[32] 
    read_argv(1,arg,31) 
    read_argv(2,arg2,7) 
    get_user_name(id,name2,31) 
    
    new bool:l_postRound = false;
    if(str_to_num(arg2) == 2)
    {
        arg2 = "1";
        l_postRound = true;
    } 
    
    if (arg[0]=='@'){ 
        new players[32], inum
        if(!(arg[1]=='a' || arg[1]=='A' || arg[1]=='C' || arg[1]=='c' || arg[1]=='T' || arg[1]=='t'))
            inum = 0
        else
            get_players(players,inum,"")
        //get_players(players,inum,"e",arg[1])
        if (inum==0){
            console_print(id, "%L", LANG_PLAYER, "AINO_NO_CLIENTS")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a) {
            if((arg[1]=='a' || arg[1]=='A') || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T' || arg[1]=='t')) || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C' || arg[1]=='c')))
            {
                set_user_noclip(players[a],str_to_num(arg2))
                g_NoclipMaster[players[a]] = l_postRound;
            }
        }
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all %ss.",name2,arg[1])
                case 1:    client_print(0,print_chat,"[AMXX] ADMIN, set noclip on all %ss.",arg[1])
            }
        console_print(id,"[AMXX] All clients have set noclip")
        log_amx("ADMIN NOCLIP - this command was issued by %s on all %s",name2,arg[1]) 
    } 
    else { 
        new player = cmd_target(id,arg,7) 
        if (!player) return PLUGIN_HANDLED 
        
        set_user_noclip(player,str_to_num(arg2))
        g_NoclipMaster[player] = l_postRound; 
        
        new name[32] 
        get_user_name(player,name,31) 
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on %s.",name2,name)
                case 1:    client_print(0,print_chat,"[AMXX] ADMIN, set noclip on %s.",name)
            }
        console_print(id,"[AMXX] Client ^"%s^" has set noclip",name)
        log_amx("ADMIN NOCLIP - this command was issued by %s on %s",name2,name) 
    } 
    return PLUGIN_HANDLED  
}
//ADMIN TELEPORT v0.9.3 by f117bomb
//=========================================================
new storedorigin[3]

public admin_teleport(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32], sx[8], sy[8], sz[8], origin[3], name2[32]
    new argc = read_argc()
    read_argv(1,arg,31)
    get_user_name(id,name2,31)
    if (argc > 2) {
        read_argv(2,sx,7)
        read_argv(3,sy,7)
        read_argv(4,sz,7)
        origin[0] = str_to_num(sx)
        origin[1] = str_to_num(sy)
        origin[2] = str_to_num(sz)
    }
    else {
        origin = storedorigin
    }
    new player = cmd_target(id,arg,7)
    if (!player) return PLUGIN_HANDLED
    set_user_origin(player, origin)
    new name[32]
    get_user_name(player,name,31)
    switch(get_cvar_num("amx_show_activity"))    {
        case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: teleported %s",name2,name)
        case 1:    client_print(0,print_chat,"[AMXX] ADMIN: teleported %s",name)
    }
    console_print(id,"[AMXX] Client ^"%s^" has been teleported to x:%i y:%i z%i",name,origin[0],origin[1],origin[2])
    log_amx("ADMIN TELEPORT - this command was issued by %s on %s",name2,name)
    return PLUGIN_HANDLED
}

public admin_userorigin(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32], origin[3]
    read_argv(1,arg,31)
    new player = cmd_target(id,arg,3)
    if (!player) return PLUGIN_HANDLED
    get_user_origin(player, origin)
    storedorigin = origin
    new name[32]
    get_user_name(player,name,31)
    console_print(id,"[AMXX] Client ^"%s^" origin, x:%i y:%i z%i stored",name,origin[0],origin[1],origin[2])
    return PLUGIN_HANDLED
}

//ADMIN STACK v0.9.3 by f117bomb
//=========================================================

public admin_stack(id,level,cid){ 
    if (!cmd_access(id,level,cid,2)) 
        return PLUGIN_HANDLED 
    
    new arg[32], name2[32] 
    read_argv(1,arg,31) 
    get_user_name(id,name2,31) 
    new player = cmd_target(id,arg,7) 
    if (!player) return PLUGIN_HANDLED 
    
    new sttype[2], name[32], origin[3], inum, players[32] 
    read_argv(2,sttype,1) 
    get_user_origin(player, origin)  
    get_players(players,inum,"a") 
    
    new offsety = 36, offsetz = 96 
    switch( str_to_num(sttype) ){ 
        case 0: offsety = 0 
        case 1: offsetz = 0 
    } 
    
    for(new a=0 ;a<inum ; ++a) { 
        if ((players[a]==player) || (get_user_flags(players[a])&ADMIN_IMMUNITY) ) 
            continue 
        origin[2] += offsetz 
        origin[1] += offsety 
        set_user_origin(players[a], origin) 
    } 
    
    get_user_name(player,name,32)
    switch(get_cvar_num("amx_show_activity"))    {
        case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: stacked all players on %s",name2,name)
        case 1:    client_print(0,print_chat,"[AMXX] ADMIN: stacked all players on %s",name)
    } 
    console_print(id,"[AMXX] Client ^"%s^" has had all players stacked on top of him",name)
    log_amx("ADMIN STACK - this command was issued by %s and stacked all players on %s",name2,name) 
    return PLUGIN_HANDLED  
}

//ADMIN MONEY 1.0 by XxAvalanchexX
//=========================================================
 public cmd_givemoney(id,level,cid)
 {
    // no access
    if(!cmd_access(id,level,cid,3))
        return PLUGIN_HANDLED;

    // grab arguments
    new arg[32], arg2[32];
    read_argv(1,arg,32);
    read_argv(2,arg2,31);

    // get player and validate
    new player = cmd_target(id,arg,2);
    if(!player) return PLUGIN_HANDLED;

    // get money and set it
    new amount = str_to_num(arg2);
    cs_set_user_money(player,cs_get_user_money(player)+amount);

    // get names
    new playerName[32], adminName[32];
    get_user_name(player,playerName,31);
    get_user_name(id,adminName,31);

    // get authids for log
    new playerAuthid[32], adminAuthid[32];
    get_user_authid(player,playerAuthid,31);
    get_user_authid(id,adminAuthid,31);

    log_amx("Give Money: ^"%s<%d><%s><>^" gave ^"%s<%d><%s><>^" $%i",adminName,get_user_userid(id),adminAuthid,playerName,get_user_userid(player),playerAuthid,amount);

    switch(get_cvar_num("amx_show_activity"))
    {
        case 2: client_print(0,print_chat,"ADMIN %s: give %s $%i",adminName,playerName,amount);
        case 1: client_print(0,print_chat,"ADMIN: give %s $%i",playerName,amount);
    }

    console_print(id,"* Gave %s $%i",playerName,amount);

    return PLUGIN_HANDLED;
 }

//ADMIN ALLTALK v1.0 by BigBaller
//=========================================================

public admin_alltalk(id,level){
    if (!(get_user_flags(id)&level)){
        console_print(id,"[AMXX] You have no access to that command.")
        return PLUGIN_HANDLED
    }
    if (read_argc() < 2){
        new alltalk_cvar = get_cvar_num("sv_alltalk")
        console_print(id,"[AMXX] ^"sv_alltalk^" is ^"%i^"",alltalk_cvar)
        return PLUGIN_HANDLED
    }
    new alltalk[6]
    read_argv(1,alltalk,6)
    server_cmd("sv_alltalk %s",alltalk)
    new name[32]
    get_user_name(id,name,31)
    switch(get_cvar_num("amx_show_activity")){
        case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: set sv_alltalk to %s",name,alltalk)
        case 1:    client_print(0,print_chat,"[AMXX] ADMIN: set sv_alltalk to %s",alltalk)
    }
    log_amx("ADMIN ALLTALK - this command was issued by %s. Admin set sv_alltalk to %s",name,alltalk)
    return PLUGIN_HANDLED
}

// Admin Llama 1.4 by SniperBeamer
//===============================================================================
new llama_msg[MESSAGES][] = {
    "Ooorgle!",
    "Bleeeat!",
    "Brawwrr!",
    "Muuuuuh!"
}
new llama_sound[MESSAGES][] = {
    "misc/ooorgle.wav",
    "misc/bleeeat.wav",
    "misc/brawwrr.wav",
    "misc/cow.wav"
}
new bool:ids[33]
new pName[33][32]
//----------------------------------------------------------------------------------------------
public llama(id,level,cid)
    {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    
    new arg[32]
    read_argv(1,arg,31)
    
    if (arg[0]=='@'){
        new plist[32],pnum
        get_players(plist,pnum,"e",arg[1])
        if (pnum==0){
            console_print(id,"No clients in such team")
            return PLUGIN_HANDLED
        }
        for (new i=0; i<pnum; i++){
            if (!(get_user_flags(plist[i])&ADMIN_IMMUNITY)&&!ids[plist[i]])
                {
                get_user_name(plist[i],pName[plist[i]],31)
                ids[plist[i]] = true
                client_cmd(plist[i],"name Llama")
            }
        }
        console_print(id,"[AMXX] You Llamed %s",arg[1])
    }
    else{
        new target = cmd_target(id,arg,3)
        if (!target || ids[target]) return PLUGIN_HANDLED
        ids[target] = true
        get_user_name(target,pName[target],31)
        console_print(id,"[AMXX] You Llamed %s",pName[target])
        client_cmd(target,"name Llama")
    }
    
    return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public unllama(id,level,cid)
    {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    
    new arg[32]
    read_argv(1,arg,31)
    
    if (arg[0]=='@'){
        new plist[32],pnum
        get_players(plist,pnum,"e",arg[1])
        if (pnum==0){
            console_print(id,"No clients in such team")
            return PLUGIN_HANDLED
        }
        for (new i=0; i<pnum; i++){
            if (!(get_user_flags(plist[i])&ADMIN_IMMUNITY)&&ids[plist[i]])
                {
                ids[plist[i]] = false
                client_cmd(ids[plist[i]],"name %s",pName[plist[i]])
            }
        }
        console_print(id,"[AMXX] You un-Llamed %s",arg[1])
    }
    else{
        new target = cmd_target(id,arg,3)
        if (!target || !ids[target]) return PLUGIN_HANDLED
        ids[target] = false
        client_cmd(target,"name %s",pName[target])
        console_print(id,"[AMXX] un-Llamed %s",pName[target])
    }
    
    return PLUGIN_HANDLED
}
public check_say(id)
{
    if (!ids[id]) return PLUGIN_CONTINUE
    
    new said[32]
    read_args(said,31)
    remove_quotes(said)
    for (new i=0; i<MESSAGES; i++)
        if(equal(said,llama_msg[i]))
        return PLUGIN_CONTINUE
    
    new ran = random_num(0,MESSAGES-1)
    client_cmd(id,"say %s",llama_msg[ran])
    if (get_cvar_num("amx_llamasound")) client_cmd(id,"spk %s",llama_sound[ran])
    
    return PLUGIN_HANDLED
}

//----------------------------------------------------------------------------------------------
#define Maxsounds 27
new soundlist[Maxsounds][] = {"Half-Life01","Half-Life02","Half-Life03","Half-Life04","Half-Life05","Half-Life06","Half-Life07","Half-Life08","Half-Life09","Half-Life10","Half-Life11","Half-Life12","Half-Life13","Half-Life14","Half-Life15","Half-Life16","Half-Life17","Prospero01","Prospero02","Prospero03","Prospero04","Prospero05","Suspense01","Suspense02","Suspense03","Suspense05","Suspense07"}
public client_connect(id)
    {
    
    g_GodMaster[id] = false
    g_NoclipMaster[id] = false
    
    if(get_cvar_num("amx_loadsong") == 0)
    return PLUGIN_HANDLED
    ids[id] = false
    new i
    i = random_num(0,Maxsounds-1)
    client_cmd(id,"mp3 play media/%s",soundlist[i])
    g_Players[id] = -1

    if(!(is_user_bot(id)) ){ 
        message_begin( MSG_ALL, gmsg_TeamInfo) 
        write_byte(id) 
        write_string(SpecName) 
        message_end() 
    } 
    return PLUGIN_CONTINUE 
}

//ADMIN GAG 1.8.3 ( 23.02.2005 ) by EKS
//========================================================================================================================================
public block_gagged(id){  // This function is what check the say / team_say messages & block them if the client is blocked.
    if(!g_GagPlayers[id]) return PLUGIN_CONTINUE // Is true if the client is NOT blocked.
    new cmd[5] 
    read_argv(0,cmd,4) 
    if ( cmd[3] == '_' )
        { 
        if (g_GagPlayers[id] & 2){ 
#if GagReason == 1
            client_print(id,print_chat,"* You are Gagged For The Following Reason: %s",gs_GagReason[id]) 
#else
            client_print(id,print_chat,"* You Have Been Gagged") 
#endif

#if PlaySound == 1
            client_cmd(id,"spk barney/youtalkmuch")
#endif
            return PLUGIN_HANDLED 
            } 
        } 
    else if (g_GagPlayers[id] & 1)   { 
#if GagReason == 1
            client_print(id,print_chat,"* You Are Gagged For The Following Reason: %s",gs_GagReason[id]) 
#else
            client_print(id,print_chat,"* You Have Been Gagged") 
#endif
#if PlaySound == 1
            client_cmd(id,"spk barney/youtalkmuch")
#endif
        return PLUGIN_HANDLED 
        } 
    return PLUGIN_CONTINUE 
    } 
public CMD_GagPlayer(id,level,cid) 
{ 
    if(!cmd_access (id,level,cid,1)) return PLUGIN_HANDLED
    new arg[32],VictimID
    
    read_argv(1,arg,31)              // Arg contains Targets nick or Userid
    VictimID = cmd_target(id,arg,8)        // This code here tryes to find out the player index. Either from a nick or #userid
    if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv
    new s_Flags[4],VictimName[32],AdminName[32],flags,ShowFlags[32],CountFlags,s_GagTime[8],Float:f_GagTime

    read_argv(2,arg,31) 
    if (!arg[0]) // This means amx_gag <nick / userid> and no other flag or time was used.
    {
        f_GagTime = DefaultGagTime
        format(s_Flags,7,"abc")
    }
    else
    {
        if(contain(arg,"m")!=-1 && contain(arg,"!")==-1) // This means the time was entered in minuts and not seconds
        {
            copyc(s_GagTime,7,arg, 'm')
            f_GagTime = floatstr(s_GagTime) * 60
        }
        else if(isdigit(arg[0])&& contain(arg,"!")==-1) // The value was entered in seconds
        {
            format(s_GagTime,7,arg)
            f_GagTime = floatstr(s_GagTime)
        }
        read_argv(3,arg,8)
        if (!arg[0])    // No flag has been entered
            format(s_Flags,7,"abc")
        else if(contain(arg,"!")==-1)        // This means that arg did NOT contain the ! symbot
            format(s_Flags,7,arg)
        else if(contain(arg,"!")!=-1)        // This means that arg did DOES contain the ! symbot
            format(s_Flags,7,"abc")
        if (f_GagTime == 0.0)
        {
            read_argv(2,arg,8)
            if(contain(arg,"!")!=-1)
                format(s_Flags,3,"abc") // Flag was entered.
            else
                format(s_Flags,3,arg) // Flag was entered.
            f_GagTime = DefaultGagTime
        }
#if GagReason == 1
        new GagReasonFound=0
        for(new i=2;i<=4;i++)
        {
            read_argv(i,arg,31)
            if(contain(arg,"!")!=-1)
            {    
                read_args(arg,31)
                new tmp[32]
                copyc(tmp,32,arg,33)
                copy(gs_GagReason[VictimID],47,arg[strlen(tmp)+1])
                GagReasonFound = 1
            }
        }
        if(GagReasonFound == 0)    // If no reason was entered, add the std reason.
            format(gs_GagReason[VictimID],47,"You Were Gagged For Not Following The Rules")
#endif
    }

    flags = read_flags(s_Flags) // Converts the string flags ( a,b or c ) into a int
    g_GagPlayers[VictimID] = flags 
#if VoiceCommMute == 1
    if(flags & 4) // This code checks if the c flag was used ( reprisented by the number 4 ), If pressent it mutes his voicecomm.
        set_speak(VictimID, SPEAK_MUTED)
#endif
    new TaskParm[1]        // For some reason set_task requires a array. So i make a array :)
    TaskParm[0] = VictimID
    set_task( f_GagTime,"task_UnGagPlayer",VictimID,TaskParm,1) 

    CountFlags = 0
    if (flags & 1)
    {
        format(ShowFlags,31,"say")
        CountFlags++
    }
    if (flags & 2)
    {
        if(CountFlags)
            format(ShowFlags,31,"%s / say_team",ShowFlags)
        if(!CountFlags)
            format(ShowFlags,31,"say_team")
    }
#if VoiceCommMute != 0
    if(flags & 4)
    {
        if(CountFlags)
            format(ShowFlags,31,"%s / voicecomm",ShowFlags)
        if(!CountFlags)
            format(ShowFlags,31,"voicecomm")        
    }
#endif
    get_user_name(id,AdminName,31)
    get_user_name(VictimID,VictimName,31)
    switch(get_cvar_num("amx_show_activity"))   
    { 
#if GagReason == 1
        case 2:   client_print(0,print_chat,"ADMIN %s: Has Gagged %s From Speaking For %0.0f Minutes, For: %s ( %s )",AdminName,VictimName,(f_GagTime / 60),gs_GagReason[VictimID],ShowFlags) // debug added
           case 1:   client_print(0,print_chat,"ADMIN: Has Gagged %s From Speaking For %0.0f Minutes, For: %s ( %s )",VictimName,(f_GagTime / 60),gs_GagReason[VictimID],ShowFlags) 
#else
        case 2:   client_print(0,print_chat,"ADMIN %s: Has Gagged %s From Speaking For %0.0f Minutes ( %s )",AdminName,VictimName,(f_GagTime / 60),ShowFlags) // debug added
           case 1:   client_print(0,print_chat,"ADMIN: Has Gagged %s From Speaking For %0.0f Minutes ( %s )",VictimName,(f_GagTime / 60),ShowFlags) 
#endif
     
     }    
#if LogAdminActions == 1
    new parm[5] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a gag or Ungag | 3 = The gag flags | 4  = Length of the gag */
    parm[0] = VictimID
    parm[1] = id
    parm[2] = 0
    parm[3] = flags
    parm[4] = floatround(Float:f_GagTime)
    LogAdminAction(parm)
#endif
    return PLUGIN_HANDLED
} 

public CMD_UnGagPlayer(id,level,cid)   /// Removed gagged player ( done via console command )
{
    new arg[32],VictimID
    read_argv(1,arg,31)              // Arg contains Targets nick
    
    VictimID = cmd_target(id,arg,8)        // This code here tryes to find out the player index. Either from a nick or #userid
    if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv

    new AdminName[32],VictimName[32] 

    get_user_name(id,AdminName,31)        // Gets Admin name
    get_user_name(VictimID,VictimName,31)

    if(!g_GagPlayers[VictimID])        // Checks if player has gagged flag
    {
        console_print(id,"%s Is Not Gagged & Cannot Be Ungagged.",arg)
        return PLUGIN_HANDLED
    }
    switch(get_cvar_num("amx_show_activity"))   
    { 
           case 2:   client_print(0,print_chat,"ADMIN %s: Has Ungagged %s",AdminName,VictimName) 
           case 1:   client_print(0,print_chat,"ADMIN: Has Ungagged %s",VictimName) 
      }

#if LogAdminActions == 1
    new parm[3] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a gag or Ungag | 3 = The gag flags | 4  = Length of the gag */
    parm[0] = VictimID
    parm[1] = id
    parm[2] = 1
    LogAdminAction(parm)
#endif
    remove_task(VictimID)        // Removes the set_task set to ungag the player
    UnGagPlayer(VictimID)        // This is the function that does the actual removal of the gag info
    return PLUGIN_HANDLED
} 

#if BlockNameChange == 1
public client_infochanged(id)
{
    if(g_GagPlayers[id])
    {
        new newname[32], oldname[32]
        get_user_info(id, "name", newname,31)
        get_user_name(id,oldname,31)
    
        if (!equal(oldname,newname))
        {
            client_print(id,print_chat,"* Gagged Clients Cannot Change Their Name")
            set_user_info(id,"name",oldname)
        }
    }
}
#endif
public task_UnGagPlayer(TaskParm[])    // This function is called when the task expires
{
    new VictimName[32]
    get_user_name(TaskParm[0],VictimName,31)
    client_print(0,print_chat,"ADMIN: %s Is No Longer Gagged",VictimName)
    UnGagPlayer(TaskParm[0])
}
#if LogAdminActions == 1
stock LogAdminAction(parm[]) // This code is what logs the admin actions.
{ 
    new VictimName[32],AdminName[32],AdminAuth[35],VictimAuth[35]
    get_user_name(parm[1],AdminName,31)
    get_user_name(parm[0],VictimName,31)
    get_user_authid(parm[1],AdminAuth,34)
    get_user_authid(parm[0],VictimAuth,34)

#if GagReason == 1
    if(parm[2] == 0)
        log_amx("Gag: ^"%s<%s>^" Has Gagged %s <%s> for %d ( %d ) Reason: %s",AdminName,AdminAuth,VictimName,VictimAuth,parm[4],parm[3],gs_GagReason[parm[0]])
#else
    if(parm[2] == 0)
        log_amx("Gag: ^"%s<%s>^" Has Gagged %s <%s> for %d ( %d )",AdminName,AdminAuth,VictimName,VictimAuth,parm[4],parm[3])
#endif
    if(parm[2] == 1)
        log_amx("UnGag: ^"%s<%s>^" Has Ungagged %s<%s>",AdminName,AdminAuth,VictimName,VictimAuth)
}
#endif
stock UnGagPlayer(id) // This code is what removes the gag.
{ 
#if VoiceCommMute == 1
    if(g_GagPlayers[id] & 4)    // Unmutes the player if he had voicecomm muted.
    {
        if(get_cvar_num("sv_alltalk") == 1)
            set_speak(id, SPEAK_ALL)
        else 
            set_speak(id, SPEAK_NORMAL)
    }
#endif
    g_GagPlayers[id] = 0
#if GagReason == 1
    setc(gs_GagReason[id],31,0)
#endif
}
#if AllowOtherPlugin2Interface == 1
public func_AddGag(id)
{
    g_GagPlayers[id] = 7 
    new TaskParm[1]        // For some reason set_task requires a array. So i make a array :)
    TaskParm[0] = id
#if VoiceCommMute == 1
    set_speak(id, SPEAK_MUTED)
#endif
    set_task( DefaultGagTime,"task_UnGagPlayer",id,TaskParm,1)
}

public func_RemoveGag(id)
{
    remove_task(id)        // Removes the set_task set to ungag the player
    UnGagPlayer(id)
}
#endif


//ADMIN GRAVITY v0.2 by JustinHoMi
//============================================================================================================================================

public admin_gravity(id,level){
    if (!(get_user_flags(id)&level)){
        console_print(id,"[AMXX] You have no access to that command.")
        return PLUGIN_HANDLED
    }
    if (read_argc() < 2){
        new gravity_cvar = get_cvar_num("sv_gravity")
        console_print(id,"[AMXX] ^"sv_gravity^" is ^"%i^"",gravity_cvar)
        return PLUGIN_HANDLED
    }
    new gravity[6]
    read_argv(1,gravity,6)
    server_cmd("sv_gravity %s",gravity)
    new name[32]
    get_user_name(id,name,31)
    switch(get_cvar_num("amx_show_activity")){
        case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: set gravity to %s",name,gravity)
        case 1:    client_print(0,print_chat,"[AMXX] ADMIN: set gravity to %s",gravity)
    }
    console_print(id,"[AMXX] Gravity has been set to %s",gravity)
    log_amx("ADMIN GRAVITY - this command was issued by %s. Admin set sv_gravity to %s",name,gravity)
    return PLUGIN_HANDLED
}

public check_gravity(id){
    new gravity = get_cvar_num("sv_gravity")
    client_print(id,print_chat,"[AMXX] The gravity is set at %i",gravity)
    return PLUGIN_HANDLED
}


//ADMIN GLOW v1.3.3 ( 3.11.2004 ) by EKS
//=================================================================================================================================

public CMD_Glow(id,level,cid) // This is the funtion called by amx_glow
{ 
    new  VictimName[32],VictimID
    read_argv(1,VictimName,31)              // This code here reads out the targed.
    VictimID = cmd_target(7,VictimName,32)        // This code here tryes to find out the player index. Either from a nick or #userid
    if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv
    new AdminName[32],Color[12]        // There is no point in starting to make arrays thats not needed, if the above if is true.
    new ColorNR = -1            // This int is made with the value -1 so it can easly be used to check if a valid color has been found & later be used to log what color the admin used.
    read_argv(2,Color,11)
    for(new i = 0;i<MaxColorCount;i++) // This loop is used to check every entry in g_ColorNames
        {
        if (equal(Color,g_ColorNames[i],11))
            {
#if WhatModule == 2
            set_user_rendering(VictimID,kRenderFxGlowShell,g_ColorR[i],g_ColorG[i],g_ColorB[i],kRenderNormal,25)
#else            
            set_rendering(VictimID,kRenderFxGlowShell,g_ColorR[i],g_ColorG[i],g_ColorB[i],kRenderNormal,25)
#endif
            ColorNR = i
            g_Players[VictimID] = i
            }
        }
    if(ColorNR == -1) // If no vaild color has been found, tell the admin and stop the plugin.
        {
        new ColorList[128]
        for(new i = 0;i<MaxColorCount;i++)
            {
            add(ColorList,127,g_ColorNames[i])
            add(ColorList,127," ")    // This is a evil hack, to add spaces.
            }
        console_print(id,"[AMX] %s is not a supported color,vaild colors are:%s",Color,ColorList)
        return PLUGIN_HANDLED
        }
    get_user_name(id,AdminName,31)
    get_user_name(VictimID,VictimName,31)
    switch(get_cvar_num("amx_show_activity"))   { 
           case 2:   client_print(0,print_chat,"ADMIN %s: has made %s glow %s",AdminName,VictimName,g_ColorNames[ColorNR])
           case 1:   client_print(0,print_chat,"ADMIN: %s is now glowing %s",VictimName,g_ColorNames[ColorNR])
           }
#if LogAdminActions == 1
    new parm[4] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a glow or Unglow */
    parm[0] = VictimID
    parm[1] = id
    parm[2] = 0
    parm[3] = ColorNR
    LogAdminAction2(parm)
#endif
    return PLUGIN_HANDLED
} 

public CMD_UnGlow(id,level,cid)  // Removed gaged player ( done via console command )
{
    new VictimName[32],AdminName[32],VictimID 
    read_argv(1,VictimName,31)             // This code here reads out the targed.
    VictimID = cmd_target(7,VictimName,32)     // This code here tryes to find out the player index. Either from a nick or #userid
    if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) || !VictimID ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv

    get_user_name(id,AdminName,31)
    get_user_name(VictimID,VictimName,31)
    if(g_Players[VictimID] == -1)
        {
        console_print(id,"[AMX] %s is not glowing in any color",VictimName)
        return PLUGIN_HANDLED
        }
#if WhatModule == 2
    set_user_rendering(VictimID,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
#else
    set_rendering(VictimID,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
#endif
    switch(get_cvar_num("amx_show_activity"))   { 
           case 2:   client_print(0,print_chat,"ADMIN %s: made %s stop glowing %s",AdminName,VictimName,g_ColorNames[g_Players[VictimID]]) 
           case 1:   client_print(0,print_chat,"ADMIN: %s is no longer glowing %s",VictimName,g_ColorNames[g_Players[VictimID]]) 
           }
    g_Players[VictimID] = -1
#if LogAdminActions == 1
    new parm[4] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a glow or Unglow */
    parm[0] = VictimID
    parm[1] = id
    parm[2] = 1
    LogAdminAction2(parm)
#endif
    return PLUGIN_HANDLED 
} 

#if LogAdminActions == 1
LogAdminAction2(parm[]) // This code is what removes the glow.
{ 
    new VictimName[32],AdminName[32],AdminAuth[35],VictimAuth[35]
    get_user_name(parm[1],AdminName,31)
    get_user_name(parm[0],VictimName,31)
    get_user_authid(parm[1],AdminAuth,34)
    get_user_authid(parm[0],VictimAuth,34)

    if(parm[2] == 0)
        log_amx("Glow: ^"%s<%s>^" has made %s <%s> glow %s",AdminName,AdminAuth,VictimName,VictimAuth,g_ColorNames[parm[3]])
    if(parm[2] == 1)
        log_amx("UnGlow: ^"%s<%s>^" has removed the glow from %s<%s>",AdminName,AdminAuth,VictimName,VictimAuth)
}
#endif


//ADMIN BURY v0.9.3 by f117bomb
//=============================================================================================================

bury_player(id,victim){
    new name[32], iwpns[32], nwpn[32], iwpn
    get_user_name(victim,name,31)
    get_user_weapons(victim,iwpns,iwpn)
    for(new a=0;a<iwpn;++a) {
        get_weaponname(iwpns[a],nwpn,31)
        engclient_cmd(victim,"drop",nwpn)
    }
    engclient_cmd(victim,"weapon_knife")
    new origin[3]
    get_user_origin(victim, origin)
    origin[2] -=    30
    set_user_origin(victim, origin)
    console_print(id,"[AMXX] Client ^"%s^" has been burried",name)
}


public admin_bury(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32], admin_name[32], player_name[32]
    read_argv(1,arg,31)
    get_user_name(id,admin_name,31)
    if (arg[0]=='@'){
        new players[32], inum
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No clients in such team")
            return    PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a){
            if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                get_user_name(players[a],player_name,31)
                console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",player_name)
                continue
            }
            bury_player(id,players[a])
        }
        switch(get_cvar_num("amx_show_activity")) {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: has buried    all %s",admin_name,arg[1])
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: has buried all %s",arg[1])
        }
        log_amx("ADMIN BURY - this command was issued by %s. Admin buried all of the %s",admin_name,arg[1])
    }
    else    {
        new player = cmd_target(id,arg,7)
        if (!player) return PLUGIN_HANDLED
        bury_player(id,player)
        get_user_name(player,player_name,31)
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: has buried    %s",admin_name,player_name)
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: has buried %s",player_name)
        }
        log_amx("ADMIN BURY - this command was issued by %s. Admin has buried %s",admin_name,player_name)
    }
    return PLUGIN_HANDLED
}

unbury_player(id,victim){
    new name[32], origin[3]
    get_user_name(victim,name,31)
    get_user_origin(victim, origin)
    origin[2] +=    35
    set_user_origin(victim, origin)
    console_print(id,"[AMXX] Client ^"%s^" has been unburried",name)
}

public admin_unbury(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32],    player_name[32], name2[32]
    read_argv(1,arg,31)
    get_user_name(id,name2,31)
    if (arg[0]=='@'){
        new players[32], inum , name[32]
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No clients in such team")
            return    PLUGIN_HANDLED
        }
        for(new    a=0;a<inum;++a){
            if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                get_user_name(players[a],name,31)
                console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",name)
                continue
            }
            unbury_player(id,players[a])
        }
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: has unburied all %s",name2,arg[1])
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: has unburied all %s",arg[1])
        }
        log_amx("ADMIN BURY - this command was issued by %s. Admin has buried %s",name2,arg[1])
    }
    else    {
        new player = cmd_target(id,arg,7)
        if (!player) return PLUGIN_HANDLED
        unbury_player(id,player)
        get_user_name(player,player_name,31)
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: has unburied %s",name2,player_name)
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: has unburied %s",player_name)
        }
        log_amx("ADMIN UNBURY - this command was issued by %s. Admin has unburied %s",name2,player_name)
    }
    return PLUGIN_HANDLED
}

//ADMIN DISARM v1.1 by mike_cao
//============================================================================================================================

disarm_player(id,victim){
    
    new name[32], origin[3], name2[32]
    get_user_origin(victim,origin)
    origin[2] -= 2000
    set_user_origin(victim,origin)
    new iweapons[32], wpname[32], inum
    get_user_weapons(victim,iweapons,inum)
    for(new a=0;a<inum;++a){
        get_weaponname(iweapons[a],wpname,31)
        engclient_cmd(victim,"drop",wpname)
    }
    engclient_cmd(victim,"weapon_knife")
    origin[2] += 2005
    set_user_origin(victim,origin)
    get_user_name(victim,name,31)
    console_print(id,"[AMXX] Client ^"%s^" has been disarmed",name)
    get_user_name(id,name2,31)
    log_amx("ADMIN DISARM - this command was issued by %s. Admin has disarmed %s",name2,name)
}

public admin_disarm(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32]
    read_argv(1,arg,31)
    if (arg[0]=='@'){
        new players[32], /*name[32],*/ inum
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No alive clients in such team")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a){
            disarm_player(id,players[a])
        }
    }
    else {
        new player = cmd_target(id,arg,5)
        if (!player) return PLUGIN_HANDLED
        disarm_player(id,player)
    }
    return PLUGIN_HANDLED
}

//AMX UBER SLAP v0.9.3 by BarMan (Skullz.NET)
//=================================================================================================================

public admin_slap(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    
    new name[32], name2[32]
    new arg[32]
    read_argv(1,arg,31)
    new player = cmd_target(id,arg,5)
    if (!player)
        return PLUGIN_HANDLED
    
    new ids[2]
    ids[0] = player
    get_user_name(player,name,32)
    udisarm_player(id,player)
    set_task(0.1, "slap_player", 0, ids, 1, "a", 100)
    set_task(11.5, "last_words", 0, ids, 1, "a", 0)
    get_user_name(id,name2,31)
    log_amx("ADMIN UBERSLAP - this command was issued by %s. Admin has uberslapped %s",name2,name)
    return PLUGIN_HANDLED
}

public udisarm_player(id,victim){
    new name[32], origin[3]
    get_user_origin(victim,origin)
    origin[2] -= 2000
    set_user_origin(victim,origin)
    new iweapons[32], wpname[32], inum
    get_user_weapons(victim,iweapons,inum)
    for(new a=0;a<inum;++a){
        get_weaponname(iweapons[a],wpname,31)
        engclient_cmd(victim,"drop",wpname)
    }
    engclient_cmd(victim,"weapon_knife")
    origin[2] += 2005
    set_user_origin(victim,origin)
    get_user_name(victim,name,31)
    return PLUGIN_CONTINUE
}

public last_words(ids[]) {
    client_cmd(0,"spk misc/knockedout")
    return PLUGIN_HANDLED
}

public slap_player(ids[]) {
    new id = ids[0]
    new upower = 1,nopower= 0
    if (get_user_health(id) > 1){
        user_slap(id,upower)
        } else {
        user_slap(id,nopower)
    }
    return PLUGIN_CONTINUE
}

//ADMIN SLAY 2 v0.9.3 by f117bomb
//====================================================================================================================

new light, s2smoke, s2white

slay_player(id,victim,type) {
    new origin[3], srco[3], name[32], name2[32]
    get_user_name(victim,name,31)
    get_user_name(id,name2,31)
    get_user_origin(victim,origin)
    origin[2] -= 26
    srco[0]=origin[0]+150
    srco[1]=origin[1]+150
    srco[2]=origin[2]+400
    switch(type){
        case 1:{
            lightning(srco,origin)
            emit_sound(victim,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 2:{
            blood(origin)
            emit_sound(victim,CHAN_ITEM, "weapons/headshot2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        case 3:    explode(origin)
    }
    user_kill(victim,1)
    console_print(id,"[AMXX] Client ^"%s^" has been slayed",name)
    log_amx("ADMIN SLAY 2 - this command was issued by %s. Admin has slayed %s",name2,name)
}

public admin_slay(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32], arg2[3], type
    read_argv(1,arg,31)
    read_argv(2,arg2,2)
    type = str_to_num(arg2)
    if (arg[0]=='@'){
        new players[32], inum , name[32]
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No clients in such team")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a){
            if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                get_user_name(players[a],name,31)
                console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",name)
                continue
            }
            slay_player(id,players[a],type)
        }
    }
    else {
        new player = cmd_target(id,arg,5)
        if (!player) return PLUGIN_HANDLED
        slay_player(id,player,type)
    }
    return PLUGIN_HANDLED
}

explode(vec1[3]) {
    // blast circles
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
    write_byte( 21 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2] + 16)
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2] + 1936)
    write_short( s2white )
    write_byte( 0 ) // startframe
    write_byte( 0 ) // framerate
    write_byte( 2 ) // life
    write_byte( 16 ) // width
    write_byte( 0 ) // noise
    write_byte( 188 ) // r
    write_byte( 220 ) // g
    write_byte( 255 ) // b
    write_byte( 255 ) //brightness
    write_byte( 0 ) // speed
    message_end()
    //Explosion2
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte( 12 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_byte( 188 ) // byte (scale in 0.1's)
    write_byte( 10 ) // byte (framerate)
    message_end()
    //s2smoke
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
    write_byte( 5 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_short( s2smoke )
    write_byte( 2 )
    write_byte( 10 )
    message_end()
}

blood(vec1[3]) {
    //LAVASPLASH
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte( 10 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2])
    message_end()
}

lightning(vec1[3],vec2[3]) {
    //Lightning
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte( 0 )
    write_coord(vec1[0])
    write_coord(vec1[1])
    write_coord(vec1[2])
    write_coord(vec2[0])
    write_coord(vec2[1])
    write_coord(vec2[2])
    write_short( light )
    write_byte( 1 ) // framestart
    write_byte( 5 ) // framerate
    write_byte( 2 ) // life
    write_byte( 20 ) // width
    write_byte( 30 ) // noise
    write_byte( 200 ) // r, g, b
    write_byte( 200 ) // r, g, b
    write_byte( 200 ) // r, g, b
    write_byte( 200 ) // brightness
    write_byte( 200 ) // speed
    message_end()
    //Sparks
    message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
    write_byte( 9 )
    write_coord( vec2[0] )
    write_coord( vec2[1] )
    write_coord( vec2[2] )
    message_end()
    //s2smoke
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
    write_byte( 5 )
    write_coord(vec2[0])
    write_coord(vec2[1])
    write_coord(vec2[2])
    write_short( s2smoke )
    write_byte( 10 )
    write_byte( 10 )
    message_end()
}

//ADMIN FIRE v1.0.0 by f117bomb
//=========================================================
new gmsgDamage,smoke,mflash
new onfire[33]

public ignite_effects(skIndex[])   {
    new kIndex = skIndex[0]
    gmsgDamage = get_user_msgid("Damage")
    
    if (is_user_alive(kIndex) && onfire[kIndex] )    {
        new korigin[3] 
        get_user_origin(kIndex,korigin)
                
        //TE_SPRITE - additive sprite, plays 1 cycle
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY) 
        write_byte( 17 ) 
        write_coord(korigin[0])  // coord, coord, coord (position) 
        write_coord(korigin[1])  
        write_coord(korigin[2]) 
        write_short( mflash ) // short (sprite index) 
        write_byte( 20 ) // byte (scale in 0.1's)  
        write_byte( 200 ) // byte (brightness)
        message_end()
        
        //Smoke
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY,korigin)
        write_byte( 5 )
        write_coord(korigin[0])// coord coord coord (position) 
        write_coord(korigin[1])
        write_coord(korigin[2])
        write_short( smoke )// short (sprite index)
        write_byte( 20 ) // byte (scale in 0.1's)
        write_byte( 15 ) // byte (framerate)
        message_end()
        
        set_task(0.2, "ignite_effects" , 0 , skIndex, 2)        
    }    
    else    {
        if( onfire[kIndex] )   {
            emit_sound(kIndex,CHAN_AUTO, "scientist/scream21.wav", 0.6, ATTN_NORM, 0, PITCH_HIGH)
            onfire[kIndex] = 0
        }
    }    
    return PLUGIN_CONTINUE
}

public ignite_player(skIndex[])   {
    new kIndex = skIndex[0]
        
    if (is_user_alive(kIndex) && onfire[kIndex] )    {
        new korigin[3] 
        new players[32], inum = 0
        new pOrigin[3]        
        new kHeath = get_user_health(kIndex)
        get_user_origin(kIndex,korigin)
        
        //create some damage
        set_user_health(kIndex,kHeath - 10)
        message_begin(MSG_ONE, gmsgDamage, {0,0,0}, kIndex) 
        write_byte(30) // dmg_save
        write_byte(30) // dmg_take 
        write_long(1<<21) // visibleDamageBits 
        write_coord(korigin[0]) // damageOrigin.x 
        write_coord(korigin[1]) // damageOrigin.y
        write_coord(korigin[2]) // damageOrigin.z 
        message_end()
                
        //create some sound
        emit_sound(kIndex,CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM)
                
        //Ignite Others                
        get_players(players,inum,"a")
        for(new i = 0 ;i < inum; ++i)   {                                    
            get_user_origin(players[i],pOrigin)                
            if( get_distance(korigin,pOrigin) < 100  )   {
                if( !onfire[players[i]] )   {
                    new spIndex[2] 
                    spIndex[0] = players[i]
                    new pName[32], kName[32]                    
                    get_user_name(players[i],pName,31)
                    get_user_name(kIndex,kName,31)
                    emit_sound(players[i],CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)
                    client_print(0,3,"* [AMXX] OH! NO! %s has caught %s on fire!",kName,pName)
                    onfire[players[i]] =1
                    ignite_player(players[i])
                    ignite_effects(players[i])    
                }                    
            }
        }            
        players[0] = 0
        pOrigin[0] = 0                    
        korigin[0] = 0        
        
        //Call Again in 2 seconds        
        set_task(2.0, "ignite_player" , 0 , skIndex, 2)        
    }    
        
    return PLUGIN_CONTINUE
}


public fire_player(id,level,cid) { 
    if (!cmd_access(id,level,cid,2)) 
        return PLUGIN_HANDLED 
    
    new arg[32]
    read_argv(1,arg,31)
    
    new victim = cmd_target(id,arg,7) 
    if (!victim) 
        return PLUGIN_HANDLED 

    new skIndex[2]
    skIndex[0] = victim    
    new name[32]
    get_user_name(victim,name,31) 
    
    onfire[victim] = 1
    ignite_effects(skIndex)
    ignite_player(skIndex)
        
    new adminname[32]  
        get_user_name(id,adminname,31)  
    switch(get_cvar_num("amx_show_activity"))   { 
             case 2:   client_print(0,print_chat,"ADMIN %s: set %s on fire.",adminname,name) 
             case 1:   client_print(0,print_chat,"ADMIN: set %s on fire.",name) 
    } 
        
    console_print(id,"Client ^"%s^" has been set on fire...",name) 
    
    return PLUGIN_HANDLED 
}  



//ADMIN ROCKET v1.3 by f117bomb
//=========================================================
new  m_blueflare2,rmflash,rgmsgDamage,white,rsmoke,rocket_z[33]

public rocket_liftoff(svictim[])   {
    new victim = svictim[0]
    
    set_user_gravity(victim,-0.50)
    client_cmd(victim,"+jump;wait;wait;-jump")
    emit_sound(victim, CHAN_VOICE, "weapons/rocket1.wav", 1.0, 0.5, 0, PITCH_NORM)
    rocket_effects(svictim)
    
    return PLUGIN_CONTINUE
}

public rocket_effects(svictim[])   {
    new victim = svictim[0]
    
    if ( is_user_alive(victim) )   {
        new vorigin[3]
        get_user_origin(victim,vorigin)
        
        message_begin(MSG_ONE, rgmsgDamage, {0,0,0}, victim)
        write_byte(30) // dmg_save
        write_byte(30) // dmg_take
        write_long(1<<16) // visibleDamageBits
        write_coord(vorigin[0]) // damageOrigin.x
        write_coord(vorigin[1]) // damageOrigin.y
        write_coord(vorigin[2]) // damageOrigin.z
        message_end()
        
        if(rocket_z[victim] == vorigin[2])
            rocket_explode(svictim)
        
        rocket_z[victim] = vorigin[2]
        
        //Draw Trail and effects
        
        //TE_SPRITETRAIL - line of moving glow sprites with gravity, fadeout, and collisions
        message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
        write_byte( 15 )
        write_coord( vorigin[0]) // coord, coord, coord (start)
        write_coord( vorigin[1])
        write_coord( vorigin[2])
        write_coord( vorigin[0]) // coord, coord, coord (end)
        write_coord( vorigin[1])
        write_coord( vorigin[2] - 30)
        write_short( m_blueflare2 ) // short (sprite index)
        write_byte( 5 ) // byte (count)
        write_byte( 1 ) // byte (life in 0.1's)
        write_byte( 1 )  // byte (scale in 0.1's)
        write_byte( 10 ) // byte (velocity along vector in 10's)
        write_byte( 5 )  // byte (randomness of velocity in 10's)
        message_end()
        
        //TE_SPRITE - additive sprite, plays 1 cycle
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte( 17 )
        write_coord(vorigin[0])  // coord, coord, coord (position)
        write_coord(vorigin[1])
        write_coord(vorigin[2] - 30)
        write_short( rmflash ) // short (sprite index)
        write_byte( 15 ) // byte (scale in 0.1's)
        write_byte( 255 ) // byte (brightness)
        message_end()
        
        set_task(0.2, "rocket_effects" , 0 , svictim, 2)
    }
    
    return PLUGIN_CONTINUE
}

public rocket_explode(svictim[])   {
    new victim = svictim[0]
    
    if ( is_user_alive(victim) )   {   /*If user is alive create effects and user_kill */
        new vec1[3]
        get_user_origin(victim,vec1)
        
        // blast circles
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
        write_byte( 21 )
        write_coord(vec1[0])
        write_coord(vec1[1])
        write_coord(vec1[2] - 10)
        write_coord(vec1[0])
        write_coord(vec1[1])
        write_coord(vec1[2] + 1910)
        write_short( white )
        write_byte( 0 ) // startframe
        write_byte( 0 ) // framerate
        write_byte( 2 ) // life
        write_byte( 16 ) // width
        write_byte( 0 ) // noise
        write_byte( 188 ) // r
        write_byte( 220 ) // g
        write_byte( 255 ) // b
        write_byte( 255 ) //brightness
        write_byte( 0 ) // speed
        message_end()
        
        //Explosion2
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte( 12 )
        write_coord(vec1[0])
        write_coord(vec1[1])
        write_coord(vec1[2])
        write_byte( 188 ) // byte (scale in 0.1's)
        write_byte( 10 ) // byte (framerate)
        message_end()
        
        //rsmoke
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
        write_byte( 5 )
        write_coord(vec1[0])
        write_coord(vec1[1])
        write_coord(vec1[2])
        write_short( rsmoke )
        write_byte( 2 )
        write_byte( 10 )
        message_end()
        
        user_kill(victim,1)
    }
    
    
    //stop_sound
    emit_sound(victim, CHAN_VOICE, "weapons/rocket1.wav", 0.0, 0.0, (1<<5), PITCH_NORM)
    
    set_user_maxspeed(victim,1.0)
    set_user_gravity(victim,1.00)
    
    return PLUGIN_CONTINUE
}


public rocket_player(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32],arg2[3]
    read_argv(1,arg,31)
    read_argv(2,arg2,2)
    if (arg[0]=='@') {
        new players[32], inum , name[32]
        get_players(players,inum,"ae",arg[1])
        if (inum==0){
            console_print(id,"[AMXX] No clients in such team")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a){
            if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                get_user_name(players[a],name,31)
                console_print(id,"[AMXX] Skipping ^"%s^" because client has immunity",name)
                continue
            }
            new sPlayer[2]
            sPlayer[0] = players[a]
            emit_sound(players[a],CHAN_WEAPON ,"weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
            set_user_maxspeed(players[a],0.01)
            set_task(1.2, "rocket_liftoff" , 0 , sPlayer, 2)
        }
    }
    else {
        new player = cmd_target(id,arg,5)
        if (!player)
            return PLUGIN_HANDLED
        new sPlayer[2]
        sPlayer[0] = player
        emit_sound(player,CHAN_WEAPON ,"weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
        set_user_maxspeed(player,0.01)
        set_task(1.2, "rocket_liftoff" , 0 , sPlayer, 2)
        
        new playername[32]
        get_user_name(player,playername,31)
        new name[32]
        get_user_name(id,name,31)
        switch(get_cvar_num("amx_show_activity")){
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN %s: created a rocket out of %s",name,playername)
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN: created a rocket out of %s",playername)
        }
        console_print(id,"[AMXX] Client ^"%s^" has been set to explode...",playername)
        log_amx("ADMIN ROCKET - this command was issued by %s. Admin has created a rocket out of %s",name,playername)
    }
    rgmsgDamage = get_user_msgid("Damage")
    return PLUGIN_HANDLED
} 


//Admin Weapon II Build 6.4.2 by SniperBeamer
//========================================================================================
public admin_weapon(id,level,cid)
    {
    if ( !cmd_access(id,level,cid,3) )
        return PLUGIN_HANDLED
    
    new arg1[32],arg2[8],weapon
    read_argv(1,arg1,31)
    read_argv(2,arg2,7)
    weapon = str_to_num(arg2)
    if ( equali(arg1,"@all") )
        {
        new plist[32],pnum
        get_players(plist,pnum,"a")
        if (pnum==0)
            {
            console_print(id,"[AMXX] This client is invalid.")
            return PLUGIN_HANDLED
        }
        for (new i=0; i<pnum; i++)
            if ( !give_weapon(plist[i],weapon) )
            {
            console_print(id,"[AMXX] Gave all the players the weapon%d.",weapon)
        }
        console_print(id,"[AMXX] Gave all the players the weapon %d.",weapon)
    }
    else if ( arg1[0]=='@' )
        {
        new plist[32],pnum
        get_players(plist,pnum,"ae",arg1[1])
        if ( pnum==0 )
            {
            console_print(id,"[AMXX] No clients in such team.")
            return PLUGIN_HANDLED 
        }
        for (new i=0; i<pnum; i++) 
            give_weapon(plist[i],weapon)
        console_print(id,"[AMXX] Gave all %ss the weapon %d.",arg1[1],weapon)
    }
    else
    {
        new pName[32] 
        new player = cmd_target(id,arg1,6)
        if (!player) return PLUGIN_HANDLED
        give_weapon(player,weapon)
        get_user_name(player,pName,31)
        console_print(id,"[AMXX] Gave %s the weapon %d.",pName,weapon)
    }
    return PLUGIN_HANDLED
}
give_weapon(id,weapon)
{
    switch (weapon)
    {
        //Secondary weapons
        //Pistols
        case 11:{
            give_item(id,"weapon_glock18")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
        }
        case 12:{
            give_item(id,"weapon_usp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
        }
        case 13:{
            give_item(id,"weapon_p228")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig") 
        }
        case 14:{
            give_item(id,"weapon_deagle")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
        }
        case 15:{
            give_item(id,"weapon_fiveseven")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
        }
        case 16:{
            give_item(id,"weapon_elite")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
        }
        case 17:{
            give_item(id,"weapon_usp")
            give_item(id,"weapon_glock18")
            give_item(id,"weapon_deagle")
            give_item(id,"weapon_p228")
            give_item(id,"weapon_elite")
            give_item(id,"weapon_fiveseven")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
        }
        //Primary weapons
        //Shotguns
        case 21:{
            give_item(id,"weapon_m3")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
        }
        case 22:{
            give_item(id,"weapon_xm1014")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
        }
        //SMGs
        case 31:{
            give_item(id,"weapon_tmp")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
        }
        case 32:{
            give_item(id,"weapon_mac10")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
        }
        case 33:{
            give_item(id,"weapon_mp5navy")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
        }
        case 34:{
            give_item(id,"weapon_p90")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
        }
        
        case 35:{ 
            give_item(id,"weapon_ump45")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
        } 
        //Rifles 
        case 40:{
            give_item(id,"weapon_famas")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 41:{
            give_item(id,"weapon_galil")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 42:{
            give_item(id,"weapon_ak47")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
        }
        case 43:{
            give_item(id,"weapon_m4a1")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 44:{
            give_item(id,"weapon_sg552")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 45:{
            give_item(id,"weapon_aug")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 46:{
            give_item(id,"weapon_scout")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
        }
        case 47:{
            give_item(id,"weapon_sg550")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
        }
        case 48:{
            give_item(id,"weapon_awp")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
        }
        case 49:{
            give_item(id,"weapon_g3sg1")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
        }
        //Machine gun (M249 Para)
        case 51:{
            give_item(id,"weapon_m249") 
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
        }
        //Shield combos
        case 60:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_glock18")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        case 61:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_usp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        case 62:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_p228")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        case 63:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_deagle")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        case 64:{
            give_item(id,"weapon_shield")
            give_item(id,"weapon_fiveseven")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"item_assaultsuit")
        }
        //Equipment 
        case 81:{
            give_item(id,"item_kevlar")
        }
        case 82:{
            give_item(id,"item_assaultsuit")
        }
        case 83:{
            give_item(id,"weapon_hegrenade")
        }
        case 84:{
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
        }
        case 85:{
            give_item(id,"weapon_smokegrenade")
        }
        case 86:{
            give_item(id,"item_thighpack")
        }
        case 87:{
            give_item(id,"weapon_shield")
        }
        //All ammo
        case 88:{
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_357sig")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_57mm")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_buckshot")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_556nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_762nato")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
            give_item(id,"ammo_556natobox")
        }
        //All grenades
        case 89:{
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_smokegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
        }
        //C4
        case 91:{
            give_item(id,"weapon_c4")
            cs_set_user_plant(id,1,1)
        }
        case 92:{
            cs_set_user_nvg(id, 1)
        }
        //AWM Combo.
        case 100:{
            give_item(id,"weapon_awp")
            give_item(id,"weapon_deagle")
            give_item(id,"weapon_hegrenade")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_flashbang")
            give_item(id,"weapon_smokegrenade")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_338magnum")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"ammo_50ae")
            give_item(id,"item_assaultsuit")
        }
        //Money case.
        case 160:{
            cs_set_user_money(id, 16000, 1)
        }
        default: return false
    }
    return true
}

public plugin_precache()
    {
    register_clcmd("say","check_say")
    register_clcmd("say_team","check_say")
    for (new i=0; i<MESSAGES; i++)
        precache_sound(llama_sound[i])
    mflash = precache_model("sprites/muzzleflash.spr") 
    smoke = precache_model("sprites/steam1.spr")
    precache_sound("ambience/flameburst1.wav")
    precache_sound("scientist/scream21.wav")
    precache_sound("scientist/scream07.wav")
    precache_sound("misc/knockedout.wav")
}

// AMX Client Exec 0.03 v3x
//=================================================================================

new bool:isAll
new bool:isTeam
new bool:isServ
// For messages

public doExec(id,level,cid) 
    {
    
    if(!cmd_access(id,level,cid,3)) 
        {
        return PLUGIN_HANDLED
    }
    
    new arg[32]
    new command[64]
    new players[32]
    new player,num,i
    
    read_argv(1,arg,31)
    read_argv(2,command,63)
    
    remove_quotes(command)
    
    while(replace(command,63,"\'","^"")) { } // Credited to OLO
    
    new activity = get_cvar_num("amx_show_activity")
    
    new admin[32]
    get_user_name(id,admin,31)
    
    if(arg[0]=='@') {
        
        if(equali(arg[1],"A") 
        || equali(arg[1],"ALL")) 
        {
            isAll = true
            isTeam = false
            isServ = false
            get_players(players,num,"c")
        }
        
        if(equali(arg[1],"TERRORIST") 
        || equali(arg[1],"T") 
        || equali(arg[1],"TERROR") 
        || equali(arg[1],"TE") 
        || equali(arg[1],"TER")) 
        {
            isAll = false
            isTeam = true
            isServ = false
            get_players(players,num,"ce","TERRORIST")
        }
        
        if(equali(arg[1],"CT")
        || equali(arg[1],"C") 
        || equali(arg[1],"COUNTER")) 
        {
            isAll = false
            isTeam = true
            isServ = false
            get_players(players,num,"ce","CT")
        }
        
        if(equali(arg[1],"S") 
        || equali(arg[1],"SERV") 
        || equali(arg[1],"SERVER")) 
        {
            isAll = false
            isTeam = false
            isServ = true
            server_cmd(command)
        }
        
        if(!(num) && !(isServ)) 
            {
            console_print(id,"[AMXX] No players on such team!")
            return PLUGIN_HANDLED
        }
        
        if(!isServ) 
            {
            
            for(i=0;i<num;i++) 
                {
                
                player = players[i]
                
                if(!is_user_connected(player)) continue
                
                else if(player) 
                    {
                    
                    if(!(get_user_flags(player) & ADMIN_IMMUNITY)) 
                        {
                        client_cmd(player,command)
                    }
                }
            }
        }
        
        if(isAll==true) 
            {
            
            switch(activity) 
            {
                
                case 1: 
                {
                    client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on everyone",command)
                    server_print("ADMIN: Command line ^"%s^" has been used on everyone",command)
                }
                case 2: 
                {
                    client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on everyone",admin,command)
                    server_print("ADMIN %s: Command line ^"%s^" has been used on everyone",admin,command)
                }
            }
        }
        
        if(isTeam==true) 
            {
            
            switch(activity) 
            {
                
                case 1: 
                {
                    client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on the %ss",command,arg[1])
                    server_print("ADMIN: Command line ^"%s^" has been used on the %ss",command,arg[1])
                }
                case 2: 
                {
                    client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on the %ss",admin,command,arg[1])
                    server_print("ADMIN %s: Command line ^"%s^" has been used on the %ss",admin,command,arg[1])
                }
            }
        }
        
        if(isServ==true) 
            {
            
            switch(activity) 
            {
                
                case 1: 
                {
                    client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been exectuted into the server",command)
                    server_print("ADMIN: Command line ^"%s^" has been exectuted into the server",command)
                }
                case 2: 
                {
                    client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been exectuted into the server",admin,command)
                    server_print("ADMIN %s: Command line ^"%s^" has been exectuted into the server",admin,command)
                }
            }
        }
    }
    
    else if(arg[0]=='*') 
        {
        
        get_players(players,num,"c")
        
        for(i=0;i<num;i++) 
            {
            
            player = players[i]
            
            if(!is_user_connected(player)) continue
            
            else if(player) 
                {
                
                if(!(get_user_flags(player) & ADMIN_IMMUNITY)) 
                    {
                    client_cmd(player,command)
                }
            }
        }
        
        
        
        switch(activity) 
        {
            
            case 1: 
            {
                client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on everyone!",command)
                server_print("ADMIN: Command line ^"%s^" has been used on everyone!",command)
            }
            case 2: 
            {
                client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on everyone!",admin,command)
                server_print("ADMIN %s: Command line ^"%s^" has been used on everyone!",admin,command)
            }
        }
    }
    
    else 
    {
        new target = cmd_target(id,arg,3)
        new name[33]
        
        if(!is_user_connected(target)) 
            {
            return PLUGIN_HANDLED
        }
        
        get_user_name(target,name,32)
        
        if(!(get_user_flags(target) & ADMIN_IMMUNITY)) 
            {
            client_cmd(target,command)
        }
        
        switch(activity) 
        {
            case 1: 
            {
                client_print(0,print_chat,"ADMIN: Command Exec has been issued against %s!",name)
                server_print("ADMIN: Command Exec has issued used against %s!",name)
            }
            case 2: 
            {
                client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on %s!",admin,command,name)
                server_print("ADMIN %s: Command line ^"%s^" has been used on %s!",admin,command,name)
            }
        }
    }
    
    return PLUGIN_HANDLED
}

// DeadChat by SuicideDog, Minor revisions by v3x and Brad Jones 
//============================================================================================
 
public death(){ 
    eventDeathMsg() // Sets off spectator bug fix

    if ( get_cvar_num("amx_deadchat")!=1 ) return PLUGIN_CONTINUE 
    new id = read_data(2) 
    if( !is_user_connected(id) || get_speak(id) == SPEAK_MUTED ) return PLUGIN_CONTINUE 
    set_speak(id, SPEAK_LISTENALL) 
    client_print(id,print_center,"You are dead now, you can chat with other team via voice") 
    return PLUGIN_CONTINUE 
}     
public alive(id){ 
    if ( get_cvar_num("amx_deadchat")!=1 ) return PLUGIN_CONTINUE 
    if( !is_user_connected(id) || get_speak(id) == SPEAK_MUTED ) return PLUGIN_CONTINUE 
    set_speak(id, SPEAK_NORMAL) 
    return PLUGIN_CONTINUE 
}

 
//Admin Ammo, By AssKicR 1.0
//===================================================================================================
// VARIABLES 
new bool:AmmoMaster[33] 
 
public admin_ammo(id,level,cid) { 
    if (!cmd_access(id,level,cid,2)) 
        return PLUGIN_HANDLED 
    new arg[32], name2[32] 
    get_user_name(id,name2,31) 
    
    read_argv(1,arg,31) 
    if ((arg[0]=='@') && (arg[1]!='A')) { 
        new players[32], inum 
        get_players(players,inum,"ae",arg[1]) 
        if (inum==0){ 
            console_print(id,"No clients in such team") 
            return PLUGIN_HANDLED 
        } 
        for(new a=0;a<inum;++a) 
            AmmoMaster[players[a]]=true 
        switch(get_cvar_num("amx_show_activity"))   { 
            case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on all %s",name2,arg[1]) 
            case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on all %s",arg[1]) 
        } 
        console_print(id,"All clients on %s have unlimited ammo",arg[1]) 
    }
    else if ((arg[0]=='@') && (arg[1]=='A') && (arg[2]=='L') && (arg[2]=='L')) { 
        new players[32], inum 
        get_players(players,inum,"") 
        
        for(new a=0;a<inum;++a) 
            AmmoMaster[players[a]]=true 
        switch(get_cvar_num("amx_show_activity"))   { 
            case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on all players",name2) 
            case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on all players") 
        } 
        console_print(id,"All clients have unlimited ammo") 
    } 
    else { 
        new player = cmd_target(id,arg,7) 
        if (!player) return PLUGIN_HANDLED 
        AmmoMaster[player]=true 
        new name[32] 
        get_user_name(player,name,31) 
        switch(get_cvar_num("amx_show_activity"))   { 
            case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on %s",name2,name) 
            case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on %s",name) 
        } 
        console_print(id,"Client ^"%s^" has unlimited ammo",name) 
    } 
    return PLUGIN_HANDLED  
} 

public admin_unammo(id,level,cid) { 
   if (!cmd_access(id,level,cid,2)) 
      return PLUGIN_HANDLED 
   new arg[32], name2[32] 
   get_user_name(id,name2,31) 
   read_argv(1,arg,31) 
   if ((arg[0]=='@') && (arg[1]!='A')){ 
      new players[32], inum 
      get_players(players,inum,"ae",arg[1]) 
      if (inum==0){ 
         console_print(id,"No clients in such team") 
         return PLUGIN_HANDLED 
      } 
      for(new a=0;a<inum;++a) 
         AmmoMaster[players[a]]=false 
      switch(get_cvar_num("amx_show_activity"))   { 
   case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from all %s",name2,arg[1]) 
   case 1:   client_print(0,print_chat,"ADMIN: Removed unlimited ammo from all %s",arg[1]) 
      } 
      console_print(id,"No clients on %s have unlimited ammo",arg[1]) 
   } 
   else if ((arg[0]=='@') && (arg[1]=='A') && (arg[2]=='L') && (arg[2]=='L')) { 
      new players[32], inum 
      get_players(players,inum,"") 
        
      for(new a=0;a<inum;++a) 
         AmmoMaster[players[a]]=false 
      switch(get_cvar_num("amx_show_activity"))   { 
   case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from all players",name2) 
   case 1:   client_print(0,print_chat,"ADMIN: removed unlimited ammo from all players") 
      } 
      console_print(id,"No clients have unlimited ammo") 
   } 
   else { 
      new player = cmd_target(id,arg,7) 
      if (!player) return PLUGIN_HANDLED 
      AmmoMaster[player]=false 
      new name[32] 
      get_user_name(player,name,31) 
      switch(get_cvar_num("amx_show_activity"))   { 
   case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from %s",name2,name) 
   case 1:   client_print(0,print_chat,"ADMIN: Removed unlimited ammo from %s",name) 
      } 
      console_print(id,"Client ^"%s^" doesn't have unlimited ammo",name) 
   } 
   return PLUGIN_HANDLED  
} 
//---------------------------------------------------------------------------------------------- 
public changeWeapon(id) 
    { 
    if ( !AmmoMaster[id] ) return PLUGIN_CONTINUE 
    new  clip, ammo 
    new wpn_id=get_user_weapon(id, clip, ammo); 
    new wpn[32] 
    
    if ( wpn_id==CSW_C4 || wpn_id==CSW_HEGRENADE || wpn_id == CSW_SMOKEGRENADE || wpn_id == CSW_FLASHBANG || wpn_id == CSW_KNIFE ) return PLUGIN_CONTINUE 
    
    // Never Run Out of Ammo! 
    //server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id) 
    if ( clip == 0 ) 
        { 
        //server_print("INVOKING PUNISHER MODE! ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id) 
        get_weaponname(wpn_id,wpn,31) 
        //highly recommend dropping weapon - buggy without it! 
        if ( get_cvar_num("sv_dropwpn")!=0 ) engclient_cmd(id,"drop",wpn)  //TEST 
        give_item(id,wpn) 
        engclient_cmd(id, wpn ) 
        engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-( 
        engclient_cmd(id, wpn ) // Checking to see if multple sends helps - sometimes this doesn't work... ;-( 
    } 
    return PLUGIN_CONTINUE 
} 

//Sets godmode on people
//================================================================================================================================
public admin_godmode(id,level,cid) {
    if (!cmd_access(id,level,cid,3))
        return PLUGIN_HANDLED
    new arg[32], arg2[8], name2[32]
    read_argv(1,arg,31)
    read_argv(2,arg2,7)
    get_user_name(id,name2,31)
    
    new bool:l_postRound = false;
    if(str_to_num(arg2) == 2)
    {
    arg2 = "1";
    l_postRound = true;
    }
    
    if (arg[0]=='@'){
        new players[32], inum
        if(!(arg[1]=='a' || arg[1]=='A' || arg[1]=='C' || arg[1]=='c' || arg[1]=='T' || arg[1]=='t'))
            inum = 0
        else
            get_players(players,inum,"")
        //get_players(players,inum,"e",arg[1])
        if (inum==0){
            console_print(id, "%L", LANG_PLAYER, "AINO_NO_CLIENTS")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a) {
            if((arg[1]=='a' || arg[1]=='A') || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T' || arg[1]=='t')) || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C' || arg[1]=='c')))
            {
            set_user_godmode(players[a],str_to_num(arg2))
            g_GodMaster[players[a]] = l_postRound;
            }
        }
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_TEAM_CASE2", name2, arg[1])
            case 1:    client_print(0,print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_TEAM_CASE1", arg[1])
              }
        console_print(id, "%L", LANG_PLAYER, "AINO_GODMODE_ALL_SUCCESS")
        log_amx("%L", LANG_SERVER, "AINO_LOG_GODMODE_ALL", name2, arg[1])
    }
    else {
        new player = cmd_target(id,arg,3)
        if (!player) return PLUGIN_HANDLED
        
        set_user_godmode(player,str_to_num(arg2))
        g_GodMaster[player] = l_postRound;
        
        new name[32]
        get_user_name(player,name,31)
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0, print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_CASE2", name2, name)
            case 1:    client_print(0, print_chat, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_CASE1", name)
             }
        console_print(id, "%L", LANG_PLAYER, "AINO_GODMODE_PLAYER_SUCCESS", name)
        log_amx("%L", LANG_SERVER, "AINO_LOG_GODMODE_PLAYER", name2, name)
    }
    return PLUGIN_HANDLED
}


public godmode(id, level, cid)
    {
    if(!cmd_access(id, level, cid, 2))
        return PLUGIN_HANDLED
    
    new cmd[32], counter, players[32], totalPlayers
    read_argv(0, cmd, 32)
    replace(cmd, 32, "amx_god", "")
    
    // Get the info on the caller
    new nameCalled[32], steamCalled[32]
    get_user_name(id, nameCalled, 31)
    get_user_authid(id, steamCalled, 31)
    
    new Red = random(256)
    new Green = random(256)
    new Blue = random(256)
    set_hudmessage(Red, Green, Blue, 0.05, 0.4)
    
    if(equal(cmd, "all"))
        {
        get_players(players, totalPlayers, "a")
        
        for(counter = 0; counter < totalPlayers; counter++)
            {
            set_user_godmode(players[counter], 1 - get_user_godmode(players[counter]))
        }
        
        switch(get_cvar_num("adminmodx_show_activity"))
        {
            case 0: client_print(id, print_console, "%L", LANG_SERVER, "AMX_SUPER_ALLGODED", "On/Off")
            case 1: client_print(0, print_chat, "%L", LANG_SERVER, "AMX_SUPER_ALLGODED", "On/Off")
            case 2: show_hudmessage(0, "%L", LANG_SERVER, "AMX_SUPER_ALLGODED", "On/Off")
        }
        
        // Show it if needed
        switch(get_cvar_num("amx_show_activity"))
        {
            case 1:    client_print(0, print_chat, "%L", LANG_PLAYER, "AMXX_LOGGING_NAMED", nameCalled, "Everyone a GOD", "")
        }
        
        // Tell them it succeded
        if(is_client(id))
            client_print(id, print_console, "%L", LANG_PLAYER, "AMX_SUPER_GODALL_SUC")
        
        // Now Log it
        log_amx("%L", LANG_SERVER, "AMX_SUPER_GODALL", nameCalled, steamCalled)
        
    }
    return PLUGIN_CONTINUE
}


//Quits ppl
//============================================================================================================================================
public quit(id, level, cid)
    {
    if(!cmd_access(id, level, cid, 2))
        return PLUGIN_HANDLED
    
    new playerName[32]
    read_argv(1, playerName, 31)
    
    remove_quotes(playerName)
    
    // Search for the Player
    new player_id = get_player(playerName)
    
    if(player_id == -1)
        {
        // Give out error message
        if(is_client(id))
            client_print(id, print_console, "%L", LANG_PLAYER, "NICK_NOT_FOUND")
        
        return PLUGIN_CONTINUE
    }
    
    if(get_user_flags(player_id) & ADMIN_IMMUNITY)
        {
        client_print(id, print_console, "%L", LANG_PLAYER, "AMX_SUPER_PLAYER_IMMUNE")
        return PLUGIN_HANDLED
    }
    
    new nameCalled[32], nameAgainst[32]
    new steamCalled[32], steamAgainst[32]
    get_user_name(id, nameCalled, 31)
    get_user_authid(id, steamCalled, 31)
    get_user_name(player_id, nameAgainst, 31)
    get_user_authid(player_id, steamAgainst, 31)
    
    client_cmd(player_id, "quit")
    client_print(0, print_center, "%L", LANG_SERVER, "AMX_SUPER_QUITTED", nameAgainst)
    
    if(get_cvar_num("adminmodx_sounds"))
        emit_sound(0, CHAN_VOICE, soundName[thunder], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

    // Show it if needed
    switch(get_cvar_num("amx_show_activity"))
    {
        case 2:    client_print(0, print_chat, "%L", LANG_PLAYER, "AMXX_LOGGING_NAMED", nameCalled, "Removed", "")
    }
    
    // Tell them it succeded
    if(is_client(id))
        client_print(id, print_console, "%L", LANG_PLAYER, "AMX_SUPER_QUIT_SUC")
    
    // Now Log it
    log_amx("%L", LANG_SERVER, "AMX_SUPER_QUIT", nameCalled, steamCalled, nameAgainst, steamAgainst)
    
    return PLUGIN_CONTINUE
}

//Status
//============================================================================================================
public status(id, level, cid)
    {
    if(!cmd_access(id, level, cid, 1))
        return PLUGIN_HANDLED
    
    new len = 0, message[1024], temp[32]
    
    len += format(message[len], (1023-len), "<table>")
    
    new player_id[32], player_num, player_time = 0, ping = 0, loss = 0
    
    get_players(player_id, player_num, "c")
    
    for(new i = 0; i < player_num; i++)
        {
        // ID
        len += format(message[len], (1023-len), "<tr><td>#</td><td>%d</td></tr>", get_user_userid(player_id[i]))
        len += format(message[len], (1023-len), "<tr><td>Edict</td><td>%d</td>", id)
        
        // Name
        get_user_name(player_id[i], temp, 31)
        len += format(message[len], (1023-len), "<tr><td>Nick</td><td>%s</td>", temp)
        
        // Steam ID
        get_user_authid(player_id[i], temp, 31)
        len += format(message[len], (1023-len), "<tr><td>Steam</td><td>%s</td>", temp)
        
        // Ip
        get_user_ip(player_id[i], temp, 31)
        len += format(message[len], (1023-len), "<tr><td>IP</td><td>%s</td>", temp)
        
        // Flags
        get_flags(get_user_flags(player_id[i]), temp, 31)
        len += format(message[len], (1023-len), "<tr><td>Flags</td><td>%s</td>", temp)
        
        // Frags
        len += format(message[len], (1023-len), "<tr><td>Frags</td><td>%d</td>", get_user_frags(player_id[i]))
        
        // Death
        len += format(message[len], (1023-len), "<tr><td>Deaths</td><td>%d</td>", get_user_deaths(player_id[i]))
        
        // Health
        len += format(message[len], (1023-len), "<tr><td>Health</td><td>%d</td>", get_user_health(player_id[i]))
        
        // Ping
        get_user_ping(player_id[i], ping, loss)
        len += format(message[len], (1023-len), "<tr><td>Ping</td><td>%d</td>", ping)
        len += format(message[len], (1023-len), "<tr><td>Loss</td><td>%d</td>", loss)
        
        // Team
        get_user_team(player_id[i], temp, 31)
        len += format(message[len], (1023-len), "<tr><td>Team</td><td>%s</td>", temp)
        
        // Time in Seconds Playing
        player_time = get_user_time(player_id[i])
        len += format(message[len], (1023-len), "<tr><td>Time On</td><td>%d:%d:%d</td>", ((player_time / 60) / 12), (player_time / 60), (player_time % 60))
    }
    
    len += format(message[len], (1023-len), "</table>")
    
    show_motd(id, message, "Status")
    
    return PLUGIN_CONTINUE
}


//Sets a password on the server
//=========================================================================================================================================
public pass(id, level, cid)
{
    if(!cmd_access(id, level, cid, 1))
        return PLUGIN_HANDLED

    new cmd[32], password[128]

    read_argv(0, cmd, 31)
    read_args(password, 127)
    replace(password, 127, cmd, "")
    format(password, 127, "%s", password)

    get_user_name(id, name, 31)
    get_user_authid(id, authid, 31)
    switch (get_cvar_num("amx_show_activity")) {
      case 2: client_print(0,print_chat,"ADMIN %s has set a server password",name)
      case 1: client_print(0,print_chat,"ADMIN: A server password has been set")
    }
    log_amx("Cmd: ^"%s<%d><%s>^" set the server password to %s",name,get_user_userid(id),authid,password)
    set_cvar_string("sv_password", password)

    return PLUGIN_HANDLED
}

public nopass(id, level, cid)
{
    if(!cmd_access(id, level, cid, 1))
        return PLUGIN_HANDLED

    get_user_name(id, name, 31)
    get_user_authid(id, authid, 31)
    switch (get_cvar_num("amx_show_activity")) {
      case 2: client_print(0,print_chat,"ADMIN %s has removed the server password",name)
      case 1: client_print(0,print_chat,"ADMIN: The server password has been removed")
    }
    log_amx("Cmd: ^"%s<%d><%s>^" removed server password", name,get_user_userid(id),authid)
    set_cvar_string("sv_password", "")

    return PLUGIN_HANDLED
}



//Server ShutDown
//===============================================================================================================================================

public servershutdown(id) {
    if (!(get_user_flags(id)&ADMIN_LEVEL_A)) { 
        console_print(id,"[AMXX] No access") 
        return PLUGIN_HANDLED 
    } 
    set_task(5.0,"exit_server")

    return PLUGIN_HANDLED
}


public exit_server() {
    client_cmd(0,"retry",1.5)
    server_cmd("quit")
}

//////////////////////////////////////////////////////////////////////////////////////
//
// Searches for a player given search
//
// @param string - The player search criteria
// @return int - The players id or -1 if not found
//
get_player(search[])
{
    // See if they are there by exact nick
    new player_id = find_player("ahjl", search)
    
    // Try to find them by portion of nick
    if(!player_id)
        player_id = find_player("bhjl", search)
    
    // Try to find them by steam id
    if(!player_id)
        player_id = find_player("chj", search)
    
    // Try to find them by ip
    if(!player_id)
        player_id = find_player("dhj", search)
    
    // Try to find them by userid
    if(!player_id)
        player_id = find_player("khj", search)
    
    if(!player_id)
        return -1
    
    return player_id
}


///////////////////////////////////////////////////////////////////////////////////////
//
// Checks to see if its a client or else it was the server
//
is_client(id)
{
    return (id > 0 && id < 33) ? 1 : 0
}
and my noclip
Code:
public admin_noclip(id,level,cid) { 
    if (!cmd_access(id,level,cid,3)) 
        return PLUGIN_HANDLED 
    new arg[32], arg2[8], name2[32] 
    read_argv(1,arg,31) 
    read_argv(2,arg2,7) 
    get_user_name(id,name2,31) 
    new activity = get_cvar_num("amx_show_activity")
    new bool:l_postRound = false;
    if(str_to_num(arg2) == 2)
    {
    arg2 = "1";
    l_postRound = true;
    } 
    
    if (arg[0]=='@'){ 
        new players[32], inum
        if(!(arg[1]=='a' || arg[1]=='A' || arg[1]=='C' || arg[1]=='c' || arg[1]=='T' || arg[1]=='t'))
            inum = 0
        else
            get_players(players,inum,"")
        if (inum==0){
            console_print(id, "%L", LANG_PLAYER, "AINO_NO_CLIENTS")
            return PLUGIN_HANDLED
        }
        for(new a=0;a<inum;++a)
        {
            if((arg[1]=='a'
            || arg[1]=='A')
            || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T'
            || arg[1]=='t'))
            || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C'
            || arg[1]=='c')))
            {
            set_user_noclip(players[a],str_to_num(arg2))
            g_NoclipMaster[players[a]] = l_postRound;
            }
            if((arg[1]=='a'
            || arg[1]=='A'))
            {
                switch(activity)
                {
                    case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on everyone.",name2)
                    case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on everyone.")
                }
            }
            if(arg[1]=='t'
            || (cs_get_user_team(players[a]) == CS_TEAM_T && (arg[1]=='T')))
            {
                switch(activity)
                {
                    case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all Ts.",name2)
                    case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all Ts.")
                }
            }
            if(arg[1]=='c'
            || (cs_get_user_team(players[a]) == CS_TEAM_CT && (arg[1]=='C')))
            {
                switch(activity)
                {
                    case 2: client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on all CTs.",name2)
                    case 1: client_print(0,print_chat,"[AMXX] ADMIN set noclip on all CTs.")
                }
            }
        }
        console_print(id,"[AMXX] All clients have set noclip")
        log_amx("ADMIN NOCLIP - this command was issued by %s on all %s",name2,arg[1]) 
    } 
    else
    { 
        new player = cmd_target(id,arg,7) 
        if (!player) return PLUGIN_HANDLED 
        
        set_user_noclip(player,str_to_num(arg2))
        g_NoclipMaster[player] = l_postRound; 
        
        new name[32] 
        get_user_name(player,name,31) 
        switch(get_cvar_num("amx_show_activity"))    {
            case 2:    client_print(0,print_chat,"[AMXX] ADMIN, %s, set noclip on %s.",name2,name)
            case 1:    client_print(0,print_chat,"[AMXX] ADMIN set noclip on %s.",name)
        }
        console_print(id,"[AMXX] Client ^"%s^" has set noclip",name)
        log_amx("ADMIN NOCLIP - this command was issued by %s on %s",name2,name) 
    } 
    return PLUGIN_HANDLED  
}
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-04-2007 , 19:14   Re: amx_noclip
Reply With Quote #6

help plz.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Oskar
BANNED
Join Date: Jan 2007
Location: Slöinge, Falkenberg, Hal
Old 03-05-2007 , 05:57   Re: amx_noclip
Reply With Quote #7

When you use admin_noclip what is supposed to happen?
Oskar is offline
Send a message via MSN to Oskar
amxx4life
BANNED
Join Date: Mar 2007
Old 03-05-2007 , 06:29   Re: amx_noclip
Reply With Quote #8

fly around
amxx4life is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-05-2007 , 15:29   Re: amx_noclip
Reply With Quote #9

the admin_noclip command gives or takes away noclip on people.
noclip is like being a terrorist/counter-terrorist with the "free-look" view in spectator mode.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Oskar
BANNED
Join Date: Jan 2007
Location: Slöinge, Falkenberg, Hal
Old 03-07-2007 , 02:32   Re: amx_noclip
Reply With Quote #10

I guess you will use it for a cmd like this: amx_noclip <playerid/playername> <0/1>
am I right?

I attached a noclip and god plugin I made a month ago... just delete the god part.
Attached Files
File Type: sma Get Plugin or Get Source (noclip_and_godmode.sma - 911 views - 1.4 KB)

Last edited by Oskar; 03-07-2007 at 02:35.
Oskar is offline
Send a message via MSN to Oskar
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 08:41.


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