Hello everybody! I've noticed it is boring that some unmatured players shoot their allies without being punished
(if their is only a TA and not a TK). So I've decided to create an original system to manage the friendly fire in DOD:
Some of you have recognized it, that is based on the old pluging DOD TK MANAGER created by Fractal (
).
That is why there is some code which is similar (for example the files for credits memory, I am not good enough to make it myself). Of course, I have thanked them in the source, nevertheless I apologize in advance if you think this is insufficient.
1. One time, menus works fine, an other time, it happens nothing when you press a key, or the menu doesn't display at all! I have tried to replace keys (1<<0) ... by 1023, but it changes nothing.
2. One time, credits are well counted, an other time, they are "mad" (for example less than -8 credits for a TK).
3. One time, players are slayed when they shoot at spawn, an other, the text is displayed but they are not slayed! (of course they have no immunity I'm not stupid
4. I can compile it with 0.20, but I get a bad load error in the server log. So to launch it, I have to compile it with 0.16. I use the Windows Dedicated Server for my tests, before to put it on my team's server (Linux). Notice I have also to use an old version of metamod to prevent a crash of the server
Code:
#include <amxmodx>
#include <amxmisc>
#include <dodx>
new Float:g_SpawnTime[33]
new g_adminimmunity
new g_bantime
new g_credits_start
new g_player_authid[33][40]
new g_player_authenticated[33]
new g_credits[33]
new g_menu_killerid[33]
new g_menu_attackerid[33]
new Float:g_LastAttackTime[33]
new Last1Attacker = 0
new Last1Victim = 0
new Last2Attacker = 0
new Last2Victim = 0
public plugin_init()
{
register_plugin("DoD FF Manager","0.1","Colt")
register_event("ResetHUD","eResetHud","b")
register_cvar("amx_ffm_bantime","180")
register_cvar("amx_ffm_credits","25")
register_cvar("amx_ffm_multiTK","1")
register_cvar("amx_ffm_protectiontime","6.0")
register_clcmd("say","HandleSay")
register_clcmd("say_team","HandleSay")
register_statsfwd(XMF_DAMAGE)
register_statsfwd(XMF_DEATH)
register_menucmd(register_menuid("-1"),1023,"Menu1")
register_menucmd(register_menuid("-2"),1023,"Menu2")
register_menucmd(register_menuid("-3"),1023,"Menu3")
register_menucmd(register_menuid("-4"),1023,"Menu4")
register_menucmd(register_menuid("-5"),1023,"Menu5")
register_menucmd(register_menuid("-6"),1023,"Menu6")
register_menucmd(register_menuid("-7"),1023,"Menu7")
register_menucmd(register_menuid("-8"),1023,"Menu8")
set_task(0.6,"load_settings")
return PLUGIN_CONTINUE
}
public load_settings()
{
g_credits_start = get_cvar_num("amx_ffm_credits")
g_bantime = get_cvar_num("amx_ffm_bantime")
return PLUGIN_CONTINUE
}
public client_connect(id)
{
g_player_authenticated[id] = 0
return PLUGIN_CONTINUE
}
public client_putinserver(id)
{
get_user_authid(id,g_player_authid[id],39)
g_player_authenticated[id] = 1
g_credits[id] = g_credits_start
if ( is_user_bot(id) )
return PLUGIN_CONTINUE
new cditsFile[64]
format(cditsFile,63,"addons/amxmodx/logcredits/%s.txt",g_player_authid[id])
replace(cditsFile,63,":","_")
replace(cditsFile,63,":","_")
if (file_exists(cditsFile))
{
new currmap[32]
get_mapname(currmap,31)
new text[32]
new a = 0
if (read_file(cditsFile,1,text,31,a) && equali(currmap,text))
{
if (read_file(cditsFile,2,text,31,a))
g_credits[id] = str_to_num(text)
}
else
delete_file(cditsFile)
}
return PLUGIN_CONTINUE
}
public client_disconnect(id)
{
if ( is_user_bot(id) )
return PLUGIN_CONTINUE
if (g_player_authenticated[id] && g_credits[id] < g_credits_start)
{
new cditsFile[64]
format(cditsFile,63,"addons/amxmodx/logcredits/%s.txt",g_player_authid[id])
replace(cditsFile,63,":","_")
replace(cditsFile,63,":","_")
new currmap[32]
get_mapname(currmap,31)
write_file(cditsFile,currmap,1)
new text[8]
num_to_str(g_credits[id],text,7)
write_file(cditsFile,text,2)
}
return PLUGIN_CONTINUE
}
public eResetHud(id){
g_SpawnTime[id] = get_gametime()
return PLUGIN_CONTINUE
}
// protection vs TA
public client_damage(attacker,victim,damage,wpnindex,hitplace,TA){
if ( !TA || !is_user_alive(victim) || damage<10 ) // damage<10: do not punish small TA, very often unvulontarys
return PLUGIN_CONTINUE
new name[32]
new menuBody[192]
new attackerid
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3) // 4 is "invisible" but used to force menu to quit in 2 situations later
get_user_name(attacker,name,31)
g_menu_attackerid[victim] = attacker
attackerid = get_user_userid(attacker)
Last2Attacker = Last1Attacker
Last2Victim = Last1Victim
Last1Attacker = attacker
Last1Victim = victim
// spawn TA protection
if ( get_gametime() - g_SpawnTime[victim] < get_cvar_float("amx_ffm_protectiontime") || get_gametime() - g_SpawnTime[attacker] < get_cvar_float("amx_ffm_protectiontime")){
g_credits[attacker] = g_credits[attacker]-7
set_task(0.5,"delayedkill",attackerid)
set_hudmessage(255, 0, 255, 0.05, 0.8, 0, 4.0, 11.0, 0.1, 0.5, 8)
show_hudmessage(0,"%s slayed to have wounded an ally at respawn^nand losses 7 credits he has %i remaining!", name, g_credits[attacker])
format(menuBody,120,"-7 credits for %s:^n1. Forgive^n2. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(attacker)
log_message("[FF MANAGER] %s attacked an ally at respawn and gets %i credits!",name, g_credits[attacker])
return PLUGIN_CONTINUE
}
// TA melee protection
if ( xmod_is_melee_wpn(wpnindex) ){
g_credits[attacker] = g_credits[attacker]-4
set_hudmessage(0, 255, 0, 0.05, 0.8, 0, 4.0, 11.0, 0.1, 0.5, 8)
show_hudmessage(0,"%s losses 4 credits to have wounded at melee^nan ally, he has %i remaining!", name, g_credits[attacker])
format(menuBody,120,"-4 credits for %s:^n1. Forgive^n2. Slap 30 Hp and forgive^n3. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(attacker)
return PLUGIN_CONTINUE
}
// TA mortar protection
if ( wpnindex == DODW_MORTAR ){
g_credits[attacker] = g_credits[attacker]-2
set_hudmessage(0, 255, 0, 0.05, 0.8, 0, 4.0, 11.0, 0.1, 0.5, 8)
show_hudmessage(0,"%s losses 2 credits to have wounded an ally with mortar,^nhe has %i remaining!", name, g_credits[attacker])
format(menuBody,120,"-2 credits for %s:^n1. Forgive^n2. Slap 10 Hp and forgive^n3. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(attacker)
return PLUGIN_CONTINUE
}
set_hudmessage(255, 255, 255, 0.05, 0.8, 0, 3.0, 10.0, 0.1, 0.5, 8)
if (wpnindex==13||wpnindex==14||wpnindex==36){
g_credits[attacker] = g_credits[attacker]-1
show_hudmessage(0,"%s losses 1 credit to have wounded of %d Hp^nan ally with grenade and has %i remaining!", name, damage, g_credits[attacker])
format(menuBody,120,"-1 credit for %s:^n1. Forgive^n2. Slap (5 Hp) and forgive.^n3. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(attacker)
return PLUGIN_CONTINUE
}
if (wpnindex==29||wpnindex==30||wpnindex==31) {
g_credits[attacker] = g_credits[attacker]-2
show_hudmessage(0,"%s losses 2 credits to have wounded of %d Hp^nan ally with rocket-launcher and has %i remaining!", name, damage, g_credits[attacker])
format(menuBody,120,"-2 credits for %s:^n1. Forgive^n2.Slap (10 Hp) and forgive.^n3. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(attacker)
return PLUGIN_CONTINUE
}
g_credits[attacker] = g_credits[attacker]-3
show_hudmessage(0,"%s losses 3 credits to have wounded of %d Hp^nan ally and has %i remaining!", name, damage, g_credits[attacker])
format(menuBody,120,"-3 credits for %s:^n1. Forgive^n2.Slap (15 Hp) and forgive.^n3. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(attacker)
return PLUGIN_CONTINUE
}
public client_death(killer,victim,wpnindex,hitplace,TK)
{
if ( !TK )
return PLUGIN_CONTINUE
// If amx_ffm_multiTK=1, when a multi-Tk at grenade happens, only the 1st will be punished
if ( get_cvar_num("amx_ffm_multiTK") && g_LastAttackTime[killer] == get_gametime() && (wpnindex==13||wpnindex==14||wpnindex==36) ){
return PLUGIN_CONTINUE
}
g_LastAttackTime[killer] = get_gametime()
new name[32]
new killerid
new victimid
new menuBody[192]
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)
get_user_name(killer,name,31)
g_menu_killerid[victim] = killer
killerid = get_user_userid(killer)
victimid = get_user_userid(victim)
Last2Attacker = Last1Attacker
Last2Victim = Last1Victim
Last1Attacker = killer
Last1Victim = victim
// spawn TK protection
if ( get_gametime() - g_SpawnTime[victim] < get_cvar_float("amx_ffm_protectiontime") || get_gametime() - g_SpawnTime[killer] < get_cvar_float("amx_ffm_protectiontime") ){
set_task(0.5,"delayedkill",killerid)
g_credits[killer] = g_credits[killer]-8
set_hudmessage(255, 0, 255, 0.05, 0.8, 0, 5.0, 11.0, 0.1, 0.5, 8)
show_hudmessage(0,"%s slayed to have killed an ally at spawn^nand losses 8 credits, he has %i remaining!", name, g_credits[killer])
format(menuBody,120,"-8 credits for %s:^n1. Forgive^n2. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(killer)
log_message("[FF MANAGER] %s has killed an ally at spawn and has %i credits remaining!",name, g_credits[killer])
return PLUGIN_CONTINUE
}
// melee TK protection
if ( xmod_is_melee_wpn(wpnindex) ){
g_credits[killer] = g_credits[killer]-6
set_hudmessage(0, 255, 0, 0.05, 0.8, 0, 5.0, 11.0, 0.1, 0.5, 8)
show_hudmessage(0,"%s losses 6 credits to have killed an ally^nat melee; he has %i remaining!", name, g_credits[killer])
format(menuBody,120,"-6 credits for %s:^n1. Forgive^n2. Slap (40Hp) and forgive^n3. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(killer)
return PLUGIN_CONTINUE
}
// mortar TK protection
if ( wpnindex == DODW_MORTAR ){
g_credits[killer] = g_credits[killer]-3
set_hudmessage(0, 255, 0, 0.05, 0.8, 0, 5.0, 11.0, 0.1, 0.5, 8)
show_hudmessage(0,"%s losses 3 credits to have killed an ally^nwith mortar; he has %i remaining!", name, g_credits[killer])
format(menuBody,120,"-3 credits for %s:^n1. Forgive^n2. Slap (15Hp) and forgive^n3. Do not forgive",name)
show_menu(victim,keys,menuBody,40)
Check_credits(killer)
return PLUGIN_CONTINUE
}
// normal TK
new menuid
// prevents the double punishment if the wounder kills: it closes the forgive menu for the TA and forgives it invisibly
if (get_user_menu(victim,menuid,keys) && g_menu_attackerid[victim]==killer){
client_cmd(victim,"slot4")
g_credits[killer] = g_credits[killer]+3
}
g_credits[killer] = g_credits[killer]-4
set_hudmessage(255, 200, 0, 0.05, 0.8, 0, 5.0, 11.0, 0.1, 0.5, 8)
show_hudmessage(0,"%s losses 4 credits to have killed an ally; he has %i remaining!", name, g_credits[killer])
set_task(0.5,"delayedmenu",victimid) // delayedmenu to prevent (I believe) the previous command "slot4" closes this new one too.
return PLUGIN_CONTINUE
}
// checks the number of credits after a TA/TK
Check_credits(player)
{
if (g_credits[player] > g_credits_start)
return 0
new name[32], userid
get_user_name(player,name,31)
userid = get_user_userid(player)
set_hudmessage(255, 0, 0, 0.05, 0.6, 0, 8.0, 10.0, 0.1, 0.5, 8)
client_print(userid, print_chat, "If you have no credits anymore, you will be banned %d minutes!",g_bantime)
if (g_credits[player] < 5 && g_credits[player] > -1)
{
set_task(0.5,"delayedkill",userid)
show_hudmessage(0,"%s slayed because he has less than 5 credits!", name, g_credits[player])
}
if (g_credits[player] < 0)
{
set_task(0.5,"delayedkill",userid)
if (g_adminimmunity && (get_user_flags(player) & ADMIN_BAN))
{
show_hudmessage(0,"%s has no credits anymore^nbut is not banned because he has the immunity!", name)
}
else
{
if ((g_bantime % 1440)==0)
{
show_hudmessage(0,"%s has no credits anymore^nand is banned %d hours!", name, (g_bantime / 60))
}
else if (g_bantime < 60)
{
show_hudmessage(0,"%s has no credits anymore^nand is banned %d minutes!", name, (g_bantime % 1440))
}
else
{
show_hudmessage(0,"%s%s has no credits anymore^nand is banned %d hours %d minutes!", name, (g_bantime / 60), (g_bantime % 1440))
}
g_credits[player] = g_credits_start // if during the same map the player is unbanned and reconnects, it prevents he starts with negatives credits...
set_task(0.7,"delayedban",userid)
}
log_message("[FF MANAGER] %s was banned %d minutes because he has no credits anymore!",name, g_bantime)
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public Menu1(id,key)
{
new NameV[32], NameA[32]
get_user_name(id,NameV,31)
get_user_name(g_menu_attackerid[id],NameA,31)
switch(key)
{
case 0:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 1
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has forgiven %s^nand gives him 1 credit back", NameV, NameA)
}
case 1:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 1
user_slap (g_menu_attackerid[id], 5)
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has slaped (5 Hp) %s^nand gives him 1 credit back", NameV, NameA)
}
case 2:{
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s does not forgive %s^nbut can do it later by writting forgive", NameV, NameA)
}
}
return PLUGIN_HANDLED
}
public Menu2(id,key)
{
new NameV[32], NameA[32]
get_user_name(id,NameV,31)
get_user_name(g_menu_attackerid[id],NameA,31)
switch(key)
{
case 0:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 2
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has forgiven %s^nand gives him 2 credits back", NameV, NameA)
}
case 1:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 2
user_slap (g_menu_attackerid[id], 10)
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has slaped (10 Hp) %s^nand gives him 2 credits back", NameV, NameA)
}
case 2:{
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s does not forgive %s^nbut can do it later by writting forgive", NameV, NameA)
}
}
return PLUGIN_HANDLED
}
public Menu3(id,key)
{
new NameV[32], NameA[32]
get_user_name(id,NameV,31)
get_user_name(g_menu_attackerid[id],NameA,31)
switch(key)
{
case 0:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 3
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has forgiven %s^nand gives him 3 credits back", NameV, NameA)
}
case 1:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 3
user_slap (g_menu_attackerid[id], 15)
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has slaped (15 Hp) %s^nand gives him 3 credits back", NameV, NameA)
}
case 2:{
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s does not forgive %s^nbut can do it later by writting forgive", NameV, NameA)
}
}
return PLUGIN_HANDLED
}
public Menu4(id,key)
{
new NameV[32], NameA[32]
get_user_name(id,NameV,31)
get_user_name(g_menu_killerid[id],NameA,31)
switch(key)
{
case 0:{
g_credits[g_menu_killerid[id]] = g_credits[g_menu_killerid[id]] + 4
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has forgiven %s^nand gives him 4 credits back", NameV, NameA)
}
case 1:{
g_credits[g_menu_killerid[id]] = g_credits[g_menu_killerid[id]] + 1
user_slap (g_menu_attackerid[id], 20)
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has slaped (20 Hp) %s^nand gives him 4 credits back", NameV, NameA)
}
case 2:{
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s does not forgive %s^nbut can do it later by writting forgive", NameV, NameA)
}
}
return PLUGIN_HANDLED
}
public Menu5(id,key)
{
new NameV[32], NameA[32]
get_user_name(id,NameV,31)
get_user_name(g_menu_attackerid[id],NameA,31)
switch(key)
{
case 0:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 5
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has forgiven %s^nand gives him 5 credits back", NameV, NameA)
}
case 1:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 5
user_slap (g_menu_attackerid[id], 30)
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has slaped (30 Hp) %s^nand gives him 5 credits back", NameV, NameA)
}
case 2:{
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s does not forgive %s^nbut can do it later by writting forgive", NameV, NameA)
}
}
return PLUGIN_HANDLED
}
public Menu6(id,key)
{
new NameV[32], NameA[32]
get_user_name(id,NameV,31)
get_user_name(g_menu_killerid[id],NameA,31)
switch(key)
{
case 0:{
g_credits[g_menu_killerid[id]] = g_credits[g_menu_killerid[id]] + 6
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has forgiven %s^nand gives him 6 credits back", NameV, NameA)
}
case 1:{
g_credits[g_menu_killerid[id]] = g_credits[g_menu_killerid[id]] + 6
user_slap (g_menu_attackerid[id], 40)
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has slaped (40 Hp) %s^nand gives him 6 credits back", NameV, NameA)
}
case 2:{
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s does not forgive %s^nbut can do it later by writting forgive", NameV, NameA)
}
}
return PLUGIN_HANDLED
}
public Menu7(id,key)
{
new NameV[32], NameA[32]
get_user_name(id,NameV,31)
get_user_name(g_menu_attackerid[id],NameA,31)
switch(key)
{
case 0:{
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 7
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has forgiven %s^nand gives him 7 credits back", NameV, NameA)
}
case 1:{
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s does not forgive %s^nbut can do it later by writting forgive", NameV, NameA)
}
}
return PLUGIN_HANDLED
}
public Menu8(id,key)
{
new NameV[32], NameA[32]
get_user_name(id,NameV,31)
get_user_name(g_menu_killerid[id],NameA,31)
switch(key)
{
case 0:{
g_credits[g_menu_killerid[id]] = g_credits[g_menu_killerid[id]] + 7
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s has forgiven %s^nand gives him 7 credits back", NameV, NameA)
}
case 1:{
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
show_hudmessage(0,"%s does not forgive %s^nbut can do it later by writting forgive", NameV, NameA)
}
}
return PLUGIN_HANDLED
}
public delayedmenu(victimid){
new menuBody[192]
new name[32]
get_user_name(g_menu_killerid[victimid],name,31)
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)
format(menuBody,120,"-4 credits pour %s:^n1. Pardonner^n2. Gifler de 20Hp et pardonner^n3. Ne pas pardonner",name)
show_menu(victimid,keys,menuBody,40)
}
public delayedkill(id){
user_kill(id)
}
public delayedban(userid){
server_cmd("banid %d.0 #%d",g_bantime,userid)
server_cmd("writeid")
server_cmd("kick #%d",userid)
}
// checks players'chat and forgives until lasts 2 actions if asked
public HandleSay(id)
{
new text[12]
read_argv(1,text,11)
if ( containi(text,"pardonner") == 0 || containi(text,"pardon") == 0 || containi(text,"forgive") == 0 || containi(text,"forgivetk") == 0 )
{
new menuid, keys
new NameV[32]
new NameA[32]
new userid
set_hudmessage(0, 90, 235, 0.05, 0.72, 0, 3.0, 11.0, 0.1, 0.5, 9)
userid = get_user_userid(id)
if (id == Last1Victim)
{
if (get_user_menu(id,menuid,keys) && (g_menu_attackerid[id]==Last1Attacker || g_menu_killerid[id]==Last1Attacker) ) {
client_cmd(id,"slot4")
get_user_name(Last1Victim,NameV,31)
get_user_name(Last1Attacker,NameA,31)
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 4
show_hudmessage(0,"Finally %s has forgiven %s", NameV, NameA)
Last1Victim = Last2Victim
Last1Attacker = Last2Attacker
Last2Victim = 0
Last2Attacker = 0
return PLUGIN_CONTINUE
}
client_print(userid, print_chat, "Sorry it is too late to forgive")
}
if (id == Last2Victim)
{
if (get_user_menu(id,menuid,keys) && (g_menu_attackerid[id]==Last2Attacker || g_menu_killerid[id]==Last2Attacker) ) {
client_cmd(id,"slot4")
get_user_name(Last1Victim,NameV,31)
get_user_name(Last1Attacker,NameA,31)
g_credits[g_menu_attackerid[id]] = g_credits[g_menu_attackerid[id]] + 4
show_hudmessage(0,"Finally %s has forgiven %s", NameV, NameA)
Last2Victim = 0
Last2Attacker = 0
return PLUGIN_CONTINUE
}
client_print(userid, print_chat, "Sorry it is too late to forgive")
}
}
return PLUGIN_CONTINUE
}
So if some of you wants to have a look and manage to find the errors, I would give them thousands of thanks
. I have spent 2 weeks to do that, and I think it will be very nice to have a similar plugin on DOD servers. And sorry for my english not very good