Page 1 of 1

modificare plugin say_restart

Posted: 20 Aug 2010, 16:30
by b[L]u
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

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <engine>

#define ACCESS ADMIN_SLAY

new Float:g_LastRestart[33]

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 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_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!" )
}

Re: modificare plugin say_restart

Posted: 20 Aug 2010, 16:39
by Reptile

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!" )
}
mp3

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!" )
}
wav

Re: modificare plugin say_restart

Posted: 20 Aug 2010, 18:27
by SaByUtZa VaSy ;x
Poti face asa?:
Cand un admin tasteaza in consola amx_live , amx_rr , amx_restart sa se dea rr si sa se auda un sunet.Fara mesaj.

Re: modificare plugin say_restart

Posted: 20 Aug 2010, 18:43
by Reptile
Ca veni vorba, plugin-ul nu a fost facut de asa-zisul D, ci de Alka.

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;
}
mp3

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;
}
wav

Re: modificare plugin say_restart

Posted: 21 Aug 2010, 18:54
by Ciprian
Mutat in Programare CS - Pluginuri!