Found another solution. Sound after first respawn with short delay. But thanks anyways.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define VERSION "1.0"
new names[32][18]
public plugin_init()
{
register_plugin("chi", VERSION, "sake")
register_event("ResetHUD", "greetings", "be")
}
public greetings(id)
{
new name[18]
get_user_name(id, name, 17)
for(new i = 0; i < 31; i++)
{
if(strcmp(name,names[i],18) == 0)
{
return PLUGIN_CONTINUE
}
}
set_task(0.2, "dummy", id)
if(strcmp(name,"C.h.i",5) == 0)
{
names[id] = "C.h.i"
client_cmd(0, "spk jnr/chi.wav")
show_hudmessage(0,"Hallo, ich bin der C.h.i vom Teamspeak!")
}
else
{
names[id] = name
new message[] = "Welcome on the Server, "
strcat(message,name,100)
strcat(message,"! Play fair!",112)
show_hudmessage(0,message)
}
return PLUGIN_CONTINUE
}
public client_disconnect(id)
{
names[id] = ""
return PLUGIN_CONTINUE
}
public dummy(id)
{
return PLUGIN_CONTINUE
}