AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Pluginname: admin_warn; wavfile is not play at the Clients (https://forums.alliedmods.net/showthread.php?t=13610)

RCC|Dynamite 05-22-2005 17:28

Pluginname: admin_warn; wavfile is not play at the Clients
 
1 Attachment(s)
Code:

/*AMXMODX script.
* amxx_warn by [RCC] Dynamite
* visit [RCC] Counterstrike Clan at www.vereinte-rusher.de
*
* This is a variation of the default Slay command included with AMXMODX.
* Thanks to the AMXMODX team for this great mod.
*
* Admin commands:
*        amxx_warn <authid, nick or #userid>
*        warn <authid, nick or #userid>
*
* Shows a MOTD box to the player when they have been warned, and announces the warning to all.
* Logs warnings to /addons/amx/warnings.log for easy reference.
* Requires an /addons/amxmodx/configs/amxx_warn/warning.txt file for the text displayed in the warning MOTD.
*/ 

#include <amxmodx>
#include <amxmisc>

public admin_warn(id,level,cid){
        if (!cmd_access(id,level,cid,2))
                return PLUGIN_HANDLED
        new arg[32]
        read_argv(1,arg,31)
        new player = cmd_target(id,arg,0)
        if (!player) return PLUGIN_HANDLED
        client_cmd(0,"spk misc/dead_police.wav")
        show_motd(player,"/addons/amxmodx/configs/amxx_warn/warning.txt","You are being warned!")

        new authid[16],name2[32],authid2[16],name[32]
        get_user_authid(id,authid,15)
        get_user_name(id,name,31)
        get_user_authid(player,authid2,15)
        get_user_name(player,name2,31)
        log_to_file("/addons/amxmodx/configs/amxx_warn/warnings.log","Cmd: ^"%s<%d><%s><>^" warned ^"%s<%d><%s><>^"",
                name,get_user_userid(id),authid, name2,get_user_userid(player),authid2 )
               
        set_hudmessage(255, 0, 0, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2);
        show_hudmessage(0,"%s has been warned for violating a server rule",name2)
        console_print(id,"Client ^"%s^" warned",name2)
       
        return PLUGIN_HANDLED 
}

public plugin_init() {
    register_plugin("Admin Warn","1.0","RCC| Dynamite")
    register_concmd("amxx_warn","admin_warn",ADMIN_LEVEL_A,"<authid, nick or #userid>")
    register_concmd("warn","admin_warn",ADMIN_LEVEL_A,"<authid, nick or #userid>")
    return PLUGIN_CONTINUE 
}

here is my problem: Clients cannot hear the sound because these are not played with them

is the path the problem ?

client_cmd(0,"spk misc/dead_police.wav")

the second proble is that the logs dosnt work and i dont no why

cu

Dynamite

v3x 05-22-2005 18:35

Well, first of all you need to precache the sound..
Code:
public plugin_precache() {     precache_sound("misc/dead_police.wav") }

n0obie4life 05-23-2005 01:48

and he didn't emit_sound ?

RCC|Dynamite 05-23-2005 12:23

1 Attachment(s)
Thanks it works outstanding!!!

I have a secound plugins where i include a soundfile to playup to all clients at the server do you know how i can made it works?

Code:

[code]#include <amxmodx>
#include <amxmisc>

public informclient(strindex[])
{
new myindex
myindex=str_to_num(strindex)
if(myindex>0)
client_print(myindex,print_chat,"Say ^"BINDS^" Um zu sehen wie Du die Verschiedenen Serverstatistiken abrufen kannst")

}

public mandatoryinform(strindex[])
{
new myindex
myindex=str_to_num(strindex)
if(myindex>0)
show_motd(myindex,"/addons/amxmodx/configs/binds.txt","Server Binds")

}

public client_putinserver(id){
new str[4]
num_to_str(id,str,2)
set_task(10.0,"informclient",432211+id,str,2)
if(get_cvar_num("forcerules"))
set_task(11.0,"mandatoryinform",432611+id,str,2)

}

public client_disconnect(id){
remove_task(432211+id)
remove_task(432611+id)

}

public server_binds(id){
show_motd(id,"/addons/amxmodx/configs/binds.txt","Server Binds")
return PLUGIN_HANDLED

}

public plugin_precache() {
    precache_sound("misc/afk.wav")
}

public admin_showthem(id,level,cid){
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1,arg,31)
new player = cmd_target(id,arg,5)
if (!player) return PLUGIN_HANDLED
client_cmd(0,"spk misc/afk.wav")

//new name[32]
//get_user_name(player,name,31)
client_cmd(player,"say Bitte nicht Fraggen ! Ich versuche die Serverbinds zu erfassen!")
client_cmd(0,"spk misc/afk.wav")
show_motd(player,"/addons/amxmodx/configs/binds.txt","Lese die Server BINDS !")
return PLUGIN_HANDLED
}

public plugin_init()

{
register_plugin("Server Binds German","1.1","RCC| Dynamite")
register_clcmd("say /showbinds", "server_binds")
register_clcmd("say showbinds", "server_binds")
register_clcmd("say /binds", "server_binds")
register_clcmd("say binds", "server_binds")
register_cvar("forcerules","0")
register_concmd("amx_showrules","admin_showthem",ADMIN_SLAY,"<authid, nick or #userid>")
return PLUGIN_CONTINUE
} [/code]


v3x 05-24-2005 13:44

Huh?

RCC|Dynamite 05-24-2005 17:27

nobody can hear the afk sound and i have permanet problem to merge soundfile. the fist problem i posted is solved.

This doesn´t work

Code:

public plugin_precache() {
    precache_sound("misc/afk.wav")
}

public admin_showthem(id,level,cid){
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1,arg,31)
new player = cmd_target(id,arg,5)
if (!player) return PLUGIN_HANDLED
client_cmd(0,"spk misc/afk.wav")

at the same time the client read the serverrules is to play to all the afk.wav read afk hear ak.wav.

bye

Dynamite


All times are GMT -4. The time now is 16:50.

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