Announced momentan nur HKs und macht sonst momentan noch nichts. Kann man ja drauf aufbauen!
Code:
/*
* Marco Stielow -- Marsti@gmx.de -- http://marsti.de.vu -- 2002/05/18
*
* Handling Hostage-Kills
*
*/
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_CONSOLE 131072
new STRING_VERSION[MAX_DATA_LENGTH] = "v1";
#define CLEAN_SLATE 0
new roundhkills[ MAX_PLAYERS ] = {CLEAN_SLATE,...};
new hkills[ MAX_PLAYERS ] = {CLEAN_SLATE,...};
public logd_hostagekill(HLCommand,HLData,HLUserName,UserIndex)
{
new Data[MAX_DATA_LENGTH];
new Message[MAX_TEXT_LENGTH];
new sID[MAX_DATA_LENGTH];
convert_string(HLData, Data, MAX_DATA_LENGTH);
strbreak(Data, sID, Data, MAX_DATA_LENGTH);
if(strcmp(Data, "Killed_A_Hostage") == 0)
{
new Name[MAX_NAME_LENGTH];
new iID = strtonum( sID );
if( !playerinfo(iID,Name,MAX_NAME_LENGTH) ) {
return 0;
}
if(iID == 0) {
return 0;
}
hkills[iID] += 1;
roundhkills[iID] += 1;
snprintf(Message, MAX_TEXT_LENGTH, "%s killed a hostage!!!\nHe killed already %i hostages this round...\nand %i hostages this game", Name, roundhkills[iID], hkills[iID] );
//snprintf(Message, MAX_TEXT_LENGTH, "%s killed a hostage!!!", Name);
centersay(Message, 5, 10, 255, 255);
}
return PLUGIN_HANDLED;
}
public hk_newround(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 ) {
roundhkills[loop] = CLEAN_SLATE;
}
return PLUGIN_HANDLED;
}
public plugin_connect(HLUserName,HLIP, UserIndex)
{
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
hkills[UserIndex] = CLEAN_SLATE;
roundhkills[UserIndex] = CLEAN_SLATE;
}
return PLUGIN_CONTINUE;
}
public plugin_disconnect(HLUserName,UserIndex)
{
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
hkills[UserIndex] = CLEAN_SLATE;
roundhkills[UserIndex] = CLEAN_SLATE;
}
return PLUGIN_CONTINUE;
}
public plugin_init() {
plugin_registerinfo("Hostage-Killing Punisher","Punishes killing hostages.",STRING_VERSION);
plugin_registercmd("logd_hostagekill", "logd_hostagekill", ACCESS_CONSOLE, "");
plugin_registercmd("hk_newround", "hk_newround", ACCESS_CONSOLE, "");
exec( "logd_reg 60 admin_command logd_hostagekill" );
exec( "logd_reg 62 admin_command hk_newround" );
return PLUGIN_CONTINUE;
}