modificare plugin say_restart
Posted: 20 Aug 2010, 16:30
salut as vrea sa-mi adaugati un sunet la acest plugin cand scriu /rr /restart /live sa se auda un sunet (EX:runda se va restarta) sunetul il am eu :D
Totul despre Counter-Strike, Resurse si Servere
https://www.extreamcs.com/forum/
Code: Select all
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define ACCESS ADMIN_SLAY
new Float:g_LastRestart[33]
new const g_Sound[] = "misc/rr.mp3";
public plugin_init()
{
register_plugin("Restart","2.0","D")
register_clcmd("say /restart","say_restart",ACCESS)
register_clcmd("say /rr","say_restart",ACCESS)
register_clcmd("say /live","say_restart",ACCESS)
}
public plugin_precache()
{
precache_sound( g_Sound );
}
public say_restart(id)
{
if(!(get_user_flags(id) & ACCESS))
return
new Float:Time = halflife_time()
if(Time - g_LastRestart[id] < 10.0)
return
g_LastRestart[id] = Time
server_cmd("sv_restart 1")
client_cmd( 0, "mp3 loop %s", g_Sound );
client_print(0, print_chat, " [----ReStaRt!----]")
client_print(0, print_chat, " [ ----LIVE!----- ]")
client_print(0, print_chat, " [----ReStaRt!----]")
set_hudmessage(255,150, 0, 0.04, 0.47, 0, 6.0, 7.0)
show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
show_hudmessage(0, "Live ! Live ! Live ! Bafta la fraguri!" )
}
Code: Select all
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define ACCESS ADMIN_SLAY
new Float:g_LastRestart[33]
new const g_Sound[] = "misc/rr.wav";
public plugin_init()
{
register_plugin("Restart","2.0","D")
register_clcmd("say /restart","say_restart",ACCESS)
register_clcmd("say /rr","say_restart",ACCESS)
register_clcmd("say /live","say_restart",ACCESS)
}
public plugin_precache()
{
precache_sound( g_Sound );
}
public say_restart(id)
{
if(!(get_user_flags(id) & ACCESS))
return
new Float:Time = halflife_time()
if(Time - g_LastRestart[id] < 10.0)
return
g_LastRestart[id] = Time
server_cmd("sv_restart 1")
client_cmd( 0, "spk %s", g_Sound );
client_print(0, print_chat, " [----ReStaRt!----]")
client_print(0, print_chat, " [ ----LIVE!----- ]")
client_print(0, print_chat, " [----ReStaRt!----]")
set_hudmessage(255,150, 0, 0.04, 0.47, 0, 6.0, 7.0)
show_hudmessage(0, "Live ! Live ! Live ! GL & HF !" )
show_hudmessage(0, "Live ! Live ! Live ! Bafta la fraguri!" )
}
Code: Select all
#include <amxmodx>
#include <amxmisc>
#pragma semicolon 1
new const g_version[] = "0.1";
new const g_Sound[] = "misc/rr.mp3";
public plugin_precache()
{
register_plugin( "New restart", g_version, "compaq" );
precache_sound( g_Sound );
}
public plugin_init()
{
register_concmd( "amx_live", "cmdRR", ADMIN_SLAY, "<seconds> - restart" );
register_concmd( "amx_rr", "cmdRR", ADMIN_SLAY, "<seconds> - restart" );
register_concmd( "amx_restart", "cmdRR", ADMIN_SLAY, "<seconds> - restart" );
}
public cmdRR( i_Index, iLevel, iCid )
{
if( !cmd_access( i_Index, iLevel, iCid, 2 ) )
{
return PLUGIN_HANDLED;
}
server_cmd( "sv_restart 1" );
client_cmd( 0, "mp3 loop %s", g_Sound );
return PLUGIN_CONTINUE;
}
Code: Select all
#include <amxmodx>
#include <amxmisc>
#pragma semicolon 1
new const g_version[] = "0.1";
new const g_Sound[] = "misc/rr.wav";
public plugin_precache()
{
register_plugin( "New restart", g_version, "compaq" );
precache_sound( g_Sound );
}
public plugin_init()
{
register_concmd( "amx_live", "cmdRR", ADMIN_SLAY, "<seconds> - restart" );
register_concmd( "amx_rr", "cmdRR", ADMIN_SLAY, "<seconds> - restart" );
register_concmd( "amx_restart", "cmdRR", ADMIN_SLAY, "<seconds> - restart" );
}
public cmdRR( i_Index, iLevel, iCid )
{
if( !cmd_access( i_Index, iLevel, iCid, 2 ) )
{
return PLUGIN_HANDLED;
}
server_cmd( "sv_restart 1" );
client_cmd( 0, "spk %s", g_Sound );
return PLUGIN_CONTINUE;
}