Code:
/*
Admin join/leave message béta 1 by h4ns
This lets the players now when admin is connected or disconnected to the server.
Just upload this into your amxx/plugins folder
add admin_ann.amxx in your amxx/plugins.ini
Restart server or changemap
AND ENJOY!
Special thanks to BigBaller for the original script.
*/
public plugin_init() {
register_plugin("Admin join/Leave Message", "beta 1","h4ns")
register_cvar("amx_join_message", "Beware %name% is connecting!")
register_cvar("amx_joined_message", "O NO! %name% is here!")
register_cvar("amx_leave_message", "Finally %name% is gone!")
}
public client_connect(id) {
new authID[33]
get_user_authid(id,authID,32)
// If it matches your Steam ID
if (equal(authID,"STEAM_0:1:3229563")) {
new joinMsg[164]
get_cvar_string("amx_join_message",joinMsg,163)
new name[33]
get_user_name(id,name,32)
replace(joinMsg,163,"%name%",name)
// set_hudmessage(...)
show_hudmessage(0,"%s",joinMsg)
}
return PLUGIN_HANDLED
}
public client_putinserver(id){
new authID[31]
get_user_authid(id,authID,30)
// If it matches your steam ID
if (equal(authID,"STEAM_0:1:3229563")) {
new joinedMsg[163]
get_cvar_string("amx_joined_message",joinedMsg,162)
new name[31]
get_user_name(id,name,30)
replace(joinedMsg,162,"%name%",name)
// set_hudmessage(...)
show_hudmessage(0,"%s",joinedMsg)
}
return PLUGIN_HANDLED
}
public client_disconnect(id){
new authID[29]
get_user_authid(id,authID,28)
// If it matches your steam ID
if (equal(authID,"STEAM_0:1:3229563")) {
new leaveMsg[161]
get_cvar_string("amx_leave_message",leaveMsg,160)
new name[29]
get_user_name(id,name,28)
replace(leaveMsg,160,^%name%",name)
// set_hudmessage(...)
show_hudmessage(0,"%s",leaveMsg)
}
return PLUGIN_HANDLED
}