Plugin "quake_like" pod
AMX posiada w sobie właśnie że jak się strzela we wroga to odgrwa dźwięk.
Może będzie prościej dla skrypterów.
Sma:
/*
* AMX Mod script.
*
* Plugin : Quake like
*
* by DanRaZor
*
* Just remember Quake III Arena ...
*
* New Cvar : amx_q3_mode = "abcde" (default)
*
* a : emit sound when enemy damaged
* b : emit sound when teammate damaged
* c : sound at start of round
* d : emit sound when entering game
* e : emit sound when disconnecting
*
* Originals Wavs From the Game. Just Boosted in volume.
*/
#include <amxmod>
readSettings( ) {
new flags[12]
get_cvar_string( "amx_q3_mode" , flags ,11)
return read_flags( flags )
}
public client_putinserver(id) {
if ( readSettings( ) & 8 ) {
new param[2]
param[0] = id
set_task ( 2.0 , "enterMsg" , 0 , param , 1 )
}
return PLUGIN_CONTINUE
}
public enterMsg (param[])
client_cmd( param[0] , "spk q3/intro" )
public client_disconnect(id) {
if ( readSettings( ) & 16)
client_cmd(0,"spk q3/exit")
return PLUGIN_CONTINUE
}
public newRound ( ) {
new roundtime = floatround( get_cvar_float("mp_roundtime") * 60.0 )
if ( roundtime == read_data(1) && readSettings( ) & 4 )
client_cmd(0,"spk q3/prepare")
return PLUGIN_CONTINUE
}
public makeDamage( victim ) {
new wpn, hitzone, attacker = get_user_attacker(victim,wpn,hitzone)
if ( !attacker ) return
new teamA = get_user_team ( attacker )
new teamV = get_user_team ( victim )
if ( teamV == teamA ) {
if ( readSettings( ) & 2 )
client_cmd(attacker,"spk q3/hit_teammate")
}
else if ( readSettings( ) & 1 )
client_cmd(attacker,"spk q3/hit")
}
public plugin_precache() {
precache_sound( "q3/hit.wav" )
precache_sound( "q3/hit_teammate.wav" )
precache_sound( "q3/prepare.wav" )
precache_sound( "q3/intro.wav" )
precache_sound( "q3/exit.wav" )
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin ("Quake like","1.2","DanRaZor")
register_event ("Damage" ,"makeDamage" ,"b","2!0","3=0","4!0")
register_event ("RoundTime" ,"newRound" ,"bc")
register_cvar ("amx_q3_mode" ,"abcde" )
return PLUGIN_CONTINUE
}