├── amx ├── plugin_bonus.sma ├── plugin_cloakwar.sma ├── plugin_csevents.sma ├── plugin_freezetag.sma ├── plugin_fun.sma ├── plugin_gamble.sma ├── plugin_glowdamage.sma ├── plugin_gore.sma ├── plugin_hunting.sma ├── plugin_ka.sma ├── plugin_listen.sma ├── plugin_mysql_ban.sma ├── plugin_namechange.sma ├── plugin_powers.sma ├── plugin_punish.sma ├── plugin_redirect.sma ├── plugin_slash.sma └── plugin_stealthwar.sma ├── amxx ├── include │ ├── Vexd_Utilities.inc │ ├── amxconst.inc │ ├── amxmisc.inc │ ├── amxmod.inc │ ├── amxmodx.inc │ ├── core.inc │ ├── csstats.inc │ ├── cstrike.inc │ ├── engine.inc │ ├── engine_const.inc │ ├── engine_stocks.inc │ ├── file.inc │ ├── float.inc │ ├── fun.inc │ ├── jghg2.inc │ ├── mysql.inc │ ├── string.inc │ ├── ucstats.inc │ ├── vault.inc │ └── xtrafun.inc ├── plugin_cloakwar.amx ├── plugin_cloakwar.sma ├── plugin_clonewar.amx ├── plugin_clonewar.sma ├── plugin_csevents.amx ├── plugin_csevents.sma ├── plugin_freezetag.amx ├── plugin_freezetag.sma ├── plugin_fun.amx ├── plugin_fun.sma ├── plugin_funman.amx ├── plugin_funman.sma ├── plugin_gamble.amx ├── plugin_gamble.sma ├── plugin_glowdamage.amx ├── plugin_glowdamage.sma ├── plugin_gore.amx ├── plugin_gore.sma ├── plugin_hunting.amx ├── plugin_hunting.sma ├── plugin_ka.amx ├── plugin_ka.sma ├── plugin_listen.amx ├── plugin_listen.sma ├── plugin_mysql_ban.amx ├── plugin_mysql_ban.sma ├── plugin_namechange.amx ├── plugin_namechange.sma ├── plugin_powers.amx ├── plugin_powers.sma ├── plugin_punish.amx ├── plugin_punish.sma ├── plugin_rambo.amx ├── plugin_rambo.sma ├── plugin_slash.amx ├── plugin_slash.sma ├── plugin_stealthwar.amx ├── plugin_stealthwar.sma ├── plugin_targetwar.amx └── plugin_targetwar.sma └── readme.md /amx/plugin_bonus.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_bonus.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Gives bonuses for making early kills. 8 | * 9 | */ 10 | #include 11 | 12 | #define MAX_NAME_LENGTH 32 13 | #define MAX_TEXT_LENGTH 512 14 | 15 | #define ACCESS_LEVEL ADMIN_LEVEL_A 16 | 17 | // Default on/off 18 | new gBonusMode = 1 19 | 20 | new gBonusCount = 0 21 | new gBonusIndex[5] = { 50,40,30,20,10 } 22 | 23 | public admin_bonuskill(id) 24 | { 25 | // Check access level 26 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 27 | console_print(id,"[AMX] You have no access to that command") 28 | return PLUGIN_HANDLED 29 | } 30 | // Check arguments 31 | if (read_argc() < 2) { 32 | console_print(id,"[AMX] Usage: amx_bonuskill < 1 | 0 >") 33 | return PLUGIN_HANDLED 34 | } 35 | new sArg1[MAX_NAME_LENGTH] 36 | read_argv(1,sArg1,MAX_NAME_LENGTH) 37 | 38 | if (str_to_num(sArg1)) { 39 | gBonusMode = 1 40 | client_print(id,print_console,"[AMX] Bonus health for kills is now ON.") 41 | } 42 | else { 43 | gBonusMode = 0 44 | client_print(id,print_console,"[AMX] Bonus health for kills is now OFF.") 45 | } 46 | 47 | return PLUGIN_HANDLED 48 | } 49 | 50 | public event_death() 51 | { 52 | if (gBonusMode) { 53 | new iKiller = read_data(1) 54 | new iVictim = read_data(2) 55 | new sMsg[MAX_TEXT_LENGTH] 56 | new sName[MAX_NAME_LENGTH] 57 | get_user_name(iKiller,sName,MAX_NAME_LENGTH) 58 | 59 | if ((iKiller != iVictim) && (gBonusCount < sizeof gBonusIndex) && (get_user_team(iKiller) != get_user_team(iVictim))) { 60 | gBonusCount++ 61 | set_user_health(iKiller,get_user_health(iKiller)+gBonusIndex[gBonusCount-1]) 62 | if (gBonusCount == 1) { 63 | format(sMsg,MAX_TEXT_LENGTH,"%s got the 1st kill! (+%i health)",sName,gBonusIndex[gBonusCount-1]) 64 | } 65 | else if (gBonusCount == 2) { 66 | format(sMsg,MAX_TEXT_LENGTH,"%s got the 2nd kill! (+%i health)",sName,gBonusIndex[gBonusCount-1]) 67 | } 68 | else if (gBonusCount == 3) { 69 | format(sMsg,MAX_TEXT_LENGTH,"%s got the 3rd kill! (+%i health)",sName,gBonusIndex[gBonusCount-1]) 70 | } 71 | else { 72 | format(sMsg,MAX_TEXT_LENGTH,"%s got the %ith kill! (+%i health)",sName,gBonusCount,gBonusIndex[gBonusCount-1]) 73 | } 74 | display_msg(sMsg,200,200,200) 75 | } 76 | } 77 | return PLUGIN_CONTINUE 78 | } 79 | 80 | public event_round_end() { 81 | gBonusCount = 0 82 | } 83 | 84 | public display_msg(msg[],r,g,b) 85 | { 86 | set_hudmessage(r,g,b,-1.0,0.40,0,6.0,6.0,0.5,0.15,2) 87 | show_hudmessage(0,msg) 88 | } 89 | 90 | /************************************************************ 91 | * PLUGIN FUNCTIONS 92 | ************************************************************/ 93 | 94 | public plugin_init() 95 | { 96 | register_plugin("Plugin Health Bonus","1.0","mike_cao") 97 | register_event("DeathMsg","event_death","a") 98 | register_event("SendAudio","event_round_end","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw") 99 | register_concmd("amx_bonuskill","admin_bonuskill",ACCESS_LEVEL,"amx_powers < authid | part of nick >") 100 | } -------------------------------------------------------------------------------- /amx/plugin_cloakwar.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_cloakwar.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin requires the following plugins to work: 8 | * (plugin_powers.sma) 9 | * 10 | * Gives the winning team cloaking powers. Cloaked players 11 | * are revealed only for a few seconds after firing but 12 | * they only have 1 health. 13 | * 14 | */ 15 | 16 | #include 17 | 18 | #define MAX_NAME_LENGTH 32 19 | #define MAX_PLAYERS 32 20 | #define MAX_WEAPONS 32 21 | #define MAX_TEXT_LENGTH 512 22 | 23 | /************************************************************ 24 | * CONFIG 25 | ************************************************************/ 26 | 27 | // Admin access level 28 | #define ACCESS_LEVEL ADMIN_LEVEL_A 29 | 30 | /************************************************************ 31 | * MAIN 32 | ************************************************************/ 33 | 34 | new gCloakTeam = 0 35 | 36 | public admin_cloakwar(id) 37 | { 38 | // Check access level 39 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 40 | console_print(id,"[AMX] You have no access to that command") 41 | return PLUGIN_HANDLED 42 | } 43 | // Check arguments 44 | if (read_argc() < 2) { 45 | console_print(id,"[AMX] Usage: amx_cloakwar < 1 | 0 >") 46 | return PLUGIN_HANDLED 47 | } 48 | new sArg1[MAX_NAME_LENGTH+1] 49 | read_argv(1,sArg1,MAX_NAME_LENGTH) 50 | set_cvar_num("amx_cloakwar_mode",str_to_num(sArg1)) 51 | if (equal(sArg1,"1")) { 52 | client_print(id,print_console,"[AMX] Cloak War is now on.") 53 | msg_display("Cloak War is now on! :)",0,200,0) 54 | } 55 | else if (equal(sArg1,"0")) { 56 | client_print(id,print_console,"[AMX] Cloak War is now off.") 57 | msg_display("Cloak War is now off! :(",0,200,0) 58 | gCloakTeam = 0 59 | event_reset() 60 | } 61 | return PLUGIN_HANDLED 62 | } 63 | 64 | public msg_display(msg[],r,g,b) 65 | { 66 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 67 | show_hudmessage(0,msg) 68 | } 69 | 70 | 71 | 72 | /************************************************************ 73 | * EVENT FUNCTIONS 74 | ************************************************************/ 75 | 76 | public event_cloak() 77 | { 78 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 79 | new sName[MAX_NAME_LENGTH] 80 | get_players(iPlayers,iNumPlayers) 81 | 82 | for (new i = 0; i < iNumPlayers; i++) { 83 | iPlayer = iPlayers[i] 84 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 85 | if (get_user_team(iPlayer)==gCloakTeam) { 86 | server_cmd("amx_cloak ^"%s^" on",sName) 87 | } 88 | } 89 | } 90 | 91 | public event_reset() 92 | { 93 | new sName[MAX_NAME_LENGTH] 94 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 95 | get_players(iPlayers,iNumPlayers) 96 | for (new i = 0; i < iNumPlayers; i++) { 97 | iPlayer = iPlayers[i] 98 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 99 | server_cmd("amx_nopowers ^"%s^" 1",sName) 100 | } 101 | } 102 | 103 | public event_respawn(id) 104 | { 105 | if (get_cvar_num("amx_cloakwar_mode")) { 106 | new sMsg[MAX_TEXT_LENGTH] 107 | new sTeam[MAX_TEXT_LENGTH] 108 | if (gCloakTeam==1) { 109 | copy(sTeam,MAX_NAME_LENGTH,"TERRORIST") 110 | } 111 | else if (gCloakTeam==2){ 112 | copy(sTeam,MAX_NAME_LENGTH,"COUNTER-TERRORIST") 113 | } 114 | format(sMsg,MAX_TEXT_LENGTH,"-= CLOAK WARS MOD =-^n^nThe %s team is cloaked! Watch out!",sTeam) 115 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 116 | show_hudmessage(id,sMsg) 117 | } 118 | return PLUGIN_CONTINUE 119 | } 120 | 121 | public event_round_t() 122 | { 123 | if (get_cvar_num("amx_cloakwar_mode")) { 124 | new sMsg[MAX_TEXT_LENGTH] 125 | gCloakTeam = 1 126 | format(sMsg,MAX_TEXT_LENGTH,"The TERRORIST team won cloaking powers!") 127 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 128 | show_hudmessage(0,sMsg) 129 | set_task(4.0,"event_reset",0,"") 130 | set_task(5.0,"event_cloak",0,"") 131 | } 132 | return PLUGIN_CONTINUE 133 | } 134 | 135 | public event_round_ct() 136 | { 137 | if (get_cvar_num("amx_cloakwar_mode")) { 138 | new sMsg[MAX_TEXT_LENGTH] 139 | gCloakTeam = 2 140 | format(sMsg,MAX_TEXT_LENGTH,"The COUNTER-TERRORIST team won cloaking powers!") 141 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 142 | show_hudmessage(0,sMsg) 143 | set_task(4.0,"event_reset",0,"") 144 | set_task(5.0,"event_cloak",0,"") 145 | } 146 | return PLUGIN_CONTINUE 147 | } 148 | 149 | public event_round_draw() 150 | { 151 | if (get_cvar_num("amx_cloakwar_mode")) { 152 | gCloakTeam = random_num(1,2) 153 | set_task(4.0,"event_reset",0,"") 154 | set_task(5.0,"event_cloak",0,"") 155 | } 156 | return PLUGIN_CONTINUE 157 | } 158 | 159 | /************************************************************ 160 | * PLUGIN FUNCTIONS 161 | ************************************************************/ 162 | 163 | public plugin_init() 164 | { 165 | register_plugin("Cloak War","1.0","mike_cao") 166 | register_clcmd("amx_cloakwar","admin_cloakwar",ACCESS_LEVEL,"amx_ka < 0 | 1 >") 167 | register_event("ResetHUD","event_respawn","be","1=1") 168 | register_cvar("amx_cloakwar_mode","1") 169 | register_event("SendAudio","event_round_t","a","2&%!MRAD_terwin") 170 | register_event("SendAudio","event_round_ct","a","2&%!MRAD_ctwin") 171 | register_event("SendAudio","event_round_draw","a","2&%!MRAD_rounddraw") 172 | return PLUGIN_CONTINUE 173 | } 174 | -------------------------------------------------------------------------------- /amx/plugin_freezetag.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_freezetag.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Players freeze each other with their knives. Players 8 | * are unfrozen by their teammates. A team wins by freezing 9 | * all the players on the other team. 10 | */ 11 | 12 | #include 13 | 14 | #define MAX_NAME_LENGTH 32 15 | #define MAX_PLAYERS 32 16 | #define MAX_WEAPONS 32 17 | #define MAX_TEXT_LENGTH 512 18 | 19 | #define TE_SPRITETRAIL 15 20 | 21 | #define SOUND_FREEZE 0 22 | #define SOUND_GLASS1 1 23 | #define SOUND_GLASS2 2 24 | #define SOUND_GLASS3 3 25 | 26 | #define MAX_SOUNDS 4 27 | 28 | /************************************************************ 29 | * CONFIG 30 | ************************************************************/ 31 | 32 | // Admin access level 33 | #define ACCESS_LEVEL ADMIN_LEVEL_A 34 | 35 | /************************************************************ 36 | * MAIN 37 | ************************************************************/ 38 | 39 | new gFreezeIndex[MAX_PLAYERS+1] 40 | new gmsgStatusText 41 | new gFF 42 | 43 | // Sounds 44 | new gSoundIndex[MAX_SOUNDS][MAX_NAME_LENGTH] 45 | 46 | // Sprites 47 | new spr_ct_spark 48 | new spr_t_spark 49 | 50 | public admin_freezetag(id) 51 | { 52 | // Check access level 53 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 54 | console_print(id,"[AMX] You have no access to that command") 55 | return PLUGIN_HANDLED 56 | } 57 | // Check arguments 58 | if (read_argc() < 2) { 59 | console_print(id,"[AMX] Usage: amx_freezetag < 1 | 0 >") 60 | return PLUGIN_HANDLED 61 | } 62 | new sArg1[MAX_NAME_LENGTH+1] 63 | read_argv(1,sArg1,MAX_NAME_LENGTH) 64 | set_cvar_num("amx_freezetag_mode",str_to_num(sArg1)) 65 | if (equal(sArg1,"1")) { 66 | client_print(id,print_console,"[AMX] Freeze Tag is now on.") 67 | msg_display("Freeze Tag is now on! :)",0,200,0) 68 | set_cvar_num("mp_friendlyfire",1) 69 | } 70 | else if (equal(sArg1,"0")) { 71 | client_print(id,print_console,"[AMX] Freeze Tag is now off.") 72 | msg_display("Freeze Tag is now off! :(",0,200,0) 73 | 74 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 75 | get_players(iPlayers,iNumPlayers) 76 | for (new i = 0; i < iNumPlayers; i++) { 77 | iPlayer = iPlayers[i] 78 | player_unfreeze(iPlayer,0) 79 | set_user_health(iPlayer,100) 80 | } 81 | set_cvar_num("mp_friendlyfire",gFF) 82 | } 83 | return PLUGIN_HANDLED 84 | } 85 | 86 | /************************************************************ 87 | * EVENT FUNCTIONS 88 | ************************************************************/ 89 | 90 | public event_death() 91 | { 92 | new iVictim = read_data(2) 93 | if (get_cvar_num("amx_freezetag_mode")) { 94 | player_unfreeze(iVictim,1) 95 | } 96 | return PLUGIN_CONTINUE 97 | } 98 | 99 | public event_weapon() 100 | { 101 | new iPlayer = read_data(0) 102 | new iWeapon = read_data(2) 103 | if (get_cvar_num("amx_freezetag_mode") && iWeapon != CSW_C4) { 104 | engclient_cmd(iPlayer,"weapon_knife") 105 | if (gFreezeIndex[iPlayer]) { 106 | player_freeze(iPlayer) 107 | } 108 | } 109 | return PLUGIN_CONTINUE 110 | } 111 | 112 | public event_damage() 113 | { 114 | if (get_cvar_num("amx_freezetag_mode")) { 115 | new iVictim = read_data(0) 116 | new iWeapon, iBody 117 | new iAttacker = get_user_attacker(iVictim,iWeapon,iBody) 118 | 119 | // Restore health 120 | set_user_health(iVictim,456) 121 | 122 | if (iVictim != iAttacker) { 123 | new sName[MAX_NAME_LENGTH] 124 | get_user_name(iAttacker,sName,MAX_NAME_LENGTH) 125 | 126 | new iTeamA = get_user_team(iAttacker) 127 | new iTeamV = get_user_team(iVictim) 128 | new iFreezeA = gFreezeIndex[iAttacker] 129 | new iFreezeV = gFreezeIndex[iVictim] 130 | 131 | // Freeze player 132 | if ((iFreezeA == 0) && (iFreezeV == 0) && (iTeamA != iTeamV)) { 133 | set_user_frags(iAttacker,get_user_frags(iAttacker)+1) 134 | player_freeze(iVictim) 135 | event_check_frozen(iVictim) 136 | 137 | set_hudmessage(0,200,0,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 138 | show_hudmessage(iVictim,"You were frozen by %s!",sName) 139 | } 140 | // Unfreeze player 141 | else if ((iFreezeA == 0) && (iFreezeV == 1) && (iTeamA == iTeamV)) { 142 | player_unfreeze(iVictim,1) 143 | 144 | set_hudmessage(0,200,0,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 145 | show_hudmessage(iVictim,"You were unfrozen by %s!",sName) 146 | } 147 | } 148 | } 149 | return PLUGIN_CONTINUE; 150 | } 151 | 152 | public event_check_frozen(player) 153 | { 154 | if (get_cvar_num("amx_freezetag_mode")) { 155 | new iCheck = 0 156 | new iPlayers[MAX_PLAYERS], iNumPlayers 157 | new sTeam[MAX_NAME_LENGTH] 158 | 159 | get_user_team(player,sTeam,MAX_NAME_LENGTH) 160 | get_players(iPlayers,iNumPlayers,"ae",sTeam) 161 | 162 | for (new i = 0; i < iNumPlayers; i++) { 163 | iCheck += gFreezeIndex[iPlayers[i]] 164 | } 165 | // All players on team frozen 166 | if (iCheck >= iNumPlayers) { 167 | for (new i = 0; i < iNumPlayers; i++) { 168 | user_kill(iPlayers[i],1) 169 | } 170 | new sMsg[MAX_TEXT_LENGTH] 171 | format(sMsg,MAX_TEXT_LENGTH,"The entire %s team was frozen!",sTeam) 172 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 173 | show_hudmessage(0,sMsg) 174 | } 175 | } 176 | } 177 | 178 | public event_round_draw() 179 | { 180 | if (get_cvar_num("amx_freezetag_mode")) { 181 | new iPlayers[MAX_PLAYERS], iNumPlayers 182 | get_players(iPlayers,iNumPlayers,"a") 183 | for (new i = 0; i < iNumPlayers; i++) { 184 | if (gFreezeIndex[iPlayers[i]]) { 185 | gFreezeIndex[iPlayers[i]] = 0 186 | player_unfreeze(iPlayers[i],0) 187 | } 188 | } 189 | } 190 | return PLUGIN_CONTINUE 191 | } 192 | 193 | public event_team_action() 194 | { 195 | if (get_cvar_num("amx_freezetag_mode")) { 196 | new sTeam[MAX_NAME_LENGTH] 197 | new sAction[MAX_NAME_LENGTH] 198 | read_logargv(1,sTeam,MAX_NAME_LENGTH) 199 | read_logargv(3,sAction,MAX_NAME_LENGTH) 200 | 201 | if (equal(sTeam,"TERRORIST")) { 202 | if (equal(sAction,"Target_Bombed") || equal(sAction,"VIP_Assassinated")) { 203 | event_slay_team(2) 204 | } 205 | } 206 | else if (equal(sTeam,"CT")) { 207 | if (equal(sAction,"Bomb_Defused") || equal(sAction,"All_Hostages_Rescued")) { 208 | event_slay_team(1) 209 | } 210 | } 211 | } 212 | return PLUGIN_CONTINUE 213 | } 214 | 215 | public event_slay_team(team) 216 | { 217 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 218 | get_players(iPlayers,iNumPlayers,"a") 219 | for (new i = 0; i < iNumPlayers; i++) { 220 | iPlayer = iPlayers[i] 221 | if (get_user_team(iPlayer)==team) { 222 | if (!gFreezeIndex[iPlayer]) { 223 | player_freeze(iPlayer) 224 | } 225 | user_kill(iPlayer) 226 | } 227 | } 228 | } 229 | 230 | public event_respawn(id) 231 | { 232 | if (get_cvar_num("amx_freezetag_mode")) { 233 | set_user_health(id,456) 234 | gFreezeIndex[id] = 0 235 | 236 | new sMsg[MAX_TEXT_LENGTH] 237 | format(sMsg,MAX_TEXT_LENGTH,"-= FREEZE TAG MOD =-^n^nFreeze all your opponents to win!^nUnfreeze your teammates with your knife!") 238 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 239 | show_hudmessage(id,sMsg) 240 | } 241 | return PLUGIN_CONTINUE 242 | } 243 | 244 | /************************************************************ 245 | * PLAYER FUNCTIONS 246 | ************************************************************/ 247 | 248 | static player_freeze(player) { 249 | gFreezeIndex[player] = 1 250 | set_user_maxspeed(player,1.0) 251 | 252 | if (get_user_team(player)==1) { 253 | set_user_rendering(player,kRenderFxGlowShell,255,0,0,kRenderNormal,100) 254 | } 255 | else { 256 | set_user_rendering(player,kRenderFxGlowShell,0,100,255,kRenderNormal,100) 257 | } 258 | emit_sound(player,CHAN_AUTO,gSoundIndex[SOUND_FREEZE],VOL_NORM,ATTN_NORM,0,PITCH_NORM) 259 | show_score() 260 | } 261 | 262 | static player_unfreeze(player,fx) { 263 | gFreezeIndex[player] = 0 264 | set_user_maxspeed(player) 265 | client_cmd(player,"slot2;") 266 | set_user_rendering(player) 267 | 268 | if (fx) { 269 | new iOrigin[3] 270 | get_user_origin(player,iOrigin) 271 | if (get_user_team(player)==1) { 272 | fx_sparks(iOrigin,spr_t_spark) 273 | } 274 | else { 275 | fx_sparks(iOrigin,spr_ct_spark) 276 | } 277 | emit_sound(player,CHAN_AUTO,gSoundIndex[random_num(1,3)],VOL_NORM,ATTN_NORM,0,PITCH_NORM) 278 | } 279 | show_score() 280 | } 281 | 282 | /************************************************************ 283 | * HELPER FUNCTIONS 284 | ************************************************************/ 285 | 286 | public show_score() 287 | { 288 | if (get_cvar_num("amx_freezetag_mode")) { 289 | new iNumT = 0 290 | new iNumCT = 0 291 | for (new i = 0; i < MAX_PLAYERS; i++) { 292 | if (is_user_alive(i) && gFreezeIndex[i]==0) { 293 | if (get_user_team(i)==1) { 294 | iNumT += 1 295 | } 296 | else if (get_user_team(i)==2) { 297 | iNumCT += 1 298 | } 299 | } 300 | } 301 | 302 | new sMsg[MAX_TEXT_LENGTH] 303 | format(sMsg,MAX_TEXT_LENGTH," FreezeTag: (CT remaining: %i) (T remaining: %i)",iNumCT,iNumT) 304 | message_begin(MSG_ALL,gmsgStatusText,{0,0,0}) 305 | write_byte(1) 306 | write_string(sMsg) 307 | message_end() 308 | } 309 | return PLUGIN_CONTINUE 310 | } 311 | 312 | public msg_display(msg[],r,g,b) 313 | { 314 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 315 | show_hudmessage(0,msg) 316 | } 317 | 318 | static fx_sparks(origin[3],sprite) { 319 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 320 | write_byte(TE_SPRITETRAIL) 321 | write_coord(origin[0]) 322 | write_coord(origin[1]) 323 | write_coord(origin[2]) 324 | write_coord(origin[0]) 325 | write_coord(origin[1]) 326 | write_coord(origin[2]) 327 | write_short(sprite) 328 | write_byte(50) // count 329 | write_byte(10) // life 330 | write_byte(1) // scale 331 | write_byte(50) // velocity 332 | write_byte(100) // randomness 333 | message_end() 334 | } 335 | 336 | /************************************************************ 337 | * PLUGIN FUNCTIONS 338 | ************************************************************/ 339 | 340 | public plugin_precache() 341 | { 342 | // Sounds 343 | copy(gSoundIndex[SOUND_FREEZE],MAX_NAME_LENGTH,"debris/beamstart8.wav") 344 | copy(gSoundIndex[SOUND_GLASS1],MAX_NAME_LENGTH,"debris/bustglass1.wav") 345 | copy(gSoundIndex[SOUND_GLASS2],MAX_NAME_LENGTH,"debris/bustglass2.wav") 346 | copy(gSoundIndex[SOUND_GLASS3],MAX_NAME_LENGTH,"debris/bustglass3.wav") 347 | 348 | for (new i = 0; i < MAX_SOUNDS; i++) { 349 | precache_sound(gSoundIndex[i]) 350 | } 351 | 352 | // Sprites 353 | spr_ct_spark = precache_model("sprites/XSpark1.spr") 354 | spr_t_spark = precache_model("sprites/Gwave1.spr") 355 | 356 | return PLUGIN_CONTINUE 357 | } 358 | 359 | public plugin_init() 360 | { 361 | register_plugin("Freeze Tag","1.0","mike_cao") 362 | register_clcmd("amx_freezetag","admin_freezetag",ACCESS_LEVEL,"amx_freezetag < 0 | 1 >") 363 | register_event("ResetHUD","event_respawn","be","1=1") 364 | register_cvar("amx_freezetag_mode","1") 365 | register_event("CurWeapon","event_weapon","be","1=1") 366 | register_event("Damage","event_damage","b","2!0","3=0","4!0") 367 | register_event("ResetHUD","event_respawn","be","1=1") 368 | register_event("DeathMsg","event_death","a") 369 | register_event("SendAudio","event_round_draw","a","2&%!MRAD_rounddraw") 370 | register_logevent("event_team_action",6,"2=triggered") 371 | 372 | gmsgStatusText = get_user_msgid("StatusText") 373 | gFF = get_cvar_num("mp_friendlyfire") 374 | set_task(1.0,"show_score",0,"",0,"b") 375 | 376 | return PLUGIN_CONTINUE 377 | } 378 | -------------------------------------------------------------------------------- /amx/plugin_glowdamage.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_glowdamage.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin makes players glow briefly when 8 | * damaged. There are team-based glow colors 9 | * as well as different colors for the amount 10 | * of damage dealt. 11 | * 12 | * Use the cvar "amx_glowdamage_mode" in your admin.cfg 13 | * 0 = off 14 | * 1 = default glow damage 15 | * 2 = team-based glow damage 16 | * 17 | */ 18 | 19 | #include 20 | 21 | #define MAX_NAME_LENGTH 32 22 | #define MAX_PLAYERS 32 23 | 24 | // Admin access level 25 | #define ACCESS_LEVEL ADMIN_LEVEL_A 26 | 27 | // Color between shots (1=on, 0=off) 28 | #define INTERMEDIATE_GLOW 0 29 | 30 | new gGlow 31 | new gGlowState[MAX_PLAYERS+1] 32 | 33 | public admin_glowdamage(id) 34 | { 35 | // Check access level 36 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 37 | client_print(id, print_console,"[AMX] You have no access to that command") 38 | return PLUGIN_HANDLED 39 | } 40 | // Check arguments 41 | if (read_argc() < 2) { 42 | client_print(id, print_console,"[AMX] Usage: amx_glowdamage < 0 | 1 | 2 > [0=off,1=on,2=team-based]") 43 | return PLUGIN_HANDLED 44 | } 45 | 46 | new sArg[MAX_NAME_LENGTH+1] 47 | read_argv(1,sArg,MAX_NAME_LENGTH) 48 | set_cvar_num("amx_glowdamage_mode",str_to_num(sArg)) 49 | 50 | if ( equal(sArg,"0") ) { 51 | client_print(id,print_console,"[AMX] Glow damage is now off") 52 | msg_display("Glow Damage Disabled.",0,200,0) 53 | } 54 | else if ( equal(sArg,"1") ) { 55 | client_print(id,print_console,"[AMX] Glow damage is now on") 56 | msg_display("Glow Damage Enabled.",0,200,0) 57 | } 58 | else if ( equal(sArg,"2") ) { 59 | client_print(id,print_console,"[AMX] Team-based glow damage is now on") 60 | msg_display("Team-based Glow Damage Enabled.",0,200,0) 61 | } 62 | 63 | return PLUGIN_HANDLED 64 | } 65 | 66 | public msg_display(msg[],r,g,b) 67 | { 68 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 69 | show_hudmessage(0,msg) 70 | } 71 | 72 | public player_glow_on(player,r,g,b,size) 73 | { 74 | new Params[1] 75 | Params[0] = player 76 | set_user_rendering(player,kRenderFxGlowShell,r,g,b,kRenderNormal,size) 77 | set_task(0.5,"player_glow_off",0,Params,1); 78 | return PLUGIN_CONTINUE 79 | } 80 | 81 | public player_glow_off(Params[]) 82 | { 83 | set_user_rendering(Params[0]) 84 | return PLUGIN_CONTINUE 85 | } 86 | 87 | public event_glowdamage() 88 | { 89 | new iR, iG, iB, iSize, iColor, iState 90 | new iVictim = read_data(0) 91 | new iDamage = read_data(2) 92 | new sTeam[MAX_NAME_LENGTH+1] 93 | 94 | gGlow = get_cvar_num("amx_glowdamage_mode") 95 | 96 | get_user_team(iVictim,sTeam,MAX_NAME_LENGTH); 97 | iColor = INTERMEDIATE_GLOW 98 | 99 | if (iColor) { 100 | iState = gGlowState[iVictim] 101 | if(iState) { 102 | gGlowState[iVictim] = 0 103 | } else { 104 | gGlowState[iVictim] = 1 105 | } 106 | } 107 | 108 | if (gGlow > 0 && !iState) { 109 | // Heavy damage 110 | if (iDamage > 30) { 111 | iSize = 20 112 | // Team-based 113 | if (gGlow == 2) { 114 | // Team 1 115 | if ( equal(sTeam,"TERRORIST") ) { 116 | iR = 255 117 | iG = 0 118 | iB = 0 119 | } 120 | // Team 2 121 | else if ( equal(sTeam,"CT") ) { 122 | iR = 0 123 | iG = 192 124 | iB = 255 125 | } 126 | // Default 127 | else { 128 | iR = 255 129 | iG = 128 130 | iB = 0 131 | } 132 | } 133 | // Non team-based 134 | else { 135 | iR = 255 136 | iG = 128 137 | iB = 0 138 | } 139 | } 140 | // Medium damage 141 | else if (iDamage > 20) { 142 | iSize = 10 143 | // Team-based 144 | if (gGlow == 2) { 145 | // Team 1 146 | if ( equal(sTeam,"TERRORIST") ) { 147 | iR = 128 148 | iG = 0 149 | iB = 0 150 | } 151 | // Team 2 152 | else if ( equal(sTeam,"CT") ) { 153 | iR = 0 154 | iG = 128 155 | iB = 192 156 | } 157 | // Default 158 | else { 159 | iR = 255 160 | iG = 96 161 | iB = 0 162 | } 163 | } 164 | // Non team-based 165 | else { 166 | iR = 255 167 | iG = 96 168 | iB = 0 169 | } 170 | } 171 | // Low damage 172 | else if (iDamage > 10) { 173 | iSize = 0 174 | // Team-based 175 | if (gGlow == 2) { 176 | // Team 1 177 | if ( equal(sTeam,"TERRORIST") ) { 178 | iR = 64 179 | iG = 0 180 | iB = 0 181 | } 182 | // Team 2 183 | else if ( equal(sTeam,"CT") ) { 184 | iR = 0 185 | iG = 64 186 | iB = 128 187 | } 188 | // Default 189 | else { 190 | iR = 255 191 | iG = 64 192 | iB = 0 193 | } 194 | } 195 | // Non team-based 196 | else { 197 | iR = 255 198 | iG = 64 199 | iB = 0 200 | } 201 | } 202 | } 203 | // Intermediate color 204 | else if ( gGlow > 0 && iState ) { 205 | iR = 255 206 | iG = 255 207 | iB = 255 208 | } 209 | // Glow player 210 | if (gGlow) { 211 | player_glow_on(iVictim,iR,iG,iB,iSize) 212 | } 213 | return PLUGIN_CONTINUE; 214 | } 215 | 216 | public plugin_init() 217 | { 218 | register_plugin("Glow Damage","1.0","mike_cao") 219 | register_clcmd("amx_glowdamage","admin_glowdamage",ACCESS_LEVEL,"amx_glowdamage < 0 | 1 | 2 >") 220 | register_event("Damage","event_glowdamage","b","2!0","3=0","4!0") 221 | register_cvar("amx_glowdamage_mode","1") 222 | return PLUGIN_CONTINUE 223 | } 224 | -------------------------------------------------------------------------------- /amx/plugin_gore.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_gore.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin adds gore effects. It is configured 8 | * with the cvar "amx_gore" using these flags: 9 | * 10 | * a - Headshot blood 11 | * b - Extra blood effects 12 | * c - Bleeding on low health 13 | * d - Gib explosion (knife, HE, high damage only) 14 | * 15 | */ 16 | #include 17 | 18 | #define MAX_NAME_LENGTH 32 19 | #define MAX_VAR_LENGTH 64 20 | #define MAX_PLAYERS 32 21 | #define MAX_TEXT_LENGTH 512 22 | 23 | #define GORE_HEADSHOT (1<<0) // "a" 24 | #define GORE_BLOOD (1<<1) // "b" 25 | #define GORE_BLEEDING (1<<2) // "c" 26 | #define GORE_GIB (1<<3) // "d" 27 | 28 | #define TE_BLOODSPRITE 115 29 | #define TE_BLOODSTREAM 101 30 | #define TE_MODEL 106 31 | #define TE_WORLDDECAL 116 32 | 33 | /************************************************************ 34 | * MAIN 35 | ************************************************************/ 36 | 37 | new gHealthIndex[MAX_PLAYERS+1] 38 | 39 | new mdl_gib_flesh 40 | new mdl_gib_head 41 | new mdl_gib_legbone 42 | new mdl_gib_lung 43 | new mdl_gib_meat 44 | new mdl_gib_spine 45 | 46 | new spr_blood_drop 47 | new spr_blood_spray 48 | 49 | public event_damage() 50 | { 51 | new iFlags = get_gore_flags() 52 | new iVictim = read_data(0) 53 | gHealthIndex[iVictim] = get_user_health(iVictim) 54 | 55 | if (iFlags&GORE_BLOOD) { 56 | new iOrigin[3] 57 | get_user_origin(iVictim,iOrigin) 58 | fx_blood(iOrigin) 59 | fx_blood_small(iOrigin,10) 60 | } 61 | return PLUGIN_CONTINUE 62 | } 63 | 64 | public event_death() 65 | { 66 | new iFlags = get_gore_flags() 67 | new iOrigin[3] 68 | new sWeapon[MAX_NAME_LENGTH] 69 | new iVictim = read_data(2) 70 | new iHeadshot = read_data(3) 71 | 72 | read_data(4,sWeapon,MAX_NAME_LENGTH) 73 | 74 | if (iFlags&GORE_HEADSHOT && iHeadshot) { 75 | get_user_origin(iVictim,iOrigin) 76 | fx_headshot(iOrigin) 77 | } 78 | else if (iFlags&GORE_GIB && (equal(sWeapon,"knife") || equal(sWeapon,"grenade") || (gHealthIndex[iVictim] - get_user_health(iVictim)) > 100)) { 79 | get_user_origin(iVictim,iOrigin) 80 | // Effects 81 | fx_trans(iVictim,0) 82 | fx_gib_explode(iOrigin,5) 83 | fx_blood_large(iOrigin,3) 84 | fx_blood_small(iOrigin,20) 85 | // Hide body 86 | iOrigin[2] = iOrigin[2]-20 87 | set_user_origin(iVictim,iOrigin) 88 | } 89 | } 90 | 91 | public event_blood() 92 | { 93 | 94 | new iFlags = get_gore_flags() 95 | if (iFlags&GORE_BLEEDING) { 96 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers, iOrigin[3] 97 | get_players(iPlayers,iNumPlayers,"a") 98 | for (new i = 0; i < iNumPlayers; i++) { 99 | iPlayer = iPlayers[i] 100 | if (get_user_health(iPlayer) < 20) { 101 | get_user_origin(iPlayer,iOrigin) 102 | fx_bleed(iOrigin) 103 | fx_blood_small(iOrigin,5) 104 | } 105 | } 106 | } 107 | } 108 | 109 | public event_respawn(id) 110 | { 111 | gHealthIndex[id] = get_user_health(id) 112 | return PLUGIN_CONTINUE 113 | } 114 | 115 | public get_gore_flags() 116 | { 117 | new sFlags[24] 118 | get_cvar_string("amx_gore",sFlags,24) 119 | return read_flags(sFlags) 120 | } 121 | 122 | /************************************************************ 123 | * FX FUNCTIONS 124 | ************************************************************/ 125 | 126 | static fx_trans(player,amount) 127 | { 128 | set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount) 129 | return PLUGIN_CONTINUE 130 | } 131 | 132 | public fx_blood(origin[3]) 133 | { 134 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 135 | write_byte(TE_BLOODSPRITE) 136 | write_coord(origin[0]+random_num(-20,20)) 137 | write_coord(origin[1]+random_num(-20,20)) 138 | write_coord(origin[2]+random_num(-20,20)) 139 | write_short(spr_blood_spray) 140 | write_short(spr_blood_drop) 141 | write_byte(248) // color index 142 | write_byte(10) // size 143 | message_end() 144 | } 145 | 146 | public fx_bleed(origin[3]) 147 | { 148 | // Blood spray 149 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 150 | write_byte(TE_BLOODSTREAM) 151 | write_coord(origin[0]) 152 | write_coord(origin[1]) 153 | write_coord(origin[2]+10) 154 | write_coord(random_num(-100,100)) // x 155 | write_coord(random_num(-100,100)) // y 156 | write_coord(random_num(-10,10)) // z 157 | write_byte(70) // color 158 | write_byte(random_num(50,100)) // speed 159 | message_end() 160 | } 161 | 162 | static fx_blood_small(origin[3],num) 163 | { 164 | // Blood decals 165 | static const blood_small[7] = {190,191,192,193,194,195,197} 166 | 167 | // Small splash 168 | for (new j = 0; j < num; j++) { 169 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 170 | write_byte(TE_WORLDDECAL) 171 | write_coord(origin[0]+random_num(-100,100)) 172 | write_coord(origin[1]+random_num(-100,100)) 173 | write_coord(origin[2]-36) 174 | write_byte(blood_small[random_num(0,6)]) // index 175 | message_end() 176 | } 177 | } 178 | 179 | static fx_blood_large(origin[3],num) 180 | { 181 | // Blood decals 182 | static const blood_large[2] = {204,205} 183 | 184 | // Large splash 185 | for (new i = 0; i < num; i++) { 186 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 187 | write_byte(TE_WORLDDECAL) 188 | write_coord(origin[0]+random_num(-50,50)) 189 | write_coord(origin[1]+random_num(-50,50)) 190 | write_coord(origin[2]-36) 191 | write_byte(blood_large[random_num(0,1)]) // index 192 | message_end() 193 | } 194 | } 195 | 196 | static fx_gib_explode(origin[3],num) 197 | { 198 | new flesh[3], x, y, z 199 | flesh[0] = mdl_gib_flesh 200 | flesh[1] = mdl_gib_meat 201 | flesh[2] = mdl_gib_legbone 202 | 203 | // Gib explosion 204 | // Head 205 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 206 | write_byte(TE_MODEL) 207 | write_coord(origin[0]) 208 | write_coord(origin[1]) 209 | write_coord(origin[2]) 210 | write_coord(random_num(-100,100)) 211 | write_coord(random_num(-100,100)) 212 | write_coord(random_num(100,200)) 213 | write_angle(random_num(0,360)) 214 | write_short(mdl_gib_head) 215 | write_byte(0) // bounce 216 | write_byte(500) // life 217 | message_end() 218 | 219 | // Spine 220 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 221 | write_byte(TE_MODEL) 222 | write_coord(origin[0]) 223 | write_coord(origin[1]) 224 | write_coord(origin[2]) 225 | write_coord(random_num(-100,100)) 226 | write_coord(random_num(-100,100)) 227 | write_coord(random_num(100,200)) 228 | write_angle(random_num(0,360)) 229 | write_short(mdl_gib_spine) 230 | write_byte(0) // bounce 231 | write_byte(500) // life 232 | message_end() 233 | 234 | // Lung 235 | for(new i = 0; i < random_num(1,2); i++) { 236 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 237 | write_byte(TE_MODEL) 238 | write_coord(origin[0]) 239 | write_coord(origin[1]) 240 | write_coord(origin[2]) 241 | write_coord(random_num(-100,100)) 242 | write_coord(random_num(-100,100)) 243 | write_coord(random_num(100,200)) 244 | write_angle(random_num(0,360)) 245 | write_short(mdl_gib_lung) 246 | write_byte(0) // bounce 247 | write_byte(500) // life 248 | message_end() 249 | } 250 | 251 | // Parts, 5 times 252 | for(new i = 0; i < 5; i++) { 253 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 254 | write_byte(TE_MODEL) 255 | write_coord(origin[0]) 256 | write_coord(origin[1]) 257 | write_coord(origin[2]) 258 | write_coord(random_num(-100,100)) 259 | write_coord(random_num(-100,100)) 260 | write_coord(random_num(100,200)) 261 | write_angle(random_num(0,360)) 262 | write_short(flesh[random_num(0,2)]) 263 | write_byte(0) // bounce 264 | write_byte(500) // life 265 | message_end() 266 | } 267 | 268 | // Blood 269 | for(new i = 0; i < num; i++) { 270 | x = random_num(-100,100) 271 | y = random_num(-100,100) 272 | z = random_num(0,100) 273 | for(new j = 0; j < 5; j++) { 274 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 275 | write_byte(TE_BLOODSPRITE) 276 | write_coord(origin[0]+(x*j)) 277 | write_coord(origin[1]+(y*j)) 278 | write_coord(origin[2]+(z*j)) 279 | write_short(spr_blood_spray) 280 | write_short(spr_blood_drop) 281 | write_byte(248) // color index 282 | write_byte(15) // size 283 | message_end() 284 | } 285 | } 286 | } 287 | 288 | public fx_headshot(origin[3]) 289 | { 290 | // Blood spray, 5 times 291 | for (new i = 0; i < 5; i++) { 292 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 293 | write_byte(101) 294 | write_coord(origin[0]) 295 | write_coord(origin[1]) 296 | write_coord(origin[2]+30) 297 | write_coord(random_num(-20,20)) // x 298 | write_coord(random_num(-20,20)) // y 299 | write_coord(random_num(50,300)) // z 300 | write_byte(70) // color 301 | write_byte(random_num(100,200)) // speed 302 | message_end() 303 | } 304 | } 305 | 306 | /************************************************************ 307 | * PLUGIN FUNCTIONS 308 | ************************************************************/ 309 | 310 | public plugin_precache() 311 | { 312 | spr_blood_drop = precache_model("sprites/blood.spr") 313 | spr_blood_spray = precache_model("sprites/bloodspray.spr") 314 | 315 | mdl_gib_flesh = precache_model("models/Fleshgibs.mdl") 316 | mdl_gib_head = precache_model("models/GIB_Skull.mdl") 317 | mdl_gib_legbone = precache_model("models/GIB_Legbone.mdl") 318 | mdl_gib_lung = precache_model("models/GIB_Lung.mdl") 319 | mdl_gib_meat = precache_model("models/GIB_B_Gib.mdl") 320 | mdl_gib_spine = precache_model("models/GIB_B_Bone.mdl") 321 | } 322 | 323 | public plugin_init() 324 | { 325 | register_plugin("Plugin Gore","1.0","mike_cao") 326 | register_event("DeathMsg","event_death","a") 327 | register_event("Damage","event_damage","b","2!0","3=0","4!0") 328 | register_event("ResetHUD","event_respawn","be","1=1") 329 | register_cvar("amx_gore","abcd") 330 | set_task(1.0,"event_blood",0,"",0,"b") 331 | 332 | return PLUGIN_CONTINUE 333 | } 334 | -------------------------------------------------------------------------------- /amx/plugin_hunting.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_hunting.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin requires the following plugins to work: 8 | * (plugin_powers.sma) 9 | * 10 | * Hunting season mod. One team (hunters) have infinite ammo and 11 | * armor. The other team (bears) have lots of health and knives. 12 | * Teams switch roles every round. 13 | * 14 | * Cvar: 15 | * amx_hunting_mode <1|0> 16 | * 17 | */ 18 | 19 | #include 20 | 21 | #define MAX_NAME_LENGTH 32 22 | #define MAX_PLAYERS 32 23 | #define MAX_TEXT_LENGTH 512 24 | 25 | #define DEFAULT_HEALTH 3000 26 | 27 | /************************************************************ 28 | * CONFIG 29 | ************************************************************/ 30 | 31 | // Admin access level 32 | #define ACCESS_LEVEL ADMIN_LEVEL_A 33 | 34 | 35 | /************************************************************ 36 | * MAIN 37 | ************************************************************/ 38 | 39 | new gHunterTeam = 1 40 | new gPlayerIndex[MAX_PLAYERS] 41 | new gMsg[MAX_TEXT_LENGTH] = {"-= HUNTING SEASON MOD =-^n^nHunters VS. Bears^n^nTeam roles switch every round."} 42 | 43 | public admin_hunting(id) 44 | { 45 | // Check access level 46 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 47 | console_print(id,"[AMX] You have no access to that command") 48 | return PLUGIN_HANDLED 49 | } 50 | // Check arguments 51 | if (read_argc() < 2) { 52 | console_print(id,"[AMX] Usage: amx_hunting < 1 | 0 >") 53 | return PLUGIN_HANDLED 54 | } 55 | new sArg1[MAX_NAME_LENGTH+1] 56 | read_argv(1,sArg1,MAX_NAME_LENGTH) 57 | set_cvar_num("amx_hunting_mode",str_to_num(sArg1)) 58 | if (equal(sArg1,"1")) { 59 | client_print(id,print_console,"[AMX] Hunting season is now on.") 60 | player_msg(0,"Hunting season is now on! :)",0,200,0) 61 | } 62 | else if (equal(sArg1,"0")) { 63 | client_print(id,print_console,"[AMX] Hunting season is now off.") 64 | player_msg(0,"Hunting season is now off! :(",0,200,0) 65 | } 66 | return PLUGIN_HANDLED 67 | } 68 | 69 | 70 | /************************************************************ 71 | * EVENT FUNCTIONS 72 | ************************************************************/ 73 | 74 | public event_respawn(id) 75 | { 76 | if (get_cvar_num("amx_hunting_mode")) { 77 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 78 | show_hudmessage(id,gMsg) 79 | 80 | new sAuthid[MAX_NAME_LENGTH] 81 | get_user_name(id,sAuthid,MAX_NAME_LENGTH) 82 | 83 | // If multiple found, use authid instead 84 | new iPlayer = player_find(id,sAuthid) 85 | if (!iPlayer) { 86 | get_user_authid(id,sAuthid,MAX_NAME_LENGTH) 87 | } 88 | // Set user as a hunter or a bear 89 | if (get_user_team(id)==gHunterTeam) { 90 | server_cmd("amx_rambo ^"%s^" on",sAuthid) 91 | gPlayerIndex[id] = 0 92 | //set_user_rendering(id,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,200) 93 | set_user_rendering(id,kRenderFxGlowShell,255,200,200,kRenderNormal,100) 94 | client_print(id,print_chat,"* You are a hunter! Go kill them bears!") 95 | } 96 | else { 97 | set_user_health(id,DEFAULT_HEALTH) 98 | gPlayerIndex[id] = 1 99 | client_print(id,print_chat,"* You are a bear! Rarw!") 100 | client_cmd(id,"weapon_knife") 101 | } 102 | } 103 | return PLUGIN_CONTINUE 104 | } 105 | 106 | public event_glow() 107 | { 108 | if (get_cvar_num("amx_hunting_mode")) { 109 | new iPlayers[MAX_PLAYERS], iNumPlayers 110 | 111 | get_players(iPlayers,iNumPlayers) 112 | 113 | for (new i = 0; i < iNumPlayers; i++) { 114 | if (gPlayerIndex[iPlayers[i]]==1) { 115 | set_user_rendering(iPlayers[i],kRenderFxGlowShell,255,255,255,kRenderNormal,200) 116 | } 117 | } 118 | 119 | } 120 | return PLUGIN_CONTINUE 121 | } 122 | 123 | public event_weapon() 124 | { 125 | if (get_cvar_num("amx_hunting_mode")) { 126 | new iPlayer = read_data(0) 127 | if (gPlayerIndex[iPlayer]==1) { 128 | engclient_cmd(iPlayer,"weapon_knife") 129 | set_user_maxspeed(iPlayer,350.0) 130 | } 131 | } 132 | return PLUGIN_CONTINUE 133 | } 134 | 135 | public event_round_end() 136 | { 137 | if (get_cvar_num("amx_hunting_mode")) { 138 | if (gHunterTeam == 1) { 139 | gHunterTeam = 2 140 | } 141 | else { 142 | gHunterTeam = 1 143 | } 144 | set_task(4.0,"event_reset",0,"") 145 | set_task(5.0,"event_glow",0,"") 146 | } 147 | return PLUGIN_CONTINUE 148 | } 149 | 150 | public event_reset() 151 | { 152 | if (get_cvar_num("amx_hunting_mode")) { 153 | new sAuthid[MAX_NAME_LENGTH] 154 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 155 | 156 | get_players(iPlayers,iNumPlayers) 157 | 158 | for (new i = 0; i < iNumPlayers; i++) { 159 | iPlayer = iPlayers[i] 160 | get_user_authid(iPlayer,sAuthid,MAX_NAME_LENGTH) 161 | server_cmd("amx_nopowers ^"%s^" 1",sAuthid) 162 | } 163 | } 164 | return PLUGIN_CONTINUE 165 | } 166 | 167 | 168 | /************************************************************ 169 | * PLAYER FUNCTIONS 170 | ************************************************************/ 171 | 172 | public player_msg(player,msg[],r,g,b) 173 | { 174 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 175 | show_hudmessage(player,msg) 176 | } 177 | 178 | static player_find(id,arg[]) 179 | { 180 | new player = find_player("bl",arg) 181 | if (player) { 182 | new player2 = find_player("blj",arg) 183 | if (player!=player2){ 184 | console_print(id,"[POWERS] Found multiple clients. Try again.") 185 | return 0 186 | } 187 | } 188 | else { 189 | player = find_player("c",arg) 190 | } 191 | if (!player){ 192 | console_print(id,"[POWERS] Client with that authid or part of nick not found") 193 | return 0 194 | } 195 | return player 196 | } 197 | 198 | 199 | /************************************************************ 200 | * PLUGIN FUNCTIONS 201 | ************************************************************/ 202 | 203 | public plugin_init() 204 | { 205 | register_plugin("Plugin Hunting Season","1.0","mike_cao") 206 | register_concmd("amx_hunting","admin_hunting",ACCESS_LEVEL,"amx_hunting < on | off >") 207 | register_event("ResetHUD","event_respawn","be","1=1") 208 | register_event("SendAudio","event_round_end","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw") 209 | register_event("CurWeapon","event_weapon","be","1=1") 210 | register_cvar("amx_hunting_mode","1") 211 | return PLUGIN_CONTINUE 212 | } 213 | -------------------------------------------------------------------------------- /amx/plugin_ka.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_ka.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Knife arena. Players can only use knives. 8 | * 9 | */ 10 | 11 | #include 12 | 13 | #define MAX_NAME_LENGTH 32 14 | #define MAX_PLAYERS 32 15 | #define MAX_WEAPONS 32 16 | #define MAX_TEXT_LENGTH 512 17 | 18 | /************************************************************ 19 | * CONFIG 20 | ************************************************************/ 21 | 22 | // Admin access level 23 | #define ACCESS_LEVEL ADMIN_LEVEL_A 24 | 25 | /************************************************************ 26 | * MAIN 27 | ************************************************************/ 28 | 29 | public admin_ka(id) 30 | { 31 | // Check access level 32 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 33 | console_print(id,"[AMX] You have no access to that command") 34 | return PLUGIN_HANDLED 35 | } 36 | // Check arguments 37 | if (read_argc() < 2) { 38 | console_print(id,"[AMX] Usage: amx_ka < 1 | 0 >") 39 | return PLUGIN_HANDLED 40 | } 41 | new sArg1[MAX_NAME_LENGTH+1] 42 | read_argv(1,sArg1,MAX_NAME_LENGTH) 43 | set_cvar_num("amx_knife_mode",str_to_num(sArg1)) 44 | if (equal(sArg1,"1")) { 45 | client_print(id,print_console,"[AMX] Knife Arena is now on.") 46 | msg_display("Knife Arena is now on! :)",0,200,0) 47 | 48 | new iPlayers[MAX_PLAYERS], iNumPlayers 49 | get_players(iPlayers,iNumPlayers) 50 | for (new i = 0; i < iNumPlayers; i++) { 51 | engclient_cmd(iPlayers[i],"weapon_knife") 52 | } 53 | } 54 | else if (equal(sArg1,"0")) { 55 | client_print(id,print_console,"[AMX] Knife Arena is now off.") 56 | msg_display("Knife Arena is now off! :(",0,200,0) 57 | } 58 | return PLUGIN_HANDLED 59 | } 60 | 61 | public msg_display(msg[],r,g,b) 62 | { 63 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 64 | show_hudmessage(0,msg) 65 | } 66 | 67 | /************************************************************ 68 | * EVENT FUNCTIONS 69 | ************************************************************/ 70 | 71 | public event_weapon() 72 | { 73 | new iPlayer = read_data(0) 74 | if (get_cvar_num("amx_knife_mode")) { 75 | engclient_cmd(iPlayer,"weapon_knife") 76 | } 77 | return PLUGIN_CONTINUE 78 | } 79 | 80 | public event_respawn(id) 81 | { 82 | if (get_cvar_num("amx_knife_mode")) { 83 | new sMsg[MAX_TEXT_LENGTH] 84 | format(sMsg,MAX_TEXT_LENGTH,"-= KNIFE ARENA MOD =-^n^nKnives only!") 85 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 86 | show_hudmessage(id,sMsg) 87 | engclient_cmd(id,"weapon_knife") 88 | } 89 | return PLUGIN_CONTINUE 90 | } 91 | 92 | /************************************************************ 93 | * PLUGIN FUNCTIONS 94 | ************************************************************/ 95 | 96 | public plugin_init() 97 | { 98 | register_plugin("Knife Arena","1.0","mike_cao") 99 | register_clcmd("amx_ka","admin_ka",ACCESS_LEVEL,"amx_ka < 0 | 1 >") 100 | register_event("ResetHUD","event_respawn","be","1=1") 101 | register_event("CurWeapon","event_weapon","be","1=1") 102 | register_cvar("amx_knife_mode","1") 103 | return PLUGIN_CONTINUE 104 | } 105 | -------------------------------------------------------------------------------- /amx/plugin_listen.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_listen.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Cvar amx_listen: 8 | * "a" - Admins can hear everyone 9 | * "b" - Dead players can hear alive players 10 | * "c" - Alive players can hear dead players 11 | * 12 | */ 13 | #include 14 | 15 | #define MAX_NAME_LENGTH 32 16 | #define MAX_PLAYERS 32 17 | #define MAX_TEXT_LENGTH 256 18 | 19 | #define LISTEN_ADMIN (1<<0) 20 | #define LISTEN_DEAD (1<<1) 21 | #define LISTEN_ALIVE (1<<2) 22 | 23 | /************************************************************ 24 | * CONFIGS 25 | ************************************************************/ 26 | 27 | // Admin access level 28 | #define ACCESS_LEVEL ADMIN_LEVEL_A 29 | 30 | /************************************************************ 31 | * MAIN 32 | ************************************************************/ 33 | 34 | public event_say(id) 35 | { 36 | new iFlags = get_listen_flags() 37 | 38 | // No flags 39 | if (!(iFlags&LISTEN_ADMIN) && !(iFlags&LISTEN_DEAD) && !(iFlags&LISTEN_ALIVE)) { 40 | return PLUGIN_CONTINUE 41 | } 42 | else { 43 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 44 | new sName[MAX_NAME_LENGTH], sCommand[MAX_NAME_LENGTH], sMessage[MAX_TEXT_LENGTH] 45 | 46 | read_argv(0,sCommand,MAX_TEXT_LENGTH) 47 | read_argv(1,sMessage,MAX_TEXT_LENGTH) 48 | get_user_name(id,sName,MAX_NAME_LENGTH) 49 | get_players(iPlayers,iNumPlayers,"c") 50 | 51 | for (new i = 0; i < iNumPlayers; i++) { 52 | iPlayer = iPlayers[i] 53 | // Ignore self, ignore same status messages 54 | if ((iPlayer != id) && (is_user_alive(iPlayer) != is_user_alive(id))) { 55 | // If speaker is alive, echo to dead players 56 | if (is_user_alive(id) && iFlags&LISTEN_DEAD && !is_user_alive(iPlayer)) { 57 | // If team message, echo only to dead team members 58 | if (equal(sCommand,"say_team") && get_user_team(id)==get_user_team(iPlayer)) { 59 | client_print(iPlayer,print_chat, "(TEAM) (ALIVE) %s : %s",sName,sMessage) 60 | } 61 | // Else echo to all dead players 62 | else { 63 | client_print(iPlayer,print_chat, "(ALIVE) %s : %s",sName,sMessage) 64 | } 65 | } 66 | // If speaker is dead, echo to alive players 67 | else if (!is_user_alive(id) && iFlags&LISTEN_ALIVE && is_user_alive(iPlayer)) { 68 | // If team message, echo only to alive team members 69 | if (equal(sCommand,"say_team") && get_user_team(id)==get_user_team(iPlayer)) { 70 | client_print(iPlayer,print_chat, "(TEAM) (DEAD) %s : %s",sName,sMessage) 71 | } 72 | // Else echo to all alive players 73 | else { 74 | client_print(iPlayer,print_chat, "(DEAD) %s : %s",sName,sMessage) 75 | } 76 | } 77 | // If admin and allowed to listen 78 | else if (get_user_flags(iPlayer)&ACCESS_LEVEL && iFlags&LISTEN_ADMIN) { 79 | client_print(iPlayer,print_chat,"(LISTEN) %s : %s",sName,sMessage) 80 | } 81 | } // end if 82 | } // end for 83 | } 84 | return PLUGIN_CONTINUE 85 | } 86 | 87 | public get_listen_flags() 88 | { 89 | new sFlags[24] 90 | get_cvar_string("amx_listen",sFlags,3) 91 | return read_flags(sFlags) 92 | } 93 | 94 | /************************************************************ 95 | * PLUGIN FUNCTIONS 96 | ************************************************************/ 97 | 98 | public plugin_init() 99 | { 100 | register_plugin("Plugin Listen","1.0","mike_cao") 101 | register_clcmd("say","event_say") 102 | register_clcmd("say_team","event_say") 103 | register_cvar("amx_listen","abc") 104 | 105 | return PLUGIN_CONTINUE 106 | } 107 | -------------------------------------------------------------------------------- /amx/plugin_mysql_ban.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_mysql_ban.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Simple ban management using a mySQL database. 8 | * 9 | * Create a table to hold bans in your mysql database: 10 | * 11 | * CREATE TABLE banned ( 12 | * banid varchar(32) NOT NULL PRIMARY KEY, 13 | * reason varchar(255), 14 | * adminid int default 0, 15 | * moddatetime bigint default 0 16 | * ); 17 | * 18 | */ 19 | #include 20 | #include 21 | 22 | new logfilename[] = "addons/amx/logs/mysql_ban.log" 23 | 24 | #define ACCESS_LEVEL ADMIN_BAN 25 | #define MAX_NAME_LENGTH 32 26 | #define MAX_TEXT_LENGTH 512 27 | #define MAX_HOST_LENGTH 64 28 | 29 | // Ban a player 30 | public admin_mysql_ban(id) 31 | { 32 | new sMysqlHost[MAX_HOST_LENGTH] 33 | new sMysqlUser[MAX_NAME_LENGTH] 34 | new sMysqlPass[MAX_NAME_LENGTH] 35 | new sMysqlDB[MAX_NAME_LENGTH] 36 | new sMysqlError[MAX_NAME_LENGTH] 37 | new iMysql = 0 38 | 39 | get_cvar_string("amx_mysql_host",sMysqlHost,MAX_HOST_LENGTH) 40 | get_cvar_string("amx_mysql_user",sMysqlUser,MAX_NAME_LENGTH) 41 | get_cvar_string("amx_mysql_pass",sMysqlPass,MAX_NAME_LENGTH) 42 | get_cvar_string("amx_mysql_db",sMysqlDB,MAX_NAME_LENGTH) 43 | 44 | // Check access level 45 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 46 | console_print(id,"[AMX] You have no access to that command") 47 | return PLUGIN_HANDLED 48 | } 49 | // Check arguments 50 | if (read_argc() < 3) { 51 | console_print(id,"[AMX] Usage: amx_mysql_ban < wonid | ip address > < reason >") 52 | return PLUGIN_HANDLED 53 | } 54 | 55 | // Connect to database 56 | iMysql = mysql_connect(sMysqlHost,sMysqlUser,sMysqlPass,sMysqlDB,sMysqlError,MAX_NAME_LENGTH) 57 | 58 | if (iMysql < 1) { 59 | // Catch errors 60 | mysql_error(iMysql,sMysqlError,MAX_NAME_LENGTH) 61 | server_print("[AMX] MySQL error : could not connect : '%s'",sMysqlError) 62 | return PLUGIN_HANDLED 63 | } 64 | else { 65 | new sQuery[MAX_TEXT_LENGTH] 66 | new sBanid[MAX_NAME_LENGTH] 67 | new sReason[MAX_TEXT_LENGTH] 68 | new sAdminid[MAX_NAME_LENGTH] 69 | new sName[MAX_NAME_LENGTH] 70 | new sModDateTime[MAX_NAME_LENGTH] 71 | read_argv(1,sBanid,MAX_NAME_LENGTH) 72 | read_argv(2,sReason,MAX_TEXT_LENGTH) 73 | get_user_authid(id,sAdminid,MAX_NAME_LENGTH) 74 | get_user_name(id,sName,MAX_NAME_LENGTH) 75 | get_time("%Y%m%d%H%M%S",sModDateTime,MAX_NAME_LENGTH) 76 | 77 | // Do query 78 | format(sQuery,256,"INSERT INTO banned (banid,reason,adminid,moddatetime) VALUES ('%s','%s',%s,%s)",sBanid,sReason,sAdminid,sModDateTime) 79 | mysql_query(iMysql,sQuery) 80 | client_print(id,print_console,"[AMX] The wonid/ip ^"%s^" has been banned.",sBanid) 81 | log_to_file(logfilename,"^"%s<%d><%s><>^" banned ^"%s^" for ^"%s^"",sName,get_user_userid(id),sAdminid,sBanid,sReason) 82 | 83 | // Close connection 84 | mysql_close(iMysql) 85 | } 86 | return PLUGIN_HANDLED 87 | } 88 | 89 | // Unban a player 90 | public admin_mysql_unban(id) 91 | { 92 | new sMysqlHost[MAX_HOST_LENGTH] 93 | new sMysqlUser[MAX_NAME_LENGTH] 94 | new sMysqlPass[MAX_NAME_LENGTH] 95 | new sMysqlDB[MAX_NAME_LENGTH] 96 | new sMysqlError[MAX_NAME_LENGTH] 97 | new iMysql = 0 98 | 99 | get_cvar_string("amx_mysql_host",sMysqlHost,MAX_HOST_LENGTH) 100 | get_cvar_string("amx_mysql_user",sMysqlUser,MAX_NAME_LENGTH) 101 | get_cvar_string("amx_mysql_pass",sMysqlPass,MAX_NAME_LENGTH) 102 | get_cvar_string("amx_mysql_db",sMysqlDB,MAX_NAME_LENGTH) 103 | 104 | // Check access level 105 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 106 | console_print(id,"[AMX] You have no access to that command") 107 | return PLUGIN_HANDLED 108 | } 109 | // Check arguments 110 | if (read_argc() < 3) { 111 | console_print(id,"[AMX] Usage: amx_mysql_unban < wonid | ip address > < reason >") 112 | return PLUGIN_HANDLED 113 | } 114 | 115 | // Connect to database 116 | iMysql = mysql_connect(sMysqlHost,sMysqlUser,sMysqlPass,sMysqlDB,sMysqlError,MAX_NAME_LENGTH) 117 | 118 | if (iMysql < 1) { 119 | // Catch errors 120 | mysql_error(iMysql,sMysqlError,MAX_NAME_LENGTH) 121 | server_print("[AMX] MySQL error : could not connect : '%s'",sMysqlError) 122 | return PLUGIN_HANDLED 123 | } 124 | else { 125 | new sQuery[MAX_TEXT_LENGTH] 126 | new sBanid[MAX_NAME_LENGTH] 127 | new sReason[MAX_TEXT_LENGTH] 128 | new sAdminid[MAX_NAME_LENGTH] 129 | new sName[MAX_NAME_LENGTH] 130 | read_argv(1,sBanid,MAX_NAME_LENGTH) 131 | read_argv(2,sReason,MAX_TEXT_LENGTH) 132 | get_user_authid(id,sAdminid,MAX_NAME_LENGTH) 133 | get_user_name(id,sName,MAX_NAME_LENGTH) 134 | 135 | // Do query 136 | format(sQuery,256,"DELETE FROM banned WHERE banid='%s'",sBanid) 137 | mysql_query(iMysql,sQuery) 138 | client_print(id,print_console,"[AMX] The wonid/ip ^"%s^" has been unbanned.",sBanid) 139 | log_to_file(logfilename,"^"%s<%d><%s><>^" unbanned ^"%s^" for ^"%s^"",sName,get_user_userid(id),sAdminid,sBanid,sReason) 140 | 141 | // Close connection 142 | mysql_close(iMysql) 143 | } 144 | return PLUGIN_HANDLED 145 | } 146 | 147 | // Find a player 148 | static player_find(id,arg[]) 149 | { 150 | new player = find_player("bl",arg) 151 | if (player) { 152 | new player2 = find_player("blj",arg) 153 | if (player!=player2){ 154 | console_print(id,"[POWERS] Found multiple clients. Try again.") 155 | return 0 156 | } 157 | } 158 | else { 159 | player = find_player("c",arg) 160 | } 161 | if (!player){ 162 | console_print(id,"[POWERS] Client with that authid or part of nick not found") 163 | return 0 164 | } 165 | return player 166 | } 167 | 168 | // Get a player's wonid 169 | public admin_getwonid(id) 170 | { 171 | // Check access level 172 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 173 | console_print(id,"[AMX] You have no access to that command") 174 | return PLUGIN_HANDLED 175 | } 176 | 177 | // Check arguments 178 | if (read_argc() < 2) { 179 | console_print(id,"[AMX] Usage: amx_getwonid < part of name >") 180 | return PLUGIN_HANDLED 181 | } 182 | 183 | // Get data 184 | new sArg1[MAX_NAME_LENGTH] 185 | read_argv(1,sArg1,MAX_NAME_LENGTH) 186 | 187 | // Player checks 188 | new iPlayer = player_find(id,sArg1) 189 | if (iPlayer) { 190 | new sName[32], sMsg[MAX_TEXT_LENGTH] 191 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 192 | format(sMsg,MAX_TEXT_LENGTH,"* ^"%s^"'s wonid is %i",sName,get_user_wonid(iPlayer)) 193 | client_print(id,print_chat,sMsg) 194 | client_print(id,print_console,sMsg) 195 | } 196 | return PLUGIN_HANDLED 197 | } 198 | 199 | // Get a player's ip address 200 | public admin_getip(id) 201 | { 202 | // Check access level 203 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 204 | console_print(id,"[AMX] You have no access to that command") 205 | return PLUGIN_HANDLED 206 | } 207 | 208 | // Check arguments 209 | if (read_argc() < 2) { 210 | console_print(id,"[AMX] Usage: amx_getip < part of name >") 211 | return PLUGIN_HANDLED 212 | } 213 | 214 | // Get data 215 | new sArg1[MAX_NAME_LENGTH] 216 | read_argv(1,sArg1,MAX_NAME_LENGTH) 217 | 218 | // Player checks 219 | new iPlayer = player_find(id,sArg1) 220 | if (iPlayer) { 221 | new sName[32], sMsg[MAX_TEXT_LENGTH], sIPAddress[MAX_NAME_LENGTH] 222 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 223 | get_user_ip(id,sIPAddress,MAX_NAME_LENGTH,1) 224 | format(sMsg,MAX_TEXT_LENGTH,"* ^"%s^"'s ip address is %s",sName,sIPAddress) 225 | client_print(id,print_chat,sMsg) 226 | client_print(id,print_console,sMsg) 227 | } 228 | return PLUGIN_HANDLED 229 | } 230 | 231 | public client_connect(id) 232 | { 233 | new sMysqlHost[MAX_HOST_LENGTH] 234 | new sMysqlUser[MAX_NAME_LENGTH] 235 | new sMysqlPass[MAX_NAME_LENGTH] 236 | new sMysqlDB[MAX_NAME_LENGTH] 237 | new sMysqlError[MAX_NAME_LENGTH] 238 | new iMysql = 0 239 | 240 | get_cvar_string("amx_mysql_host",sMysqlHost,MAX_HOST_LENGTH) 241 | get_cvar_string("amx_mysql_user",sMysqlUser,MAX_NAME_LENGTH) 242 | get_cvar_string("amx_mysql_pass",sMysqlPass,MAX_NAME_LENGTH) 243 | get_cvar_string("amx_mysql_db",sMysqlDB,MAX_NAME_LENGTH) 244 | 245 | // Connect to database 246 | iMysql = mysql_connect(sMysqlHost,sMysqlUser,sMysqlPass,sMysqlDB,sMysqlError,MAX_NAME_LENGTH) 247 | 248 | if (iMysql < 1) { 249 | // Catch errors 250 | mysql_error(iMysql,sMysqlError,32) 251 | server_print("[AMX] MySQL error : could not connect : '%s'",sMysqlError) 252 | return PLUGIN_HANDLED 253 | } 254 | else { 255 | new sQuery[MAX_TEXT_LENGTH] 256 | new sAuthid[MAX_NAME_LENGTH] 257 | new sIPAddress[MAX_NAME_LENGTH] 258 | new sName[MAX_NAME_LENGTH] 259 | get_user_authid(id,sAuthid,MAX_NAME_LENGTH) 260 | get_user_ip(id,sIPAddress,MAX_NAME_LENGTH,1) 261 | get_user_name(id,sName,MAX_NAME_LENGTH) 262 | 263 | // Do query 264 | format(sQuery,256,"SELECT banid FROM banned WHERE banid='%s' OR banid='%s'",sAuthid,sIPAddress) 265 | mysql_query(iMysql,sQuery) 266 | 267 | // If result, then player is banned 268 | if (mysql_nextrow(iMysql)) { 269 | log_to_file(logfilename,"^"%s<%d><%s><>^" from ^"%s^" was rejected.",sName,get_user_userid(id),sAuthid,sIPAddress) 270 | client_cmd(id,"clear;echo * You are banned from this server.;disconnect") 271 | return PLUGIN_HANDLED 272 | } 273 | mysql_close(iMysql) 274 | } 275 | return PLUGIN_CONTINUE 276 | } 277 | 278 | public plugin_init() 279 | { 280 | register_plugin("Plugin MySQL Ban","1.0","mike_cao") 281 | register_cvar("amx_mysql_host","66.111.48.230") 282 | register_cvar("amx_mysql_user","root") 283 | register_cvar("amx_mysql_pass","") 284 | register_cvar("amx_mysql_db","amx") 285 | 286 | register_concmd("amx_mysql_ban","admin_mysql_ban",ACCESS_LEVEL,"amx_mysql_ban < wonid | ip > < reason >") 287 | register_concmd("amx_mysql_unban","admin_mysql_unban",ACCESS_LEVEL,"amx_mysql_unban < wonid | ip > < reason >") 288 | register_concmd("amx_getwonid","admin_getwonid",ACCESS_LEVEL,"getwonid < part of name >") 289 | register_concmd("amx_getip","admin_getip",ACCESS_LEVEL,"getip < part of name >") 290 | 291 | return PLUGIN_CONTINUE 292 | } 293 | -------------------------------------------------------------------------------- /amx/plugin_namechange.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_namechange.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Prevents players from changing their names 8 | * a certain time after the round has started. 9 | * 10 | */ 11 | #include 12 | 13 | #define MAX_NAME_LENGTH 32 14 | #define MAX_PLAYERS 32 15 | #define MAX_TEXT_LENGTH 512 16 | 17 | new Float:gSpawnTime 18 | new gNameIndex[MAX_PLAYERS+1][MAX_NAME_LENGTH] 19 | 20 | /************************************************************ 21 | * CONFIG 22 | ************************************************************/ 23 | 24 | // No name change allowed this many seconds after round starts 25 | #define DEFAULT_NAMECHANGE_TIME 30 26 | 27 | // Kill the player for changing their name (1=on/0=off) 28 | new NAMECHANGE_KILL = 0 29 | 30 | /************************************************************ 31 | * PLUGIN FUNCTIONS 32 | ************************************************************/ 33 | 34 | public event_respawn(id) 35 | { 36 | gSpawnTime = get_gametime() 37 | return PLUGIN_CONTINUE 38 | } 39 | 40 | public client_connect(id) 41 | { 42 | copy(gNameIndex[id],MAX_NAME_LENGTH,"") 43 | return PLUGIN_CONTINUE 44 | } 45 | 46 | // Name change 47 | public client_infochanged(id) 48 | { 49 | new sName[MAX_TEXT_LENGTH], sNewName[MAX_TEXT_LENGTH] 50 | get_user_name(id,sName,MAX_TEXT_LENGTH) 51 | get_user_info(id,"name",sNewName,MAX_TEXT_LENGTH) 52 | 53 | // Not allowed 54 | if (!equal(sName,sNewName) && !equal(sNewName,gNameIndex[id]) && get_gametime() > (gSpawnTime + DEFAULT_NAMECHANGE_TIME) && is_user_alive(id)) { 55 | client_print(id,print_console,"* You can't change your name %i seconds after the round has started.",DEFAULT_NAMECHANGE_TIME) 56 | 57 | if (NAMECHANGE_KILL == 1) { 58 | user_kill(id); 59 | } 60 | else { 61 | copy(gNameIndex[id],MAX_NAME_LENGTH,sName) 62 | client_cmd(id,"name ^"%s^"",sName) 63 | } 64 | } 65 | return PLUGIN_CONTINUE 66 | } 67 | 68 | public plugin_init() 69 | { 70 | register_plugin("Plugin Namechange","1.1","mike_cao") 71 | register_event("ResetHUD","event_respawn","be","1=1") 72 | } -------------------------------------------------------------------------------- /amx/plugin_redirect.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_redirect.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Redirects players to another server if current server is full. 8 | * 9 | */ 10 | 11 | #include 12 | 13 | #define MAX_NAME_LENGTH 32 14 | #define MAX_TEXT_LENGTH 256 15 | 16 | new gServerName[MAX_TEXT_LENGTH] = "www.yourserver.com" 17 | new gServerAddress[MAX_TEXT_LENGTH] = "1.2.3.4" 18 | 19 | // Show redirect message? 20 | new gMsg = 0 21 | 22 | public client_connect(id) 23 | { 24 | new iMaxPlayers = get_maxplayers() 25 | new iReservedSlots = 0 26 | 27 | if (cvar_exists("amx_reserved_slots")) { 28 | iReservedSlots = get_cvar_num("amx_reserved_slots") 29 | } 30 | new iPlayers = get_playersnum() + 1 31 | if (iPlayers > (iMaxPlayers - iReservedSlots)) { 32 | if (!(get_user_flags(id)&ADMIN_RESERVATION)) { 33 | if (gMsg) { 34 | client_cmd(id,"echo ^"Server is currently full.^"") 35 | client_cmd(id,"echo ^"Redirecting to %s^";wait;wait;",gServerName) 36 | } 37 | client_cmd(id,"connect %s",gServerAddress) 38 | } 39 | } 40 | } 41 | 42 | 43 | public plugin_init() { 44 | register_plugin("Plugin Redirect","1.0","mike_cao") 45 | return PLUGIN_CONTINUE 46 | } 47 | -------------------------------------------------------------------------------- /amx/plugin_slash.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_slash.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin allows admins to execute amx commands 8 | * using 'say' and a slash '/'. It can also execute 9 | * a command on all players or a team using '@all' and 10 | * '@team' in place of the authid/nick parameter. 11 | * 12 | * Examples: 13 | * To kick a player type '/kick playername' 14 | * To kick all players type '/kick @all' 15 | * To kick all players on a team type '/kick @team:TEAMID' 16 | * To ban all players for 10 minutes, type '/ban 10 @all' 17 | * 18 | * Additional Commands: 19 | * Includes an IRC style '/me' command. If you say 20 | * '/me sucks', it'll replace the '/me' with your name 21 | * and print it to everyone. 22 | * 23 | */ 24 | 25 | #include 26 | 27 | #define MAX_NAME_LENGTH 32 28 | #define MAX_TEXT_LENGTH 192 29 | #define MAX_PLAYERS 32 30 | 31 | public admin_slash(id) 32 | { 33 | new sName[MAX_NAME_LENGTH+1] 34 | new sArg[MAX_NAME_LENGTH+1] 35 | read_argv(1,sArg,MAX_NAME_LENGTH) 36 | 37 | // Check for '/' char 38 | if ( sArg[0] == '/' ) { 39 | new sCommand[MAX_TEXT_LENGTH+1] 40 | new sMessage[MAX_TEXT_LENGTH+1] 41 | new sTemp[MAX_TEXT_LENGTH+1] 42 | 43 | // Get data 44 | read_args(sMessage,MAX_TEXT_LENGTH) 45 | remove_quotes(sMessage) 46 | replace(sMessage,MAX_TEXT_LENGTH,"/","") 47 | 48 | // For all players 49 | if ( containi(sMessage,"@all") != -1 ) { 50 | new iPlayers[MAX_PLAYERS], iNumPlayers 51 | get_players(iPlayers,iNumPlayers) 52 | 53 | for (new i = 0; i < iNumPlayers; i++) { 54 | get_user_name(iPlayers[i],sName,MAX_NAME_LENGTH) 55 | copy(sTemp,MAX_TEXT_LENGTH,sMessage) 56 | replace(sTemp,MAX_TEXT_LENGTH,"@all","^"@name^"") 57 | replace(sTemp,MAX_TEXT_LENGTH,"@name",sName) 58 | format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sTemp) 59 | client_cmd(id,sCommand) 60 | } 61 | copyc(sCommand,MAX_NAME_LENGTH,sTemp,' ') 62 | client_print(id,print_chat,"[AMX] Command ^"%s^" executed on all players",sCommand) 63 | } 64 | // For a team 65 | else if ( containi(sMessage,"@team:") != -1 ) { 66 | new sTeam[MAX_NAME_LENGTH] 67 | new sRemove[MAX_TEXT_LENGTH] 68 | new sMod[MAX_NAME_LENGTH] 69 | 70 | // Get team 71 | copy(sTemp,MAX_TEXT_LENGTH,sMessage) 72 | copyc(sRemove,MAX_TEXT_LENGTH,sTemp,'@') 73 | replace(sTemp,MAX_TEXT_LENGTH,sRemove,"") 74 | copyc(sTeam,MAX_TEXT_LENGTH,sTemp,' ') 75 | 76 | if ( containi(sTeam,"@team:") != -1 ) { 77 | replace(sMessage,MAX_TEXT_LENGTH,sTeam,"^"@name^"") 78 | replace(sTeam,MAX_TEXT_LENGTH,"@team:","") 79 | 80 | // Get mod 81 | get_modname(sMod,MAX_NAME_LENGTH) 82 | 83 | // Shortcuts for Counter-strike 84 | if (equal(sMod,"cstrike")) { 85 | if ( equal(sTeam,"T") ) { 86 | copy(sTeam,MAX_NAME_LENGTH,"TERRORIST") 87 | } 88 | else if ( equal(sTeam,"S") ) { 89 | copy(sTeam,MAX_NAME_LENGTH,"SPECTATOR") 90 | } 91 | } 92 | } 93 | else { 94 | client_print(id,print_chat,"[AMX] Team identifier not recognized") 95 | return PLUGIN_HANDLED 96 | } 97 | 98 | new iPlayers[MAX_PLAYERS], iNumPlayers 99 | get_players(iPlayers,iNumPlayers,"e",sTeam) 100 | 101 | if ( iNumPlayers ) { 102 | for (new i = 0; i < iNumPlayers; i++) { 103 | get_user_name(iPlayers[i],sName,MAX_NAME_LENGTH) 104 | copy(sTemp,MAX_TEXT_LENGTH,sMessage) 105 | replace(sTemp,MAX_TEXT_LENGTH,"@name",sName) 106 | format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sTemp) 107 | client_cmd(id,sCommand) 108 | } 109 | copyc(sCommand,MAX_NAME_LENGTH,sTemp,' ') 110 | client_print(id,print_chat,"[AMX] Command ^"%s^" executed on team ^"%s^"",sCommand,sTeam) 111 | } 112 | else { 113 | client_print(id,print_chat,"[AMX] There are no players on team ^"%s^"",sTeam) 114 | } 115 | } 116 | else { 117 | format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sMessage) 118 | client_cmd(id,sCommand) 119 | } 120 | 121 | return PLUGIN_HANDLED 122 | } 123 | return PLUGIN_CONTINUE 124 | } 125 | 126 | public admin_me(id) 127 | { 128 | new sName[MAX_NAME_LENGTH+1] 129 | new sMessage[MAX_TEXT_LENGTH+1] 130 | 131 | // Get data 132 | get_user_name(id,sName,MAX_NAME_LENGTH) 133 | read_args(sMessage,MAX_TEXT_LENGTH) 134 | remove_quotes(sMessage) 135 | 136 | // Display message only to same status players 137 | new bAlive = is_user_alive(id) 138 | for (new i = 1; i <= MAX_PLAYERS; i++) { 139 | if(is_user_alive(i) == bAlive) { 140 | client_print(i,print_chat,"%s %s",sName,sMessage) 141 | } 142 | } 143 | return PLUGIN_HANDLED 144 | } 145 | 146 | public plugin_init() 147 | { 148 | register_plugin("Plugin Slash","1.1","mike_cao") 149 | register_clcmd("say","admin_slash",0,"say /command < params >") 150 | register_clcmd("amx_me","admin_me",0,"amx_me < text >") 151 | return PLUGIN_CONTINUE 152 | } 153 | -------------------------------------------------------------------------------- /amx/plugin_stealthwar.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMOD script. 3 | * (plugin_stealthwar.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Makes the winning team invisible. Invisible 8 | * players can only use knives. 9 | * 10 | */ 11 | 12 | #include 13 | 14 | #define MAX_NAME_LENGTH 32 15 | #define MAX_PLAYERS 32 16 | #define MAX_TEXT_LENGTH 512 17 | #define MAX_SOUNDS 2 18 | 19 | #define TE_SMOKE 5 20 | 21 | #define SOUND_FLASH1 0 22 | #define SOUND_FLASH2 1 23 | 24 | /************************************************************ 25 | * CONFIG 26 | ************************************************************/ 27 | 28 | // Admin access level 29 | #define ACCESS_LEVEL ADMIN_LEVEL_A 30 | 31 | /************************************************************ 32 | * MAIN 33 | ************************************************************/ 34 | 35 | new gStealthTeam = 0 36 | 37 | // Sprites 38 | new spr_smoke 39 | 40 | // Sounds 41 | new gSoundIndex[MAX_SOUNDS][MAX_NAME_LENGTH] 42 | 43 | public admin_stealthwar(id) 44 | { 45 | // Check access level 46 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 47 | console_print(id,"[AMX] You have no access to that command") 48 | return PLUGIN_HANDLED 49 | } 50 | // Check arguments 51 | if (read_argc() < 2) { 52 | console_print(id,"[AMX] Usage: amx_stealthwar < 1 | 0 >") 53 | return PLUGIN_HANDLED 54 | } 55 | new sArg1[MAX_NAME_LENGTH+1] 56 | read_argv(1,sArg1,MAX_NAME_LENGTH) 57 | set_cvar_num("amx_stealthwar_mode",str_to_num(sArg1)) 58 | if (equal(sArg1,"1")) { 59 | client_print(id,print_console,"[AMX] Stealth War is now on.") 60 | msg_display("Stealth War is now on! :)",0,200,0) 61 | } 62 | else if (equal(sArg1,"0")) { 63 | client_print(id,print_console,"[AMX] Stealth War is now off.") 64 | msg_display("Stealth War is now off! :(",0,200,0) 65 | gStealthTeam = 0 66 | event_reset() 67 | } 68 | return PLUGIN_HANDLED 69 | } 70 | 71 | public msg_display(msg[],r,g,b) 72 | { 73 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 74 | show_hudmessage(0,msg) 75 | } 76 | 77 | 78 | 79 | /************************************************************ 80 | * EVENT FUNCTIONS 81 | ************************************************************/ 82 | 83 | public event_stealth() 84 | { 85 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 86 | new sName[MAX_NAME_LENGTH] 87 | new iOrigin[3] 88 | get_players(iPlayers,iNumPlayers) 89 | 90 | for (new i = 0; i < iNumPlayers; i++) { 91 | iPlayer = iPlayers[i] 92 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 93 | if (get_user_team(iPlayer)==gStealthTeam) { 94 | set_user_rendering(iPlayer,kRenderFxNone,0,0,0,kRenderTransAlpha,0) 95 | engclient_cmd(iPlayer,"weapon_knife") 96 | get_user_origin(iPlayer,iOrigin) 97 | fx_stealth(iOrigin) 98 | emit_sound(iPlayer,CHAN_AUTO,gSoundIndex[random_num(0,1)],VOL_NORM,ATTN_NORM,0,PITCH_NORM) 99 | } 100 | } 101 | } 102 | 103 | public event_reset() 104 | { 105 | new iPlayers[MAX_PLAYERS], iNumPlayers 106 | get_players(iPlayers,iNumPlayers) 107 | for (new i = 0; i < iNumPlayers; i++) { 108 | set_user_rendering(iPlayers[i]) 109 | } 110 | } 111 | 112 | public event_respawn(id) 113 | { 114 | if (get_cvar_num("amx_stealthwar_mode")) { 115 | new sMsg[MAX_TEXT_LENGTH] 116 | new sTeam[MAX_TEXT_LENGTH] 117 | if (gStealthTeam==1) { 118 | copy(sTeam,MAX_NAME_LENGTH,"TERRORIST") 119 | } 120 | else if (gStealthTeam==2){ 121 | copy(sTeam,MAX_NAME_LENGTH,"COUNTER-TERRORIST") 122 | } 123 | format(sMsg,MAX_TEXT_LENGTH,"-= STEALTH WARS MOD =-^n^nThe %s team is invisible and armed with knives!",sTeam) 124 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 125 | show_hudmessage(id,sMsg) 126 | } 127 | return PLUGIN_CONTINUE 128 | } 129 | 130 | public event_round_t() 131 | { 132 | if (get_cvar_num("amx_stealthwar_mode")) { 133 | new sMsg[MAX_TEXT_LENGTH] 134 | gStealthTeam = 1 135 | format(sMsg,MAX_TEXT_LENGTH,"The TERRORIST team won invisible powers!") 136 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 137 | show_hudmessage(0,sMsg) 138 | set_task(4.0,"event_reset",0,"") 139 | set_task(6.0,"event_stealth",0,"") 140 | } 141 | return PLUGIN_CONTINUE 142 | } 143 | 144 | public event_round_ct() 145 | { 146 | if (get_cvar_num("amx_stealthwar_mode")) { 147 | new sMsg[MAX_TEXT_LENGTH] 148 | gStealthTeam = 2 149 | format(sMsg,MAX_TEXT_LENGTH,"The COUNTER-TERRORIST team won invisible powers!") 150 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 151 | show_hudmessage(0,sMsg) 152 | set_task(4.0,"event_reset",0,"") 153 | set_task(6.0,"event_stealth",0,"") 154 | } 155 | return PLUGIN_CONTINUE 156 | } 157 | 158 | public event_round_draw() 159 | { 160 | if (get_cvar_num("amx_stealthwar_mode")) { 161 | gStealthTeam = random_num(1,2) 162 | set_task(4.0,"event_reset",0,"") 163 | set_task(6.0,"event_stealth",0,"") 164 | } 165 | return PLUGIN_CONTINUE 166 | } 167 | 168 | public event_weapon() 169 | { 170 | new iPlayer = read_data(0) 171 | new iWeapon = read_data(2) 172 | if (get_cvar_num("amx_stealthwar_mode") && get_user_team(iPlayer)==gStealthTeam && iWeapon != CSW_C4) { 173 | engclient_cmd(iPlayer,"weapon_knife") 174 | } 175 | return PLUGIN_CONTINUE 176 | } 177 | 178 | public event_death() 179 | { 180 | new iVictim = read_data(2) 181 | if (get_cvar_num("amx_stealthwar_mode") && get_user_team(iVictim)==gStealthTeam) { 182 | set_user_rendering(iVictim) 183 | } 184 | return PLUGIN_CONTINUE 185 | } 186 | 187 | public event_damage() 188 | { 189 | new iVictim = read_data(0) 190 | new iDamage = read_data(2) 191 | if (get_cvar_num("amx_stealthwar_mode") && get_user_team(iVictim)==gStealthTeam) { 192 | if (get_user_health(iVictim) > 0) { 193 | // Heavy damage 194 | if (iDamage > 30) { 195 | player_vis_on(iVictim,192) 196 | } 197 | // Medium damage 198 | else if (iDamage > 15) { 199 | player_vis_on(iVictim,128) 200 | } 201 | // Low damage 202 | else { 203 | player_vis_on(iVictim,64) 204 | } 205 | } 206 | } 207 | return PLUGIN_CONTINUE; 208 | } 209 | 210 | public fx_stealth(origin[3]) { 211 | // Smoke 212 | message_begin( MSG_BROADCAST,SVC_TEMPENTITY) 213 | write_byte(TE_SMOKE) 214 | write_coord(origin[0]) 215 | write_coord(origin[1]) 216 | write_coord(origin[2]) 217 | write_short(spr_smoke) 218 | write_byte(20) // scale 219 | write_byte(20) // framerate 220 | message_end() 221 | } 222 | 223 | /************************************************************ 224 | * PLAYER FUNCTIONS 225 | ************************************************************/ 226 | 227 | public player_vis_on(player,amount) 228 | { 229 | new Params[1] 230 | Params[0] = player 231 | set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount) 232 | set_task(1.0,"player_vis_off",0,Params,1); 233 | return PLUGIN_CONTINUE 234 | } 235 | 236 | public player_vis_off(Params[]) 237 | { 238 | set_user_rendering(Params[0],kRenderFxNone,0,0,0,kRenderTransAlpha,0) 239 | return PLUGIN_CONTINUE 240 | } 241 | 242 | /************************************************************ 243 | * PLUGIN FUNCTIONS 244 | ************************************************************/ 245 | 246 | public plugin_precache() 247 | { 248 | copy(gSoundIndex[SOUND_FLASH1],MAX_NAME_LENGTH,"weapons/flashbang-1.wav") 249 | copy(gSoundIndex[SOUND_FLASH2],MAX_NAME_LENGTH,"weapons/flashbang-2.wav") 250 | 251 | for (new i = 0; i < MAX_SOUNDS; i++) { 252 | precache_sound(gSoundIndex[i]) 253 | } 254 | 255 | spr_smoke = precache_model("sprites/steam1.spr") 256 | } 257 | 258 | public plugin_init() 259 | { 260 | register_plugin("Stealth War","1.0","mike_cao") 261 | register_clcmd("amx_stealthwar","admin_stealthwar",ACCESS_LEVEL,"amx_ka < 0 | 1 >") 262 | register_event("ResetHUD","event_respawn","be","1=1") 263 | register_cvar("amx_stealthwar_mode","1") 264 | register_event("SendAudio","event_round_t","a","2&%!MRAD_terwin") 265 | register_event("SendAudio","event_round_ct","a","2&%!MRAD_ctwin") 266 | register_event("SendAudio","event_round_draw","a","2&%!MRAD_rounddraw") 267 | register_event("CurWeapon","event_weapon","be","1=1") 268 | register_event("DeathMsg","event_death","a") 269 | register_event("Damage","event_damage","b","2!0","3=0","4!0") 270 | return PLUGIN_CONTINUE 271 | } 272 | -------------------------------------------------------------------------------- /amxx/include/Vexd_Utilities.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/include/Vexd_Utilities.inc -------------------------------------------------------------------------------- /amxx/include/amxconst.inc: -------------------------------------------------------------------------------- 1 | /* AMX Mod X constants 2 | * 3 | * by the AMX Mod X Development Team 4 | * originally developed by OLO 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _amxconst_included 10 | #endinput 11 | #endif 12 | #define _amxconst_included 13 | 14 | #define AMXX_VERSION 0.16 15 | 16 | /* Uncomment if you are not using Steam */ 17 | //#define NO_STEAM 18 | 19 | #define ADMIN_IMMUNITY (1<<0) /* flag "a" */ 20 | #define ADMIN_RESERVATION (1<<1) /* flag "b" */ 21 | #define ADMIN_KICK (1<<2) /* flag "c" */ 22 | #define ADMIN_BAN (1<<3) /* flag "d" */ 23 | #define ADMIN_SLAY (1<<4) /* flag "e" */ 24 | #define ADMIN_MAP (1<<5) /* flag "f" */ 25 | #define ADMIN_CVAR (1<<6) /* flag "g" */ 26 | #define ADMIN_CFG (1<<7) /* flag "h" */ 27 | #define ADMIN_CHAT (1<<8) /* flag "i" */ 28 | #define ADMIN_VOTE (1<<9) /* flag "j" */ 29 | #define ADMIN_PASSWORD (1<<10) /* flag "k" */ 30 | #define ADMIN_RCON (1<<11) /* flag "l" */ 31 | #define ADMIN_LEVEL_A (1<<12) /* flag "m" */ 32 | #define ADMIN_LEVEL_B (1<<13) /* flag "n" */ 33 | #define ADMIN_LEVEL_C (1<<14) /* flag "o" */ 34 | #define ADMIN_LEVEL_D (1<<15) /* flag "p" */ 35 | #define ADMIN_LEVEL_E (1<<16) /* flag "q" */ 36 | #define ADMIN_LEVEL_F (1<<17) /* flag "r" */ 37 | #define ADMIN_LEVEL_G (1<<18) /* flag "s" */ 38 | #define ADMIN_LEVEL_H (1<<19) /* flag "t" */ 39 | #define ADMIN_MENU (1<<20) /* flag "u" */ 40 | #define ADMIN_ADMIN (1<<24) /* flag "y" */ 41 | #define ADMIN_USER (1<<25) /* flag "z" */ 42 | 43 | #define FLAG_KICK (1<<0) /* flag "a" */ 44 | #define FLAG_TAG (1<<1) /* flag "b" */ 45 | #define FLAG_AUTHID (1<<2) /* flag "c" */ 46 | #define FLAG_IP (1<<3) /* flag "d" */ 47 | #define FLAG_NOPASS (1<<4) /* flag "e" */ 48 | 49 | #define PLUGIN_CONTINUE 0 /* Results returned by public functions */ 50 | #define PLUGIN_HANDLED 1 /* stop other plugins */ 51 | #define PLUGIN_HANDLED_MAIN 2 /* to use in client_command(), continue all plugins but stop the command */ 52 | 53 | /* Destination types for message_begin() */ 54 | #define MSG_BROADCAST 0 /* unreliable to all */ 55 | #define MSG_ONE 1 /* reliable to one (msg_entity) */ 56 | #define MSG_ALL 2 /* reliable to all */ 57 | #define MSG_INIT 3 /* write to the init string */ 58 | #define MSG_PVS 4 /* Ents in PVS of org */ 59 | #define MSG_PAS 5 /* Ents in PAS of org */ 60 | #define MSG_PVS_R 6 /* Reliable to PVS */ 61 | #define MSG_PAS_R 7 /* Reliable to PAS */ 62 | #define MSG_ONE_UNRELIABLE 8 /* Send to one client, but don't put in reliable stream, put in unreliable datagram ( could be dropped ) */ 63 | #define MSG_SPEC 9 /* Sends to all spectator proxies */ 64 | 65 | /* Message types for message_begin() */ 66 | #define SVC_TEMPENTITY 23 67 | #define SVC_INTERMISSION 30 68 | #define SVC_CDTRACK 32 69 | #define SVC_WEAPONANIM 35 70 | #define SVC_ROOMTYPE 37 71 | #define SVC_ADDANGLE 38 /* [vec3] add this angle to the view angle */ 72 | #define SVC_NEWUSERMSG 39 73 | #define SVC_HLTV 50 74 | 75 | /* Flags for register_cvar() */ 76 | #define FCVAR_ARCHIVE 1 /* set to cause it to be saved to vars.rc */ 77 | #define FCVAR_USERINFO 2 /* changes the client's info string */ 78 | #define FCVAR_SERVER 4 /* notifies players when changed */ 79 | #define FCVAR_EXTDLL 8 /* defined by external DLL */ 80 | #define FCVAR_CLIENTDLL 16 /* defined by the client dll */ 81 | #define FCVAR_PROTECTED 32 /* It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value */ 82 | #define FCVAR_SPONLY 64 /* This cvar cannot be changed by clients connected to a multiplayer server. */ 83 | #define FCVAR_PRINTABLEONLY 128 /* This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). */ 84 | #define FCVAR_UNLOGGED 256 /* If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log */ 85 | 86 | 87 | /* Id of weapons in CS */ 88 | #define CSW_P228 1 89 | #define CSW_SCOUT 3 90 | #define CSW_HEGRENADE 4 91 | #define CSW_XM1014 5 92 | #define CSW_C4 6 93 | #define CSW_MAC10 7 94 | #define CSW_AUG 8 95 | #define CSW_SMOKEGRENADE 9 96 | #define CSW_ELITE 10 97 | #define CSW_FIVESEVEN 11 98 | #define CSW_UMP45 12 99 | #define CSW_SG550 13 100 | #define CSW_GALI 14 101 | #define CSW_GALIL 14 102 | #define CSW_FAMAS 15 103 | #define CSW_USP 16 104 | #define CSW_GLOCK18 17 105 | #define CSW_AWP 18 106 | #define CSW_MP5NAVY 19 107 | #define CSW_M249 20 108 | #define CSW_M3 21 109 | #define CSW_M4A1 22 110 | #define CSW_TMP 23 111 | #define CSW_G3SG1 24 112 | #define CSW_FLASHBANG 25 113 | #define CSW_DEAGLE 26 114 | #define CSW_SG552 27 115 | #define CSW_AK47 28 116 | #define CSW_KNIFE 29 117 | #define CSW_P90 30 118 | 119 | /* Parts of body for hits */ 120 | #define HIT_GENERIC 0 /* none */ 121 | #define HIT_HEAD 1 122 | #define HIT_CHEST 2 123 | #define HIT_STOMACH 3 124 | #define HIT_LEFTARM 4 125 | #define HIT_RIGHTARM 5 126 | #define HIT_LEFTLEG 6 127 | #define HIT_RIGHTLEG 7 128 | 129 | /* Constants for emit_sound() */ 130 | /* Channels */ 131 | #define CHAN_AUTO 0 132 | #define CHAN_WEAPON 1 133 | #define CHAN_VOICE 2 134 | #define CHAN_ITEM 3 135 | #define CHAN_BODY 4 136 | #define CHAN_STREAM 5 /* allocate stream channel from the static or dynamic area */ 137 | #define CHAN_STATIC 6 /* allocate channel from the static area */ 138 | #define CHAN_NETWORKVOICE_BASE 7 /* voice data coming across the network */ 139 | #define CHAN_NETWORKVOICE_END 500 /* network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). */ 140 | 141 | /* Attenuation values */ 142 | #define ATTN_NONE 0.00 143 | #define ATTN_NORM 0.80 144 | #define ATTN_IDLE 2.00 145 | #define ATTN_STATIC 1.25 146 | 147 | /* Pitch values */ 148 | #define PITCH_NORM 100 /* non-pitch shifted */ 149 | #define PITCH_LOW 95 /* other values are possible - 0-255, where 255 is very high */ 150 | #define PITCH_HIGH 120 151 | 152 | 153 | /* Volume values */ 154 | #define VOL_NORM 1.0 155 | 156 | /* Destination types for client_print() */ 157 | enum { 158 | print_notify = 1, 159 | print_console, 160 | print_chat, 161 | print_center, 162 | } 163 | 164 | /* Destination types for engclient_print() */ 165 | enum { 166 | engprint_console = 0, 167 | engprint_center, 168 | engprint_chat, 169 | } 170 | 171 | /* Render for set_user_rendering() */ 172 | enum { 173 | kRenderNormal = 0, /* src */ 174 | kRenderTransColor, /* c*a+dest*(1-a) */ 175 | kRenderTransTexture, /* src*a+dest*(1-a) */ 176 | kRenderGlow, /* src*a+dest -- No Z buffer checks */ 177 | kRenderTransAlpha, /* src*srca+dest*(1-srca) */ 178 | kRenderTransAdd, /* src*a+dest */ 179 | } 180 | 181 | /* Fx for set_user_rendering() */ 182 | enum { 183 | kRenderFxNone = 0, 184 | kRenderFxPulseSlow, 185 | kRenderFxPulseFast, 186 | kRenderFxPulseSlowWide, 187 | kRenderFxPulseFastWide, 188 | kRenderFxFadeSlow, 189 | kRenderFxFadeFast, 190 | kRenderFxSolidSlow, 191 | kRenderFxSolidFast, 192 | kRenderFxStrobeSlow, 193 | kRenderFxStrobeFast, 194 | kRenderFxStrobeFaster, 195 | kRenderFxFlickerSlow, 196 | kRenderFxFlickerFast, 197 | kRenderFxNoDissipation, 198 | kRenderFxDistort, /* Distort/scale/translate flicker */ 199 | kRenderFxHologram, /* kRenderFxDistort + distance fade */ 200 | kRenderFxDeadPlayer, /* kRenderAmt is the player index */ 201 | kRenderFxExplode, /* Scale up really big! */ 202 | kRenderFxGlowShell, /* Glowing Shell */ 203 | kRenderFxClampMinScale, /* Keep this sprite from getting very small (SPRITES only!) */ 204 | } 205 | 206 | /* Type for force_unmodified() */ 207 | enum { 208 | force_exactfile = 0, /* File on client must exactly match server's file */ 209 | force_model_samebounds, /* For model files only, the geometry must fit in the same bbox */ 210 | force_model_specifybounds, /* For model files only, the geometry must fit in the specified bbox */ 211 | } 212 | 213 | /* Status for get_module() */ 214 | enum { 215 | module_none = 0, 216 | module_query, 217 | module_badload, 218 | module_loaded, 219 | module_noinfo, 220 | module_noquery, 221 | module_noattach, 222 | module_old, 223 | }; -------------------------------------------------------------------------------- /amxx/include/amxmisc.inc: -------------------------------------------------------------------------------- 1 | /* AMX Mod X misc. 2 | * 3 | * by the AMX Mod X Development Team 4 | * originally developed by OLO 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _amxmisc_included 10 | #endinput 11 | #endif 12 | #define _amxmisc_included 13 | 14 | stock cmd_access(id,level,cid,num) { 15 | if ( ((get_user_flags(id)&level)!=level) && (id!=(is_dedicated_server()?0:1)) ) { 16 | console_print(id,"You have no access to that command") 17 | return 0 18 | } 19 | if (read_argc() < num) { 20 | new hcmd[32], hinfo[128], hflag 21 | get_concmd(cid,hcmd,31,hflag,hinfo,127,level) 22 | console_print(id,"Usage: %s %s",hcmd,hinfo) 23 | return 0 24 | } 25 | return 1 26 | } 27 | 28 | stock access(id,level) 29 | return (get_user_flags(id) & level) 30 | 31 | /* Flags: 32 | * 1 - obey immunity 33 | * 2 - allow yourself 34 | * 4 - must be alive 35 | * 8 - can't be bot */ 36 | stock cmd_target(id,const arg[],flags = 1) { 37 | new player = find_player("bl",arg) 38 | if (player) { 39 | if ( player != find_player("blj",arg) ) { 40 | console_print(id,"There are more clients matching to your argument") 41 | return 0 42 | } 43 | } 44 | else if ( ( player = find_player("c",arg) )==0 && arg[0]=='#' && arg[1] ) 45 | player = find_player("k",str_to_num(arg[1])) 46 | if (!player) { 47 | console_print(id,"Client with that name or userid not found") 48 | return 0 49 | } 50 | if (flags & 1) { 51 | if ((get_user_flags(player)&ADMIN_IMMUNITY) && ((flags&2)?(id!=player):true) ) { 52 | new imname[32] 53 | get_user_name(player,imname,31) 54 | console_print(id,"Client ^"%s^" has immunity",imname) 55 | return 0 56 | } 57 | } 58 | if (flags & 4) { 59 | if (!is_user_alive(player)) { 60 | new imname[32] 61 | get_user_name(player,imname,31) 62 | console_print(id,"That action can't be performed on dead client ^"%s^"",imname) 63 | return 0 64 | } 65 | } 66 | if (flags & 8) { 67 | if (is_user_bot(player)) { 68 | new imname[32] 69 | get_user_name(player,imname,31) 70 | console_print(id,"That action can't be performed on bot ^"%s^"",imname) 71 | return 0 72 | } 73 | } 74 | return player 75 | } 76 | 77 | stock show_activity( id, const name[], {Float,_}: ... ) { 78 | new buffer[128] 79 | format_args( buffer , 127 , 2 ) 80 | switch(get_cvar_num("amx_show_activity")) { 81 | case 2: client_print(0,print_chat,"%s %s: %s", 82 | (get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN" , name , buffer ) 83 | case 1: client_print(0,print_chat,"%s: %s", 84 | (get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN", buffer ) 85 | } 86 | } 87 | 88 | stock is_running(const arg[]) { 89 | new mod_name[32] 90 | get_modname(mod_name,31) 91 | return equal(mod_name,arg) 92 | } 93 | 94 | stock get_basedir(name[],len) 95 | return get_localinfo("amxx_basedir",name,len) 96 | 97 | stock get_configsdir(name[],len) 98 | return get_localinfo("amxx_configsdir",name,len) 99 | 100 | stock get_customdir(name[],len) 101 | return get_localinfo("amxx_customdir",name,len) 102 | 103 | #if defined NO_STEAM 104 | stock get_user_wonid(index) 105 | { 106 | new authid[32] 107 | get_user_authid(index,authid,31) 108 | return str_to_num(authid) 109 | } 110 | #endif -------------------------------------------------------------------------------- /amxx/include/amxmod.inc: -------------------------------------------------------------------------------- 1 | /* AMX Mod X Backwards Compatibility 2 | * 3 | * by the AMX Mod X Development Team 4 | * 5 | * This file is provided as is (no warranties). 6 | */ 7 | 8 | #if defined _amxmod_included 9 | #endinput 10 | #endif 11 | #define _amxmod_included 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | stock user_spawn(index) 19 | return spawn(index) 20 | 21 | stock get_logfile( name[], len ) 22 | return get_time("admin%m%d.log",name,len) 23 | 24 | stock get_user_money(index) 25 | return cs_get_user_money(index) 26 | 27 | stock set_user_money(index,money,flash=1) 28 | return cs_set_user_money(index,money,flash) 29 | 30 | stock numtostr(num,string[],len) 31 | return num_to_str(num,string,len) 32 | 33 | stock strtonum(const string[]) 34 | return str_to_num(string) 35 | 36 | stock build_path( path[] , len , {Float,_}:... ) 37 | { 38 | new basedir[32] 39 | get_localinfo("amxx_basedir",basedir,31) 40 | format_args(path,len,2) 41 | return replace(path,len,"$basedir",basedir) 42 | } -------------------------------------------------------------------------------- /amxx/include/core.inc: -------------------------------------------------------------------------------- 1 | /* Core functions 2 | * 3 | * (c) Copyright 1998-2003, ITB CompuPhase 4 | * 5 | * This file is provided as is (no warranties). 6 | */ 7 | 8 | #if defined _core_included 9 | #endinput 10 | #endif 11 | #define _core_included 12 | 13 | native heapspace(); 14 | 15 | native funcidx(const name[]); 16 | 17 | native numargs(); 18 | native getarg(arg, index=0); 19 | native setarg(arg, index=0, value); 20 | 21 | native strlen(const string[]); 22 | native strpack(dest[], const source[]); 23 | native strunpack(dest[], const source[]); 24 | 25 | native tolower(c); 26 | native toupper(c); 27 | native swapchars(c); 28 | 29 | native random(max); 30 | 31 | native min(value1, value2); 32 | native max(value1, value2); 33 | native clamp(value, min=cellmin, max=cellmax); 34 | 35 | native power(value, exponent); 36 | native sqroot(value); 37 | 38 | native time(&hour=0,&minute=0,&second=0); 39 | native date(&year=0,&month=0,&day=0); 40 | 41 | native tickcount(&granularity=0); -------------------------------------------------------------------------------- /amxx/include/csstats.inc: -------------------------------------------------------------------------------- 1 | /* CS Stats functions 2 | * 3 | * by the AMX Mod X Development Team 4 | * originally developed by OLO 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _csstats_included 10 | #endinput 11 | #endif 12 | #define _csstats_included 13 | 14 | /* Gets stats from given weapon index. If wpnindex is 0 15 | * then the stats are from all weapons. If weapon has not been used function 16 | * returns 0 in other case 1. Fields in stats are: 17 | * 0 - kills 18 | * 1 - deaths 19 | * 2 - headshots 20 | * 3 - teamkilling 21 | * 4 - shots 22 | * 5 - hits 23 | * 6 - damage 24 | * For body hits fields see amxconst.inc. */ 25 | native get_user_wstats(index,wpnindex,stats[8],bodyhits[8]); 26 | 27 | /* Gets round stats from given weapon index.*/ 28 | native get_user_wrstats(index,wpnindex,stats[8],bodyhits[8]); 29 | 30 | /* Gets overall stats which are stored in file on server 31 | * and updated on every respawn or user disconnect. 32 | * Function returns the position in stats by diff. kills to deaths. */ 33 | native get_user_stats(index,stats[8],bodyhits[8]); 34 | 35 | /* Gets round stats of player. */ 36 | native get_user_rstats(index,stats[8],bodyhits[8]); 37 | 38 | /* Gets stats with which user have killed/hurt his victim. If victim is 0 39 | * then stats are from all victims. If victim has not been hurt, function 40 | * returns 0 in other case 1. User stats are reset on his respawn. */ 41 | native get_user_vstats(index,victim,stats[8],bodyhits[8],wpnname[]="",len=0); 42 | 43 | /* Gets stats with which user have been killed/hurt. If killer is 0 44 | * then stats are from all attacks. If killer has not hurt user, function 45 | * returns 0 in other case 1. User stats are reset on his respawn. */ 46 | native get_user_astats(index,wpnindex,stats[8],bodyhits[8],wpnname[]="",len=0); 47 | 48 | /* Resets life, weapon, victims and attackers user stats. */ 49 | native reset_user_wstats(index); 50 | 51 | /* Gets overall stats which stored in stats.dat file in amx folder 52 | * and updated on every mapchange or user disconnect. 53 | * Function returns next index of stats entry or 0 if no more exists. */ 54 | native get_stats(index,stats[8],bodyhits[8],name[],len); 55 | 56 | /* Returns number of all entries in stats. */ 57 | native get_statsnum(); -------------------------------------------------------------------------------- /amxx/include/cstrike.inc: -------------------------------------------------------------------------------- 1 | /* Counter-Strike functions 2 | * 3 | * by the AMX Mod X Development Team 4 | * 5 | * This file is provided as is (no warranties). 6 | */ 7 | 8 | #if defined _cstrike_included 9 | #endinput 10 | #endif 11 | #define _cstrike_included 12 | 13 | /* Returns player deaths. */ 14 | native cs_get_user_deaths(index); 15 | 16 | /* Sets player deaths. */ 17 | native cs_set_user_deaths(index, newdeaths); 18 | 19 | /* Returns index of entity (does not have to be a player) which hostage is following. 0 is hostage doesn't follow anything. */ 20 | native cs_get_hostage_foll(index); 21 | 22 | /* Set hostage to follow entity specified in followedindex. Does not have to be a player. If followedindex is 0 the hostage will stop following. */ 23 | native cs_set_hostage_foll(index, followedindex = 0); 24 | 25 | /* Get unique hostage id. */ 26 | native cs_get_hostage_id(index); 27 | 28 | /* Get amount of ammo in backpack on a user for a specific weapon. 29 | * Look in amxconst.inc for weapon types: CSW_*. 30 | * Weapons on the same line uses the same ammo type: 31 | * awm 32 | * scout, ak, g3 33 | * para 34 | * famas, m4a1, aug, sg550, galil, sg552 35 | * m3, xm 36 | * usp, ump, mac 37 | * fiveseven, p90 38 | * deagle 39 | * p228 40 | * glock, mp5, tmp, elites 41 | * flash 42 | * he 43 | * smoke */ 44 | native cs_get_user_bpammo(index, weapon); 45 | 46 | /* Restock/remove ammo in a user's backpack. */ 47 | native cs_set_user_bpammo(index, weapon, amount); 48 | 49 | /* Returns 1 if user has a defuse kit. */ 50 | native cs_get_user_defuse(index); 51 | 52 | /* If defusekit is 1, the user will have a defuse kit. 53 | * You can specify a different colour for the defuse kit icon showing on hud. Default is the normal green. 54 | * You can specify an icon. Default is "defuser". Set flash to 1 if you want the icon to flash red. */ 55 | native cs_set_user_defuse(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0); 56 | 57 | /* Is user in buyzone? Returns 1 when true, 0 when false. */ 58 | native cs_get_user_buyzone(index); 59 | 60 | /* Get user model. */ 61 | native cs_get_user_model(index, model[], len); 62 | 63 | /* Set user model. */ 64 | native cs_set_user_model(index, const model[]); 65 | 66 | /* Use to reset model to standard selected model. */ 67 | native cs_reset_user_model(index); 68 | 69 | /* Returns users money. */ 70 | native cs_get_user_money(index); 71 | 72 | /* Gives money to user. If flash is 1, the difference between new and old amount will flash red or green. */ 73 | native cs_set_user_money(index, money, flash = 1); 74 | 75 | /* Does user have night vision goggles? */ 76 | native cs_get_user_nvg(index); 77 | 78 | /* Set nvgoggles to 1 to give night vision goggles to index. Set it to 0 to remove them. */ 79 | native cs_set_user_nvg(index, nvgoggles = 1); 80 | 81 | /* Returns 1 if user has the "skill" to plant bomb, else 0. Normally this would only be true for a terrorist carrying a bomb. */ 82 | native cs_get_user_plant(index); 83 | 84 | /* If plant is 1, a user will be set to be able to plant bomb within the usual bomb target areas if having one. 85 | * You should use this if you give a player a weapon_c4, or he won't be able to plant it 86 | * without dropping it and picking it up again (only possible for terrorists). 87 | * If showbombicon is 1, the green C4 icon will be shown on user hud (if plant "skill" was enabled). */ 88 | native cs_set_user_plant(index, plant = 1, showbombicon = 1); 89 | 90 | /* Get team directly from player's entity. 91 | * 1 = terrorist 92 | * 2 = counter-terrorist 93 | * 3 = spectator */ 94 | native cs_get_user_team(index); 95 | 96 | /* Set user team without killing player (so you can move hostages, plant bomb etc as terrorist). */ 97 | native cs_set_user_team(index, team); 98 | 99 | /* Is user vip? */ 100 | native cs_get_user_vip(index); 101 | 102 | /* If vip = 1, user is set to vip. Note that this is useful to unset vips, so they can change teams properly. 103 | * This will not change the player's model to/from vip, or add/remove the "VIP" text in scoreboard. */ 104 | native cs_set_user_vip(index, vip = 1); 105 | 106 | /* Returns 1 if specified weapon is in burst mode. */ 107 | native cs_get_weapon_burst(index); 108 | 109 | /* If burstmode = 1, weapon will be changed to burst mode, 0 and non-burst mode (semiautomatic/automatic) will be activated. 110 | * Only GLOCK and FAMAS can enter/leave burst mode. */ 111 | native cs_set_weapon_burst(index, burstmode = 1); 112 | 113 | /* Returns 1 if weapon is silenced, else 0. */ 114 | native cs_get_weapon_silen(index); 115 | 116 | /* If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced. */ 117 | native cs_set_weapon_silen(index, silence = 1); 118 | 119 | /* Returns amount of ammo in weapon's clip. */ 120 | native cs_get_weapon_ammo(index); 121 | 122 | /* Set amount of ammo in weapon's clip. */ 123 | native cs_set_weapon_ammo(index, newammo); -------------------------------------------------------------------------------- /amxx/include/engine.inc: -------------------------------------------------------------------------------- 1 | /* Engine functions 2 | * 3 | * by the AMX Mod X Development Team 4 | * thanks to Vexd 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _engine_included 10 | #endinput 11 | #endif 12 | #define _engine_included 13 | 14 | #include 15 | 16 | /* This is a highly experimental command that will directly hook a message in the engine! 17 | * You can overwrite the message before anything happens and either let the message continue 18 | * or fully block it. Here is how it works: 19 | * If you hook a message, the message is stored but not sent. You have the opportunity to 20 | * not only execute code, but to get/set the contents of the message, before you choose to 21 | * either block it or let it go on its way. The hooked function will be passed a msg_id. */ 22 | native register_message(iMsgId, szFunction[]); 23 | 24 | /* The get/set _msg commands will utterly fail if used outside a hooked message scope. 25 | * They should never, NEVER, EVER be used unless inside a registered message function. 26 | * There are eight different ways of sending a message, five are ints, two are floats, and one is string. 27 | * These are denoted by iArgType. argn is the number 28 | * of the argument. Exceeding the bounds of 1 to get_msg_args() is a bad idea. */ 29 | 30 | /* Gets number of arguments that were passed to this message */ 31 | native get_msg_args(); 32 | 33 | /* Gets the argument type of argument argn */ 34 | native get_msg_argtype(argn); 35 | 36 | /* Gets the value of argn. */ 37 | native get_msg_arg_int(argn); 38 | native Float:get_msg_arg_float(argn); 39 | native get_msg_arg_string(argn, szReturn[], iLength); 40 | 41 | /* sets the value of argn. */ 42 | native set_msg_arg_int(argn, argtype, iValue); 43 | native set_msg_arg_float(argn, argtype, Float:fValue); 44 | native set_msg_arg_string(argn, szString[]); 45 | 46 | /* Note, the offsets are passed as linux values, not windows values. 47 | * Although the engine module will automatically calculate the difference, 48 | * you must pass with the +5 linux offset (e.g. if 230 on windows, pass 235 no matter what) */ 49 | 50 | /* Gets pvPrivateData offset. */ 51 | native get_offset(id, offset); 52 | native Float:get_offset_float(id, offset); 53 | native get_offset_short(id, offset); 54 | native get_offset_char(id, offset); 55 | 56 | /* sets pvPrivateData offset. */ 57 | native set_offset(id, offset, value); 58 | native set_offset_float(id, offset, Float:value); 59 | native set_offset_short(id, offset, value); 60 | native set_offset_char(id, offset, value); 61 | 62 | /* Get entity pointer into string pointer[]. If pointer/len is 0 pointer is returned as integer. */ 63 | native get_entity_pointer(index, pointer[] = 0, len = 0); 64 | 65 | /* Precaches any file. */ 66 | native precache_generic(szFile[]); 67 | /* Precaches an event. */ 68 | native precache_event(type, Name[], {float,_}:...); 69 | 70 | //set/get a user's speak flags 71 | native set_speak(iIndex, iSpeakFlags) 72 | native get_speak(iIndex) 73 | 74 | //Drops an entity to the floor (work?) 75 | native drop_to_floor(entity) 76 | 77 | /* Get whole buffer containing keys and their data. */ 78 | native get_info_keybuffer(id, buffer[], length); 79 | 80 | /* Use an entity with another entity. "used" could be a hostage, "user" a player. */ 81 | native force_use(pPlayer, pEntity); 82 | 83 | /* Get globals from server. */ 84 | native Float:get_global_float(variable); 85 | native get_global_int(variable); 86 | native get_global_string(variable, string[], maxlen); 87 | native get_global_vector(variable, Float:vector[3]); 88 | native get_global_edict(variable); 89 | 90 | /* Set entity bounds. */ 91 | native set_size(index, Float:mins[3], Float:maxs[3]); 92 | 93 | /* Get decal index */ 94 | native get_decal_index(const szDecalName[]); 95 | 96 | 97 | /* Sets/gets things in an entities Entvars Struct. */ 98 | native entity_get_int(iIndex, iKey); 99 | native entity_set_int(iIndex, iKey, iVal); 100 | native Float:entity_get_float(iIndex, iKey); 101 | native entity_set_float(iIndex, iKey, Float:iVal); 102 | native entity_get_vector(iIndex, iKey, Float:vRetVector[3]); 103 | native entity_set_vector(iIndex, iKey, Float:vNewVector[3]); 104 | native entity_get_edict(iIndex, iKey); 105 | native entity_set_edict(iIndex, iKey, iNewIndex); 106 | native entity_get_string(iIndex, iKey, szReturn[], iRetLen); 107 | native entity_set_string(iIndex, iKey, const szNewVal[]); 108 | native entity_get_byte(iIndex, iKey); 109 | native entity_set_byte(iIndex, iKey, iVal); 110 | 111 | /* Creates an entity, will return the index of the created entity. ClassName must be valid. */ 112 | native create_entity(szClassname[]); 113 | 114 | /* Finds an entity in the world, will return 0 if nothing is found */ 115 | native find_ent_by_class(iIndex, szClass[]); 116 | //optionally you can set a jghg2 type 117 | // 1: target, 2:targetname, 0:classname (default) 118 | native find_ent_by_owner(iIndex, szClass[], iOwner, iJghgType=0); 119 | native find_ent_by_target(iIndex, szClass[]); 120 | native find_ent_by_tname(iIndex, szClass[]); 121 | native find_ent_by_model(iIndex, szClass[], szModel[]); 122 | native find_ent_in_sphere(start_from_ent, Float:origin[3], Float:radius); 123 | 124 | //this will CBaseEntity::Think() or something from the entity 125 | native call_think(entity) 126 | 127 | /* Is entity valid? */ 128 | native is_valid_ent(iIndex); 129 | 130 | /* Proper origin setting, keeps updated with Half-Life engine. */ 131 | native entity_set_origin(iIndex, Float:fNewOrigin[3]); 132 | 133 | /* Sets the model of an Entity. */ 134 | native entity_set_model(iIndex, const szModel[]); 135 | 136 | /* Remove an entity from the world. */ 137 | native remove_entity(iIndex); 138 | 139 | /* Return current number of entities in the map */ 140 | native entity_count(); 141 | 142 | /* Simulate two entities colliding/touching. */ 143 | native fake_touch(iToucher, iTouched); 144 | 145 | /* Dispatch a KeyValuePair, used for initalizing entities when a map spawns them. */ 146 | native DispatchKeyValue(iIndex, szKey[], szValue[]); 147 | 148 | /* Runs the GameDLL's DispatchSpawn for an entity, I think it's used with DispatchKeyValue. */ 149 | native DispatchSpawn(iIndex); 150 | 151 | /* Hurts/Kills players in a sphere, like an explosion, Multiplier determines damage. */ 152 | native RadiusDamage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier); 153 | 154 | /* Gives you a velocity in the direction a player is looking, iVelocity is the multiplier. */ 155 | native VelocityByAim(iIndex, iVelocity, Float:vRetValue[3]); 156 | 157 | /* Will return the contents of a point (inside map? in sky? outside map? etc.). */ 158 | native PointContents(Float:fCheckAt[3]); 159 | 160 | /* Trace a line from Start(X, Y, Z) to End(X, Y, Z), will return the point hit in vReturn[3] 161 | * and an entity index if an entity is hit. */ 162 | native trace_line(iIgnoreEnt, Float:fStart[3], Float:fEnd[3], Float:vReturn[3]); 163 | 164 | /* Traces a line, and returns the normal to the plane hit in vReturn. 165 | * Returns 0 if theres no normal. */ 166 | native trace_normal(iIgnoreEnt, Float:fStart[3], Float:fEnd[3], Float:vReturn[3]); 167 | 168 | /* Changes a Vector to an Angle vector. */ 169 | native vector_to_angle(Float:fVector[3], Float:vReturn[3]); 170 | 171 | /* Gets the length of a vector (float[3]). */ 172 | native Float:vector_length(Float:vVector[3]); 173 | 174 | /* Gets the distance between 2 vectors (float[3]). */ 175 | native Float:vector_distance(Float:vVector[3], Float:vVector2[3]); 176 | 177 | /* Gets the ID of a grenade. */ 178 | native get_grenade_id(id, model[], len, grenadeid = 0); 179 | 180 | /* Gets gpGlobals->time from Half-Life */ 181 | native Float:halflife_time(); 182 | 183 | /* Sets map lighting, #OFF to disable. */ 184 | native set_lights(const Lighting[]); 185 | 186 | // Sets/Gets what engine messages are blocked. */ 187 | native set_msg_block(iMessage, iMessageFlags); 188 | native get_msg_block(iMessage); 189 | 190 | /* Sets Player's View to entity iTargetIndex. */ 191 | native attach_view(iIndex, iTargetIndex); 192 | 193 | /* Sets Player's View Mode. */ 194 | native set_view(iIndex, ViewType); 195 | 196 | /* Called when 2 entities touch. */ 197 | forward pfn_touch(ptr, ptd); 198 | 199 | /* Called once every server frame. May cause lag. */ 200 | forward server_frame(); 201 | 202 | /* Called when a client types kill in console. */ 203 | forward client_kill(id); 204 | 205 | /* Forward for PreThink()/PostThink() on a player. */ 206 | forward client_PreThink(id); 207 | forward client_PostThink(id); 208 | 209 | //from jghg2 210 | /* As above, but returns number of ents stored in entlist. Use to find a specific type of entity classname (specify in _lookforclassname) around a 211 | * certain entity specified in aroundent. All matching ents are stored in entlist. Specify max amount of entities to find in maxents. 212 | * If aroundent is 0 its origin is not used, but origin in 6th parameter. Ie, do not specify 6th parameter (origin) if you specified an entity 213 | * in aroundent. 214 | */ 215 | native find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float:origin[3] = {0.0, 0.0, 0.0}); 216 | 217 | #include -------------------------------------------------------------------------------- /amxx/include/engine_stocks.inc: -------------------------------------------------------------------------------- 1 | /* Engine stocks 2 | * 3 | * by the AMX Mod X Development Team 4 | * thanks to AssKicR, Freecode and T(+)rget 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _engine_stocks_included 10 | #endinput 11 | #endif 12 | #define _engine_stocks_included 13 | 14 | //wrapper for find_ent_by_class 15 | stock find_ent(iStart, szClassname[]) 16 | { 17 | return find_ent_by_class(iStart, szClassname) 18 | } 19 | 20 | /* Changes an integer vec to a floating vec */ 21 | 22 | stock IVecFVec(IVec[3], Float:FVec[3]) 23 | { 24 | FVec[0] = float(IVec[0]) 25 | FVec[1] = float(IVec[1]) 26 | FVec[2] = float(IVec[2]) 27 | 28 | return 1 29 | } 30 | 31 | /* Changes a float vec to an integer vec */ 32 | stock FVecIVec(Float:FVec[3], IVec[3]) 33 | { 34 | IVec[0] = floatround(FVec[0]) 35 | IVec[1] = floatround(FVec[1]) 36 | IVec[2] = floatround(FVec[2]) 37 | 38 | return 1 39 | } 40 | 41 | /* Get the Button(s) user is pressing */ 42 | stock get_user_button(id) 43 | return entity_get_int(id, EV_INT_button) 44 | 45 | stock get_user_oldbutton(id) 46 | return entity_get_int(id, EV_INT_oldbuttons) 47 | 48 | /* Get flags an entity is flagged with */ 49 | stock get_entity_flags(ent) 50 | return entity_get_int(ent, EV_INT_flags) 51 | 52 | /* Get the distance between two entities */ 53 | stock get_entity_distance(ent1, ent2) 54 | { 55 | new Float:orig1[3], Float:orig2[3], origin1[3], origin2[3] 56 | entity_get_vector(ent1, EV_VEC_origin, orig1) 57 | for(new a = 0; a < 3; a++) 58 | origin1[a] = floatround(orig1[a]) 59 | 60 | entity_get_vector(ent2, EV_VEC_origin, orig2) 61 | for(new b = 0; b < 3; b++) 62 | origin2[b] = floatround(orig2[b]) 63 | 64 | return get_distance(origin1, origin2) 65 | } 66 | 67 | /* Get grenade thrown by this user */ 68 | stock get_grenade(id) 69 | { 70 | new iGrenade = find_ent_by_class(-1, "grenade") 71 | while(iGrenade > 0) 72 | { 73 | if(entity_get_edict(iGrenade, EV_ENT_owner) == id) 74 | return iGrenade 75 | 76 | iGrenade = find_ent_by_class(iGrenade, "grenade") 77 | } 78 | 79 | return 0 80 | } 81 | 82 | /* Get origin of a brush entity */ 83 | stock get_brush_entity_origin(ent, Float:orig[3]) 84 | { 85 | new Float:Min[3], Float:Max[3] 86 | entity_get_vector(ent, EV_VEC_mins, Min) 87 | entity_get_vector(ent, EV_VEC_maxs, Max) 88 | for(new a = 0; a < 3; a++) 89 | orig[a] = (Min[a] + Max[a]) / 2 90 | 91 | return orig[0] && orig[1] && orig[2] 92 | } 93 | 94 | /* Remove entity by name */ 95 | stock remove_entity_name(eName[]) 96 | { 97 | new iEntity = FindEntity(-1, eName) 98 | while (iEntity > 0) 99 | { 100 | remove_entity(iEntity) 101 | iEntity = find_ent_by_class(-1, eName) 102 | } 103 | 104 | return 1 105 | } 106 | 107 | /* Get the contents of the point a user is aiming at */ 108 | stock ViewContents(id) 109 | { 110 | new origin[3],Float:Orig[3] 111 | get_user_origin( id, origin, 3 ) 112 | for(new a = 0; a < 3; a++) 113 | Orig[a] = float(origin[a]) 114 | 115 | return PointContents( Orig ) 116 | } 117 | 118 | stock get_speed(ent) 119 | { 120 | new Float:Vel[3], rVel[3] 121 | entity_get_vector(ent, EV_VEC_velocity, Vel) 122 | for(new i = 0; i < 3; i++) 123 | rVel[i] = floatround(Vel[i]) 124 | 125 | return sqroot(rVel[0] * rVel[0] + rVel[1] * rVel[1] + rVel[2] * rVel[2]) 126 | } 127 | 128 | /* Creates a death message. */ 129 | stock make_deathmsg(killer,victim,headshot,weapon[]) 130 | { 131 | message_begin(MSG_ALL,get_user_msgid("DeathMsg"),{0,0,0},0) 132 | write_byte( killer ) 133 | write_byte( victim ) 134 | write_byte( headshot ) 135 | write_string( weapon[] ) 136 | message_end() 137 | 138 | return 1 139 | } 140 | 141 | /* Kills a user without a message. */ 142 | stock user_silentkill(index) 143 | { 144 | set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE) 145 | user_kill(index,1) 146 | 147 | return 1 148 | } 149 | 150 | /* Set endering of an entity */ 151 | stock set_rendering(index,fx=kRenderFxNone, r=255,g=255,b=255, render=kRenderNormal,amount=16) 152 | { 153 | entity_set_int(index,EV_INT_renderfx,fx) 154 | new Float:RenderColor[3] 155 | RenderColor[0] = float(r) 156 | RenderColor[1] = float(g) 157 | RenderColor[2] = float(b) 158 | entity_set_vector(index,EV_VEC_rendercolor,RenderColor) 159 | entity_set_int(index,EV_INT_rendermode,render) 160 | entity_set_float(index,EV_FL_renderamt,float(amount)) 161 | 162 | return 1 163 | } 164 | 165 | /* Set flags on an entity */ 166 | stock set_entity_flags(ent,flag,onoff) 167 | { 168 | if ((entity_get_int(ent,EV_INT_flags)&flag) > 0) 169 | { 170 | if (onoff == 1) 171 | { 172 | return 2 173 | } 174 | else 175 | { 176 | entity_set_int(ent,EV_INT_flags,entity_get_int(ent,EV_INT_flags)-flag) 177 | return 1 178 | } 179 | } 180 | else 181 | { 182 | if (onoff == 0) 183 | { 184 | return 2 185 | } 186 | else 187 | { 188 | entity_set_int(ent,EV_INT_flags,entity_get_int(ent,EV_INT_flags)+flag) 189 | return 1 190 | } 191 | } 192 | 193 | return 0 194 | } 195 | 196 | /* If visible = 1, entity will be set to be visible, else invisible. */ 197 | stock set_entity_visibility(entity, visible = 1) { 198 | entity_set_int(entity, EV_INT_effects, visible == 1 ? entity_get_int(entity, EV_INT_effects) & ~EF_NODRAW : entity_get_int(entity, EV_INT_effects) | EF_NODRAW) 199 | 200 | return 1 201 | } 202 | 203 | /* Returns 1 if entity is visible. */ 204 | stock get_entity_visibility(entity) { 205 | return (entity_get_int(entity, EV_INT_effects) & EF_NODRAW) 206 | } -------------------------------------------------------------------------------- /amxx/include/file.inc: -------------------------------------------------------------------------------- 1 | /* Files functions 2 | * 3 | * by the AMX Mod X Development Team 4 | * originally developed by OLO 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _file_included 10 | #endinput 11 | #endif 12 | #define _file_included 13 | 14 | /* Reads content from directory. 15 | * Returns index of next element or 0 when end of dir. is reached. */ 16 | native read_dir(const dirname[],pos,output[],len,&outlen); 17 | 18 | /* Reads line from file. Returns index of next line or 0 when end of file is reached. */ 19 | native read_file(const file[],line,text[],len,&txtlen); 20 | 21 | /* Writes text to file. Function returns 0 on failure. 22 | * When line is set to -1, the text is added at the end of file. */ 23 | native write_file(const file[],const text[],line = -1); 24 | 25 | /* Deletes file. Function returns 1 on success, 0 on failure. */ 26 | native delete_file(const file[]); 27 | 28 | /* Checks for file. If file exists function returns 1, in other case 0. */ 29 | native file_exists(const file[]); 30 | 31 | /* Returns a file size in bytes if flag is set to 0. 32 | * When flag is set to 1 returns number of lines in the file, 33 | * and when flags is 2, function returns 1 if the file ends 34 | * with line feed. If file doesn't exist returns -1. */ 35 | native file_size(const file[], flag=0); -------------------------------------------------------------------------------- /amxx/include/float.inc: -------------------------------------------------------------------------------- 1 | /* Float arithmetic 2 | * 3 | * (c) Copyright 1999, Artran, Inc. 4 | * Written by Greg Garner (gmg@artran.com) 5 | * Modified in March 2001 to include user defined 6 | * operators for the floating point functions. 7 | * 8 | * This file is provided as is (no warranties). 9 | */ 10 | 11 | /* Different methods of rounding */ 12 | enum floatround_method { 13 | floatround_round = 0, 14 | floatround_floor, 15 | floatround_ceil, 16 | floatround_tozero 17 | } 18 | 19 | enum anglemode { 20 | radian = 0, 21 | degrees, 22 | grades 23 | } 24 | 25 | /* Convert an integer into a floating point value */ 26 | native Float:float(value); 27 | 28 | /* Convert a string into a floating point value */ 29 | native Float:floatstr(const string[]); 30 | 31 | /* Multiple two floats together */ 32 | native Float:floatmul(Float:oper1, Float:oper2); 33 | 34 | /* Divide the dividend float by the divisor float */ 35 | native Float:floatdiv(Float:dividend, Float:divisor); 36 | 37 | /* Add two floats together */ 38 | native Float:floatadd(Float:dividend, Float:divisor); 39 | 40 | /* Subtract oper2 float from oper1 float */ 41 | native Float:floatsub(Float:oper1, Float:oper2); 42 | 43 | /* Return the fractional part of a float */ 44 | native Float:floatfract(Float:value); 45 | 46 | /* Round a float into a integer value */ 47 | native floatround(Float:value, floatround_method:method=floatround_round); 48 | 49 | /* Compare two integers. If the two elements are equal, return 0. 50 | * If the first argument is greater than the second argument, return 1, 51 | * If the first argument is less than the second argument, return -1. */ 52 | native floatcmp(Float:fOne, Float:fTwo); 53 | 54 | /* Return the square root of the input value, same as floatpower(value, 0.5) */ 55 | native Float:floatsqroot(Float:value); 56 | 57 | /* Return the value raised to the power of the exponent */ 58 | native Float:floatpower(Float:value, Float:exponent); 59 | 60 | /* Return the logarithm */ 61 | native Float:floatlog(Float:value, Float:base=10.0); 62 | 63 | /* Return the sine, cosine or tangent. 64 | * The input angle may be in radian, degrees or grades. */ 65 | native Float:floatsin(Float:value, anglemode:mode=radian); 66 | native Float:floatcos(Float:value, anglemode:mode=radian); 67 | native Float:floattan(Float:value, anglemode:mode=radian); 68 | 69 | /* Return the absolute value */ 70 | native Float:floatabs(Float:value); 71 | 72 | #pragma rational Float 73 | 74 | /* user defined operators */ 75 | native Float:operator*(Float:oper1, Float:oper2) = floatmul; 76 | native Float:operator/(Float:oper1, Float:oper2) = floatdiv; 77 | native Float:operator+(Float:oper1, Float:oper2) = floatadd; 78 | native Float:operator-(Float:oper1, Float:oper2) = floatsub; 79 | 80 | stock Float:operator++(Float:oper) 81 | return oper+1.0; 82 | 83 | stock Float:operator--(Float:oper) 84 | return oper-1.0; 85 | 86 | stock Float:operator-(Float:oper) 87 | return oper^Float:0x80000000; /* IEEE values are sign/magnitude */ 88 | 89 | stock Float:operator*(Float:oper1, oper2) 90 | return floatmul(oper1, float(oper2)); /* "*" is commutative */ 91 | 92 | stock Float:operator/(Float:oper1, oper2) 93 | return floatdiv(oper1, float(oper2)); 94 | 95 | stock Float:operator/(oper1, Float:oper2) 96 | return floatdiv(float(oper1), oper2); 97 | 98 | stock Float:operator+(Float:oper1, oper2) 99 | return floatadd(oper1, float(oper2)); /* "+" is commutative */ 100 | 101 | stock Float:operator-(Float:oper1, oper2) 102 | return floatsub(oper1, float(oper2)); 103 | 104 | stock Float:operator-(oper1, Float:oper2) 105 | return floatsub(float(oper1), oper2); 106 | 107 | stock bool:operator==(Float:oper1, Float:oper2) 108 | return floatcmp(oper1, oper2) == 0; 109 | 110 | stock bool:operator==(Float:oper1, oper2) 111 | return floatcmp(oper1, float(oper2)) == 0; /* "==" is commutative */ 112 | 113 | stock bool:operator!=(Float:oper1, Float:oper2) 114 | return floatcmp(oper1, oper2) != 0; 115 | 116 | stock bool:operator!=(Float:oper1, oper2) 117 | return floatcmp(oper1, float(oper2)) != 0; /* "==" is commutative */ 118 | 119 | stock bool:operator>(Float:oper1, Float:oper2) 120 | return floatcmp(oper1, oper2) > 0; 121 | 122 | stock bool:operator>(Float:oper1, oper2) 123 | return floatcmp(oper1, float(oper2)) > 0; 124 | 125 | stock bool:operator>(oper1, Float:oper2) 126 | return floatcmp(float(oper1), oper2) > 0; 127 | 128 | stock bool:operator>=(Float:oper1, Float:oper2) 129 | return floatcmp(oper1, oper2) >= 0; 130 | 131 | stock bool:operator>=(Float:oper1, oper2) 132 | return floatcmp(oper1, float(oper2)) >= 0; 133 | 134 | stock bool:operator>=(oper1, Float:oper2) 135 | return floatcmp(float(oper1), oper2) >= 0; 136 | 137 | stock bool:operator<(Float:oper1, Float:oper2) 138 | return floatcmp(oper1, oper2) < 0; 139 | 140 | stock bool:operator<(Float:oper1, oper2) 141 | return floatcmp(oper1, float(oper2)) < 0; 142 | 143 | stock bool:operator<(oper1, Float:oper2) 144 | return floatcmp(float(oper1), oper2) < 0; 145 | 146 | stock bool:operator<=(Float:oper1, Float:oper2) 147 | return floatcmp(oper1, oper2) <= 0; 148 | 149 | stock bool:operator<=(Float:oper1, oper2) 150 | return floatcmp(oper1, float(oper2)) <= 0; 151 | 152 | stock bool:operator<=(oper1, Float:oper2) 153 | return floatcmp(float(oper1), oper2) <= 0; 154 | 155 | stock bool:operator!(Float:oper) 156 | return (_:oper & 0x7fffffff) == 0; 157 | 158 | /* forbidden operations */ 159 | forward operator%(Float:oper1, Float:oper2); 160 | forward operator%(Float:oper1, oper2); 161 | forward operator%(oper1, Float:oper2); -------------------------------------------------------------------------------- /amxx/include/fun.inc: -------------------------------------------------------------------------------- 1 | /* Fun functions 2 | * 3 | * by the AMX Mod X Development Team 4 | * 5 | * This file is provided as is (no warranties). 6 | */ 7 | 8 | #if defined _fun_included 9 | #endinput 10 | #endif 11 | #define _fun_included 12 | 13 | /* Returns 1 if receiver hears sender via voice communication. */ 14 | native get_client_listen(receiver, sender); 15 | 16 | /* Sets who can listen who. Function returns 0 17 | * if for some reasons this setting can't be done. */ 18 | native set_client_listen(receiver, sender, listen); 19 | 20 | /* Sets player godmode. If you want to disable godmode set only first parameter. */ 21 | native set_user_godmode(index, godmode = 0); 22 | 23 | /* Returns 1 if godmode is set. */ 24 | native get_user_godmode(index); 25 | 26 | /* Sets player armor. */ 27 | native set_user_armor(index, armor); 28 | 29 | /* Sets player health. */ 30 | native set_user_health(index, health); 31 | 32 | /* Move player to origin. */ 33 | native set_user_origin(index, origin[3]); 34 | 35 | /* Sets player rendering mode. */ 36 | native set_user_rendering(index, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16); 37 | 38 | /* Gives item to player, name of item can start 39 | * with weapon_, ammo_ and item_. This event 40 | * is announced with proper message to all players. */ 41 | native give_item(index, const item[]); 42 | 43 | /* Sets hit zones for player. 44 | * Parts of body are as bits: 45 | * 1 - generic 46 | * 2 - head 47 | * 4 - chest 48 | * 8 - stomach 49 | * 16 - left arm 50 | * 32 - right arm 51 | * 64 - left leg 52 | * 128 - right leg 53 | * Set index to a player's index and leave target at 0 to define what bodyparts this player can hit when he is firing. 54 | * Set index to 0 and target to a player's index to define what bodyparts on player other players can hit when they are firing. 55 | * Set both index and target to 0 to define globally what bodyparts people can hit and what bodyparts can be hit when firing. */ 56 | native set_user_hitzones(index = 0, target = 0, body = 255); 57 | 58 | /* Get user hitzones. 59 | * To get what bodyparts a player can hit when firing, set the player's index to index and target to 0. 60 | * To get what bodyparts other players can hit when firing at player, set index to 0 and target to player's index. */ 61 | native get_user_hitzones(index, target); 62 | 63 | /* Sets users max. speed. */ 64 | native set_user_maxspeed(index, Float:speed = -1.0); 65 | 66 | /* Returns users max. speed. */ 67 | native Float:get_user_maxspeed(index); 68 | 69 | /* Sets users gravity. */ 70 | native set_user_gravity(index, Float:gravity = 1.0); 71 | 72 | /* Returns users gravity. */ 73 | native get_user_gravity(index); 74 | 75 | /* Spawns entity. */ 76 | native spawn(index); 77 | 78 | /* Sets player noclip. If you want to disable noclip set only first parameter. */ 79 | native set_user_noclip(index, noclip = 0); 80 | 81 | /* Returns 1 if noclip is set. */ 82 | native get_user_noclip(index); 83 | 84 | /* Gives player silent footsteps. 85 | * if set = 0 it will return footsteps to normal */ 86 | native set_user_footsteps(id, set = 1); 87 | -------------------------------------------------------------------------------- /amxx/include/jghg2.inc: -------------------------------------------------------------------------------- 1 | // JGHG2 module 2 | //This file is provided for backwards compatibility. 3 | //It includes the engine and cstrike modules automatically. 4 | //It is intended for AMX Mod X 5 | 6 | #if !defined INCLUDED_JGHG 7 | #define INCLUDED_JGHG 8 | 9 | #include 10 | #include 11 | 12 | #if !defined _jghg_enums 13 | #define _jghg_enums 14 | // Global member variables 15 | enum { 16 | // Edict 17 | GL_trace_ent = 0, 18 | 19 | // Float 20 | GL_coop, 21 | GL_deathmatch, 22 | GL_force_retouch, 23 | GL_found_secrets, 24 | GL_frametime, 25 | GL_serverflags, 26 | GL_teamplay, 27 | GL_time, 28 | GL_trace_allsolid, 29 | GL_trace_fraction, 30 | GL_trace_inopen, 31 | GL_trace_inwater, 32 | GL_trace_plane_dist, 33 | GL_trace_startsolid, 34 | 35 | // Int 36 | GL_cdAudioTrack, 37 | GL_maxClients, 38 | GL_maxEntities, 39 | GL_msg_entity, 40 | GL_trace_flags, 41 | GL_trace_hitgroup, 42 | 43 | // String 44 | GL_pStringBase, 45 | GL_mapname, 46 | GL_startspot, 47 | 48 | // Vector 49 | GL_trace_endpos, 50 | GL_trace_plane_normal, 51 | GL_v_forward, 52 | GL_v_right, 53 | GL_v_up, 54 | GL_vecLandmarkOffset, 55 | 56 | // Void (not supported) 57 | GL_pSaveData 58 | } 59 | 60 | // jghg_categories 61 | enum { 62 | jghg2_classname = 0, 63 | jghg2_target = 1, 64 | jghg2_targetname = 2 65 | } 66 | #endif 67 | 68 | stock jghg_find_ent_owner(start_from_ent, jghg_category, value[], owner_index) 69 | { 70 | find_ent_by_owner(start_from_ent, value, owner_index, jghg_category) 71 | } 72 | 73 | stock find_ent_sphere(start_from_ent, Float:origin[3], Float:radius) 74 | { 75 | return find_ent_in_sphere(start_from_ent, origin, radius) 76 | } 77 | 78 | stock get_hostage_id(hostage) 79 | { 80 | return cs_get_hostage_id(hostage) 81 | } 82 | 83 | 84 | stock get_owner(id) 85 | { 86 | return entity_get_edict(id, EV_ENT_owner) 87 | } 88 | 89 | stock get_pdata(entity, offset) 90 | { 91 | return get_offset(entity, offset) 92 | } 93 | stock Float:get_pdata_float(entity, offset) 94 | { 95 | return get_offset_float(entity, offset) 96 | } 97 | stock get_pdata_char(entity, offset) 98 | { 99 | return get_offset_char(entity, offset) 100 | } 101 | stock get_pdata_short(entity, offset) 102 | { 103 | return get_offset_short(entity, offset) 104 | } 105 | stock set_pdata(entity, offset, value) 106 | { 107 | return set_offset(entity, offset, value) 108 | } 109 | stock set_pdata_float(entity, offset, Float:value) 110 | { 111 | return set_offset_float(entity, offset, value) 112 | } 113 | stock set_pdata_char(entity, offset, value) 114 | { 115 | return set_offset_char(entity, offset, value) 116 | } 117 | stock set_pdata_short(entity, offset, value) 118 | { 119 | return set_offset_short(entity, offset, value) 120 | } 121 | 122 | stock is_ent_valid(id) 123 | { 124 | return is_valid_ent(id) 125 | } 126 | 127 | stock number_of_entities() 128 | { 129 | return entity_count() 130 | } 131 | 132 | stock use(used, user) 133 | { 134 | return force_use(user, used) 135 | } 136 | 137 | stock Float:globals_get_float(variable) 138 | { 139 | return get_global_float(variable) 140 | } 141 | stock globals_get_int(variable) 142 | { 143 | return get_global_int(variable) 144 | } 145 | stock globals_get_string(variable, string[], maxlen) 146 | { 147 | return get_global_string(variable, string, maxlen) 148 | } 149 | stock globals_get_vector(variable, Float:vector[3]) 150 | { 151 | return get_global_vector(variable, vector) 152 | } 153 | stock globals_get_edict(variable) 154 | { 155 | return get_global_edict(variable) 156 | } 157 | 158 | stock get_max_entities() { 159 | return get_global_int(GL_maxEntities) 160 | } 161 | 162 | stock jghg2_set_size(index, Float:mins[3], Float:maxs[3]) 163 | { 164 | return set_size(index, mins, maxs) 165 | } 166 | 167 | stock jghg2_think(index) 168 | { 169 | return call_think(index) 170 | } 171 | 172 | #endif // INCLUDED_JGHG -------------------------------------------------------------------------------- /amxx/include/mysql.inc: -------------------------------------------------------------------------------- 1 | /* MySQL functions 2 | * 3 | * by the AMX Mod X Development Team 4 | * originally developed by OLO 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _mysql_included 10 | #endinput 11 | #endif 12 | #define _mysql_included 13 | 14 | /* Opens connection. If already such exists then that will be used. 15 | * Function returns sql id to use with other sql natives. 16 | * Host can be plain ip or with port seperated with ':' char. */ 17 | native mysql_connect(host[],user[],pass[],dbname[],error[],maxlength); 18 | 19 | /* Uses an existing connection (sql) to perform a new query (query) (might close previous query if any). */ 20 | native mysql_query(sql,query[], {Float,_}:...); 21 | 22 | /* Prepares next row of current query (sql) for read access ; returns the number of the row, 0 at end. */ 23 | native mysql_nextrow(sql); 24 | 25 | /* Stores specified column (fieldnum) of current query (sql) in (dest) with (maxlength) characters maximum. */ 26 | native mysql_getfield(sql,fieldnum,dest[],maxlength); 27 | 28 | /* Clears query (sql) and closes connection (if any other plugin doesn't use it). */ 29 | native mysql_close(sql); 30 | 31 | /* Stores last error of current query/connection (sql) in (dest) with (maxlength) characters maximum. */ 32 | native mysql_error(sql,dest[],maxlength); -------------------------------------------------------------------------------- /amxx/include/string.inc: -------------------------------------------------------------------------------- 1 | /* Strings manipulation 2 | * 3 | * by the AMX Mod X Development Team 4 | * originally developed by OLO 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _string_included 10 | #endinput 11 | #endif 12 | #define _string_included 13 | 14 | /* Checks if source contains string. On success function 15 | * returns position in source, on failure returns -1. */ 16 | native contain(const source[],const string[]); 17 | 18 | /* Checks if source contains string with case ignoring. On success function 19 | * returns position in source, on failure returns -1. */ 20 | native containi(const source[],const string[]); 21 | 22 | /* Replaces given string to another in given text. */ 23 | native replace(text[],len,const what[],const with[]); 24 | 25 | /* Adds one string to another. Last parameter different from 0, specifies 26 | * how many chars we want to add. Function returns number of all merged chars. */ 27 | native add(dest[],len,const src[],max=0); 28 | 29 | /* Fills string with given format and parameters. 30 | * Function returns number of copied chars. 31 | * Example: format(dest,"Hello %s. You are %d years old","Tom",17). */ 32 | native format(output[] ,len ,const format[] , {Float,_}:...); 33 | 34 | /* Gets parameters from function as formated string. */ 35 | native format_args(output[] ,len ,pos = 0); 36 | 37 | /* Converts number to string. */ 38 | native num_to_str(num,string[],len); 39 | 40 | /* Returns converted string to number. */ 41 | native str_to_num(const string[]); 42 | 43 | /* Checks if two strings equal. If len var is set 44 | * then there are only c chars comapred. */ 45 | native equal(const a[],const b[],c=0); 46 | 47 | /* Checks if two strings equal with case ignoring. 48 | * If len var is set then there are only c chars comapred. */ 49 | native equali(const a[],const b[],c=0); 50 | 51 | /* Copies one string to another. By len var 52 | * you may specify max. number of chars to copy. */ 53 | native copy(dest[],len,const src[]); 54 | 55 | /* Copies one string to another until char ch is found. 56 | * By len var you may specify max. number of chars to copy. */ 57 | native copyc(dest[],len,const src[],ch); 58 | 59 | /* Sets string with given character. */ 60 | native setc(src[],len,ch); 61 | 62 | /* Gets parameters from text. 63 | * Example: to split text: "^"This is^" the best year", 64 | * call function like this: parse(text,arg1,len1,arg2,len2,arg3,len3,arg4,len4) 65 | * and you will get: "This is", "the", "best", "year" 66 | * Function returns number of parsed parameters. */ 67 | native parse(const text[], ... ); 68 | 69 | /* Converts all chars in string to lower case. */ 70 | native strtolower(string[]); 71 | 72 | /* Converts all chars in string to upper case. */ 73 | native strtoupper(string[]); 74 | 75 | /* Returns true when value is digit. */ 76 | native isdigit(ch); 77 | 78 | /* Returns true when value is letter. */ 79 | native isalpha(ch); 80 | 81 | /* Returns true when value is space. */ 82 | native isspace(ch); 83 | 84 | /* Returns true when value is letter or digit. */ 85 | native isalnum(ch); -------------------------------------------------------------------------------- /amxx/include/ucstats.inc: -------------------------------------------------------------------------------- 1 | // UCStats definitions 2 | #define MAX_NAME_LENGTH 32 3 | #define MAX_VAR_LENGTH 64 4 | #define MAX_PLAYERS 32 5 | #define MAX_TEXT_LENGTH 512 6 | #define MAX_UDP_LENGTH 1024 7 | #define MAX_CVARS 16 8 | #define MIN_PLAYTIME 60 9 | 10 | // Supported mods 11 | #define MOD_CSTRIKE 1 12 | #define MOD_DOD 2 13 | 14 | // Stats defintions 15 | #define INDEX_WEAPONS 16 16 | #define INDEX_BODY 8 17 | 18 | // Weapon stats indexes 19 | #define INDEX_WEAPON 0 20 | #define INDEX_KILLS 1 21 | #define INDEX_DEATHS 2 22 | #define INDEX_HS 3 23 | #define INDEX_TK 4 24 | #define INDEX_SHOTS 5 25 | #define INDEX_HITS 6 26 | #define INDEX_DMG 7 27 | 28 | // Hit stats indexes 29 | #define INDEX_GENERIC 0 30 | #define INDEX_HEAD 1 31 | #define INDEX_CHEST 2 32 | #define INDEX_STOMACH 3 33 | #define INDEX_LEFTARM 4 34 | #define INDEX_RIGHTARM 5 35 | #define INDEX_LEFTLEG 6 36 | #define INDEX_RIGHTLEG 7 37 | 38 | // Player stats indexes 39 | #define PLAYER_KILLS 0 40 | #define PLAYER_DEATHS 1 41 | #define PLAYER_LASTWEAPON 2 42 | #define PLAYER_LASTAMMO 3 43 | #define PLAYER_TIME 4 44 | #define PLAYER_HEALTH 5 45 | #define PLAYER_KILLCOUNT 6 46 | #define PLAYER_KILLSTREAK 7 47 | #define PLAYER_ROUNDS 8 48 | #define PLAYER_SURVIVE 9 49 | #define PLAYER_MISC 10 50 | #define PLAYER_INDEX 11 51 | 52 | // Weapons 53 | #define WEAPON_INDEX 1024 54 | #define MAX_CS_WEAPONS 34 55 | #define MAX_DOD_WEAPONS 45 56 | 57 | // Counter-strike weapons 58 | #define CS_P228 1 59 | #define CS_SCOUT 3 60 | #define CS_HEGRENADE 4 61 | #define CS_XM1014 5 62 | #define CS_C4 6 63 | #define CS_MAC10 7 64 | #define CS_AUG 8 65 | #define CS_SMOKEGRENADE 9 66 | #define CS_ELITE 10 67 | #define CS_FIVESEVEN 11 68 | #define CS_UMP45 12 69 | #define CS_SG550 13 70 | #define CS_USP 16 71 | #define CS_GLOCK18 17 72 | #define CS_AWP 18 73 | #define CS_MP5NAVY 19 74 | #define CS_M249 20 75 | #define CS_M3 21 76 | #define CS_M4A1 22 77 | #define CS_TMP 23 78 | #define CS_G3SG1 24 79 | #define CS_FLASHBANG 25 80 | #define CS_DEAGLE 26 81 | #define CS_SG552 27 82 | #define CS_AK47 28 83 | #define CS_KNIFE 29 84 | #define CS_P90 30 85 | #define CS_GALIL 31 86 | #define CS_FAMAS 32 87 | #define CS_SHIELD 33 88 | 89 | // Day of defeat weapons 90 | #define DOD_AMERKNIFE 1 91 | #define DOD_GERKNIFE 2 92 | #define DOD_COLT 3 93 | #define DOD_LUGER 4 94 | #define DOD_GARAND 5 95 | #define DOD_SCOPEDKAR 6 96 | #define DOD_THOMPSON 7 97 | #define DOD_MP44 8 98 | #define DOD_SPRING 9 99 | #define DOD_KAR 10 100 | #define DOD_BAR 11 101 | #define DOD_MP40 12 102 | #define DOD_GRENADE 13 103 | #define DOD_GRENADE2 14 104 | #define DOD_GRENADE_EX 15 105 | #define DOD_GRENADE2_EX 16 106 | #define DOD_MG42 17 107 | #define DOD_30CAL 18 108 | #define DOD_SPADE 19 109 | #define DOD_M1CARBINE 20 110 | #define DOD_MG34 21 111 | #define DOD_GREASEGUN 22 112 | #define DOD_FG42 23 113 | #define DOD_K43 24 114 | #define DOD_ENFIELD 25 115 | #define DOD_STEN 26 116 | #define DOD_BREN 27 117 | #define DOD_WEBLY 28 118 | #define DOD_BAZOOKA 29 119 | #define DOD_PSCHRECK 30 120 | #define DOD_PIAT 31 121 | #define DOD_SCOPED_FG42 32 122 | #define DOD_FCARBINE 33 123 | #define DOD_BAYONET 34 124 | #define DOD_SCOPED_ENFIELD 35 125 | #define DOD_MILLS_BOMB 36 126 | #define DOD_BRIT_KNIFE 37 127 | #define DOD_GARANDBUTT 38 128 | #define DOD_ENF_BAYONET 39 129 | #define DOD_K43BUTT 40 130 | #define DOD_WEAPON41 41 131 | #define DOD_WEAPON42 42 132 | #define DOD_WEAPON43 43 133 | #define DOD_WEAPON44 44 134 | -------------------------------------------------------------------------------- /amxx/include/vault.inc: -------------------------------------------------------------------------------- 1 | /* Vault functions 2 | * 3 | * by the AMX Mod X Development Team 4 | * originally developed by OLO 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if defined _vault_included 10 | #endinput 11 | #endif 12 | #define _vault_included 13 | 14 | /* Reads a data from given key. 15 | * If len is set to zero then get_vaultdata 16 | * returns value as an number. */ 17 | native get_vaultdata(const key[], data[] = "", len = 0); 18 | 19 | /* Sets a data under given key. */ 20 | native set_vaultdata(const key[], const data[] = "" ); 21 | 22 | /* Removes a key from vault.*/ 23 | native remove_vaultdata(const key[]); 24 | 25 | /* Checks if a key exists in the vault.*/ 26 | native vaultdata_exists(const key[]); -------------------------------------------------------------------------------- /amxx/include/xtrafun.inc: -------------------------------------------------------------------------------- 1 | /* Xtrafun backwards compatibility 2 | * 3 | * by the AMX Mod X Development Team 4 | * These natives were originally made by SpaceDude, EJ, and JustinHoMi. 5 | * 6 | * This file is provided as is (no warranties). 7 | */ 8 | 9 | #if !defined _xtrafun_included 10 | #define _xtrafun_included 11 | 12 | #if !defined _engine_included 13 | #include 14 | #endif 15 | 16 | /* Gets the velocity of an entity */ 17 | stock get_entity_velocity(index, velocity[3]) { 18 | new Float:vector[3] 19 | entity_get_vector(index, EV_VEC_velocity, vector) 20 | FVecIVec(vector, velocity) 21 | } 22 | 23 | /* Sets the velocity of an entity */ 24 | stock set_entity_velocity(index, velocity[3]) { 25 | new Float:vector[3] 26 | IVecFVec(velocity, vector) 27 | entity_set_vector(index, EV_VEC_velocity, vector) 28 | } 29 | 30 | /* Gets the origin of an entity */ 31 | stock get_entity_origin(index, origin[3]) { 32 | new Float:vector[3] 33 | entity_get_vector(index, EV_VEC_origin, vector) 34 | FVecIVec(vector, origin) 35 | } 36 | 37 | /* Sets the origin of an entity */ 38 | stock set_entity_origin(index, origin[3]) { 39 | new Float:vector[3] 40 | IVecFVec(originvector) 41 | entity_set_vector(index, EV_VEC_origin, vector) 42 | } 43 | 44 | /* Gets the velocity of a player */ 45 | stock get_user_velocity(index, velocity[3]) { 46 | get_entity_velocity(index, velocity) 47 | } 48 | 49 | /* Sets the velocity of a player */ 50 | stock set_user_velocity(index, velocity[3]) { 51 | set_entity_velocity(index, velocity) 52 | } 53 | 54 | /* Get the index of the grenade belonging to index. 55 | * Model of grenade is returned in model[]. 56 | * Specify the grenadeindex to start searching from, 57 | * or leave it at 0 to search from the start. 58 | * Returns grenade index. 59 | * Paths + models of grenades in Counter-Strike: 60 | * HEGRENADE = "models/w_hegrenade.mdl" 61 | * FLASHBANG = "models/w_flashbang.mdl" 62 | * SMOKEGRENADE = "models/w_smokegrenade.mdl" */ 63 | stock get_grenade_index(index, model[], len, grenadeindex = 0) { 64 | new entfind = grenadeindex 65 | new entowner = index 66 | 67 | for (;;) { 68 | entfind = find_ent_by_class(entfind, "grenade") 69 | 70 | if (entfind && is_valid_ent(entfind)) { 71 | if (entity_get_edict(entFind, EV_ENT_owner) == entowner) { 72 | entity_get_string(entfind, EV_SZ_model, model) 73 | return entfind 74 | } 75 | } 76 | else { 77 | // Eventually comes here if loop fails to find a grenade with specified owner. 78 | return 0; 79 | } 80 | } 81 | } 82 | 83 | /* Find the number of entities in the game */ 84 | stock current_num_ents() { 85 | return entity_count(); 86 | } 87 | 88 | enum { 89 | classname = 0, 90 | target, 91 | targetname 92 | } 93 | 94 | /* Find an entity ID from start_from_ent id (use 0 to start from 95 | * the beginning, category is either "classname", "target" or 96 | * "targetname", value is the name you are searching for */ 97 | stock find_entity(start_from_ent, category, value[]) { 98 | switch (category) { 99 | case target: return find_ent_by_target(start_from_ent, value) 100 | case targetname: return find_ent_by_tname(start_from_ent, value) 101 | } 102 | return find_ent_by_class(start_from_ent, value) 103 | } 104 | 105 | #endif // _xtrafun_included -------------------------------------------------------------------------------- /amxx/plugin_cloakwar.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_cloakwar.amx -------------------------------------------------------------------------------- /amxx/plugin_cloakwar.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_cloakwar.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin requires the following plugins to work: 8 | * (plugin_powers.sma) 9 | * 10 | * Gives the winning team cloaking powers. Cloaked players 11 | * are revealed only for a few seconds after firing but 12 | * they only have 1 health. 13 | * 14 | */ 15 | 16 | #include 17 | 18 | #define MAX_NAME_LENGTH 32 19 | #define MAX_PLAYERS 32 20 | #define MAX_WEAPONS 32 21 | #define MAX_TEXT_LENGTH 512 22 | 23 | /************************************************************ 24 | * CONFIG 25 | ************************************************************/ 26 | 27 | // Admin access level 28 | #define ACCESS_LEVEL ADMIN_LEVEL_A 29 | 30 | /************************************************************ 31 | * MAIN 32 | ************************************************************/ 33 | 34 | new gCloakTeam = 0 35 | 36 | public admin_cloakwar(id) 37 | { 38 | // Check access level 39 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 40 | console_print(id,"[AMX] You have no access to that command") 41 | return PLUGIN_HANDLED 42 | } 43 | // Check arguments 44 | if (read_argc() < 2) { 45 | console_print(id,"[AMX] Usage: amx_cloakwar < 1 | 0 >") 46 | return PLUGIN_HANDLED 47 | } 48 | new sArg1[MAX_NAME_LENGTH+1] 49 | read_argv(1,sArg1,MAX_NAME_LENGTH) 50 | set_cvar_num("amx_cloakwar_mode",str_to_num(sArg1)) 51 | if (equal(sArg1,"1")) { 52 | client_print(id,print_console,"[AMX] Cloak War is now on.") 53 | msg_display("Cloak War is now on! :)",0,200,0) 54 | } 55 | else if (equal(sArg1,"0")) { 56 | client_print(id,print_console,"[AMX] Cloak War is now off.") 57 | msg_display("Cloak War is now off! :(",0,200,0) 58 | gCloakTeam = 0 59 | event_reset() 60 | } 61 | return PLUGIN_HANDLED 62 | } 63 | 64 | public msg_display(msg[],r,g,b) 65 | { 66 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 67 | show_hudmessage(0,msg) 68 | } 69 | 70 | 71 | 72 | /************************************************************ 73 | * EVENT FUNCTIONS 74 | ************************************************************/ 75 | 76 | public event_cloak() 77 | { 78 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 79 | new sName[MAX_NAME_LENGTH] 80 | get_players(iPlayers,iNumPlayers) 81 | 82 | for (new i = 0; i < iNumPlayers; i++) { 83 | iPlayer = iPlayers[i] 84 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 85 | if (get_user_team(iPlayer)==gCloakTeam) { 86 | server_cmd("amx_cloak ^"%s^" on",sName) 87 | } 88 | } 89 | } 90 | 91 | public event_reset() 92 | { 93 | new sName[MAX_NAME_LENGTH] 94 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 95 | get_players(iPlayers,iNumPlayers) 96 | for (new i = 0; i < iNumPlayers; i++) { 97 | iPlayer = iPlayers[i] 98 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 99 | server_cmd("amx_nopowers ^"%s^" 1",sName) 100 | } 101 | } 102 | 103 | public event_respawn(id) 104 | { 105 | if (get_cvar_num("amx_cloakwar_mode")) { 106 | new sMsg[MAX_TEXT_LENGTH] 107 | new sTeam[MAX_TEXT_LENGTH] 108 | if (gCloakTeam==1) { 109 | copy(sTeam,MAX_NAME_LENGTH,"TERRORIST") 110 | } 111 | else if (gCloakTeam==2){ 112 | copy(sTeam,MAX_NAME_LENGTH,"COUNTER-TERRORIST") 113 | } 114 | format(sMsg,MAX_TEXT_LENGTH,"-= CLOAK WARS MOD =-^n^nThe %s team is cloaked! Watch out!",sTeam) 115 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 116 | show_hudmessage(id,sMsg) 117 | } 118 | return PLUGIN_CONTINUE 119 | } 120 | 121 | public event_round_t() 122 | { 123 | if (get_cvar_num("amx_cloakwar_mode")) { 124 | new sMsg[MAX_TEXT_LENGTH] 125 | gCloakTeam = 1 126 | format(sMsg,MAX_TEXT_LENGTH,"The TERRORIST team won cloaking powers!") 127 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 128 | show_hudmessage(0,sMsg) 129 | set_task(4.0,"event_reset",0,"") 130 | set_task(5.0,"event_cloak",0,"") 131 | } 132 | return PLUGIN_CONTINUE 133 | } 134 | 135 | public event_round_ct() 136 | { 137 | if (get_cvar_num("amx_cloakwar_mode")) { 138 | new sMsg[MAX_TEXT_LENGTH] 139 | gCloakTeam = 2 140 | format(sMsg,MAX_TEXT_LENGTH,"The COUNTER-TERRORIST team won cloaking powers!") 141 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 142 | show_hudmessage(0,sMsg) 143 | set_task(4.0,"event_reset",0,"") 144 | set_task(5.0,"event_cloak",0,"") 145 | } 146 | return PLUGIN_CONTINUE 147 | } 148 | 149 | public event_round_draw() 150 | { 151 | if (get_cvar_num("amx_cloakwar_mode")) { 152 | gCloakTeam = random_num(1,2) 153 | set_task(4.0,"event_reset",0,"") 154 | set_task(5.0,"event_cloak",0,"") 155 | } 156 | return PLUGIN_CONTINUE 157 | } 158 | 159 | /************************************************************ 160 | * PLUGIN FUNCTIONS 161 | ************************************************************/ 162 | 163 | public plugin_init() 164 | { 165 | register_plugin("Cloak War","1.0","mike_cao") 166 | register_clcmd("amx_cloakwar","admin_cloakwar",ACCESS_LEVEL,"amx_ka < 0 | 1 >") 167 | register_event("ResetHUD","event_respawn","be","1=1") 168 | register_cvar("amx_cloakwar_mode","0") 169 | register_event("SendAudio","event_round_t","a","2&%!MRAD_terwin") 170 | register_event("SendAudio","event_round_ct","a","2&%!MRAD_ctwin") 171 | register_event("SendAudio","event_round_draw","a","2&%!MRAD_rounddraw") 172 | return PLUGIN_CONTINUE 173 | } 174 | -------------------------------------------------------------------------------- /amxx/plugin_clonewar.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_clonewar.amx -------------------------------------------------------------------------------- /amxx/plugin_clonewar.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_hunting.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin requires the Vexd module. 8 | * 9 | * Clone wars mod. All players have the same model. 10 | * 11 | * Cvar: 12 | * amx_clonewar_mode <1|0> 13 | * 14 | */ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #define MAX_NAME_LENGTH 32 21 | #define MAX_PLAYERS 32 22 | #define MAX_TEXT_LENGTH 512 23 | #define MODEL_INDEX 8 24 | 25 | /************************************************************ 26 | * CONFIG 27 | ************************************************************/ 28 | 29 | // Admin access level 30 | #define ACCESS_LEVEL ADMIN_LEVEL_A 31 | 32 | 33 | /************************************************************ 34 | * MAIN 35 | ************************************************************/ 36 | 37 | new gMsg[MAX_TEXT_LENGTH] = {"-= CLONE WARS MOD =-^n^nAttack of the Clones!"} 38 | new gModels[MODEL_INDEX][] = {"arctic","gign","gsg9","guerilla","leet","sas","urban","vip"} 39 | new gModel[MAX_NAME_LENGTH] 40 | new gFFDefault = 0 41 | new gmsgStatusText 42 | 43 | public admin_clonewar(id) 44 | { 45 | // Check access level 46 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 47 | console_print(id,"[AMX] You have no access to that command") 48 | return PLUGIN_HANDLED 49 | } 50 | // Check arguments 51 | if (read_argc() < 2) { 52 | console_print(id,"[AMX] Usage: amx_clonewar < 1 | 0 >") 53 | return PLUGIN_HANDLED 54 | } 55 | new sArg1[MAX_NAME_LENGTH+1] 56 | read_argv(1,sArg1,MAX_NAME_LENGTH) 57 | set_cvar_num("amx_clonewar_mode",str_to_num(sArg1)) 58 | if (equal(sArg1,"1")) { 59 | client_print(id,print_console,"[AMX] Clone wars mod is now on.") 60 | player_msg(0,"Clone wars is now on! :)",0,200,0) 61 | set_cvar_num("mp_friendlyfire",1) 62 | } 63 | else if (equal(sArg1,"0")) { 64 | client_print(id,print_console,"[AMX] Clone wars mod is now off.") 65 | player_msg(0,"Clone wars is now off! :(",0,200,0) 66 | set_cvar_num("mp_friendlyfire",gFFDefault) 67 | } 68 | return PLUGIN_HANDLED 69 | } 70 | 71 | /************************************************************ 72 | * EVENT FUNCTIONS 73 | ************************************************************/ 74 | 75 | public event_respawn(id) 76 | { 77 | if (get_cvar_num("amx_clonewar_mode")) { 78 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 79 | show_hudmessage(id,gMsg) 80 | 81 | cs_set_user_model(id,gModel) 82 | } 83 | return PLUGIN_CONTINUE 84 | } 85 | 86 | public event_damage() 87 | { 88 | new iVictim = read_data(0) 89 | new iDamage = read_data(2) 90 | new iWeapon, iBody 91 | new iAttacker = get_user_attacker(iVictim,iWeapon,iBody) 92 | 93 | if (iVictim != iAttacker && get_user_team(iAttacker) == get_user_team(iVictim)) { 94 | new iHealth = get_user_health(iAttacker) 95 | set_user_health(iAttacker,iHealth-iDamage) 96 | } 97 | 98 | return PLUGIN_CONTINUE 99 | } 100 | 101 | public event_round_end() 102 | { 103 | if (get_cvar_num("amx_clonewar_mode")) { 104 | format(gModel,MAX_NAME_LENGTH,"%s",gModels[random_num(0,MODEL_INDEX-1)]) 105 | } 106 | return PLUGIN_CONTINUE 107 | } 108 | 109 | public event_msg() 110 | { 111 | if (get_cvar_num("amx_clonewar_mode")) { 112 | new sMsg[MAX_TEXT_LENGTH] 113 | format(sMsg,MAX_TEXT_LENGTH,"Clone Wars Mod") 114 | message_begin(MSG_ALL,gmsgStatusText,{0,0,0}) 115 | write_byte(0) 116 | write_string(sMsg) 117 | message_end() 118 | } 119 | return PLUGIN_HANDLED 120 | } 121 | 122 | /************************************************************ 123 | * PLAYER FUNCTIONS 124 | ************************************************************/ 125 | 126 | public player_msg(player,msg[],r,g,b) 127 | { 128 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 129 | show_hudmessage(player,msg) 130 | } 131 | 132 | /************************************************************ 133 | * PLUGIN FUNCTIONS 134 | ************************************************************/ 135 | 136 | public plugin_init() 137 | { 138 | register_plugin("Clone Wars","1.0","mike_cao") 139 | register_concmd("amx_clonewar","admin_clonewar",ACCESS_LEVEL,"amx_clonewar < on | off >") 140 | register_event("ResetHUD","event_respawn","be","1=1") 141 | register_event("SendAudio","event_round_end","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw") 142 | register_cvar("amx_clonewar_mode","0") 143 | gFFDefault = get_cvar_num("mp_friendlyfire") 144 | gmsgStatusText = get_user_msgid("StatusText") 145 | set_task(0.5,"event_msg",0,"",0,"b") 146 | return PLUGIN_CONTINUE 147 | } 148 | -------------------------------------------------------------------------------- /amxx/plugin_csevents.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_csevents.amx -------------------------------------------------------------------------------- /amxx/plugin_freezetag.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_freezetag.amx -------------------------------------------------------------------------------- /amxx/plugin_fun.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_fun.amx -------------------------------------------------------------------------------- /amxx/plugin_funman.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_funman.amx -------------------------------------------------------------------------------- /amxx/plugin_funman.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_funman.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Fun manager. Turns on different fun modes based 8 | * on the current map. 9 | * 10 | * Cvar: 11 | * amx_funman_mode <1|0> 12 | * 13 | */ 14 | 15 | #include 16 | 17 | #define MAX_NAME_LENGTH 32 18 | 19 | /************************************************************ 20 | * CONFIG 21 | ************************************************************/ 22 | 23 | // Admin access level 24 | #define ACCESS_LEVEL ADMIN_LEVEL_A 25 | 26 | 27 | /************************************************************ 28 | * MAIN 29 | ************************************************************/ 30 | 31 | #define MAP_INDEX 4 32 | #define FUN_INDEX 7 33 | 34 | // Fun mode index 35 | new gFunModes[FUN_INDEX][] = { 36 | "amx_gamble_mode", 37 | "amx_freezetag_mode", 38 | "amx_stealthwar_mode", 39 | "amx_cloakwar_mode", 40 | "amx_hunting_mode", 41 | "amx_targetwar_mode", 42 | "amx_knife_mode" 43 | } 44 | 45 | // Map index 46 | new gMaps[MAP_INDEX][] = { 47 | "cs_assault", 48 | "de_dust", 49 | "de_aztec", 50 | "de_dust2" 51 | } 52 | 53 | // Fun modes tied to maps 54 | new gMapCvars[MAP_INDEX][] = { 55 | "amx_freezetag_mode", 56 | "amx_stealthwar_mode", 57 | "amx_cloakwar_mode", 58 | "amx_hunting_mode" 59 | } 60 | 61 | // Default fun mode 62 | new gDefault[MAX_NAME_LENGTH] = "amx_gamble_mode" 63 | 64 | public admin_funman(id) 65 | { 66 | // Check access level 67 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 68 | console_print(id,"[AMX] You have no access to that command") 69 | return PLUGIN_HANDLED 70 | } 71 | // Check arguments 72 | if (read_argc() < 2) { 73 | console_print(id,"[AMX] Usage: amx_funman < 1 | 0 >") 74 | return PLUGIN_HANDLED 75 | } 76 | new sArg1[MAX_NAME_LENGTH+1] 77 | read_argv(1,sArg1,MAX_NAME_LENGTH) 78 | set_cvar_num("amx_funman_mode",str_to_num(sArg1)) 79 | if (equal(sArg1,"1")) { 80 | client_print(id,print_console,"[AMX] Fun manager now on.") 81 | } 82 | else if (equal(sArg1,"0")) { 83 | client_print(id,print_console,"[AMX] Fun manager is now off.") 84 | } 85 | return PLUGIN_HANDLED 86 | } 87 | 88 | public event_fun() { 89 | if (get_cvar_num("amx_funman_mode")) { 90 | new sMap[MAX_NAME_LENGTH] 91 | new isMatch = 0 92 | get_mapname(sMap,MAX_NAME_LENGTH) 93 | 94 | event_reset() 95 | 96 | for (new i = 0; i < MAP_INDEX; i++) { 97 | if (equal(sMap,gMaps[i])) { 98 | set_cvar_num(gMapCvars[i],1) 99 | isMatch = 1 100 | break 101 | } 102 | } 103 | 104 | if (!isMatch) { 105 | set_cvar_num(gDefault,1) 106 | } 107 | } 108 | return PLUGIN_HANDLED 109 | } 110 | 111 | public event_reset() { 112 | for (new i = 0; i < FUN_INDEX; i++) { 113 | set_cvar_num(gFunModes[i],0) 114 | } 115 | return PLUGIN_HANDLED 116 | } 117 | 118 | /************************************************************ 119 | * PLUGIN FUNCTIONS 120 | ************************************************************/ 121 | 122 | public plugin_init() 123 | { 124 | register_plugin("Fun Manager","1.0","mike_cao") 125 | register_concmd("amx_funman","admin_funman",ACCESS_LEVEL,"amx_funman < on | off >") 126 | register_cvar("amx_funman_mode","0") 127 | 128 | set_task(5.0,"event_fun") 129 | 130 | return PLUGIN_CONTINUE 131 | } 132 | -------------------------------------------------------------------------------- /amxx/plugin_gamble.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_gamble.amx -------------------------------------------------------------------------------- /amxx/plugin_glowdamage.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_glowdamage.amx -------------------------------------------------------------------------------- /amxx/plugin_glowdamage.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_glowdamage.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin makes players glow briefly when 8 | * damaged. There are team-based glow colors 9 | * as well as different colors for the amount 10 | * of damage dealt. 11 | * 12 | * Use the cvar "amx_glowdamage_mode" in your admin.cfg 13 | * 0 = off 14 | * 1 = default glow damage 15 | * 2 = team-based glow damage 16 | * 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #define MAX_NAME_LENGTH 32 23 | #define MAX_PLAYERS 32 24 | 25 | // Admin access level 26 | #define ACCESS_LEVEL ADMIN_LEVEL_A 27 | 28 | // Color between shots (1=on, 0=off) 29 | #define INTERMEDIATE_GLOW 0 30 | 31 | new gGlow 32 | new gGlowState[MAX_PLAYERS+1] 33 | 34 | public admin_glowdamage(id) 35 | { 36 | // Check access level 37 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 38 | client_print(id, print_console,"[AMX] You have no access to that command") 39 | return PLUGIN_HANDLED 40 | } 41 | // Check arguments 42 | if (read_argc() < 2) { 43 | client_print(id, print_console,"[AMX] Usage: amx_glowdamage < 0 | 1 | 2 > [0=off,1=on,2=team-based]") 44 | return PLUGIN_HANDLED 45 | } 46 | 47 | new sArg[MAX_NAME_LENGTH+1] 48 | read_argv(1,sArg,MAX_NAME_LENGTH) 49 | set_cvar_num("amx_glowdamage_mode",str_to_num(sArg)) 50 | 51 | if ( equal(sArg,"0") ) { 52 | client_print(id,print_console,"[AMX] Glow damage is now off") 53 | msg_display("Glow Damage Disabled.",0,200,0) 54 | } 55 | else if ( equal(sArg,"1") ) { 56 | client_print(id,print_console,"[AMX] Glow damage is now on") 57 | msg_display("Glow Damage Enabled.",0,200,0) 58 | } 59 | else if ( equal(sArg,"2") ) { 60 | client_print(id,print_console,"[AMX] Team-based glow damage is now on") 61 | msg_display("Team-based Glow Damage Enabled.",0,200,0) 62 | } 63 | 64 | return PLUGIN_HANDLED 65 | } 66 | 67 | public msg_display(msg[],r,g,b) 68 | { 69 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 70 | show_hudmessage(0,msg) 71 | } 72 | 73 | public player_glow_on(player,r,g,b,size) 74 | { 75 | new Params[1] 76 | Params[0] = player 77 | set_user_rendering(player,kRenderFxGlowShell,r,g,b,kRenderNormal,size) 78 | set_task(0.5,"player_glow_off",0,Params,1); 79 | return PLUGIN_CONTINUE 80 | } 81 | 82 | public player_glow_off(Params[]) 83 | { 84 | set_user_rendering(Params[0]) 85 | return PLUGIN_CONTINUE 86 | } 87 | 88 | public event_glowdamage() 89 | { 90 | new iR, iG, iB, iSize, iColor, iState 91 | new iVictim = read_data(0) 92 | new iDamage = read_data(2) 93 | new sTeam[MAX_NAME_LENGTH+1] 94 | 95 | gGlow = get_cvar_num("amx_glowdamage_mode") 96 | 97 | get_user_team(iVictim,sTeam,MAX_NAME_LENGTH); 98 | iColor = INTERMEDIATE_GLOW 99 | 100 | if (iColor) { 101 | iState = gGlowState[iVictim] 102 | if(iState) { 103 | gGlowState[iVictim] = 0 104 | } else { 105 | gGlowState[iVictim] = 1 106 | } 107 | } 108 | 109 | if (gGlow > 0 && !iState) { 110 | // Heavy damage 111 | if (iDamage > 30) { 112 | iSize = 20 113 | // Team-based 114 | if (gGlow == 2) { 115 | // Team 1 116 | if ( equal(sTeam,"TERRORIST") ) { 117 | iR = 255 118 | iG = 0 119 | iB = 0 120 | } 121 | // Team 2 122 | else if ( equal(sTeam,"CT") ) { 123 | iR = 0 124 | iG = 192 125 | iB = 255 126 | } 127 | // Default 128 | else { 129 | iR = 255 130 | iG = 128 131 | iB = 0 132 | } 133 | } 134 | // Non team-based 135 | else { 136 | iR = 255 137 | iG = 128 138 | iB = 0 139 | } 140 | } 141 | // Medium damage 142 | else if (iDamage > 20) { 143 | iSize = 10 144 | // Team-based 145 | if (gGlow == 2) { 146 | // Team 1 147 | if ( equal(sTeam,"TERRORIST") ) { 148 | iR = 128 149 | iG = 0 150 | iB = 0 151 | } 152 | // Team 2 153 | else if ( equal(sTeam,"CT") ) { 154 | iR = 0 155 | iG = 128 156 | iB = 192 157 | } 158 | // Default 159 | else { 160 | iR = 255 161 | iG = 96 162 | iB = 0 163 | } 164 | } 165 | // Non team-based 166 | else { 167 | iR = 255 168 | iG = 96 169 | iB = 0 170 | } 171 | } 172 | // Low damage 173 | else if (iDamage > 10) { 174 | iSize = 0 175 | // Team-based 176 | if (gGlow == 2) { 177 | // Team 1 178 | if ( equal(sTeam,"TERRORIST") ) { 179 | iR = 64 180 | iG = 0 181 | iB = 0 182 | } 183 | // Team 2 184 | else if ( equal(sTeam,"CT") ) { 185 | iR = 0 186 | iG = 64 187 | iB = 128 188 | } 189 | // Default 190 | else { 191 | iR = 255 192 | iG = 64 193 | iB = 0 194 | } 195 | } 196 | // Non team-based 197 | else { 198 | iR = 255 199 | iG = 64 200 | iB = 0 201 | } 202 | } 203 | } 204 | // Intermediate color 205 | else if ( gGlow > 0 && iState ) { 206 | iR = 255 207 | iG = 255 208 | iB = 255 209 | } 210 | // Glow player 211 | if (gGlow) { 212 | player_glow_on(iVictim,iR,iG,iB,iSize) 213 | } 214 | return PLUGIN_CONTINUE; 215 | } 216 | 217 | public plugin_init() 218 | { 219 | register_plugin("Glow Damage","1.0","mike_cao") 220 | register_clcmd("amx_glowdamage","admin_glowdamage",ACCESS_LEVEL,"amx_glowdamage < 0 | 1 | 2 >") 221 | register_event("Damage","event_glowdamage","b","2!0","3=0","4!0") 222 | register_cvar("amx_glowdamage_mode","0") 223 | return PLUGIN_CONTINUE 224 | } 225 | -------------------------------------------------------------------------------- /amxx/plugin_gore.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_gore.amx -------------------------------------------------------------------------------- /amxx/plugin_gore.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_gore.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin adds gore effects. It is configured 8 | * with the cvar "amx_gore" using these flags: 9 | * 10 | * a - Headshot blood 11 | * b - Extra blood effects 12 | * c - Bleeding on low health 13 | * d - Gib explosion (knife, HE, high damage only) 14 | * 15 | */ 16 | #include 17 | #include 18 | 19 | #define MAX_NAME_LENGTH 32 20 | #define MAX_VAR_LENGTH 64 21 | #define MAX_PLAYERS 32 22 | #define MAX_TEXT_LENGTH 512 23 | 24 | #define GORE_HEADSHOT (1<<0) // "a" 25 | #define GORE_BLOOD (1<<1) // "b" 26 | #define GORE_BLEEDING (1<<2) // "c" 27 | #define GORE_GIB (1<<3) // "d" 28 | 29 | #define TE_BLOODSPRITE 115 30 | #define TE_BLOODSTREAM 101 31 | #define TE_MODEL 106 32 | #define TE_WORLDDECAL 116 33 | 34 | /************************************************************ 35 | * MAIN 36 | ************************************************************/ 37 | 38 | new gHealthIndex[MAX_PLAYERS+1] 39 | 40 | new mdl_gib_flesh 41 | new mdl_gib_head 42 | new mdl_gib_legbone 43 | new mdl_gib_lung 44 | new mdl_gib_meat 45 | new mdl_gib_spine 46 | 47 | new spr_blood_drop 48 | new spr_blood_spray 49 | 50 | public event_damage() 51 | { 52 | new iFlags = get_gore_flags() 53 | new iVictim = read_data(0) 54 | gHealthIndex[iVictim] = get_user_health(iVictim) 55 | 56 | if (iFlags&GORE_BLOOD) { 57 | new iOrigin[3] 58 | get_user_origin(iVictim,iOrigin) 59 | fx_blood(iOrigin) 60 | fx_blood_small(iOrigin,10) 61 | } 62 | return PLUGIN_CONTINUE 63 | } 64 | 65 | public event_death() 66 | { 67 | new iFlags = get_gore_flags() 68 | new iOrigin[3] 69 | new sWeapon[MAX_NAME_LENGTH] 70 | new iVictim = read_data(2) 71 | new iHeadshot = read_data(3) 72 | 73 | read_data(4,sWeapon,MAX_NAME_LENGTH) 74 | 75 | if (iFlags&GORE_HEADSHOT && iHeadshot) { 76 | get_user_origin(iVictim,iOrigin) 77 | fx_headshot(iOrigin) 78 | } 79 | else if (iFlags&GORE_GIB && (equal(sWeapon,"knife") || equal(sWeapon,"grenade") || (gHealthIndex[iVictim] - get_user_health(iVictim)) > 100)) { 80 | get_user_origin(iVictim,iOrigin) 81 | // Effects 82 | fx_trans(iVictim,0) 83 | fx_gib_explode(iOrigin,5) 84 | fx_blood_large(iOrigin,3) 85 | fx_blood_small(iOrigin,20) 86 | // Hide body 87 | iOrigin[2] = iOrigin[2]-20 88 | set_user_origin(iVictim,iOrigin) 89 | } 90 | } 91 | 92 | public event_blood() 93 | { 94 | 95 | new iFlags = get_gore_flags() 96 | if (iFlags&GORE_BLEEDING) { 97 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers, iOrigin[3] 98 | get_players(iPlayers,iNumPlayers,"a") 99 | for (new i = 0; i < iNumPlayers; i++) { 100 | iPlayer = iPlayers[i] 101 | if (get_user_health(iPlayer) < 20) { 102 | get_user_origin(iPlayer,iOrigin) 103 | fx_bleed(iOrigin) 104 | fx_blood_small(iOrigin,5) 105 | } 106 | } 107 | } 108 | } 109 | 110 | public event_respawn(id) 111 | { 112 | gHealthIndex[id] = get_user_health(id) 113 | return PLUGIN_CONTINUE 114 | } 115 | 116 | public get_gore_flags() 117 | { 118 | new sFlags[24] 119 | get_cvar_string("amx_gore",sFlags,24) 120 | return read_flags(sFlags) 121 | } 122 | 123 | /************************************************************ 124 | * FX FUNCTIONS 125 | ************************************************************/ 126 | 127 | static fx_trans(player,amount) 128 | { 129 | set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount) 130 | return PLUGIN_CONTINUE 131 | } 132 | 133 | public fx_blood(origin[3]) 134 | { 135 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 136 | write_byte(TE_BLOODSPRITE) 137 | write_coord(origin[0]+random_num(-20,20)) 138 | write_coord(origin[1]+random_num(-20,20)) 139 | write_coord(origin[2]+random_num(-20,20)) 140 | write_short(spr_blood_spray) 141 | write_short(spr_blood_drop) 142 | write_byte(248) // color index 143 | write_byte(10) // size 144 | message_end() 145 | } 146 | 147 | public fx_bleed(origin[3]) 148 | { 149 | // Blood spray 150 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 151 | write_byte(TE_BLOODSTREAM) 152 | write_coord(origin[0]) 153 | write_coord(origin[1]) 154 | write_coord(origin[2]+10) 155 | write_coord(random_num(-100,100)) // x 156 | write_coord(random_num(-100,100)) // y 157 | write_coord(random_num(-10,10)) // z 158 | write_byte(70) // color 159 | write_byte(random_num(50,100)) // speed 160 | message_end() 161 | } 162 | 163 | static fx_blood_small(origin[3],num) 164 | { 165 | // Blood decals 166 | static const blood_small[7] = {190,191,192,193,194,195,197} 167 | 168 | // Small splash 169 | for (new j = 0; j < num; j++) { 170 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 171 | write_byte(TE_WORLDDECAL) 172 | write_coord(origin[0]+random_num(-100,100)) 173 | write_coord(origin[1]+random_num(-100,100)) 174 | write_coord(origin[2]-36) 175 | write_byte(blood_small[random_num(0,6)]) // index 176 | message_end() 177 | } 178 | } 179 | 180 | static fx_blood_large(origin[3],num) 181 | { 182 | // Blood decals 183 | static const blood_large[2] = {204,205} 184 | 185 | // Large splash 186 | for (new i = 0; i < num; i++) { 187 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 188 | write_byte(TE_WORLDDECAL) 189 | write_coord(origin[0]+random_num(-50,50)) 190 | write_coord(origin[1]+random_num(-50,50)) 191 | write_coord(origin[2]-36) 192 | write_byte(blood_large[random_num(0,1)]) // index 193 | message_end() 194 | } 195 | } 196 | 197 | static fx_gib_explode(origin[3],num) 198 | { 199 | new flesh[3], x, y, z 200 | flesh[0] = mdl_gib_flesh 201 | flesh[1] = mdl_gib_meat 202 | flesh[2] = mdl_gib_legbone 203 | 204 | // Gib explosion 205 | // Head 206 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 207 | write_byte(TE_MODEL) 208 | write_coord(origin[0]) 209 | write_coord(origin[1]) 210 | write_coord(origin[2]) 211 | write_coord(random_num(-100,100)) 212 | write_coord(random_num(-100,100)) 213 | write_coord(random_num(100,200)) 214 | write_angle(random_num(0,360)) 215 | write_short(mdl_gib_head) 216 | write_byte(0) // bounce 217 | write_byte(500) // life 218 | message_end() 219 | 220 | // Spine 221 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 222 | write_byte(TE_MODEL) 223 | write_coord(origin[0]) 224 | write_coord(origin[1]) 225 | write_coord(origin[2]) 226 | write_coord(random_num(-100,100)) 227 | write_coord(random_num(-100,100)) 228 | write_coord(random_num(100,200)) 229 | write_angle(random_num(0,360)) 230 | write_short(mdl_gib_spine) 231 | write_byte(0) // bounce 232 | write_byte(500) // life 233 | message_end() 234 | 235 | // Lung 236 | for(new i = 0; i < random_num(1,2); i++) { 237 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 238 | write_byte(TE_MODEL) 239 | write_coord(origin[0]) 240 | write_coord(origin[1]) 241 | write_coord(origin[2]) 242 | write_coord(random_num(-100,100)) 243 | write_coord(random_num(-100,100)) 244 | write_coord(random_num(100,200)) 245 | write_angle(random_num(0,360)) 246 | write_short(mdl_gib_lung) 247 | write_byte(0) // bounce 248 | write_byte(500) // life 249 | message_end() 250 | } 251 | 252 | // Parts, 5 times 253 | for(new i = 0; i < 5; i++) { 254 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 255 | write_byte(TE_MODEL) 256 | write_coord(origin[0]) 257 | write_coord(origin[1]) 258 | write_coord(origin[2]) 259 | write_coord(random_num(-100,100)) 260 | write_coord(random_num(-100,100)) 261 | write_coord(random_num(100,200)) 262 | write_angle(random_num(0,360)) 263 | write_short(flesh[random_num(0,2)]) 264 | write_byte(0) // bounce 265 | write_byte(500) // life 266 | message_end() 267 | } 268 | 269 | // Blood 270 | for(new i = 0; i < num; i++) { 271 | x = random_num(-100,100) 272 | y = random_num(-100,100) 273 | z = random_num(0,100) 274 | for(new j = 0; j < 5; j++) { 275 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 276 | write_byte(TE_BLOODSPRITE) 277 | write_coord(origin[0]+(x*j)) 278 | write_coord(origin[1]+(y*j)) 279 | write_coord(origin[2]+(z*j)) 280 | write_short(spr_blood_spray) 281 | write_short(spr_blood_drop) 282 | write_byte(248) // color index 283 | write_byte(15) // size 284 | message_end() 285 | } 286 | } 287 | } 288 | 289 | public fx_headshot(origin[3]) 290 | { 291 | // Blood spray, 5 times 292 | for (new i = 0; i < 5; i++) { 293 | message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 294 | write_byte(101) 295 | write_coord(origin[0]) 296 | write_coord(origin[1]) 297 | write_coord(origin[2]+30) 298 | write_coord(random_num(-20,20)) // x 299 | write_coord(random_num(-20,20)) // y 300 | write_coord(random_num(50,300)) // z 301 | write_byte(70) // color 302 | write_byte(random_num(100,200)) // speed 303 | message_end() 304 | } 305 | } 306 | 307 | /************************************************************ 308 | * PLUGIN FUNCTIONS 309 | ************************************************************/ 310 | 311 | public plugin_precache() 312 | { 313 | spr_blood_drop = precache_model("sprites/blood.spr") 314 | spr_blood_spray = precache_model("sprites/bloodspray.spr") 315 | 316 | mdl_gib_flesh = precache_model("models/Fleshgibs.mdl") 317 | mdl_gib_head = precache_model("models/GIB_Skull.mdl") 318 | mdl_gib_legbone = precache_model("models/GIB_Legbone.mdl") 319 | mdl_gib_lung = precache_model("models/GIB_Lung.mdl") 320 | mdl_gib_meat = precache_model("models/GIB_B_Gib.mdl") 321 | mdl_gib_spine = precache_model("models/GIB_B_Bone.mdl") 322 | } 323 | 324 | public plugin_init() 325 | { 326 | register_plugin("Plugin Gore","1.0","mike_cao") 327 | register_event("DeathMsg","event_death","a") 328 | register_event("Damage","event_damage","b","2!0","3=0","4!0") 329 | register_event("ResetHUD","event_respawn","be","1=1") 330 | register_cvar("amx_gore","abcd") 331 | set_task(1.0,"event_blood",0,"",0,"b") 332 | 333 | return PLUGIN_CONTINUE 334 | } 335 | -------------------------------------------------------------------------------- /amxx/plugin_hunting.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_hunting.amx -------------------------------------------------------------------------------- /amxx/plugin_hunting.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_hunting.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin requires the following plugins to work: 8 | * (plugin_powers.sma) 9 | * 10 | * Hunting season mod. One team (hunters) have infinite ammo and 11 | * armor. The other team (bears) have lots of health and knives. 12 | * Teams switch roles every round. 13 | * 14 | * Cvar: 15 | * amx_hunting_mode <1|0> 16 | * 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #define MAX_NAME_LENGTH 32 23 | #define MAX_PLAYERS 32 24 | #define MAX_TEXT_LENGTH 512 25 | 26 | #define DEFAULT_HEALTH 3000 27 | 28 | /************************************************************ 29 | * CONFIG 30 | ************************************************************/ 31 | 32 | // Admin access level 33 | #define ACCESS_LEVEL ADMIN_LEVEL_A 34 | 35 | 36 | /************************************************************ 37 | * MAIN 38 | ************************************************************/ 39 | 40 | new gHunterTeam = 1 41 | new gBearHealth = DEFAULT_HEALTH 42 | new gMsg[MAX_TEXT_LENGTH] = {"-= HUNTING SEASON MOD =-^n^nHunters VS. Bears^n^nTeam roles switch every round."} 43 | 44 | public admin_hunting(id) 45 | { 46 | // Check access level 47 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 48 | console_print(id,"[AMX] You have no access to that command") 49 | return PLUGIN_HANDLED 50 | } 51 | // Check arguments 52 | if (read_argc() < 2) { 53 | console_print(id,"[AMX] Usage: amx_hunting < 1 | 0 >") 54 | return PLUGIN_HANDLED 55 | } 56 | new sArg1[MAX_NAME_LENGTH+1] 57 | read_argv(1,sArg1,MAX_NAME_LENGTH) 58 | set_cvar_num("amx_hunting_mode",str_to_num(sArg1)) 59 | if (equal(sArg1,"1")) { 60 | client_print(id,print_console,"[AMX] Hunting season is now on.") 61 | player_msg(0,"Hunting season is now on! :)",0,200,0) 62 | } 63 | else if (equal(sArg1,"0")) { 64 | client_print(id,print_console,"[AMX] Hunting season is now off.") 65 | player_msg(0,"Hunting season is now off! :(",0,200,0) 66 | } 67 | return PLUGIN_HANDLED 68 | } 69 | 70 | public admin_bear(id) 71 | { 72 | // Check access level 73 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 74 | console_print(id,"[AMX] You have no access to that command") 75 | return PLUGIN_HANDLED 76 | } 77 | // Check arguments 78 | if (read_argc() < 2) { 79 | console_print(id,"[AMX] Usage: amx_bear < health >") 80 | return PLUGIN_HANDLED 81 | } 82 | new sArg1[MAX_NAME_LENGTH+1] 83 | read_argv(1,sArg1,MAX_NAME_LENGTH) 84 | 85 | gBearHealth = str_to_num(sArg1) 86 | client_print(id,print_console,"[AMX] Bear health set to %s",sArg1) 87 | 88 | return PLUGIN_HANDLED 89 | } 90 | 91 | /************************************************************ 92 | * EVENT FUNCTIONS 93 | ************************************************************/ 94 | 95 | public event_respawn(id) 96 | { 97 | if (get_cvar_num("amx_hunting_mode")) { 98 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 99 | show_hudmessage(id,gMsg) 100 | 101 | new sAuthid[MAX_NAME_LENGTH] 102 | get_user_name(id,sAuthid,MAX_NAME_LENGTH) 103 | 104 | // If multiple found, use authid instead 105 | new iPlayer = player_find(id,sAuthid) 106 | if (!iPlayer) { 107 | get_user_authid(id,sAuthid,MAX_NAME_LENGTH) 108 | } 109 | // Set user as a hunter or a bear 110 | if (get_user_team(id)==gHunterTeam) { 111 | server_cmd("amx_rambo ^"%s^" on",sAuthid) 112 | client_print(id,print_chat,"* You are a hunter! Go kill them bears!") 113 | } 114 | else { 115 | set_user_health(id,gBearHealth) 116 | client_print(id,print_chat,"* You are a bear! Rawr!") 117 | engclient_cmd(id,"weapon_knife") 118 | set_user_maxspeed(id,350.0) 119 | } 120 | } 121 | return PLUGIN_CONTINUE 122 | } 123 | 124 | public event_glow() 125 | { 126 | if (get_cvar_num("amx_hunting_mode")) { 127 | new iPlayers[MAX_PLAYERS], iNumPlayers 128 | 129 | get_players(iPlayers,iNumPlayers) 130 | 131 | for (new i = 0; i < iNumPlayers; i++) { 132 | if (get_user_team(iPlayers[i]) == gHunterTeam) { 133 | set_user_rendering(iPlayers[i]) 134 | } 135 | else { 136 | set_user_rendering(iPlayers[i],kRenderFxGlowShell,255,255,255,kRenderNormal,200) 137 | } 138 | } 139 | 140 | } 141 | return PLUGIN_CONTINUE 142 | } 143 | 144 | public event_weapon() 145 | { 146 | if (get_cvar_num("amx_hunting_mode")) { 147 | new iPlayer = read_data(0) 148 | if (get_user_team(iPlayer) != gHunterTeam) { 149 | engclient_cmd(iPlayer,"weapon_knife") 150 | set_user_maxspeed(iPlayer,350.0) 151 | } 152 | } 153 | return PLUGIN_CONTINUE 154 | } 155 | 156 | public event_round_end() 157 | { 158 | if (get_cvar_num("amx_hunting_mode")) { 159 | if (gHunterTeam == 1) { 160 | gHunterTeam = 2 161 | } 162 | else { 163 | gHunterTeam = 1 164 | } 165 | set_task(4.0,"event_reset",0,"") 166 | set_task(5.0,"event_glow",0,"") 167 | } 168 | return PLUGIN_CONTINUE 169 | } 170 | 171 | public event_reset() 172 | { 173 | if (get_cvar_num("amx_hunting_mode")) { 174 | new sAuthid[MAX_NAME_LENGTH] 175 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 176 | 177 | get_players(iPlayers,iNumPlayers) 178 | 179 | for (new i = 0; i < iNumPlayers; i++) { 180 | iPlayer = iPlayers[i] 181 | get_user_authid(iPlayer,sAuthid,MAX_NAME_LENGTH) 182 | server_cmd("amx_nopowers ^"%s^" 1",sAuthid) 183 | } 184 | } 185 | return PLUGIN_CONTINUE 186 | } 187 | 188 | 189 | /************************************************************ 190 | * PLAYER FUNCTIONS 191 | ************************************************************/ 192 | 193 | public player_msg(player,msg[],r,g,b) 194 | { 195 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 196 | show_hudmessage(player,msg) 197 | } 198 | 199 | static player_find(id,arg[]) 200 | { 201 | new player = find_player("bl",arg) 202 | if (player) { 203 | new player2 = find_player("blj",arg) 204 | if (player!=player2){ 205 | console_print(id,"[POWERS] Found multiple clients. Try again.") 206 | return 0 207 | } 208 | } 209 | else { 210 | player = find_player("c",arg) 211 | } 212 | if (!player){ 213 | console_print(id,"[POWERS] Client with that authid or part of nick not found") 214 | return 0 215 | } 216 | return player 217 | } 218 | 219 | 220 | /************************************************************ 221 | * PLUGIN FUNCTIONS 222 | ************************************************************/ 223 | 224 | public plugin_init() 225 | { 226 | register_plugin("Plugin Hunting Season","1.0","mike_cao") 227 | register_concmd("amx_hunting","admin_hunting",ACCESS_LEVEL,"amx_hunting < on | off >") 228 | register_concmd("amx_bear","admin_bear",ACCESS_LEVEL,"amx_bear < health >") 229 | register_event("ResetHUD","event_respawn","be","1=1") 230 | register_event("SendAudio","event_round_end","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw") 231 | register_event("CurWeapon","event_weapon","be","1=1") 232 | register_cvar("amx_hunting_mode","0") 233 | return PLUGIN_CONTINUE 234 | } 235 | -------------------------------------------------------------------------------- /amxx/plugin_ka.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_ka.amx -------------------------------------------------------------------------------- /amxx/plugin_ka.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_ka.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Knife arena. Players can only use knives. 8 | * 9 | */ 10 | 11 | #include 12 | 13 | #define MAX_NAME_LENGTH 32 14 | #define MAX_PLAYERS 32 15 | #define MAX_WEAPONS 32 16 | #define MAX_TEXT_LENGTH 512 17 | 18 | /************************************************************ 19 | * CONFIG 20 | ************************************************************/ 21 | 22 | // Admin access level 23 | #define ACCESS_LEVEL ADMIN_LEVEL_A 24 | 25 | /************************************************************ 26 | * MAIN 27 | ************************************************************/ 28 | 29 | public admin_ka(id) 30 | { 31 | // Check access level 32 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 33 | console_print(id,"[AMX] You have no access to that command") 34 | return PLUGIN_HANDLED 35 | } 36 | // Check arguments 37 | if (read_argc() < 2) { 38 | console_print(id,"[AMX] Usage: amx_ka < 1 | 0 >") 39 | return PLUGIN_HANDLED 40 | } 41 | new sArg1[MAX_NAME_LENGTH+1] 42 | read_argv(1,sArg1,MAX_NAME_LENGTH) 43 | set_cvar_num("amx_knife_mode",str_to_num(sArg1)) 44 | if (equal(sArg1,"1")) { 45 | client_print(id,print_console,"[AMX] Knife Arena is now on.") 46 | msg_display("Knife Arena is now on! :)",0,200,0) 47 | 48 | new iPlayers[MAX_PLAYERS], iNumPlayers 49 | get_players(iPlayers,iNumPlayers) 50 | for (new i = 0; i < iNumPlayers; i++) { 51 | engclient_cmd(iPlayers[i],"weapon_knife") 52 | } 53 | } 54 | else if (equal(sArg1,"0")) { 55 | client_print(id,print_console,"[AMX] Knife Arena is now off.") 56 | msg_display("Knife Arena is now off! :(",0,200,0) 57 | } 58 | return PLUGIN_HANDLED 59 | } 60 | 61 | public msg_display(msg[],r,g,b) 62 | { 63 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 64 | show_hudmessage(0,msg) 65 | } 66 | 67 | /************************************************************ 68 | * EVENT FUNCTIONS 69 | ************************************************************/ 70 | 71 | public event_weapon() 72 | { 73 | new iPlayer = read_data(0) 74 | if (get_cvar_num("amx_knife_mode")) { 75 | engclient_cmd(iPlayer,"weapon_knife") 76 | } 77 | return PLUGIN_CONTINUE 78 | } 79 | 80 | public event_respawn(id) 81 | { 82 | if (get_cvar_num("amx_knife_mode")) { 83 | new sMsg[MAX_TEXT_LENGTH] 84 | format(sMsg,MAX_TEXT_LENGTH,"-= KNIFE ARENA MOD =-^n^nKnives only!") 85 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 86 | show_hudmessage(id,sMsg) 87 | engclient_cmd(id,"weapon_knife") 88 | } 89 | return PLUGIN_CONTINUE 90 | } 91 | 92 | /************************************************************ 93 | * PLUGIN FUNCTIONS 94 | ************************************************************/ 95 | 96 | public plugin_init() 97 | { 98 | register_plugin("Knife Arena","1.0","mike_cao") 99 | register_clcmd("amx_ka","admin_ka",ACCESS_LEVEL,"amx_ka < 0 | 1 >") 100 | register_event("ResetHUD","event_respawn","be","1=1") 101 | register_event("CurWeapon","event_weapon","be","1=1") 102 | register_cvar("amx_knife_mode","0") 103 | return PLUGIN_CONTINUE 104 | } 105 | -------------------------------------------------------------------------------- /amxx/plugin_listen.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_listen.amx -------------------------------------------------------------------------------- /amxx/plugin_listen.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_listen.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Cvar amx_listen: 8 | * "a" - Admins can hear everyone 9 | * "b" - Dead players can hear alive players 10 | * "c" - Alive players can hear dead players 11 | * 12 | */ 13 | #include 14 | 15 | #define MAX_NAME_LENGTH 32 16 | #define MAX_PLAYERS 32 17 | #define MAX_TEXT_LENGTH 256 18 | 19 | #define LISTEN_ADMIN (1<<0) 20 | #define LISTEN_DEAD (1<<1) 21 | #define LISTEN_ALIVE (1<<2) 22 | 23 | /************************************************************ 24 | * CONFIGS 25 | ************************************************************/ 26 | 27 | // Admin access level 28 | #define ACCESS_LEVEL ADMIN_LEVEL_A 29 | 30 | /************************************************************ 31 | * MAIN 32 | ************************************************************/ 33 | 34 | public event_say(id) 35 | { 36 | new iFlags = get_listen_flags() 37 | 38 | // No flags 39 | if (!(iFlags&LISTEN_ADMIN) && !(iFlags&LISTEN_DEAD) && !(iFlags&LISTEN_ALIVE)) { 40 | return PLUGIN_CONTINUE 41 | } 42 | else { 43 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 44 | new sName[MAX_NAME_LENGTH], sCommand[MAX_NAME_LENGTH], sMessage[MAX_TEXT_LENGTH] 45 | 46 | read_argv(0,sCommand,MAX_TEXT_LENGTH) 47 | read_argv(1,sMessage,MAX_TEXT_LENGTH) 48 | get_user_name(id,sName,MAX_NAME_LENGTH) 49 | get_players(iPlayers,iNumPlayers,"c") 50 | 51 | for (new i = 0; i < iNumPlayers; i++) { 52 | iPlayer = iPlayers[i] 53 | // Ignore self, ignore same status messages 54 | if ((iPlayer != id) && (is_user_alive(iPlayer) != is_user_alive(id))) { 55 | // If speaker is alive, echo to dead players 56 | if (is_user_alive(id) && iFlags&LISTEN_DEAD && !is_user_alive(iPlayer)) { 57 | // If team message, echo only to dead team members 58 | if (equal(sCommand,"say_team") && get_user_team(id)==get_user_team(iPlayer)) { 59 | client_print(iPlayer,print_chat, "(TEAM) (ALIVE) %s : %s",sName,sMessage) 60 | } 61 | // Else echo to all dead players 62 | else { 63 | client_print(iPlayer,print_chat, "(ALIVE) %s : %s",sName,sMessage) 64 | } 65 | } 66 | // If speaker is dead, echo to alive players 67 | else if (!is_user_alive(id) && iFlags&LISTEN_ALIVE && is_user_alive(iPlayer)) { 68 | // If team message, echo only to alive team members 69 | if (equal(sCommand,"say_team") && get_user_team(id)==get_user_team(iPlayer)) { 70 | client_print(iPlayer,print_chat, "(TEAM) (DEAD) %s : %s",sName,sMessage) 71 | } 72 | // Else echo to all alive players 73 | else { 74 | client_print(iPlayer,print_chat, "(DEAD) %s : %s",sName,sMessage) 75 | } 76 | } 77 | // If admin and allowed to listen 78 | else if (get_user_flags(iPlayer)&ACCESS_LEVEL && iFlags&LISTEN_ADMIN) { 79 | client_print(iPlayer,print_chat,"(LISTEN) %s : %s",sName,sMessage) 80 | } 81 | } // end if 82 | } // end for 83 | } 84 | return PLUGIN_CONTINUE 85 | } 86 | 87 | public get_listen_flags() 88 | { 89 | new sFlags[24] 90 | get_cvar_string("amx_listen",sFlags,3) 91 | return read_flags(sFlags) 92 | } 93 | 94 | /************************************************************ 95 | * PLUGIN FUNCTIONS 96 | ************************************************************/ 97 | 98 | public plugin_init() 99 | { 100 | register_plugin("Plugin Listen","1.0","mike_cao") 101 | register_clcmd("say","event_say") 102 | register_clcmd("say_team","event_say") 103 | register_cvar("amx_listen","abc") 104 | 105 | return PLUGIN_CONTINUE 106 | } 107 | -------------------------------------------------------------------------------- /amxx/plugin_mysql_ban.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_mysql_ban.amx -------------------------------------------------------------------------------- /amxx/plugin_namechange.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_namechange.amx -------------------------------------------------------------------------------- /amxx/plugin_namechange.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_namechange.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Prevents or punishes players for changing their names. 8 | * 9 | */ 10 | #include 11 | 12 | #define MAX_NAME_LENGTH 32 13 | #define MAX_PLAYERS 32 14 | #define MAX_TEXT_LENGTH 512 15 | 16 | new Float:gSpawnTime 17 | new gNameIndex[MAX_PLAYERS+1][MAX_NAME_LENGTH] 18 | 19 | /************************************************************ 20 | * CONFIG 21 | ************************************************************/ 22 | 23 | // Action to take for players changing their name 24 | // 0 = do nothing 25 | // 1 = change back to old name 26 | // 2 = kill player 27 | // 3 = disconnect player 28 | new NAMECHANGE_ACTION = 3 29 | 30 | // No name change allowed this many seconds after round starts 31 | // Counter-strike only 32 | #define DEFAULT_NAMECHANGE_TIME 30 33 | 34 | /************************************************************ 35 | * PLUGIN FUNCTIONS 36 | ************************************************************/ 37 | 38 | public event_respawn(id) 39 | { 40 | gSpawnTime = get_gametime() 41 | return PLUGIN_CONTINUE 42 | } 43 | 44 | public client_connect(id) 45 | { 46 | copy(gNameIndex[id],MAX_NAME_LENGTH,"") 47 | return PLUGIN_CONTINUE 48 | } 49 | 50 | // Name change 51 | public client_infochanged(id) 52 | { 53 | new sName[MAX_TEXT_LENGTH], sNewName[MAX_TEXT_LENGTH], sMod[MAX_NAME_LENGTH] 54 | get_user_name(id,sName,MAX_TEXT_LENGTH) 55 | get_user_info(id,"name",sNewName,MAX_TEXT_LENGTH) 56 | get_modname(sMod,MAX_NAME_LENGTH) 57 | 58 | if (!equal(sName,sNewName) && !equal(sNewName,gNameIndex[id])) { 59 | if (NAMECHANGE_ACTION <= 0) return PLUGIN_CONTINUE 60 | 61 | if (equal(sMod,"cstrike")) { 62 | if (is_user_alive(id) && get_gametime() > (gSpawnTime + DEFAULT_NAMECHANGE_TIME)) { 63 | client_print(id,print_console,"* You can't change your name %i seconds after the round has started.",DEFAULT_NAMECHANGE_TIME) 64 | } 65 | else { 66 | return PLUGIN_CONTINUE 67 | } 68 | } 69 | 70 | if (NAMECHANGE_ACTION == 1) { 71 | copy(gNameIndex[id],MAX_NAME_LENGTH,sName) 72 | client_cmd(id,"name ^"%s^"",sName) 73 | } 74 | else if (NAMECHANGE_ACTION == 2) { 75 | user_kill(id); 76 | client_cmd(id,"echo * Killed due to name change.") 77 | } 78 | else if (NAMECHANGE_ACTION == 3) { 79 | client_cmd(id,"echo * Reconnecting due to name change.;retry"); 80 | } 81 | } 82 | return PLUGIN_CONTINUE 83 | } 84 | 85 | public plugin_init() 86 | { 87 | register_plugin("Plugin Namechange","1.2","mike_cao") 88 | register_event("ResetHUD","event_respawn","be","1=1") 89 | } 90 | -------------------------------------------------------------------------------- /amxx/plugin_powers.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_powers.amx -------------------------------------------------------------------------------- /amxx/plugin_punish.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_punish.amx -------------------------------------------------------------------------------- /amxx/plugin_rambo.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_rambo.amx -------------------------------------------------------------------------------- /amxx/plugin_rambo.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_punish.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin gives players infinite bullets. 8 | * 9 | */ 10 | #include 11 | #include 12 | 13 | #define MAX_NAME_LENGTH 32 14 | #define MAX_PLAYERS 32 15 | #define MAX_WEAPONS 32 16 | #define MAX_TEXT_LENGTH 512 17 | 18 | /************************************************************ 19 | * CONFIGS 20 | ************************************************************/ 21 | 22 | // Admin access level 23 | #define ACCESS_LEVEL ADMIN_LEVEL_A 24 | 25 | /************************************************************ 26 | * MAIN 27 | ************************************************************/ 28 | 29 | // Globals 30 | new gMod[MAX_NAME_LENGTH] 31 | new gRamboIndex[MAX_PLAYERS+1] 32 | 33 | // Weapon names for DOD 34 | new gDodWeapons[40][] = { 35 | "","amerknife","gerknife","colt","luger","garand","scopedkar","thompson","mp44", 36 | "spring","kar","bar","mp40","grenade","grenade2","grenade","grenade2", 37 | "mg42","30cal","spade","m1carbine","mg34","greasegun","fg42","k43","enfield", 38 | "sten","bren","webly","bazooka","pschreck","piat","scoped_fg42","fcarbine", 39 | "bayonet","scoped_enfield","mills_bomb","brit_knife","garandbutt","enf_bayonet" 40 | } 41 | 42 | public admin_rambo(id) 43 | { 44 | // Check access level 45 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 46 | console_print(id,"[AMX] You have no access to that command") 47 | return PLUGIN_HANDLED 48 | } 49 | // Check arguments 50 | if (read_argc() < 2) { 51 | console_print(id,"[AMX] Usage: amx_rambo < authid | part of nick > < 1 | 0 >") 52 | return PLUGIN_HANDLED 53 | } 54 | 55 | // Find target player 56 | new sArg1[MAX_NAME_LENGTH] 57 | new sArg2[MAX_NAME_LENGTH] 58 | read_argv(1,sArg1,MAX_NAME_LENGTH) 59 | read_argv(2,sArg2,MAX_NAME_LENGTH) 60 | 61 | // Player checks 62 | new iPlayer = player_find(id,sArg1) 63 | if (iPlayer) { 64 | new sName[MAX_NAME_LENGTH] 65 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 66 | if (str_to_num(sArg2) == 1 || equal(sArg2,"on")) { 67 | gRamboIndex[iPlayer] = 1 68 | client_print(id,print_console,"[AMX] %s is now rambo.",sName) 69 | } 70 | else { 71 | gRamboIndex[iPlayer] = 0 72 | client_print(id,print_console,"[AMX] %s is no longer rambo.",sName) 73 | } 74 | } 75 | return PLUGIN_HANDLED 76 | } 77 | 78 | public event_weapon() 79 | { 80 | new iPlayer = read_data(0) 81 | new iClip, iAmmo, iOrigin[3] 82 | new sWeapon[MAX_NAME_LENGTH] 83 | 84 | new iWeapon = get_user_weapon(iPlayer, iClip, iAmmo) 85 | 86 | if (iClip == 0 && gRamboIndex[iPlayer] == 1) { 87 | if (equal(gMod,"dod")) { 88 | format(sWeapon,MAX_NAME_LENGTH,"weapon_%s",gDodWeapons[iWeapon]) 89 | } 90 | else { 91 | get_weaponname(iWeapon,sWeapon,MAX_NAME_LENGTH) 92 | } 93 | get_user_origin(iPlayer,iOrigin) 94 | iOrigin[2] -= 1000 95 | set_user_origin(iPlayer,iOrigin) 96 | engclient_cmd(iPlayer,"drop",sWeapon) 97 | give_item(iPlayer,sWeapon) 98 | iOrigin[2] += 1010 99 | set_user_origin(iPlayer,iOrigin) 100 | engclient_cmd(iPlayer,sWeapon) 101 | } 102 | 103 | return PLUGIN_CONTINUE 104 | } 105 | 106 | /************************************************************ 107 | * PLAYER FUNCTIONS 108 | ************************************************************/ 109 | 110 | public player_find(id,arg[]) 111 | { 112 | new player = find_player("bl",arg) 113 | if (player){ 114 | new player2 = find_player("blj",arg) 115 | if (player!=player2){ 116 | console_print(id,"[AMX] Found multiple clients. Try again.") 117 | return 0 118 | } 119 | } 120 | else { 121 | player = find_player("c",arg) 122 | } 123 | if (!player){ 124 | console_print(id,"[AMX] Client with that authid or part of nick not found") 125 | return 0 126 | } 127 | return player 128 | } 129 | 130 | /************************************************************ 131 | * PLUGIN FUNCTIONS 132 | ************************************************************/ 133 | 134 | public client_connect(id) 135 | { 136 | gRamboIndex[id] = 0 137 | return PLUGIN_CONTINUE 138 | } 139 | 140 | public client_disconnect(id) 141 | { 142 | gRamboIndex[id] = 0 143 | return PLUGIN_CONTINUE 144 | } 145 | 146 | public plugin_init() 147 | { 148 | register_plugin("Rambo","1.0","mike_cao") 149 | register_event("CurWeapon","event_weapon","be","1=1") 150 | register_concmd("amx_rambo","admin_rambo",ACCESS_LEVEL,"amx_rambo < authid | part of nick > < on | off >") 151 | get_modname(gMod,MAX_NAME_LENGTH) 152 | return PLUGIN_CONTINUE 153 | } 154 | -------------------------------------------------------------------------------- /amxx/plugin_slash.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_slash.amx -------------------------------------------------------------------------------- /amxx/plugin_slash.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_slash.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * This plugin allows admins to execute amx commands 8 | * using 'say' and a slash '/'. It can also execute 9 | * a command on all players or a team using '@all' and 10 | * '@team' in place of the authid/nick parameter. 11 | * 12 | * Examples: 13 | * To kick a player type '/kick playername' 14 | * To kick all players type '/kick @all' 15 | * To kick all players on a team type '/kick @team:TEAMID' 16 | * To ban all players for 10 minutes, type '/ban 10 @all' 17 | * 18 | * Additional Commands: 19 | * Includes an IRC style '/me' command. If you say 20 | * '/me sucks', it'll replace the '/me' with your name 21 | * and print it to everyone. 22 | * 23 | */ 24 | 25 | #include 26 | 27 | #define MAX_NAME_LENGTH 32 28 | #define MAX_TEXT_LENGTH 192 29 | #define MAX_PLAYERS 32 30 | 31 | public admin_slash(id) 32 | { 33 | new sName[MAX_NAME_LENGTH+1] 34 | new sArg[MAX_NAME_LENGTH+1] 35 | read_argv(1,sArg,MAX_NAME_LENGTH) 36 | 37 | // Check for '/' char 38 | if ( sArg[0] == '/' ) { 39 | new sCommand[MAX_TEXT_LENGTH+1] 40 | new sMessage[MAX_TEXT_LENGTH+1] 41 | new sTemp[MAX_TEXT_LENGTH+1] 42 | 43 | // Get data 44 | read_args(sMessage,MAX_TEXT_LENGTH) 45 | remove_quotes(sMessage) 46 | replace(sMessage,MAX_TEXT_LENGTH,"/","") 47 | 48 | // For all players 49 | if ( containi(sMessage,"@all") != -1 ) { 50 | new iPlayers[MAX_PLAYERS], iNumPlayers 51 | get_players(iPlayers,iNumPlayers) 52 | 53 | for (new i = 0; i < iNumPlayers; i++) { 54 | get_user_name(iPlayers[i],sName,MAX_NAME_LENGTH) 55 | copy(sTemp,MAX_TEXT_LENGTH,sMessage) 56 | replace(sTemp,MAX_TEXT_LENGTH,"@all","^"@name^"") 57 | replace(sTemp,MAX_TEXT_LENGTH,"@name",sName) 58 | format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sTemp) 59 | client_cmd(id,sCommand) 60 | } 61 | copyc(sCommand,MAX_NAME_LENGTH,sTemp,' ') 62 | client_print(id,print_chat,"[AMX] Command ^"%s^" executed on all players",sCommand) 63 | } 64 | // For a team 65 | else if ( containi(sMessage,"@team:") != -1 ) { 66 | new sTeam[MAX_NAME_LENGTH] 67 | new sRemove[MAX_TEXT_LENGTH] 68 | new sMod[MAX_NAME_LENGTH] 69 | 70 | // Get team 71 | copy(sTemp,MAX_TEXT_LENGTH,sMessage) 72 | copyc(sRemove,MAX_TEXT_LENGTH,sTemp,'@') 73 | replace(sTemp,MAX_TEXT_LENGTH,sRemove,"") 74 | copyc(sTeam,MAX_TEXT_LENGTH,sTemp,' ') 75 | 76 | if ( containi(sTeam,"@team:") != -1 ) { 77 | replace(sMessage,MAX_TEXT_LENGTH,sTeam,"^"@name^"") 78 | replace(sTeam,MAX_TEXT_LENGTH,"@team:","") 79 | 80 | // Get mod 81 | get_modname(sMod,MAX_NAME_LENGTH) 82 | 83 | // Shortcuts for Counter-strike 84 | if (equal(sMod,"cstrike")) { 85 | if ( equal(sTeam,"T") ) { 86 | copy(sTeam,MAX_NAME_LENGTH,"TERRORIST") 87 | } 88 | else if ( equal(sTeam,"S") ) { 89 | copy(sTeam,MAX_NAME_LENGTH,"SPECTATOR") 90 | } 91 | } 92 | } 93 | else { 94 | client_print(id,print_chat,"[AMX] Team identifier not recognized") 95 | return PLUGIN_HANDLED 96 | } 97 | 98 | new iPlayers[MAX_PLAYERS], iNumPlayers 99 | get_players(iPlayers,iNumPlayers,"e",sTeam) 100 | 101 | if ( iNumPlayers ) { 102 | for (new i = 0; i < iNumPlayers; i++) { 103 | get_user_name(iPlayers[i],sName,MAX_NAME_LENGTH) 104 | copy(sTemp,MAX_TEXT_LENGTH,sMessage) 105 | replace(sTemp,MAX_TEXT_LENGTH,"@name",sName) 106 | format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sTemp) 107 | client_cmd(id,sCommand) 108 | } 109 | copyc(sCommand,MAX_NAME_LENGTH,sTemp,' ') 110 | client_print(id,print_chat,"[AMX] Command ^"%s^" executed on team ^"%s^"",sCommand,sTeam) 111 | } 112 | else { 113 | client_print(id,print_chat,"[AMX] There are no players on team ^"%s^"",sTeam) 114 | } 115 | } 116 | else { 117 | format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sMessage) 118 | client_cmd(id,sCommand) 119 | } 120 | 121 | return PLUGIN_HANDLED 122 | } 123 | return PLUGIN_CONTINUE 124 | } 125 | 126 | public admin_me(id) 127 | { 128 | new sName[MAX_NAME_LENGTH+1] 129 | new sMessage[MAX_TEXT_LENGTH+1] 130 | 131 | // Get data 132 | get_user_name(id,sName,MAX_NAME_LENGTH) 133 | read_args(sMessage,MAX_TEXT_LENGTH) 134 | remove_quotes(sMessage) 135 | 136 | // Display message only to same status players 137 | new bAlive = is_user_alive(id) 138 | for (new i = 1; i <= MAX_PLAYERS; i++) { 139 | if(is_user_alive(i) == bAlive) { 140 | client_print(i,print_chat,"%s %s",sName,sMessage) 141 | } 142 | } 143 | return PLUGIN_HANDLED 144 | } 145 | 146 | public plugin_init() 147 | { 148 | register_plugin("Plugin Slash","1.1","mike_cao") 149 | register_clcmd("say","admin_slash",0,"say /command < params >") 150 | register_clcmd("amx_me","admin_me",0,"amx_me < text >") 151 | return PLUGIN_CONTINUE 152 | } 153 | -------------------------------------------------------------------------------- /amxx/plugin_stealthwar.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_stealthwar.amx -------------------------------------------------------------------------------- /amxx/plugin_stealthwar.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_stealthwar.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Makes the winning team invisible. Invisible 8 | * players can only use knives. 9 | * 10 | */ 11 | 12 | #include 13 | #include 14 | 15 | #define MAX_NAME_LENGTH 32 16 | #define MAX_PLAYERS 32 17 | #define MAX_TEXT_LENGTH 512 18 | #define MAX_SOUNDS 2 19 | 20 | #define TE_SMOKE 5 21 | 22 | #define SOUND_FLASH1 0 23 | #define SOUND_FLASH2 1 24 | 25 | /************************************************************ 26 | * CONFIG 27 | ************************************************************/ 28 | 29 | // Admin access level 30 | #define ACCESS_LEVEL ADMIN_LEVEL_A 31 | 32 | /************************************************************ 33 | * MAIN 34 | ************************************************************/ 35 | 36 | new gStealthTeam = 0 37 | new gmsgStatusText 38 | 39 | // Sprites 40 | new spr_smoke 41 | 42 | // Sounds 43 | new gSoundIndex[MAX_SOUNDS][MAX_NAME_LENGTH] 44 | 45 | public admin_stealthwar(id) 46 | { 47 | // Check access level 48 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 49 | console_print(id,"[AMX] You have no access to that command") 50 | return PLUGIN_HANDLED 51 | } 52 | // Check arguments 53 | if (read_argc() < 2) { 54 | console_print(id,"[AMX] Usage: amx_stealthwar < 1 | 0 >") 55 | return PLUGIN_HANDLED 56 | } 57 | new sArg1[MAX_NAME_LENGTH+1] 58 | read_argv(1,sArg1,MAX_NAME_LENGTH) 59 | set_cvar_num("amx_stealthwar_mode",str_to_num(sArg1)) 60 | if (equal(sArg1,"1")) { 61 | client_print(id,print_console,"[AMX] Stealth War is now on.") 62 | msg_display("Stealth War is now on! :)",0,200,0) 63 | } 64 | else if (equal(sArg1,"0")) { 65 | client_print(id,print_console,"[AMX] Stealth War is now off.") 66 | msg_display("Stealth War is now off! :(",0,200,0) 67 | gStealthTeam = 0 68 | event_reset() 69 | } 70 | return PLUGIN_HANDLED 71 | } 72 | 73 | public msg_display(msg[],r,g,b) 74 | { 75 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 76 | show_hudmessage(0,msg) 77 | } 78 | 79 | 80 | 81 | /************************************************************ 82 | * EVENT FUNCTIONS 83 | ************************************************************/ 84 | 85 | public event_stealth() 86 | { 87 | new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers 88 | new sName[MAX_NAME_LENGTH] 89 | new iOrigin[3] 90 | get_players(iPlayers,iNumPlayers) 91 | 92 | for (new i = 0; i < iNumPlayers; i++) { 93 | iPlayer = iPlayers[i] 94 | get_user_name(iPlayer,sName,MAX_NAME_LENGTH) 95 | if (get_user_team(iPlayer)==gStealthTeam) { 96 | set_user_rendering(iPlayer,kRenderFxNone,0,0,0,kRenderTransAlpha,0) 97 | engclient_cmd(iPlayer,"weapon_knife") 98 | get_user_origin(iPlayer,iOrigin) 99 | fx_stealth(iOrigin) 100 | emit_sound(iPlayer,CHAN_AUTO,gSoundIndex[random_num(0,1)],VOL_NORM,ATTN_NORM,0,PITCH_NORM) 101 | } 102 | } 103 | } 104 | 105 | public event_reset() 106 | { 107 | new iPlayers[MAX_PLAYERS], iNumPlayers 108 | get_players(iPlayers,iNumPlayers) 109 | for (new i = 0; i < iNumPlayers; i++) { 110 | set_user_rendering(iPlayers[i]) 111 | } 112 | } 113 | 114 | public event_respawn(id) 115 | { 116 | if (get_cvar_num("amx_stealthwar_mode")) { 117 | new sMsg[MAX_TEXT_LENGTH] 118 | new sTeam[MAX_TEXT_LENGTH] 119 | if (gStealthTeam==1) { 120 | copy(sTeam,MAX_NAME_LENGTH,"TERRORIST") 121 | } 122 | else if (gStealthTeam==2){ 123 | copy(sTeam,MAX_NAME_LENGTH,"COUNTER-TERRORIST") 124 | } 125 | format(sMsg,MAX_TEXT_LENGTH,"-= STEALTH WARS MOD =-^n^nThe %s team is invisible and armed with knives!",sTeam) 126 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 127 | show_hudmessage(id,sMsg) 128 | } 129 | return PLUGIN_CONTINUE 130 | } 131 | 132 | public event_round_t() 133 | { 134 | if (get_cvar_num("amx_stealthwar_mode")) { 135 | new sMsg[MAX_TEXT_LENGTH] 136 | gStealthTeam = 1 137 | format(sMsg,MAX_TEXT_LENGTH,"The TERRORIST team won invisible powers!") 138 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 139 | show_hudmessage(0,sMsg) 140 | set_task(4.0,"event_reset",0,"") 141 | set_task(6.0,"event_stealth",0,"") 142 | } 143 | return PLUGIN_CONTINUE 144 | } 145 | 146 | public event_round_ct() 147 | { 148 | if (get_cvar_num("amx_stealthwar_mode")) { 149 | new sMsg[MAX_TEXT_LENGTH] 150 | gStealthTeam = 2 151 | format(sMsg,MAX_TEXT_LENGTH,"The COUNTER-TERRORIST team won invisible powers!") 152 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,6.0,0.5,0.15,1) 153 | show_hudmessage(0,sMsg) 154 | set_task(4.0,"event_reset",0,"") 155 | set_task(6.0,"event_stealth",0,"") 156 | } 157 | return PLUGIN_CONTINUE 158 | } 159 | 160 | public event_round_draw() 161 | { 162 | if (get_cvar_num("amx_stealthwar_mode")) { 163 | gStealthTeam = random_num(1,2) 164 | set_task(4.0,"event_reset",0,"") 165 | set_task(6.0,"event_stealth",0,"") 166 | } 167 | return PLUGIN_CONTINUE 168 | } 169 | 170 | public event_weapon() 171 | { 172 | new iPlayer = read_data(0) 173 | new iWeapon = read_data(2) 174 | if (get_cvar_num("amx_stealthwar_mode") && get_user_team(iPlayer)==gStealthTeam && iWeapon != CSW_C4) { 175 | engclient_cmd(iPlayer,"weapon_knife") 176 | } 177 | return PLUGIN_CONTINUE 178 | } 179 | 180 | public event_death() 181 | { 182 | new iVictim = read_data(2) 183 | if (get_cvar_num("amx_stealthwar_mode") && get_user_team(iVictim)==gStealthTeam) { 184 | set_user_rendering(iVictim) 185 | } 186 | return PLUGIN_CONTINUE 187 | } 188 | 189 | public event_damage() 190 | { 191 | if (get_cvar_num("amx_stealthwar_mode")) { 192 | new iVictim = read_data(0) 193 | new iDamage = read_data(2) 194 | if (get_user_team(iVictim)==gStealthTeam) { 195 | if (get_user_health(iVictim) > 0) { 196 | // Heavy damage 197 | if (iDamage > 30) { 198 | player_vis_on(iVictim,192) 199 | } 200 | // Medium damage 201 | else if (iDamage > 15) { 202 | player_vis_on(iVictim,128) 203 | } 204 | // Low damage 205 | else { 206 | player_vis_on(iVictim,64) 207 | } 208 | } 209 | } 210 | } 211 | return PLUGIN_CONTINUE 212 | } 213 | 214 | public event_msg() 215 | { 216 | if (get_cvar_num("amx_stealthwar_mode")) { 217 | new sMsg[MAX_TEXT_LENGTH] 218 | format(sMsg,MAX_TEXT_LENGTH,"Stealth Wars Mod") 219 | message_begin(MSG_ALL,gmsgStatusText,{0,0,0}) 220 | write_byte(0) 221 | write_string(sMsg) 222 | message_end() 223 | } 224 | return PLUGIN_HANDLED 225 | } 226 | 227 | public fx_stealth(origin[3]) { 228 | // Smoke 229 | message_begin( MSG_BROADCAST,SVC_TEMPENTITY) 230 | write_byte(TE_SMOKE) 231 | write_coord(origin[0]) 232 | write_coord(origin[1]) 233 | write_coord(origin[2]) 234 | write_short(spr_smoke) 235 | write_byte(20) // scale 236 | write_byte(20) // framerate 237 | message_end() 238 | } 239 | 240 | /************************************************************ 241 | * PLAYER FUNCTIONS 242 | ************************************************************/ 243 | 244 | public player_vis_on(player,amount) 245 | { 246 | new Params[1] 247 | Params[0] = player 248 | set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount) 249 | set_task(1.0,"player_vis_off",0,Params,1); 250 | return PLUGIN_CONTINUE 251 | } 252 | 253 | public player_vis_off(Params[]) 254 | { 255 | set_user_rendering(Params[0],kRenderFxNone,0,0,0,kRenderTransAlpha,0) 256 | return PLUGIN_CONTINUE 257 | } 258 | 259 | /************************************************************ 260 | * PLUGIN FUNCTIONS 261 | ************************************************************/ 262 | 263 | public plugin_precache() 264 | { 265 | copy(gSoundIndex[SOUND_FLASH1],MAX_NAME_LENGTH,"weapons/flashbang-1.wav") 266 | copy(gSoundIndex[SOUND_FLASH2],MAX_NAME_LENGTH,"weapons/flashbang-2.wav") 267 | 268 | for (new i = 0; i < MAX_SOUNDS; i++) { 269 | precache_sound(gSoundIndex[i]) 270 | } 271 | 272 | spr_smoke = precache_model("sprites/steam1.spr") 273 | } 274 | 275 | public plugin_init() 276 | { 277 | register_plugin("Stealth War","1.0","mike_cao") 278 | register_clcmd("amx_stealthwar","admin_stealthwar",ACCESS_LEVEL,"amx_ka < 0 | 1 >") 279 | register_event("ResetHUD","event_respawn","be","1=1") 280 | register_cvar("amx_stealthwar_mode","0") 281 | register_event("SendAudio","event_round_t","a","2&%!MRAD_terwin") 282 | register_event("SendAudio","event_round_ct","a","2&%!MRAD_ctwin") 283 | register_event("SendAudio","event_round_draw","a","2&%!MRAD_rounddraw") 284 | register_event("CurWeapon","event_weapon","be","1=1") 285 | register_event("DeathMsg","event_death","a") 286 | register_event("Damage","event_damage","b","2!0","3=0","4!0") 287 | 288 | gmsgStatusText = get_user_msgid("StatusText") 289 | set_task(0.5,"event_msg",0,"",0,"b") 290 | 291 | return PLUGIN_CONTINUE 292 | } 293 | -------------------------------------------------------------------------------- /amxx/plugin_targetwar.amx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikecao/amx-plugins/12fa28f7a91bf10d515abc853276493b05516576/amxx/plugin_targetwar.amx -------------------------------------------------------------------------------- /amxx/plugin_targetwar.sma: -------------------------------------------------------------------------------- 1 | /* 2 | * AMXMODX script. 3 | * (plugin_targetwar.sma) 4 | * by mike_cao 5 | * This file is provided as is (no warranties). 6 | * 7 | * Target war mod. One person on each team is randomly 8 | * selected to be a target. Only the target can die, 9 | * everyone else has immunity. If the target dies, another 10 | * player is randomly selected to be a target. 11 | * 12 | * Cvar: 13 | * amx_targetwar_mode <1|0> 14 | * 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #define MAX_NAME_LENGTH 32 21 | #define MAX_PLAYERS 32 22 | #define MAX_TEXT_LENGTH 512 23 | 24 | #define FX_MULT (1<<12) 25 | 26 | /************************************************************ 27 | * CONFIG 28 | ************************************************************/ 29 | 30 | // Admin access level 31 | #define ACCESS_LEVEL ADMIN_LEVEL_A 32 | 33 | 34 | /************************************************************ 35 | * MAIN 36 | ************************************************************/ 37 | 38 | new gMsg[MAX_TEXT_LENGTH] = {"-= TARGET WARS MOD =-^n^nSearch and destroy the target players."} 39 | new gTargetT = 0 40 | new gTargetCT = 0 41 | new gmsgFade 42 | 43 | public admin_targetwar(id) 44 | { 45 | // Check access level 46 | if (!(get_user_flags(id)&ACCESS_LEVEL)) { 47 | console_print(id,"[AMX] You have no access to that command") 48 | return PLUGIN_HANDLED 49 | } 50 | // Check arguments 51 | if (read_argc() < 2) { 52 | console_print(id,"[AMX] Usage: amx_targetwar < 1 | 0 >") 53 | return PLUGIN_HANDLED 54 | } 55 | new sArg1[MAX_NAME_LENGTH+1] 56 | read_argv(1,sArg1,MAX_NAME_LENGTH) 57 | set_cvar_num("amx_targetwar_mode",str_to_num(sArg1)) 58 | if (equal(sArg1,"1")) { 59 | client_print(id,print_console,"[AMX] Target wars is now on.") 60 | player_msg(0,"Target wars is now on! :)",0,200,0) 61 | } 62 | else if (equal(sArg1,"0")) { 63 | client_print(id,print_console,"[AMX] Target wars is now off.") 64 | player_msg(0,"Target wars is now off! :(",0,200,0) 65 | } 66 | return PLUGIN_HANDLED 67 | } 68 | 69 | /************************************************************ 70 | * EVENT FUNCTIONS 71 | ************************************************************/ 72 | 73 | public event_respawn(id) 74 | { 75 | if (get_cvar_num("amx_targetwar_mode")) { 76 | set_hudmessage(0,255,0,-1.0,0.25,0,6.0,10.0,0.5,0.15,1) 77 | show_hudmessage(id,gMsg) 78 | } 79 | return PLUGIN_CONTINUE 80 | } 81 | 82 | public event_death() 83 | { 84 | new iVictim = read_data(2) 85 | if (iVictim == gTargetT) { 86 | get_target_t() 87 | } 88 | else if (iVictim == gTargetCT) { 89 | get_target_ct() 90 | } 91 | return PLUGIN_CONTINUE 92 | } 93 | 94 | public event_target() 95 | { 96 | if (get_cvar_num("amx_targetwar_mode")) { 97 | new iPlayers[MAX_PLAYERS], iNumPlayers 98 | get_players(iPlayers,iNumPlayers) 99 | 100 | for (new i = 0; i < iNumPlayers; i++) { 101 | set_user_godmode(iPlayers[i],1) 102 | } 103 | 104 | get_target_t() 105 | get_target_ct() 106 | } 107 | return PLUGIN_CONTINUE 108 | } 109 | 110 | public event_round_end() 111 | { 112 | if (get_cvar_num("amx_targetwar_mode")) { 113 | set_task(5.0,"event_target",0,"") 114 | } 115 | return PLUGIN_CONTINUE 116 | } 117 | 118 | 119 | /************************************************************ 120 | * HELPER FUNCTIONS 121 | ************************************************************/ 122 | 123 | public player_msg(player,msg[],r,g,b) 124 | { 125 | set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2) 126 | show_hudmessage(player,msg) 127 | } 128 | 129 | public get_target_ct() 130 | { 131 | new iPlayers[MAX_PLAYERS], iNumPlayers 132 | new sName[MAX_NAME_LENGTH] 133 | 134 | get_players(iPlayers,iNumPlayers,"ae","CT") 135 | gTargetCT = iPlayers[random_num(0,iNumPlayers-1)] 136 | 137 | set_user_godmode(gTargetCT) 138 | fx_glow(gTargetCT,0,100,255,20) 139 | fx_screen_fade(gTargetCT,1,0,0,0,100,255,255) 140 | 141 | get_user_name(gTargetCT,sName,MAX_NAME_LENGTH) 142 | client_print(0,print_chat,"***** CT Target: %s *****",sName) 143 | } 144 | 145 | public get_target_t() 146 | { 147 | new iPlayers[MAX_PLAYERS], iNumPlayers 148 | new sName[MAX_NAME_LENGTH] 149 | 150 | get_players(iPlayers,iNumPlayers,"ae","TERRORIST") 151 | gTargetT = iPlayers[random_num(0,iNumPlayers-1)] 152 | 153 | set_user_godmode(gTargetT) 154 | fx_glow(gTargetT,255,0,0,20) 155 | fx_screen_fade(gTargetT,1,0,0,255,0,0,255) 156 | 157 | get_user_name(gTargetT,sName,MAX_NAME_LENGTH) 158 | client_print(0,print_chat,"***** T Target: %s *****",sName) 159 | } 160 | 161 | 162 | static fx_glow(player,r,g,b,size) 163 | { 164 | set_user_rendering(player,kRenderFxGlowShell,r,g,b,kRenderNormal,size) 165 | return PLUGIN_CONTINUE 166 | } 167 | 168 | static fx_screen_fade(player,duration,hold,type,r,g,b,alpha) 169 | { 170 | message_begin(MSG_ONE,gmsgFade,{0,0,0},player) 171 | write_short(duration*FX_MULT) // fade duration 172 | write_short(hold*FX_MULT) // fade hold time 173 | write_short(type) // fade type (in/out) 174 | write_byte(r) // fade red 175 | write_byte(g) // fade green 176 | write_byte(b) // fade blue 177 | write_byte(alpha) // fade alpha 178 | message_end() 179 | } 180 | 181 | /************************************************************ 182 | * PLUGIN FUNCTIONS 183 | ************************************************************/ 184 | 185 | public plugin_init() 186 | { 187 | register_plugin("Plugin Hunting Season","1.0","mike_cao") 188 | register_concmd("amx_targetwar","admin_targetwar",ACCESS_LEVEL,"amx_targetwar < on | off >") 189 | register_event("DeathMsg","event_death","a") 190 | register_event("ResetHUD","event_respawn","be","1=1") 191 | register_event("SendAudio","event_round_end","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw") 192 | register_cvar("amx_targetwar_mode","0") 193 | 194 | gmsgFade = get_user_msgid("ScreenFade") 195 | 196 | return PLUGIN_CONTINUE 197 | } 198 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | AMX Plugins 2 | === 3 | 4 | These plugins are for use on your Counter-Strike or Day of Defeat servers running either AMX or AMX Mod X (AMXX). 5 | 6 | Included Plugins 7 | --- 8 | 9 | ### plugin_cloakwar 10 | 11 | Gives the winning team cloaking powers. Cloaked players 12 | are revealed only for a few seconds after firing but 13 | they only have 1 health. 14 | 15 | ### plugin_clonewar 16 | 17 | Makes all players use the same model. 18 | 19 | ### plugin_csevents 20 | 21 | Announces events for Counter-Strike. 22 | 23 | * Bomb exploded 24 | * Bomb planted 25 | * Bomb defused 26 | * Bomb being planted 27 | * Bomb being defused 28 | * Player spawned with bomb 29 | * Player picked up bomb 30 | * Player dropped bomb 31 | * Audio bomb countdown 32 | * Hostage touched 33 | * Hostage rescued 34 | * Hostage killed (with punishment) 35 | * Headshots (multiple messages) 36 | * Knife kills (multiple messages) 37 | * Grenade kills (multiple messages) 38 | * Grenade suicides 39 | * Player spawned as VIP 40 | * VIP killed 41 | * VIP escaped 42 | * VIP failed to escape 43 | * First kill (bonus health/money) 44 | * Killstreak 45 | 46 | ### plugin_freezetag 47 | 48 | Players freeze each other with their knives. Players 49 | are unfrozen by their teammates. A team wins by freezing 50 | all the players on the other team. (My favorite plugin) 51 | 52 | ### plugin_fun 53 | 54 | Provides admin commands for all fun functions. 55 | 56 | * amx_godmode - gives player gomode 57 | * amx_noclip - gives player noclip 58 | * amx_frags - changes player frags 59 | * amx_armor - changes player armor 60 | * amx_health - changes player health 61 | * amx_maxspeed - changes player maxspeed 62 | * amx_gravity - changes player gravity 63 | * amx_money - changes player money 64 | * amx_give - give a player a weapon/item 65 | * amx_weapon - gives player weapons 66 | * amx_tp - teleports a player to a coordinate 67 | * amx_tpsave - saves a coordinate for teleporting 68 | * amx_nohead - turns off headshots for a player 69 | * amx_glow - makes a player glow 70 | * amx_spawn - makes a player spawn 71 | * amx_footsteps - changes player footsteps 72 | * amx_lights - change map lighting 73 | 74 | ### plugin_funman 75 | 76 | Fun manager. Turns on different fun modes based on the current map. 77 | 78 | ### plugin_gamble 79 | 80 | This plugin allows players to gamble for certain 81 | powers by saying "gamble!". They can also receive 82 | negative effects. All powers are time limited. 83 | 84 | * God Mode - Player cannot be killed 85 | * Shield - Player not affected by any powers 86 | * Speed - Player runs much faster 87 | * Slow - Player runs much slower 88 | * Stealth - Player is invisible 89 | * Quad Damage - Player does 4x damage 90 | * Protect - Player receives 1/4 damage 91 | * Rambo - Player has infinite armor and ammo 92 | * Leech - Player gets health from damage to others 93 | * Absorb - Player absorbs damage into health 94 | * Reflect - player does mirror damage to attackers 95 | * Curse - Player receives mirror damage for attacking (can spread) 96 | * Regen - Player slowly regains health 97 | * Poison - Player slowly loses health (can spread) 98 | * Death - Countdown until player death (can spread) 99 | * Fireball - Player turns into a giant fireball and hurts others around him 100 | * Medic - Player heals others around him 101 | * Ghost - Player can fly through walls 102 | * Hologram - Player becomes a hologram: can't harm others or be harmed 103 | * Timebomb - Player becomes a timebomb. Explosion kills surrounding players. 104 | * Oneshot - Bullets kill in one shot 105 | * Explodeshot - Bullets do explosive damage 106 | * Stunshot - Bullets have stun effect 107 | * Cloak - Player is cloaked until he fires 108 | * Lasershot - Player fires a powerful laser 109 | * Grenadier - Player gets infinite grenades 110 | * Flashshot - Bullets have a blinding effect 111 | * Vampire - Players absorbs health from others around him 112 | * AGshot - Bullets have a anti-gravity effect 113 | * Splintershot - bullets splinter on impact 114 | * Disarm - Player loses all his weapons 115 | * Bury - Player is buried in the ground and can't move 116 | * Blind - Player is blinded 117 | * Drunk - Player staggers and has bad vision 118 | * Bunny - Player jumps constantly 119 | * Poor - Player loses all his money 120 | 121 | **Requires plugin_powers and plugin_punish to work.** 122 | 123 | ### plugin_glowdamage 124 | 125 | This plugin makes players glow briefly when 126 | damaged. There are team-based glow colors 127 | as well as different colors for the amount 128 | of damage dealt. 129 | 130 | ### plugin_gore 131 | 132 | This plugin adds extra gore effects. 133 | 134 | * Headshot blood 135 | * Extra blood effects 136 | * Bleeding on low health 137 | * Gib explosion (knife, HE, high damage only) 138 | 139 | ### plugin_hunting 140 | 141 | Hunting season mod. One team (hunters) have infinite ammo and 142 | armor. The other team (bears) have lots of health and knives. 143 | Teams switch roles every round. 144 | 145 | **Requires plugin_powers to work.** 146 | 147 | ### plugin_ka 148 | 149 | Knife arena. Players can only use knives. 150 | 151 | ### plugin_listen 152 | 153 | Changes who can hear who. 154 | 155 | * Admins can hear everyone 156 | * Dead players can hear alive players 157 | * Alive players can hear dead players 158 | 159 | ### plugin_mysql_ban 160 | 161 | Simple ban management using a MySQL database. 162 | 163 | Create a table to hold bans in your mysql database: 164 | 165 | `CREATE TABLE banned ( 166 | banid varchar(32) NOT NULL PRIMARY KEY, 167 | banname varchar(32), 168 | adminid varchar(32), 169 | adminname varchar(32), 170 | reason varchar(255), 171 | bandatetime int unsigned default 0 172 | );` 173 | 174 | ### plugin_namechange 175 | 176 | Prevents or punishes players for changing their names. 177 | 178 | ### plugin_powers 179 | 180 | This plugin gives admins the ability to set positive 181 | and negative effects on players. 182 | 183 | * amx_god - player cannot be killed (different from set_user_godmode) 184 | * amx_shield - player not affected by any powers 185 | * amx_speed - player speed is modified 186 | * amx_stealth - player visibility is modified 187 | * amx_harm - player damage given is modified 188 | * amx_protect - player damage received is modified 189 | * amx_rambo - player has infinite armor and ammo 190 | * amx_leech - player gets health from damage to others 191 | * amx_absorb - player absorbs damage into health 192 | * amx_reflect - player does mirror damage on attackers 193 | * amx_curse - player receives mirror damage for attacking (can spread) 194 | * amx_regen - player slowly regains health 195 | * amx_poison - player slowly loses health (can spread) 196 | * amx_death - countdown until player death (can spread) 197 | * amx_fireball - player hurts others around him 198 | * amx_medic - player heals others around him 199 | * amx_ghost - player can fly through walls 200 | * amx_hologram - player becomes a hologram: can't harm or be harmed 201 | * amx_timebomb - player becomes a timebomb 202 | * amx_oneshot - bullets kill in one shot 203 | * amx_explodeshot - bullets do explosive damage 204 | * amx_stunshot - bullets have stun effect 205 | * amx_cloak - player is cloaked until he fires 206 | * amx_lasershot - player fires a powerful laser 207 | * amx_grenadier - player gets infinite grenades 208 | * amx_flashshot - bullets have a blinding effect 209 | * amx_vampire - players absorbs health from others around him 210 | * amx_agshot - bullets have a anti-gravity effect 211 | * amx_splintershot - bullets splinter on impact 212 | 213 | ### plugin_punish 214 | 215 | This plugin gives admins the ability to punish 216 | players in multiple ways. 217 | 218 | * amx_disarm - removes all weapons from a player 219 | * amx_bury - burys a player in the ground, drops all his weapons 220 | * amx_unbury - unbury a player 221 | * amx_gag - prevents player from speaking 222 | * amx_ungag - ungag a player 223 | * amx_smack - slaps a player multiple times 224 | * amx_blind - blinds a player 225 | * amx_unblind - removes blind from a player 226 | * amx_drunk - makes player stagger and have bad vision 227 | * amx_sober - removes drunk from a player 228 | * amx_bunny - makes player constantly jump 229 | 230 | ### plugin_rambo 231 | 232 | Gives a player infinite bullets. (For Day of Defeat only) 233 | 234 | ### plugin_slash 235 | 236 | This plugin allows admins to execute amx commands 237 | using 'say' and a slash '/'. It can also execute 238 | a command on all players or a team using '@all' and 239 | '@team' in place of the authid/nick parameter. 240 | 241 | Examples: 242 | To kick a player type '/kick playername' 243 | To kick all players type '/kick @all' 244 | To kick all players on a team type '/kick @team:TEAMID' 245 | To ban all players for 10 minutes, type '/ban 10 @all' 246 | 247 | Additional Commands: 248 | Includes an IRC style '/me' command. If you say 249 | '/me sucks', it'll replace the '/me' with your name 250 | and print it to everyone. 251 | 252 | ### plugin_stealthwar 253 | 254 | Makes the winning team invisible. Invisible players can only use knives. 255 | 256 | ### plugin_targetwar 257 | 258 | Target war mod. One person on each team is randomly 259 | selected to be a target. Only the target can die, 260 | everyone else has immunity. If the target dies, another 261 | player is randomly selected to be a target. 262 | --------------------------------------------------------------------------------