Code:
#include <amxmodx>
new friendlyfire_cvar[16]
public admin_ff(id,level){
if (!(get_user_flags(id)&level)){
console_print(id,"[AMXX] You have no access to that command.")
return PLUGIN_HANDLED
}
if (read_argc() < 2){
new ff_cvar = get_cvar_num("mp_friendlyfire")
console_print(id,"[AMXX] ^"mp_friendlyfire^" is %s", ff_cvar ? "ON" : "OFF")
return PLUGIN_HANDLED
}
new ff_s[2]
read_argv(1,ff_s,2)
new ff = str_to_num(ff_s)
if(ff == 1) {
server_cmd("mp_friendlyfire 1")
console_print(id,"[AMXX] Friendly fire is now on")
client_print(0, print_chat, "[AMXX] Friendly fire is now on")
set_hudmessage(0,255,0, -1.0, 0.25, 2, 0.02, 7.0, 0.01, 0.1, 2)
show_hudmessage(0,"Friendly fire is ON! Watch your fire! ^n Your teammates are counting on you to actually aim!")
}
else if(ff == 0) {
server_cmd("mp_friendlyfire 0")
console_print(id,"[AMXX] Friendly fire is now off")
client_print(0, print_chat, "[AMXX] Friendly Fire is now OFF!")
set_hudmessage(0,255,0, -1.0, 0.25, 2, 0.02, 7.0, 0.01, 0.1, 2)
show_hudmessage(0,"Friendly fire is OFF. ^n Go ahead, shoot your partner.")
}
return PLUGIN_HANDLED
}
public HandleSay(id) {
new Speech[192]
read_args(Speech,192)
remove_quotes(Speech)
if (containi(Speech, "ff")!=-1) {
get_cvar_string("mp_friendlyfire",friendlyfire_cvar,16)
set_hudmessage(0,255,0, -1.0, 0.25, 2, 0.02, 7.0, 0.01, 0.1, 2)
if (str_to_num
(friendlyfire_cvar) == 1){
show_hudmessage(0,"Friendly fire is on!")
client_print(0,print_chat,"Friendly fire is ON!") } else {
show_hudmessage(0,"Friendly fire is off.")
client_print(0,print_chat,"Friendly fire is OFF!") }
}
return PLUGIN_CONTINUE
}
public plugin_init(){
register_plugin("Admin FF","0.21","JustinHoMi")
register_concmd("amx_ff","admin_ff",ADMIN_CVAR,"< 0/1 >")
register_clcmd("say","HandleSay")
return PLUGIN_CONTINUE
}
Thankx for your help TImberlin, i got it figured out tho, i guess what i was sayin was when you type ff i wanted it to say FF is ON right above where he typed it (say). Its Great, this was all i was missing ona ff server. THankx Alot!