Hallo Leute !
Hier nochmal das Plugin, was Killstreak, HP, Playeraward und Headshot beinhalted.
Der Original-Thread scheint wohl weg zu sein:
Hier also nochmal der Code :
Code:
/*******************************************************************
* *********
** Sir Drink a lots All-In-One v 1.0 ********
*** *******
**** INFO: Announces a headshot shot , when you hit the ******
***** the head of your enemy.It announces only a headshot, *****
****** if the enemy died. ****
******* It has its own Playeraward with announcing the ***
******* teamscore and the best player of the round with ***
******* his number of headshots, he made.:-) ***
******* This plugin includes its own killstreak and the ***
******* HP-Plugin. I have made this Version, because I hope, ***
******* it doesnt need much system-performance. ***
******* Thanks to Warhead,Biohazard,[Cola]-Whiskey an the ***
********* www.adminmod.de forumusers for help and the idea **
********* ALSO GREAT THANKS TO NETKOWALSKI FOR THE NEW CODE !!! *
*******************************************************************
For Headshot-Announcing:
admin_headshot 0/1:
1= Headshot-Sound and Message is activated
0= Headshot-Sound and Message is deactivated
For Killstreak-Announcing:
------------------------------
admin_killstreak 0/1:
0= Killstreak-Sound and Messages activated.
1= Killstreak-Sound and Messages deactivated.
For Using the HP - Messages:
------------------------------
You have to set up admin_hp 0,1 ,admin_hpdisplay 0,1 ,admin_hpweapon 0,1 and admin_hpdeath 0,1 in your vault.ini.
To store your values forever :-)
admin_hp 0,1:
0= HP is deactivated.
1= HP is activated.
admin_hpdisplay :
0= Only Display in chat area...
1= Display as typesay-message only visible for the victim.
admin_hpweapon:
0= Display with announcement of the killers weapon and armor.
1= Display without the weapon and armor.
admin_hpdeath:
0= Message is only displayed if you type hp in chat
1= Message is also displayed directly after death
It is recommended, that you only use the diplay in typesay if you have deactivated the
display with weapon.
!!! Sometimes it occurs that the client crashes if you use typesay !!!
*/
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
new STRING_VERSION[MAX_DATA_LENGTH] = "1.0";
#define ACCESS_CONSOLE 131072
#define ACCESS_ALL 0
#define CLEAN_SLATE 0
/************************ Killstreak-Level-Settings ********************/
#define Level1 3
#define Level2 4
#define Level3 6
#define Level4 8
#define Level5 10
/**********************************************************************/
new KillCount[ 100 ] = {CLEAN_SLATE,...}; /*Used for Counting Frags for the playeraward (reset by starting new round)*/
new FragCount[ MAX_PLAYERS ] = {CLEAN_SLATE,...}; /*Used for Counting Frags for killstreak (reset only by death)*/
new HeadCount[ 100 ] = {CLEAN_SLATE,...}; /*Used for Counting the Headshots for the playeraward (reset by starting new round)*/
/**************************** Arrays used for HP-Announcing ***********/
new health[ MAX_PLAYERS ]= {CLEAN_SLATE,...};
new endhealth[MAX_PLAYERS] ={CLEAN_SLATE,...};
new enemy[MAX_PLAYERS] ={CLEAN_SLATE,...};
new armor[ MAX_PLAYERS ]= {CLEAN_SLATE,...};
new endarmor[MAX_PLAYERS] ={CLEAN_SLATE,...};
new endweapon[MAX_PLAYERS]={CLEAN_SLATE,...};
/**********************************************************************/
/************ Variables used for checking vault.ini entries ***********/
new Headshot[MAX_NUMBER_LENGTH];
new Killstreak[MAX_NUMBER_LENGTH];
new HP[MAX_NUMBER_LENGTH]
new Death[MAX_NUMBER_LENGTH];
new Displayweapon[MAX_NUMBER_LENGTH];
new Display[MAX_NUMBER_LENGTH];
/**********************************************************************/
/**************** Variables used for Playeraward **********************/
new ctscore [MAX_DATA_LENGTH];
new terrscore[MAX_DATA_LENGTH];
new SpielerID = 0;
/**********************************************************************/
/************************************************************************************/
/********************** Functions to change entries in vault.ini ********************/
/************************************************************************************/
/*************************************************************************
***************** Settings for Headshot-Announcing ***********************
**************************************************************************/
public admin_headshot( 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_headshot", Data);
selfmessage("Der Headshot-Sound und die Anzeige ist ab jetzt IMMER ausgeschaltet.");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_headshot", Data);
selfmessage("Der Headshot-Sound und die Anzeige ist ab jetzt IMMER eingeschaltet.");
}
else
{
get_vaultdata("admin_headshot",Data, MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"Der Wert fuer admin_headshot steht zur Zeit auf %s",Data);
selfmessage("Ungueltiger Wert fuer admin_headshot.");
selfmessage("Entweder 0 fuer Headshot-Announcing ausschalten oder 1 um es einzuschalten. ");
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
/******************************************************************************
******************* Settings for Killstreak-Announcing ************************
*******************************************************************************/
public admin_killstreak( 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_killstreak", Data);
selfmessage("Das Killstreak wird ab jetzt IMMER ausgeschaltet sein.");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_killstreak", Data);
selfmessage("Das Killstreak wird ab jetzt IMMER eingeschaltet sein.");
}
else
{
get_vaultdata("admin_killstreak",Data, MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"Der Wert fuer admin_killstreak steht zur Zeit auf %s",Data);
selfmessage("Ungueltiger Wert fuer admin_killstreak.");
selfmessage("Entweder 1 um Killstreak zu aktivieren oder 0 um es zu deaktivieren. ");
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
/**************************************************************************
*************************** Settings for HP-Announcing ********************
***************************************************************************/
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)
{
set_vaultdata("admin_hp", Data);
selfmessage("Das HP ist ab jetzt IMMER ausgeschaltet.");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_hp", Data);
selfmessage("Das HP ist ab jetzt IMMER eingeschaltet.");
}
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 0 fuer HP ausschalten oder 1 fuer HP einschalten. ");
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 Chat angezeigt.");
}
else if(strcmp(Data,"1")==0)
{
set_vaultdata("admin_hpdisplay", Data);
selfmessage("Das HP wird ab jetzt IMMER als Typesay 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("Entweder 0 fuer Display im Chat oder 1 fuer Display als Typesay. ");
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 nur mit Waffenangabe oder 0 fuer Anzeige ohne Waffenangabe an den Spieler.");
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;
}
/************************************************************************************/
/************************************************************************************/
/******************************************************************************************
*************************** This Funktion is used by HP-Announcing ************************
*************************** and Killstreak-Announcing. Plays the ************************
*************************** sound to everybody at the server. ************************
*******************************************************************************************/
playFile( sFileName[ ] )
{
new Name[ MAX_NAME_LENGTH ];
new iUserID;
new iWONID;
new maxplayers = maxplayercount();
for( new i = 1; i <= maxplayers; i++ )
{
if( playerinfo(i, Name, MAX_NAME_LENGTH, iUserID, iWONID ) )
{
//if its not a bot
if( iWONID != 0 )
{
playsound(Name, sFileName );
}
}
}
return 1;
}
/******************************************************************************************
*************************** This Funktion is used by HP-Announcing ************************
*******************************************************************************************/
soundall(NameKiller[],weapon[])
{
get_vaultdata("admin_headshot",Headshot, MAX_DATA_LENGTH);
if(strcmp(Headshot,"1")==0)
{
new Text[ MAX_TEXT_LENGTH ];
playFile( "misc/headshot.wav" );
snprintf( Text, MAX_TEXT_LENGTH, "%s made a headshot with the %s",NameKiller,weapon);
typesay(Text, 6, 255, 255, 255 );
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
/******************************************************************************************
*************************** The Injure-Event is used by HP-Display ************************
*************************** and the Announcing of Headshot ************************
*******************************************************************************************/
public aio_injure( HLCommand,HLData,HLUserName,UserIndex )
{
new iIDA;
new iIDD;
new iIDH;
new iIDV;
new dummy1[50];
new dummy2[50];
new Attacker[3];
new Victim[3];
new Damage[30];
new Armor[30];
new Victimhealth[30];
new Data[MAX_DATA_LENGTH];
new NameKiller[MAX_NAME_LENGTH];
new weapon[50];
new IsDead = 0,UserID,WONID,Team;
convert_string( HLData, Data, MAX_DATA_LENGTH );
strgsplit(Data," ",": ",Attacker,3,Victim,3,weapon,50,dummy1,50,Damage,50,dummy1,50,dummy1,50,dummy2,50,Armor,50);
strsplit(dummy2,"# ",dummy1,30,Victimhealth,30);
strsplit(Armor,"# ",dummy1,30,Armor,30);
iIDA =strtonum (Attacker);
iIDV =strtonum (Victim);
iIDD =strtonum (Damage);
iIDH =strtonum (Victimhealth);
health[iIDV]=iIDH;
armor[iIDV]=strtonum(Armor);
if(!playerinfo(iIDA,NameKiller,MAX_DATA_LENGTH,UserID,WONID,Team,IsDead))
{
return PLUGIN_FAILURE;
}
if (strcmp(weapon,"deagle") == 0 && iIDD >=80 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"elite") == 0 && iIDD >=40 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"glock18") == 0 && iIDD >=40 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"p228") == 0 && iIDD >=40 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"fiveseven") == 0 && iIDD >=40 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"usp") == 0 && iIDD >=40&& iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"m3") == 0 && iIDD >=156 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"xm1014") == 0 && iIDD >=99 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"mp5navy") == 0 && iIDD >=36 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"p90") == 0 && iIDD >=40 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"tmp") == 0 && iIDD >=36 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"mac10") == 0 && iIDD >=40 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"ump40") == 0 && iIDD >=45 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"aug") == 0 && iIDD >=50 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"sg552") == 0 && iIDD >=50 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"awp") == 0 && iIDD >=155 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"m4a1") == 0 && iIDD >=50 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"ak47") == 0 && iIDD >=50 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"scout") == 0 && iIDD >=95 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"sg550") == 0 && iIDD >=70 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"g3sg1") == 0 && iIDD >=70 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
if (strcmp(weapon,"m249") == 0 && iIDD >=50 && iIDH <= 0)
{
HeadCount[iIDA] += 1;
soundall(NameKiller,weapon);
}
return PLUGIN_CONTINUE;
}
/******************************************************************************************
******************************** The Kill-Event is used by all ****************************
*******************************************************************************************/
public aio_kill( HLCommand,HLData,HLUserName,UserIndex )
{
new iIDA;
new iIDV;
new sID1[3];
new sID2[3];
new iUserID;
new iWONID;
new iTeamA;
new iTeamV
new Data[MAX_DATA_LENGTH];
new Victim[MAX_NAME_LENGTH];
new Killer[MAX_NAME_LENGTH];
new weapon[MAX_NAME_LENGTH];
new killerweapon[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new Text1[MAX_TEXT_LENGTH];
new loop;
convert_string( HLData, Data, MAX_DATA_LENGTH );
strsplit( Data, " ", sID1, 3, sID2, 3 ,weapon,50);
iIDA = strtonum( sID1 );
iIDV = strtonum (sID2 );
endhealth[iIDV]=health[iIDA];
FragCount[iIDV]=CLEAN_SLATE;
if (endhealth[iIDV]==0)
{
endhealth[iIDV]=100;
}
enemy[iIDV]=iIDA;
if(playerinfo(iIDA, Killer, MAX_NAME_LENGTH, iUserID, iWONID, iTeamA))
{
if(playerinfo(iIDV, Victim, MAX_NAME_LENGTH, iUserID, iWONID, iTeamV))
{
if(iTeamV != iTeamA)
{
KillCount[ iIDA ] += 1;
FragCount[ iIDA ] += 1;
}
else
{
KillCount[iIDA] -=1;
FragCount[iIDA] -=1;
}
}
}
/******************* KILLSTREAK-ANNOUNCING AND SOUNDS **********************/
get_vaultdata("admin_killstreak",Killstreak, MAX_NUMBER_LENGTH);
if(strcmp(Killstreak,"1")==0)
{
if (FragCount[ iIDA ] == Level1)
{
playFile( "misc/multikill.wav" );
snprintf(Text, MAX_TEXT_LENGTH, "%s: Multi Kill!!!(%i Kills).", Killer,FragCount[iIDA]);
typesay(Text, 6, 255, 255, 255);
}
else if( FragCount[ iIDA ] == Level2 )
{
playFile( "misc/ultrakill.wav" );
snprintf( Text, MAX_TEXT_LENGTH, "%s: Ultra Kill!!!(%i Kills).", Killer,FragCount[iIDA]);
typesay(Text, 6, 255, 10, 255 );
}
else if( FragCount[iIDA ] == Level3 )
{
playFile( "misc/killingspree.wav" );
snprintf( Text, MAX_TEXT_LENGTH, "%s is on a Killing Spree!!!(%i Kills).", Killer,FragCount[iIDA]);
typesay(Text, 6, 255, 15, 15 );
}
else if( FragCount[iIDA ] == Level4 || FragCount[iIDA ] == Level5 )
{
playFile( "misc/monsterkill.wav" );
snprintf( Text, MAX_TEXT_LENGTH, "%s made a MONSTERKILLLLL!!!(%i Kills)", Killer,FragCount[iIDA]);
typesay(Text, 6, 255, 15, 15 );
}
}
/*************************************************************************/
for (loop = 1; loop < maxplayercount();loop++)
{
if (KillCount[SpielerID]< KillCount[loop])
SpielerID = strtonum (sID1);
}
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";
}
get_vaultdata("admin_hp",HP, MAX_NUMBER_LENGTH);
if(strcmp(HP,"1")==0)
{
get_vaultdata("admin_hpdeath",Death, MAX_NUMBER_LENGTH);
if(strcmp(Death,"1")==0)
{
get_vaultdata("admin_hpweapon",Displayweapon, MAX_NUMBER_LENGTH);
if(strcmp(Displayweapon,"0")==0)
{
if (endhealth[iIDV]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s wurde von Niemandem verletzt!",Killer);
snprintf(Text1,MAX_DATA_LENGTH,"%s wurde von Niemandem verletzt!",Killer);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP !",Killer,endhealth[iIDV]);
snprintf(Text1,MAX_DATA_LENGTH,"%s hatte noch %i HP !",Killer,endhealth[iIDV]);
}
}
else
{
if (endhealth[iIDV]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s wurde von Niemandem verletzt! Er traf Dich mit %s",Killer,killerweapon);
snprintf(Text1,MAX_DATA_LENGTH,"%s wurde von Niemandem verletzt!^n Er traf Dich mit %s",Killer,killerweapon);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP und %i Armor.Er traf Dich mit %s !",Killer,endhealth[iIDV],endarmor[iIDV],killerweapon);
snprintf(Text1,MAX_DATA_LENGTH,"%s hatte noch %i HP und %i Armor.^n Er traf Dich mit %s !",Killer,endhealth[iIDV],endarmor[iIDV],killerweapon);
}
}
get_vaultdata("admin_hpdisplay",Display, MAX_NUMBER_LENGTH);
if(strcmp(Display,"0")==0)
{
messageex(Victim,Text,print_chat);
}
else
{
messageex(Victim,Text1,print_tty);
}
}
}
return PLUGIN_CONTINUE;
}
/******************************************************************************************
************************The World-Event is used by Playeraward,****************************
************************and the HP. Arrays will be set to 0. ****************************
*******************************************************************************************/
public aio_resetthescore(HLCommand,HLData,HLUserName,UserIndex)
{
new loopx;
new Data[MAX_NAME_LENGTH];
new x;
convert_string(HLData,Data,MAX_NAME_LENGTH);
if( strcmp( "Round_Start", Data ) != 0 )
return PLUGIN_HANDLED;
x = maxplayercount();
for( loopx = 1; loopx < x; loopx ++ )
{
if(SpielerID == 0)
{
return PLUGIN_HANDLED;
}
KillCount[loopx] = CLEAN_SLATE;
HeadCount[loopx] = CLEAN_SLATE;
health[loopx] = CLEAN_SLATE;
endhealth[loopx] = CLEAN_SLATE;
enemy[loopx] =CLEAN_SLATE;
endweapon[loopx]=CLEAN_SLATE;
armor[loopx] = CLEAN_SLATE;
endarmor[loopx]= CLEAN_SLATE;
}
return PLUGIN_CONTINUE;
}
/************************************************************************************************
************************The TeamAction-Event is used by Playeraward. ****************************
************************It displays the result after TeamX Wins ****************************
*************************************************************************************************/
public aio_showintheend(HLCommand,HLData,HLUserName,UserIndex)
{
new Params[MAX_DATA_LENGTH];
new Msg[MAX_TEXT_LENGTH];
new Name1[MAX_NAME_LENGTH];
new Name2[MAX_NAME_LENGTH];
new Name3[MAX_NAME_LENGTH];
new Name4[MAX_NAME_LENGTH];
new Name5[MAX_NAME_LENGTH];
new ct[MAX_DATA_LENGTH];
new terr[MAX_DATA_LENGTH];
new event[MAX_DATA_LENGTH];
new b[MAX_NAME_LENGTH];
new c[MAX_NAME_LENGTH];
new d[MAX_NAME_LENGTH];
new e[MAX_NAME_LENGTH];
new f[MAX_NAME_LENGTH];
new loop;
new a;
convert_string(HLData,Params,MAX_DATA_LENGTH);
new Data1[MAX_DATA_LENGTH];
new Data2[MAX_DATA_LENGTH];
strbreak(Params,Data1,Data2,MAX_DATA_LENGTH);
strsplit(Data2, "# " ,event,MAX_DATA_LENGTH,ct,MAX_DATA_LENGTH,ctscore,MAX_DATA_LENGTH,terr,MAX_DATA_LENGTH,terrscore,MAX_DATA_LENGTH);
if(strmatch(Data1, "CT", strlen("CT")) || strmatch(Data1, "TERRORIST", strlen("TERRORIST")))
{
if(SpielerID == 0)
{
return PLUGIN_HANDLED;
}
for( loop = 1; loop < maxplayercount(); loop++ )
{
if (KillCount[SpielerID]== KillCount[loop])
{
a++;
switch (a)
{
case 1:
{
playerinfo(loop, Name1, MAX_NAME_LENGTH);
}
case 2:
{
if(!playerinfo(loop, Name2, MAX_NAME_LENGTH))
{
break;
}
else
{
snprintf(f,MAX_NAME_LENGTH,"with %i kill(s)",KillCount[SpielerID]);
snprintf(b,MAX_NAME_LENGTH,"Other Best Players: 2.: %s",Name2);
}
}
case 3:
{
if(!playerinfo(loop, Name3, MAX_NAME_LENGTH))
{
break;
}
else
{
snprintf(c,MAX_NAME_LENGTH,"3.: %s",Name3);
}
}
case 4:
{
if(!playerinfo(loop, Name4, MAX_NAME_LENGTH))
{
break;
}
else
{
snprintf(d,MAX_NAME_LENGTH,"4.: %s",Name4);
}
}
case 5:
{
if(!playerinfo(loop, Name5, MAX_NAME_LENGTH))
{
break;
}
else
{
snprintf(e,MAX_NAME_LENGTH,"5.: %s",Name5);
}
}
}
}
}
a = 0;
snprintf( Msg, MAX_TEXT_LENGTH, "T: %s - CT: %s ^nBest: %s -Kills: %i -HS: %i",terrscore,ctscore,Name1,KillCount[SpielerID],HeadCount[SpielerID]);
if(strlen(Msg)>80)
{
return PLUGIN_HANDLED;
}
typesay(Msg,12,10,255,255);
snprintf(Msg,MAX_TEXT_LENGTH,"%s %s %s %s %s",b,c,d,e,f);
say(Msg);
}
return PLUGIN_HANDLED;
}
/************************************************************************************************
************************ The HandleSay is used by Playeraward and ****************************
************************ the HP. It reacts at chat-entries like ****************************
************************ "score","hp" etc. ****************************
*************************************************************************************************/
public HandleSay(HLCommand,HLData,HLUserName,UserIndex)
{
new data[MAX_DATA_LENGTH];
new Name[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new Text1[MAX_TEXT_LENGTH];
new IsDead = 0,UserID,WONID,Team;
new User[MAX_DATA_LENGTH];
new iUser;
new killerweapon[MAX_NAME_LENGTH];
new enemyname[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, "score") ==1)
{
playerinfo(iUser,Name,MAX_DATA_LENGTH,UserID,WONID,Team,IsDead);
if(IsDead == 0)
{
return PLUGIN_CONTINUE;
}
else
{
if(SpielerID == 0)
{
return PLUGIN_HANDLED;
}
snprintf( Text, MAX_TEXT_LENGTH, "T: %s -- CT: %s^nBest at the moment: %s Kills: %i",terrscore,ctscore,Name,KillCount[SpielerID]);
if(strlen(Text)>80)
{
return PLUGIN_HANDLED;
}
typesay(Text,12,10,255,255);
}
}
if (streq(data, "hp?")==1 || streq(data, "hp")==1 || streq(data, "hp ?")==1)
{
get_vaultdata("admin_hp",HP, MAX_NUMBER_LENGTH);
if(strcmp(HP,"1")==0)
{
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_hpdeath",Death, MAX_NUMBER_LENGTH);
if(strcmp(Death,"1")==0)
{
get_vaultdata("admin_hpweapon",Displayweapon, MAX_NUMBER_LENGTH);
if(strcmp(Displayweapon,"0")==0)
{
if (endhealth[iUser]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s wurde von Niemandem verletzt!",enemyname);
snprintf(Text1,MAX_DATA_LENGTH,"%s wurde von Niemandem verletzt!",enemyname);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP !",enemyname,endhealth[iUser]);
snprintf(Text1,MAX_DATA_LENGTH,"%s hatte noch %i HP !",enemyname,endhealth[iUser]);
}
}
else
{
if (endhealth[iUser]==100)
{
snprintf(Text,MAX_DATA_LENGTH,"%s wurde von Niemandem verletzt! Er traf Dich mit %s",enemyname,killerweapon);
snprintf(Text1,MAX_DATA_LENGTH,"%s wurde von Niemandem verletzt!^n Er traf Dich mit %s",enemyname,killerweapon);
}
else
{
snprintf(Text,MAX_DATA_LENGTH,"%s hatte noch %i HP und %i Armor.Er traf Dich mit %s !",enemyname,endhealth[iUser],endarmor[iUser],killerweapon);
snprintf(Text1,MAX_DATA_LENGTH,"%s hatte noch %i HP und %i Armor.^n Er traf Dich mit %s !",enemyname,endhealth[iUser],endarmor[iUser],killerweapon);
}
}
get_vaultdata("admin_hpdisplay",Display, MAX_NUMBER_LENGTH);
if(strcmp(Display,"0")==0)
{
messageex(User,Text,print_chat);
}
else
{
messageex(User,Text1,print_tty);
}
}
}
}
}
return PLUGIN_CONTINUE;
}
public plugin_connect(HLUserName,HLIP,UserIndex)
{
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS)
{
KillCount[UserIndex] = CLEAN_SLATE;
}
return PLUGIN_CONTINUE;
}
public plugin_disconnect(HLUserName, UserIndex)
{
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS)
{
KillCount[UserIndex] = CLEAN_SLATE;
}
return PLUGIN_CONTINUE;
}
public plugin_init()
{
plugin_registerinfo("Impressiv-Script","Announces very good kills.",STRING_VERSION);
plugin_registercmd("aio_injure", "aio_injure", ACCESS_CONSOLE, "");
plugin_registercmd("aio_kill", "aio_kill", ACCESS_CONSOLE, "");
plugin_registercmd("aio_resetthescore", "aio_resetthescore", ACCESS_CONSOLE, "");
plugin_registercmd("aio_showintheend", "aio_showintheend", ACCESS_CONSOLE, "");
plugin_registercmd("admin_aioheadshot", "admin_headshot", ACCESS_BAN, "admin_aioheadshot (1/0): 0=Headshot-Announcing is disabled, 1=Headshot-Announcing enabled");
plugin_registercmd("admin_aiokillstreak", "admin_killstreak", ACCESS_BAN, "admin_aiokillstreak (1/0): 0=Killstreak is disabled, 1=Killstreak is enabled.");
plugin_registercmd("admin_aiohp", "admin_hp", ACCESS_BAN, "admin_aiohp (1/0): 0=HP is disabled, 1=HP is enabled");
plugin_registercmd("admin_aiohpdisplay", "admin_hpdisplay", ACCESS_BAN, "admin_aiohpdisplay (1/0): 0=Text is displayed in chat, 1=Text is displayed in typesay");
plugin_registercmd("admin_aiohpweapon", "admin_hpweapon", ACCESS_BAN, "admin_aiohpweapon (1/0): 0=Text is displayed without weapon, 1=Text is displayed with weapon");
plugin_registercmd("admin_aiohpdeath", "admin_hpdeath", ACCESS_BAN, "admin_aiohpdeath (1/0): 0=Text is displayed only if you ask hp in chat, 1=Text is displayed directly after death");
plugin_registercmd("say","HandleSay",ACCESS_ALL);
plugin_registerhelp("say",ACCESS_ALL,"say score: Will announce the teamscore and current best player.");
exec( "logd_reg 57 admin_command aio_kill" );
exec( "logd_reg 62 admin_command aio_resetthescore" );
exec( "logd_reg 61 admin_command aio_showintheend" );
exec( "logd_reg 58 admin_command aio_injure" );
return PLUGIN_CONTINUE;
}
Testet es aus
Gruß,
SDal