/*******************************************************************
* *********
** Sir Drink a lots HP-Plugin v 3.5 ********
*** *******
**** INFO: Shows the health of your enemy and, if it is ******
***** set up in the vault.ini, also the weapon which he has *****
***** used. *****
****** You can write hp,hp? or hp ? in chat to display this ****
******* message again. ***
******** Thanks to Warhead,Biohazard,[COLA]*Whiskey and the **
*********
www.adminmod.de forumusers for help and the idea *
********* GREAT THANKS TO NETKOWALSKI FOR UPDATING THE CODE !!!! *
*******************************************************************
You have to set up the following commands in your vault.ini
to store this values forever
admin_hp:
0= Turns HP Plugin Off
1= Turns HP Plugin On
admin_hpdeath:
0= Message is only displayed if you type hp,hp? or hp ? in chat
1= Message is also displayed directly after death
admin_hparmor:
0= Display with announcement of the killers armor.
1= Display without the killers armor.
admin_hpweapon:
0= Display with announcement of the killers weapon.
1= Display without the weapon.
admin_hpudo:
0= Display with announcement of the Damage you do.
1= Display without the Damage you do.
admin_hpdisplay:
0= Display in chat area...
1= Display as typesay-message only visible for the victim.
*/
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_CONSOLE 131072
#define CLEAN_SLATE 0
#define MAX_PLAYERS 33
new STRING_VERSION[MAX_DATA_LENGTH] = "3.5";
new health[MAX_PLAYERS] = {CLEAN_SLATE,...};
new endhealth[MAX_PLAYERS] = {CLEAN_SLATE,...};
new enemy[MAX_PLAYERS] = {CLEAN_SLATE,...};
new endweapon[MAX_PLAYERS] = {CLEAN_SLATE,...};
new armor[MAX_PLAYERS] = {CLEAN_SLATE,...};
new endarmor[MAX_PLAYERS] = {CLEAN_SLATE,...};
new killdata[MAX_PLAYERS][MAX_PLAYERS];
new Death[MAX_DATA_LENGTH];
new Displayarmor[MAX_DATA_LENGTH];
new Displayweapon[MAX_DATA_LENGTH];
new Displayudo[MAX_DATA_LENGTH];
new Display[MAX_DATA_LENGTH];
new bhpEnabled = 1;
new Message[MAX_TEXT_LENGTH];
public admin_hp(HLCommand,HLData,HLUserName,UserIndex)
{
new Data[MAX_DATA_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
if(strcmp(Data,"0")==0)
{
bhpEnabled = 1;
set_vaultdata("admin_hp",Data);
selfmessage("HP Anzeige nach Tot ist an.IMMER !!!");
}
else if(strcmp(Data,"1")==0)
{
bhpEnabled = 0;
set_vaultdata("admin_hp",Data);
selfmessage("HP Anzeige ist ausgeschaltet.IMMER !!!");
}
else
{
get_vaultdata("admin_hp",Data,MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"Der Wert fuer admin_hp steht zur Zeit auf %s",Data);
selfmessage("Ungueltiger Wert fuer admin_hp.");
selfmessage("Entweder 1 = HP Anzeige AN oder 0 = HP Anzeige AUS.");
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
public admin_hpdeath(HLCommand,HLData,HLUserName,UserIndex)
{
new Data[MAX_DATA_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
if(strcmp(Data,"0")==0)
{
set_vaultdata("admin_hpdeath",Data);
selfmessage("Das HP wird ab jetzt nicht mehr direkt beim Ableben angezeigt.IMMER !!!");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_hpdeath",Data);
selfmessage("Das HP wird ab jetzt auch direkt beim Ableben angezeigt.IMMER !!!");
}
else
{
get_vaultdata("admin_hpdeath",Data,MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"Der Wert fuer admin_hpdeath steht zur Zeit auf %s",Data);
selfmessage("Ungueltiger Wert fuer admin_hpdeath.");
selfmessage("Entweder 1 fuer direkte Anzeige nach dem Tod oder 0 fuer Anzeige nur bei Chat-Nachfrage.");
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
public admin_hparmor(HLCommand,HLData,HLUserName,UserIndex)
{
new Data[MAX_DATA_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLData, Data,MAX_DATA_LENGTH);
if(strcmp(Data,"0")==0)
{
set_vaultdata("admin_hparmor",Data);
selfmessage("Das HP wird ab jetzt IMMER ohne Armorangabe angezeigt.");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_hparmor",Data);
selfmessage("Das HP wird ab jetzt IMMER mit Armorangabe angezeigt.");
}
else
{
get_vaultdata("admin_hparmor",Data,MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"Der Wert fuer admin_hparmor steht zur Zeit auf %s",Data);
selfmessage("Ungueltiger Wert fuer admin_hparmor.");
selfmessage("Entweder 1 fuer Anzeige mit Armorangabe oder 0 fuer Anzeige ohne Armorangabe.");
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
public admin_hpweapon(HLCommand,HLData,HLUserName,UserIndex)
{
new Data[MAX_DATA_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
if(strcmp(Data,"0")==0)
{
set_vaultdata("admin_hpweapon",Data);
selfmessage("Das HP wird ab jetzt IMMER ohne Waffenangabe angezeigt.");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_hpweapon",Data);
selfmessage("Das HP wird ab jetzt IMMER mit Waffenangabe angezeigt.");
}
else
{
get_vaultdata("admin_hpweapon",Data,MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"Der Wert fuer admin_hpweapon steht zur Zeit auf %s",Data);
selfmessage("Ungueltiger Wert fuer admin_hpweapon.");
selfmessage("Entweder 1 fuer Anzeige mit Waffenangabe oder 0 fuer Anzeige ohne Waffenangabe.");
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
public admin_hpudo(HLCommand,HLData,HLUserName,UserIndex)
{
new Data[MAX_DATA_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
if(strcmp(Data,"0")==0)
{
set_vaultdata("admin_hpudo",Data);
selfmessage("Das HP wird ab jetzt IMMER ohne Schadensangabe des Gekillten angezeigt.");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_hpudo",Data);
selfmessage("Das HP wird ab jetzt IMMER mit Schadensangabe des Gekillten angezeigt.");
}
else
{
get_vaultdata("admin_hpudo",Data,MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"Der Wert fuer admin_hpudo steht zur Zeit auf %s",Data);
selfmessage("Ungueltiger Wert fuer admin_hpudo.");
selfmessage("Entweder 1 fuer Anzeige mit Schadensangabe des Gekillten oder 0 fuer Anzeige ohne Schadensangabe des Gekillten.");
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
public admin_hpdisplay( HLCommand,HLData,HLUserName,UserIndex )
{
new Data[MAX_DATA_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string( HLData, Data, MAX_DATA_LENGTH );
if(strcmp(Data,"0")==0)
{
set_vaultdata("admin_hpdisplay", Data);
selfmessage("Das HP wird ab jetzt IMMER im Chatbereich angezeigt.");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_hpdisplay", Data);
selfmessage("Das HP wird ab jetzt IMMER als Typesay angezeigt.");
}
else if(strcmp(Data,"2")==0)
{
set_vaultdata("admin_hpdisplay", Data);
selfmessage("Das HP wird ab jetzt IMMER als Centersay angezeigt.");
}
else
{
get_vaultdata("admin_hpdisplay",Data, MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"Der Wert fuer admin_hpdisplay steht zur Zeit auf %s",Data);
selfmessage("Ungueltiger Wert fuer admin_hpdisplay.");
selfmessage("0 fuer Anzeige im Chat, 1 fuer Typesay oder 2 fuer Centersay-Nachricht an den Spieler. ");
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
public hp_injure( HLCommand,HLData,HLUserName,UserIndex )
{
new Damage[MAX_DATA_LENGTH];
new b[MAX_DATA_LENGTH];
new c[MAX_DATA_LENGTH];
new d[MAX_DATA_LENGTH];
new Armor[MAX_DATA_LENGTH];
new Victim[MAX_DATA_LENGTH];
new Data[MAX_DATA_LENGTH];
new iIDV;
new iIDA;
convert_string( HLData, Data, MAX_DATA_LENGTH );
strsplit(Data,"#",Damage,50,b,50,c,50,d,50,Armor,50);
strsplit(Damage," ",c,50,Victim,50);
strsplit(d," ",Damage,50,b,50,c,50);
iIDA = strtonum(c);
iIDV = strtonum(Victim);
killdata[iIDA][iIDV]=killdata[iIDA][iIDV]+(health[iIDV]-strtonum(Damage));
health[iIDV]=strtonum(Damage);
armor[iIDV]=strtonum(Armor);
return PLUGIN_CONTINUE;
}
public hp_kill( HLCommand,HLData,HLUserName,UserIndex )
{
if (!bhpEnabled)
{
return PLUGIN_CONTINUE;
}
new iIDA;
new iIDV;
new sIDA[MAX_NAME_LENGTH];
new sIDV[MAX_NAME_LENGTH];
new Data[MAX_DATA_LENGTH];
new Victim[MAX_DATA_LENGTH];
new Attacker[MAX_DATA_LENGTH];
new vaultweapon[MAX_DATA_LENGTH];
new vaultarmor[MAX_DATA_LENGTH];
new vaultudo[MAX_DATA_LENGTH];
new Text[MAX_DATA_LENGTH];
new weapon[MAX_DATA_LENGTH];
new killerweapon[MAX_DATA_LENGTH];
new iRand = random(3);
convert_string( HLData, Data, MAX_DATA_LENGTH );
strsplit(Data," ",sIDA,MAX_NAME_LENGTH,sIDV,MAX_NAME_LENGTH,weapon,MAX_DATA_LENGTH);
iIDA = strtonum(sIDA);
iIDV = strtonum(sIDV);
endhealth[iIDV]=health[iIDA];
endarmor[iIDV]=armor[iIDA];
if (endhealth[iIDV]==0)
{
endhealth[iIDV]=100;
}
enemy[iIDV]=iIDA;
if (strcmp(weapon,"grenade") == 0 )
{
endweapon[iIDV]=1;
killerweapon ="der HE Granate";
}
if (strcmp(weapon,"knife") == 0 )
{
endweapon[iIDV]=2;
killerweapon ="dem Messer";
}
if (strcmp(weapon,"deagle") == 0 )
{
endweapon[iIDV]=3;
killerweapon ="der Desert Eagle";
}
if (strcmp(weapon,"elite") == 0 )
{
endweapon[iIDV]=4;
killerweapon ="den Elite Dual Berettas";
}
if (strcmp(weapon,"glock18") == 0 )
{
endweapon[iIDV]=5;
killerweapon ="der Glock 18";
}
if (strcmp(weapon,"p228") == 0 )
{
endweapon[iIDV]=6;
killerweapon ="der SIG P228";
}
if (strcmp(weapon,"fiveseven") == 0)
{
endweapon[iIDV]=7;
killerweapon ="der FN Five-Seven";
}
if (strcmp(weapon,"usp") == 0)
{
endweapon[iIDV]=8;
killerweapon ="der H&K USP";
}
if (strcmp(weapon,"m3") == 0 )
{
endweapon[iIDV]=9;
killerweapon ="der M3 Super90";
}
if (strcmp(weapon,"xm1014") == 0 )
{
endweapon[iIDV]=10;
killerweapon ="der XM1014";
}
if (strcmp(weapon,"mp5navy") == 0 )
{
endweapon[iIDV]=11;
killerweapon ="der MP5 Navy";
}
if (strcmp(weapon,"p90") == 0 )
{
endweapon[iIDV]=12;
killerweapon ="der FN P90";
}
if (strcmp(weapon,"tmp") == 0 )
{
endweapon[iIDV]=13;
killerweapon ="der Steyr TMP";
}
if (strcmp(weapon,"mac10") == 0 )
{
endweapon[iIDV]=14;
killerweapon ="der Ingram MAC-10";
}
if (strcmp(weapon,"ump45") == 0 )
{
endweapon[iIDV]=15;
killerweapon ="der H&K UMP45";
}
if (strcmp(weapon,"aug") == 0 )
{
endweapon[iIDV]=16;
killerweapon ="der Steyr Aug";
}
if (strcmp(weapon,"sg552") == 0 )
{
endweapon[iIDV]=17;
killerweapon ="der Sig SG-552";
}
if (strcmp(weapon,"awp") == 0 )
{
endweapon[iIDV]=18;
killerweapon ="der AWP";
}
if (strcmp(weapon,"m4a1") == 0 )
{
endweapon[iIDV]=19;
killerweapon ="der M4A1";
}
if (strcmp(weapon,"ak47") == 0 )
{
endweapon[iIDV]=20;
killerweapon ="der AK-47";
}
if (strcmp(weapon,"scout") == 0 )
{
endweapon[iIDV]=21;
killerweapon ="der Steyr Scout";
}
if (strcmp(weapon,"sg550") == 0 )
{
endweapon[iIDV]=22;
killerweapon ="der Sig SG-550 Sniper";
}
if (strcmp(weapon,"g3sg1") == 0 )
{
endweapon[iIDV]=23;
killerweapon ="der H&K G3/SG-1";
}
if (strcmp(weapon,"m249") == 0 )
{
endweapon[iIDV]=24;
killerweapon ="der FN M249 Para";
}
playerinfo(iIDA,Attacker,MAX_DATA_LENGTH);
playerinfo(iIDV,Victim,MAX_DATA_LENGTH);
switch(iRand)
{
case 1: snprintf(Message,MAX_TEXT_LENGTH,"wurde von Niemandem verletzt!");
case 2: snprintf(Message,MAX_TEXT_LENGTH,"wurde von keiner Kugel getroffen!");
case 3: snprintf(Message,MAX_TEXT_LENGTH,"ist jeder Kugel ausgewichen!");
}
get_vaultdata("admin_hpdeath",Death, MAX_DATA_LENGTH);
if(strcmp(Death,"1")==0)
{
get_vaultdata("admin_hparmor",Displayarmor, MAX_DATA_LENGTH);
if(strcmp(Displayarmor,"0")==0)
{
snprintf(vaultarmor,MAX_DATA_LENGTH,"");
}
else
{
snprintf(vaultarmor,MAX_DATA_LENGTH," & %i Armor",endarmor[iIDV]);
}
get_vaultdata("admin_hpweapon",Displayweapon, MAX_DATA_LENGTH);
if(strcmp(Displayweapon,"0")==0)
{
snprintf(vaultweapon,MAX_DATA_LENGTH,"");
}
else
{
snprintf(vaultweapon,MAX_DATA_LENGTH,"Er traf Dich mit %s!",killerweapon);
}
get_vaultdata("admin_hpudo",Displayudo,MAX_DATA_LENGTH);
if(strcmp(Displayudo,"0")==0)
{
snprintf(vaultudo,MAX_DATA_LENGTH,"");
}
else
{
if (killdata[iIDV][iIDA]==0)
{
snprintf(vaultudo,MAX_DATA_LENGTH,"Du hast ihn nicht getroffen!",killdata[iIDV][iIDA]);
}
else
{
snprintf(vaultudo,MAX_DATA_LENGTH,"Du hast ihm %i HP abgezogen!",killdata[iIDV][iIDA]);
}
}
get_vaultdata("admin_hpdisplay",Display, MAX_DATA_LENGTH);
if(strcmp(Display,"0")==0)
{
if (endhealth[iIDV]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s %s %s",Attacker,Message,vaultweapon);
messageex(Victim,Text,print_chat);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP%s, %s %s",Attacker,endhealth[iIDV],vaultarmor,vaultweapon,vaultudo);
messageex(Victim,Text,print_chat);
}
}
if(strcmp(Display,"1")==0)
{
if (endhealth[iIDV]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s %s ^n%s",Attacker,Message,vaultweapon);
if(strlen(Attacker)>45)
{
snprintf(Text,MAX_DATA_LENGTH,"Dein Gegner %s ^n%s",Message,vaultweapon);
}
messageex(Victim,Text,print_tty);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP%s ^n%s ^n%s",Attacker,endhealth[iIDV],vaultarmor,vaultweapon,vaultudo);
if(strlen(Attacker)>50)
{
snprintf(Text,MAX_DATA_LENGTH,"Dein Gegner hatte noch %i HP%s ^n%s ^n%s",endhealth[iIDV],vaultarmor,vaultweapon,vaultudo);
}
messageex(Victim,Text,print_tty);
}
}
if(strcmp(Display,"2")==0)
{
if (endhealth[iIDV]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s %s ^n%s",Attacker,Message,vaultweapon);
if(strlen(Attacker)>45)
{
snprintf(Text,MAX_DATA_LENGTH,"Dein Gegner %s ^n%s",Message,vaultweapon);
}
messageex(Victim,Text,print_pretty);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP%s ^n%s ^n%s",Attacker,endhealth[iIDV],vaultarmor,vaultweapon,vaultudo);
if(strlen(Attacker)>50)
{
snprintf(Text,MAX_DATA_LENGTH,"Dein Gegner hatte noch %i HP%s ^n%s ^n%s",endhealth[iIDV],vaultarmor,vaultweapon,vaultudo);
}
messageex(Victim,Text,print_pretty);
}
}
}
return PLUGIN_HANDLED;
}
public hp_reset(HLCommand,HLData,HLUserName,UserIndex,Param)
{
new loop;
new Data[MAX_NAME_LENGTH];
convert_string(HLData,Data,MAX_NAME_LENGTH);
if( strcmp( "Round_Start", Data ) != 0 )
{
return PLUGIN_HANDLED;
}
for( loop = 0; loop < MAX_PLAYERS; loop += 1 )
{
health[loop] = 100;
endhealth[loop] = CLEAN_SLATE;
enemy[loop] =CLEAN_SLATE;
endweapon[loop]=CLEAN_SLATE;
armor[loop] = CLEAN_SLATE;
endarmor[loop]= CLEAN_SLATE;
for(new i=0;i<MAX_PLAYERS; i=i+1)
{
killdata[loop]
= CLEAN_SLATE;
}
}
return PLUGIN_HANDLED;
}
public HandleSay(HLCommand,HLData,HLUserName,UserIndex)
{
if (!bhpEnabled)
{
return PLUGIN_CONTINUE;
}
new Data[MAX_DATA_LENGTH];
new User[MAX_DATA_LENGTH];
new enemyname[MAX_DATA_LENGTH];
new vaultweapon[MAX_DATA_LENGTH];
new vaultarmor[MAX_DATA_LENGTH];
new vaultudo[MAX_DATA_LENGTH];
new Text[MAX_DATA_LENGTH];
new IsDead = 0,UserID,WONID,Team;
new iUser;
new killerweapon[MAX_NAME_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_DATA_LENGTH);
strstripquotes(Data);
get_userindex( User, iUser );
if (streq(Data, "hp?")==1 || streq(Data, "hp")==1 || streq(Data, "hp ?")==1)
{
playerinfo(iUser,User,MAX_DATA_LENGTH,UserID,WONID,Team,IsDead);
if(IsDead == 0)
{
return PLUGIN_CONTINUE;
}
else
{
if(enemy[iUser]==0)
{
messageex(User,"Du wurdest von keinem umgebracht. Selbstmord ? Oder war es der boese Admin ?",print_chat)
return PLUGIN_HANDLED;
}
switch(endweapon[iUser])
{
case 1: killerweapon ="der HE Granate";
case 2: killerweapon ="dem Messer";
case 3: killerweapon ="der Desert Eagle";
case 4: killerweapon ="den Elite Dual Berettas";
case 5: killerweapon ="der Glock 18";
case 6: killerweapon ="der SIG P228";
case 7: killerweapon ="der FN Five-Seven";
case 8: killerweapon ="der H&K USP";
case 9: killerweapon ="der M3 Super90";
case 10: killerweapon ="der XM1014";
case 11: killerweapon ="der MP5 Navy";
case 12: killerweapon ="der FN P90";
case 13: killerweapon ="der Steyr TMP";
case 14: killerweapon ="der Ingram MAC-10";
case 15: killerweapon ="der H&K UMP45";
case 16: killerweapon ="der Steyr Aug";
case 17: killerweapon ="der Sig SG-552";
case 18: killerweapon ="der AWP";
case 19: killerweapon ="der M4A1";
case 20: killerweapon ="der AK-47";
case 21: killerweapon ="der Steyr Scout";
case 22: killerweapon ="der Sig SG-550 Sniper";
case 23: killerweapon ="der H&K G3/SG-1";
case 24: killerweapon ="der FN M249 Para";
}
playerinfo(enemy[iUser],enemyname,MAX_DATA_LENGTH);
get_vaultdata("admin_hparmor",Displayarmor, MAX_DATA_LENGTH);
if(strcmp(Displayarmor,"0")==0)
{
snprintf(vaultarmor,MAX_DATA_LENGTH,"");
}
else
{
snprintf(vaultarmor,MAX_DATA_LENGTH," & %i Armor",endarmor[iUser]);
}
get_vaultdata("admin_hpweapon",Displayweapon, MAX_DATA_LENGTH);
if(strcmp(Displayweapon,"0")==0)
{
snprintf(vaultweapon,MAX_DATA_LENGTH,"");
}
else
{
snprintf(vaultweapon,MAX_DATA_LENGTH,"Er traf Dich mit %s!",killerweapon);
}
get_vaultdata("admin_hpudo",Displayudo,MAX_DATA_LENGTH);
if(strcmp(Displayudo,"0")==0)
{
snprintf(vaultudo,MAX_DATA_LENGTH,"");
}
else
{
if (killdata[iUser][enemy[iUser]]==0)
{
snprintf(vaultudo,MAX_DATA_LENGTH,"Du hast ihn nicht getroffen!",killdata[iUser][enemy[iUser]]);
}
else
{
snprintf(vaultudo,MAX_DATA_LENGTH,"Du hast ihm %i HP abgezogen!",killdata[iUser][enemy[iUser]]);
}
}
get_vaultdata("admin_hpdisplay",Display, MAX_DATA_LENGTH);
if(strcmp(Display,"0")==0)
{
if (endhealth[iUser]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s %s %s",enemyname,Message,vaultweapon);
messageex(User,Text,print_chat);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP%s, %s %s",enemyname,endhealth[iUser],vaultarmor,vaultweapon,vaultudo);
messageex(User,Text,print_chat);
}
}
if(strcmp(Display,"1")==0)
{
if (endhealth[iUser]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s %s^n%s",enemyname,Message,vaultweapon);
if(strlen(enemyname)>45)
{
snprintf(Text,MAX_DATA_LENGTH,"Dein Gegner %s ^n%s",Message,vaultweapon);
}
messageex(User,Text,print_tty);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP%s ^n%s ^n%s",enemyname,endhealth[iUser],vaultarmor,vaultweapon,vaultudo);
if(strlen(enemyname)>50)
{
snprintf(Text,MAX_DATA_LENGTH,"Dein Gegner hatte noch %i HP%s ^n%s ^n%s",endhealth[iUser],vaultarmor,vaultweapon,vaultudo);
}
messageex(User,Text,print_tty);
}
}
if(strcmp(Display,"2")==0)
{
if (endhealth[iUser]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s %s ^n%s",enemyname,Message,vaultweapon);
if(strlen(enemyname)>45)
{
snprintf(Text,MAX_DATA_LENGTH,"Dein Gegner %s ^n%s",Message,vaultweapon);
}
messageex(User,Text,print_pretty);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP%s ^n%s ^n%s",enemyname,endhealth[iUser],vaultarmor,vaultweapon,vaultudo);
if(strlen(enemyname)>50)
{
snprintf(Text,MAX_DATA_LENGTH,"Dein Gegner hatte noch %i HP%s ^n%s ^n%s",endhealth[iUser],vaultarmor,vaultweapon,vaultudo);
}
messageex(User,Text,print_pretty);
}
}
}
}
return PLUGIN_CONTINUE;
}
public plugin_init()
{
plugin_registerinfo("?HP-Script","Announces the health of your opponent",STRING_VERSION);
plugin_registercmd("hp_injure", "hp_injure", ACCESS_CONSOLE, "");
plugin_registercmd("hp_kill", "hp_kill", ACCESS_CONSOLE, "");
plugin_registercmd("hp_reset", "hp_reset", ACCESS_CONSOLE, "");
plugin_registercmd("say","HandleSay",ACCESS_ALL);
plugin_registerhelp("say",ACCESS_ALL,"say hp?/hp/hp ?: Will announce the health and weapon of your killer.");
plugin_registercmd("admin_hp", "admin_hp", ACCESS_BAN, "admin_hp (1/0): Turns HP Display on/off.");
plugin_registercmd("admin_hpdeath", "admin_hpdeath", ACCESS_BAN, "admin_hpdeath (1/0): 0=message is displayed only if you ask hp in chat, 1=message is displayed directly after death");
plugin_registercmd("admin_hparmor", "admin_hparmor", ACCESS_BAN, "admin_hparmor (1/0): 0=message is displayed without armor, 1=message is displayed with the killers armor");
plugin_registercmd("admin_hpweapon", "admin_hpweapon", ACCESS_BAN, "admin_hpweapon (1/0): 0=message is displayed without weapon, 1=message is displayed with the weapon");
plugin_registercmd("admin_hpudo", "admin_hpudo", ACCESS_BAN, "admin_hpudo (1/0): 0=message is displayed without Damage you do, 1=message is displayed with the Damage you do");
plugin_registercmd("admin_hpdisplay", "admin_hpdisplay", ACCESS_BAN, "admin_hpdisplay (2/1/0): 0=display in chat, 1=display in typesay, 2=display in centersay");
exec( "logd_reg 58 admin_command hp_injure" );
exec( "logd_reg 57 admin_command hp_kill" );
exec( "logd_reg 62 admin_command hp_reset" );
return PLUGIN_CONTINUE;
}