Hallo zusammen!
Könnte jemand bitte das plugin_logd_multikill so erweitern, dass bei jedem Rundenstart für ein paar Sekunden eine Anzeige aufblinkt ("Credits-Blinken"), dass man nun schon seit x Runden die Führung hält!?
Danke schonmal!
PS: Wie kann man diese "coolen" Sprach-Sounds machen, die hier benutzt werden? Oder wurden die einfach von UT genommen. Ich hätte gerne noch so einen Sound "You
have the lead!"
Code:
/*
* Multikillcounter by [TV]Smudo.
* Announces Kills per seconds.
* Announces First Blood.
* Announces the leading Player.
* Based on Bud-froggys Killing Streak Announcer®.
*/
#pragma dynamic 16384
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
new STRING_VERSION[MAX_DATA_LENGTH] = "v1";
new FBSwitch = 1; /*First Blood. 0=OFF, 1=First Blood pro Runde , 2=First Blood pro Map.*/
#define KITSwitch 1; /*Kills in Time Switch. 1=ON or 0=OFF.*/
#define HSSwitch 1; /*Highscore. 0=OFF, 1=ON.*/
#define KillInTime 2 /*Time in Seconds*/
#define KIT_Level1 2; /*Kills per Time*/
#define KIT_Level2 3; /*Kills per Time*/
#define ACCESS_CONSOLE 131072
#define CLEAN_SLATE 0
new FragCount[ MAX_PLAYERS ] = {CLEAN_SLATE,...};
new HSCount[ MAX_PLAYERS ] = {CLEAN_SLATE,...};
new KITTimer;
new KIT_Zeit = 0;
new KIT_Count;
new Name[MAX_NAME_LENGTH];
new lastName[MAX_TEXT_LENGTH];
new lastHSName[MAX_TEXT_LENGTH];
new iIDA;
new iIDAlast;
new fbStatus = 1;
new highScore = 0;
new lastHighScore = 0;
playFile( sFileName[ ] )
{
new iUserID;
new iWONID;
new maxplayers = maxplayercount();
for( new i = 1; i <= maxplayers; i++ )
{
if( playerinfo(i, Name, MAX_NAME_LENGTH, iUserID, iWONID ) ) {
{
playsound(Name, sFileName );
}
}
}
return 1;
}
public logd_multikill( HLCommand,HLData,HLUserName,UserIndex )
{
new iIDV;
new Text[MAX_TEXT_LENGTH];
new sID1[3];
new sID2[3];
new Data[MAX_DATA_LENGTH];
new Message[ MAX_TEXT_LENGTH ];
convert_string( HLData, Data, MAX_DATA_LENGTH );
strsplit( Data, " ", sID1, 3, sID2, 3 );
iIDA = strtonum( sID1 );
iIDV = strtonum( sID2 );
if(!playerinfo(iIDA, Name, MAX_NAME_LENGTH)){
return PLUGIN_FAILURE;
}
FragCount[ iIDV ] = CLEAN_SLATE;
/*tkr_checktk*/
new iUserID;
new iWONID;
new iTeamA;
new iTeamV;
new sIDA[3];
new sIDV[3];
/*new Data[MAX_NAME_LENGTH];*/
convert_string(HLData,Data,MAX_DATA_LENGTH);
strsplit(Data, " ", sIDA, 3, sIDV, 3 );
if(playerinfo(iIDA, Data, MAX_NAME_LENGTH, iUserID, iWONID, iTeamA))
{
if(playerinfo(iIDV, Data, MAX_NAME_LENGTH, iUserID, iWONID, iTeamV))
{
if(iTeamV != iTeamA) {
FragCount[ iIDA ] += 1;
KIT_Count += 1;
HSCount[ iIDA ] += 1;
}
if(iTeamV == iTeamA) {
FragCount[ iIDA ] -= 1;
KIT_Count -= 1;
HSCount[ iIDA ] -= 1;
}
}
}
if(KITSwitch==1 && iIDA == iIDAlast && KIT_Zeit > 0) {
playerinfo(iIDA,lastName,MAX_DATA_LENGTH);
Kill_In_Time();
}
else if(KITSwitch==1 && iIDA == iIDAlast && KIT_Zeit <= 0) {
KIT_Count = 1;
iIDAlast = iIDA;
playerinfo(iIDA,lastName,MAX_DATA_LENGTH);
KIT_Zeit = (KillInTime + 1);
KITTimer = set_timer("Kill_In_Time",1,KIT_Zeit);
Kill_In_Time();
}
else if(KITSwitch==1 && iIDA != iIDAlast && KIT_Count < 3) {
KIT_Count = 1;
iIDAlast = iIDA;
playerinfo(iIDA,lastName,MAX_DATA_LENGTH);
if (KIT_Zeit > 0) {
kill_timer(KITTimer);
}
KIT_Zeit = (KillInTime + 1);
KITTimer = set_timer("Kill_In_Time",1,KIT_Zeit);
Kill_In_Time();
}
else if(KITSwitch==1 && iIDA != iIDAlast && KIT_Count > 2) {
iIDAlast = iIDA;
KIT_Count = 1;
snprintf( Text, MAX_TEXT_LENGTH, "Double Kill von %s!!",lastName);
typesay(Text, 6, 255, 255, 255 );
snprintf( Text, MAX_TEXT_LENGTH, "%s schaffte 2 Kills in %i Sekunden!!!",Name,KillInTime);
say(Text);
playFile( "misc/dk.wav" );
if (KIT_Zeit > 0) {
kill_timer(KITTimer);
}
KIT_Zeit = (KillInTime + 1);
KITTimer = set_timer("Kill_In_Time",1,KIT_Zeit);
Kill_In_Time();
}
if(fbStatus==1 && FBSwitch>=1) {
snprintf( Message, MAX_TEXT_LENGTH, "First Blood: %s!", Name);
typesay(Message, 6, 255, 15, 15 );
playFile( "misc/fblood.wav" );
fbStatus=0;
}
if(HSCount[ iIDA ]>highScore && (lastHighScore!=iIDA) && HSSwitch == 1 && HSCount[ iIDA ] > 2) {
snprintf(Text,MAX_DATA_LENGTH,"%s hat die Fuehrung mit %i Kills uebernommen !",Name,HSCount[ iIDA ]);
typesay(Text, 6, 255, 15, 15 );
say(Text);
playsound(Name, "misc/takenlead.wav" );
playsound(lastHSName, "misc/lostlead.wav" );
highScore = HSCount[ iIDA ];
lastHighScore=iIDA;
playerinfo(iIDA,lastHSName,MAX_DATA_LENGTH);
}
else if (HSCount[ iIDA ]==highScore && HSSwitch == 1 && HSCount[ iIDA ] > 2) {
playsound(Name, "misc/tiedlead.wav" );
playsound(lastHSName, "misc/tiedlead.wav" );
lastHighScore=0;
}
else if (HSCount[ iIDA ]>highScore && (lastHighScore==iIDA) && HSSwitch == 1 && HSCount[ iIDA ] > 2) {
highScore = HSCount[ iIDA ];
}
return PLUGIN_HANDLED;
}
public Kill_In_Time() {
new Text[MAX_TEXT_LENGTH];
KIT_Zeit--;
if (KIT_Zeit > 0){
return PLUGIN_CONTINUE;
}
if(KIT_Count == KIT_Level1) {
snprintf( Text, MAX_TEXT_LENGTH, "Double Kill von %s!!!",Name);
typesay(Text, 6, 255, 255, 255 );
snprintf( Text, MAX_TEXT_LENGTH, "%s schaffte %i Kills in %i Sekunden!!!",Name,KIT_Level1,KillInTime);
say(Text);
playFile( "misc/dk.wav" );
} else if(KIT_Count == KIT_Level2) {
snprintf( Text, MAX_TEXT_LENGTH, "Monster Kill von %s!!!",Name);
typesay(Text, 6, 255, 255, 255 );
snprintf( Text, MAX_TEXT_LENGTH, "%s schaffte %i Kills in %i Sekunden!!!",Name,KIT_Level2,KillInTime);
say(Text);
playFile( "misc/monsterkill.wav" );
} else if(KIT_Count > KIT_Level2){
snprintf( Text, MAX_TEXT_LENGTH, "Oh mein Gott! %i Kills!!^nEin Mega Mo-mo-mo-Monsterkill von %s",KIT_Count,Name);
typesay(Text, 6, 255, 255, 255 );
snprintf( Text, MAX_TEXT_LENGTH, "%s schaffte %i Kills in %i Sekunden!!!",Name,KIT_Count,KillInTime);
say(Text);
playFile( "misc/monsterkill.wav" );
}
KIT_Count = 0;
KIT_Zeit = 0;
return PLUGIN_CONTINUE;
}
public resetfb(HLCommand,HLData,HLUserName,UserIndex)
{
new Data[MAX_NAME_LENGTH];
convert_string(HLData,Data,MAX_NAME_LENGTH);
if((strcmp("Round_Start", Data) != 0 ) && FBSwitch == 1)
return PLUGIN_HANDLED;
else if (FBSwitch == 1) {
fbStatus=1;
}
return PLUGIN_HANDLED;
}
public resetcount(HLCommand,HLData,HLUserName,UserIndex)
{
new Data [MAX_DATA_LENGTH];
new x [MAX_DATA_LENGTH];
convert_string( HLData, Data, MAX_DATA_LENGTH );
strsplit(Data,"# ",x,MAX_DATA_LENGTH);
if(strcmp(Data,"Game_Commencing")==0)
{
FragCount[ iIDA ] = 0;
HSCount[ iIDA ] = 0;
}
else if(strcmp(x,"Restart_Round_")==0)
{
FragCount[ iIDA ] = 0;
HSCount[ iIDA ] = 0;
}
return PLUGIN_HANDLED;
}
public plugin_connect(HLUserName, HLIP, UserIndex)
{
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
FragCount[UserIndex] = CLEAN_SLATE;
HSCount[UserIndex] = CLEAN_SLATE;
}
return PLUGIN_CONTINUE;
}
public plugin_disconnect(HLUserName, UserIndex)
{
new maxplayers = maxplayercount();
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
FragCount[UserIndex] = CLEAN_SLATE;
HSCount[UserIndex] = CLEAN_SLATE;
for( new i = 1; i <= maxplayers; i++ )
{
if(HSCount[i] > highScore) {
highScore = HSCount[i];
}
}
}
return PLUGIN_CONTINUE;
}
public plugin_init()
{
plugin_registerinfo("Multikill Announcer.","Announces kills in Time.",STRING_VERSION);
plugin_registercmd("logd_multikill", "logd_multikill", ACCESS_CONSOLE, "");
plugin_registercmd("resetfb", "resetfb", ACCESS_CONSOLE, "");
plugin_registercmd("resetfb", "resetcount", ACCESS_CONSOLE, "");
exec( "logd_reg 57 admin_command logd_multikill" );
exec( "logd_reg 62 admin_command resetfb" );
exec( "logd_reg 62 admin_command resetcount" );
return PLUGIN_CONTINUE;
}