|
Member
|

07-26-2007
, 02:48
Plugin Not Reading
|
#1
|
I'm not sure if this is the correct forum [if not please move].
I created a plugin, when the user connects it checks if the person is an admin, if they are it prints a message about an admin connecting, if not, just says player is connect, then it plays a random sound. The same routine for disconnecting.
PHP Code:
/*
* PLUGIN CREATED BY MARREC
* MARREC IS THE CO-OWNER OF FNM
* PLUGIN IS NOT TO BE RE-USED ON
* ANY SERVER WITH OR WITH
* OUT PERMISSION FROM
* ANY BODY IN FNM
* ALL PLUGIN CONTENT IS 100%
* HAND-CREATED, USING
* NO HELP FROM ANOTHER
* PLUGIN
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "FnM Connect/Disconnect Sound and Print"
#define VERSION "1.0"
#define AUTHOR "MARREC"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /play1","PlaySound(1,1)")
register_clcmd("say /play2","PlaySound(2,1)")
register_clcmd("say /play3","PlaySound(1,2)")
register_clcmd("say /play4","PlaySound(2,2)")
}
public plugin_precache(){
precache_sound("sound/fnm/welcome1.wav")
precache_sound("sound/fnm/welcome2.wav")
precache_sound("sound/fnm/leave1.wav")
precache_sound("sound/fnm/leave2.wav")
}
public client_connect(id){
if(access(id,ADMIN_ADMIN)){
new name[33], authID[33]
get_user_name(id,name,32)
get_user_authid(id,authID,32)
client_print(0,print_chat,">>> AN ADMIN HAS CONNECTED <<<")
client_print(0,print_chat,"Admin: %s [%s] has connected to FnM",name,authID)
}else {
new name[33],authID[33]
get_user_name(id,name,32)
get_user_authid(id,authID,32)
client_print(0,print_chat,">>> A NEW PLAYER HAS CONNECTED <<<")
client_print(0,print_chat,"Player: %s [%s] has connected to FnM",name,authID)
}
new sound_num = random_num(1,2)
PlaySound(sound_num,1)
return PLUGIN_CONTINUE
}
public client_disconnect(id){
if(access(id,ADMIN_ADMIN)){
new name[33], authID[33]
get_user_name(id,name,32)
get_user_authid(id,authID,32)
client_print(0,print_chat,">>> AN ADMIN HAS DISNNECTED <<<")
client_print(0,print_chat,"Admin: %s [%s] has disconnected from FnM",name,authID)
}else {
new name[33],authID[33]
get_user_name(id,name,32)
get_user_authid(id,authID,32)
client_print(0,print_chat,">>> A PLAYER HAS DISCONNECTED <<<")
client_print(0,print_chat,"Player: %s [%s] has disconnected from FnM",name,authID)
}
new sound_num = random_num(1,2)
PlaySound(sound_num,2)
return PLUGIN_CONTINUE
}
public PlaySound(num,x){
new num,x
if(x == 1){
switch(num){
case 1: emit_sound(0, CHAN_VOICE, "fnm/welcome1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
case 2: emit_sound(0, CHAN_VOICE, "fnm/welcome2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}
if(x == 2){
switch(num){
case 1: emit_sound(0, CHAN_VOICE, "fnm/leave1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
case 2: emit_sound(0, CHAN_VOICE, "fnm/leave2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}
return PLUGIN_CONTINUE
}
*NOTE: I was testing on a LAN server installed with AMXX.
|
|