I need help with my edited plugin. It's from amx_spank2 but i edited it. I need help bc it doesn't slap the person. Here is the source:
Code:
#include <amxmodx>
#include <amxmisc>
public admin_attitude(id,level,cid){
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new name[32], name2[32]
new arg[32]
get_user_name(id,name2,31) // Admin name
read_argv(1,arg,31) // Target player
new player = cmd_target(id,arg,5)
if (!player) // Exception catch
return PLUGIN_HANDLED
new ids[2]
ids[0] = player
get_user_name(player,name,32) // Extract name from player id
client_cmd(0,"spk misc/attitude") // Wav to all. For player only: client_cmd(ids[0], "spk misc/attitude.wav")
client_print(0,print_chat, "%s Is getting slapped due to his high attitude by %s",name,name2)
// Prints a message to all stating that a player is being slapped by the admin.
set_task(3.1, "attitude", 0, ids, 1, "a", 0)
// Delays slapping by 3.1 seconds to give the attitude.wav time to play
return PLUGIN_HANDLED
}
public spanking(ids[]){
client_cmd(ids[0],"say I will never be a bad boy again! I promise!") // Makes player say that he won't do it again
set_task(0.4, "slap_player", 0, ids, 1, "a", 100) // Gives the player 100 spanks at 0.4 sec intervals
return PLUGIN_CONTINUE
}
public slap_player(ids[]) {
user_slap(ids[0],0) // Slap player with 0 damage
return PLUGIN_CONTINUE
}
public plugin_precache() {
precache_sound("misc/attitude.wav") // Forces client to download wav if not already present
return PLUGIN_CONTINUE
}
public plugin_init(){
register_plugin("amx_attitude","0.5","NiGHTFiRE")
register_concmd("amx_attitude","admin_attitude",ADMIN_SLAY,"<authid, nick or #userid>")
return PLUGIN_CONTINUE
}