ich habe nur ne version von AM 2.50.11 aber das kann ich jetzt nichtmehr compilieren weis jemand wo der fehler liegt ?
Code:
/****************************************************************
** Biohazards Enemy Counter v 1.2 ******
*** *****
**** INFO: Tells you how many enemies are left in current ****
***** round. It acts on Kills, Teamkills, Disconnection and ***
****** Suicide. Also works with PodBot 2.5 **
****************************************************************/
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_CONSOLE 131072
#define ACCESS_EC 512
#define SHOW_TIME 1
#define COLOR_R 255
#define COLOR_G 255
#define COLOR_B 255
new STRING_VERSION[MAX_DATA_LENGTH] = "1.2";
new ADDON_WORDS[] = "man left";
new bEnemyCounter = 1; // 1 - Enemy Counter on, 2 - Enemy Counter off
new bAudio = 0; // 1 - HL Speech on, 0 - HL Speech off
new Style = 3; // 1 - Centersay, 2 - Typesay, 3 - Chat, 0 - disable
new Range = 1; // Sets the range in which Enemy Counter will act. Value has to be greater then 0 !
public admin_ec_off(HLCommand, HLData, HLUserName, UserIndex)
{
new User[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLUserName, User, MAX_NAME_LENGTH);
if (bEnemyCounter != 0) {
bEnemyCounter = 0; // Enemy Counter off
say(">>> Enemy Counter has been disabled <<<");
snprintf(Text, MAX_TEXT_LENGTH, "Enemy Counter has been disabled by %s", User);
log(Text);
}
else selfmessage("Enemy Counter already disabled");
return PLUGIN_HANDLED;
}
public admin_ec_on(HLCommand, HLData, HLUserName, UserIndex)
{
new User[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLUserName, User, MAX_NAME_LENGTH);
if (bEnemyCounter != 1) {
bEnemyCounter = 1; // Enemy Counter on
say(">>> Enemy Counter has been enabled <<<");
snprintf(Text, MAX_TEXT_LENGTH, "Enemy Counter has been enabled by %s", User);
log(Text);
}
else selfmessage("Enemy Counter already enabled");
return PLUGIN_HANDLED;
}
public admin_ecaudio_off(HLCommand, HLData, HLUserName, UserIndex)
{
bAudio = 0; // HL-Speech off
selfmessage(">>> Enemy Counter: HL-Speech off");
// log("HL-Speech off");
return PLUGIN_HANDLED;
}
public admin_ecaudio_on(HLCommand, HLData, HLUserName, UserIndex)
{
bAudio = 1; // HL-Speech on
selfmessage(">>> Enemy Counter: HL-Speech on");
// log("HL-Speech on");
return PLUGIN_HANDLED;
}
public admin_ec_style(HLCommand,HLData,HLUserName,UserIndex)
{
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
new Value;
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
Value = strtonum(Data);
if (Value == 1) {
Style = 1 // Centersy
selfmessage(">> Style changed to 'Centersay'");
}
if (Value == 2) {
Style = 2 // Typesay
selfmessage(">> Style changed to 'Typesay'");
}
if (Value == 3) {
Style = 3 // Chat
selfmessage(">> Style changed to 'Chat'");
}
if (Value == 0) {
Style = 0 // disabled
selfmessage(">> Style changed to 'disabled'");
}
if ((Value != 1) && (Value != 2) && (Value != 3) && (Value != 0))
selfmessage("Value has to be a number between 0 and 3 !");
return PLUGIN_HANDLED;
}
public admin_ec_range(HLCommand,HLData,HLUserName,UserIndex)
{
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
new Value;
new Text[MAX_TEXT_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
Value = strtonum(Data);
if (Value < 1) {
selfmessage("Value has to be a number above 0 !");
}
if (Value > 100) {
selfmessage("You silly bear, tell me a server which can handle more than 100 players !");
}
if ((Value > 0) && (Value <= 100)) {
Range = Value;
snprintf(Text, MAX_TEXT_LENGTH, ">>> Range set to %i",Value);
selfmessage(Text);
}
return PLUGIN_HANDLED;
}
public logd_enemycount (HLCommand,HLData,HLUserName,UserIndex)
{
if (!bEnemyCounter)
return PLUGIN_CONTINUE;
new iIDK;
new iIDV;
new sID1[3];
new sID2[3];
new iTeamK;
new iTeamV;
new iUserID;
new iWONID;
new Data[MAX_DATA_LENGTH];
new Victim[MAX_NAME_LENGTH];
new Killer[MAX_NAME_LENGTH];
new Target[MAX_NAME_LENGTH];
new SessionID;
new WONID;
new Team;
new Dead;
new Anzahl_T = 0;
new Anzahl_CT = 0;
new i;
new maxplayers = maxplayercount();
convert_string( HLData, Data, MAX_DATA_LENGTH );
strsplit( Data, " ", sID1, 3, sID2, 3 );
iIDK = strtonum( sID1 );
iIDV = strtonum( sID2 );
if(playerinfo(iIDK, Killer, MAX_NAME_LENGTH, iUserID, iWONID, iTeamK))
{
if(playerinfo(iIDV, Victim, MAX_NAME_LENGTH, iUserID, iWONID, iTeamV))
{
for(i=1; i<=maxplayers; i++) {
strinit(Target);
if (playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team,Dead))
{
if ((Dead == 0) && (Team == 1)) {
Anzahl_T ++;
}
if ((Dead == 0) && (Team == 2)) {
Anzahl_CT ++;
}
}
}
ec_status(iTeamV, Anzahl_T, Anzahl_CT);
}
}
return PLUGIN_CONTINUE;
}
public ec_onsuicide (sName, sUID, sWonid, sTeam, sWeapon)
{
new Target[MAX_NAME_LENGTH];
new SessionID;
new WONID;
new Team;
new Dead;
new Anzahl_T = 0;
new Anzahl_CT = 0;
new i;
new maxplayers = maxplayercount();
for(i=1; i<=maxplayers; i++) {
strinit(Target);
if (playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team,Dead))
{
if ((Dead == 0) && (Team == 1)) {
Anzahl_T ++;
}
if ((Dead == 0) && (Team == 2)) {
Anzahl_CT ++;
}
}
}
ec_status(sTeam, Anzahl_T, Anzahl_CT);
}
public ec_ondisconnect (dName, dUID, dWonid, dTeam)
{
new Target[MAX_NAME_LENGTH];
new SessionID;
new WONID;
new Team;
new Dead;
new Anzahl_T = 0;
new Anzahl_CT = 0;
new i;
new maxplayers = maxplayercount();
for(i=1; i<=maxplayers; i++) {
strinit(Target);
if (playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team,Dead))
{
if ((Dead == 0) && (Team == 1)) {
Anzahl_T ++;
}
if ((Dead == 0) && (Team == 2)) {
Anzahl_CT ++;
}
}
}
ec_status(dTeam, Anzahl_T, Anzahl_CT);
}
public ec_status(GroupV, Anz_T, Anz_CT)
{
if ((Anz_T > Range) && (Anz_CT > Range))
return PLUGIN_CONTINUE;
// if ((Anz_CT == 0) || (Anz_T == 0))
// return PLUGIN_CONTINUE;
new TextMessage[MAX_TEXT_LENGTH];
new ChatMessage[MAX_TEXT_LENGTH];
new SessionID;
new WONID;
new Team;
new Target[MAX_NAME_LENGTH];
new AudioMessage[MAX_DATA_LENGTH];
new maxplayers = maxplayercount();
new i;
snprintf(TextMessage, MAX_TEXT_LENGTH, "Counter: %i^nTerrors: %i", Anz_CT, Anz_T);
if (Style == 1) centersay(TextMessage, SHOW_TIME, COLOR_R, COLOR_G, COLOR_B);
if (Style == 2) typesay(TextMessage, SHOW_TIME, COLOR_R, COLOR_G, COLOR_B);
if (Style == 3) {
snprintf(ChatMessage, MAX_TEXT_LENGTH, "Enemy Counter: CT *%i* - Ter *%i*", Anz_CT, Anz_T);
say(ChatMessage);
}
if (GroupV == 1) {
if (Anz_T == 11) strcpy(AudioMessage, "speak ^"eleven ", MAX_DATA_LENGTH);
if (Anz_T == 10) strcpy(AudioMessage, "speak ^"ten ", MAX_DATA_LENGTH);
if (Anz_T == 9) strcpy(AudioMessage, "speak ^"nine ", MAX_DATA_LENGTH);
if (Anz_T == 8) strcpy(AudioMessage, "speak ^"eight ", MAX_DATA_LENGTH);
if (Anz_T == 7) strcpy(AudioMessage, "speak ^"seven ", MAX_DATA_LENGTH);
if (Anz_T == 6) strcpy(AudioMessage, "speak ^"six ", MAX_DATA_LENGTH);
if (Anz_T == 5) strcpy(AudioMessage, "speak ^"five ", MAX_DATA_LENGTH);
if (Anz_T == 4) strcpy(AudioMessage, "speak ^"four ", MAX_DATA_LENGTH);
if (Anz_T == 3) strcpy(AudioMessage, "speak ^"three ", MAX_DATA_LENGTH);
if (Anz_T == 2) strcpy(AudioMessage, "speak ^"two ", MAX_DATA_LENGTH);
if (Anz_T == 1) strcpy(AudioMessage, "speak ^"one ", MAX_DATA_LENGTH);
strcat(AudioMessage, ADDON_WORDS, MAX_DATA_LENGTH);
strcat(AudioMessage, "^"", MAX_DATA_LENGTH);
}
if (GroupV == 2) {
if (Anz_CT == 11) strcpy(AudioMessage, "speak ^"eleven ", MAX_DATA_LENGTH);
if (Anz_CT == 10) strcpy(AudioMessage, "speak ^"ten ", MAX_DATA_LENGTH);
if (Anz_CT == 9) strcpy(AudioMessage, "speak ^"nine ", MAX_DATA_LENGTH);
if (Anz_CT == 8) strcpy(AudioMessage, "speak ^"eight ", MAX_DATA_LENGTH);
if (Anz_CT == 7) strcpy(AudioMessage, "speak ^"seven ", MAX_DATA_LENGTH);
if (Anz_CT == 6) strcpy(AudioMessage, "speak ^"six ", MAX_DATA_LENGTH);
if (Anz_CT == 5) strcpy(AudioMessage, "speak ^"five ", MAX_DATA_LENGTH);
if (Anz_CT == 4) strcpy(AudioMessage, "speak ^"four ", MAX_DATA_LENGTH);
if (Anz_CT == 3) strcpy(AudioMessage, "speak ^"three ", MAX_DATA_LENGTH);
if (Anz_CT == 2) strcpy(AudioMessage, "speak ^"two ", MAX_DATA_LENGTH);
if (Anz_CT == 1) strcpy(AudioMessage, "speak ^"one ", MAX_DATA_LENGTH);
strcat(AudioMessage, ADDON_WORDS, MAX_DATA_LENGTH);
strcat(AudioMessage, "^"", MAX_DATA_LENGTH);
}
if (bAudio == 1) {
for(i=1; i<=maxplayers; i++) {
strinit(Target);
if (playerinfo(i,Target,MAX_NAME_LENGTH,SessionID,WONID,Team) && (WONID != 0)) {
if (Team != GroupV) {
execclient(Target,AudioMessage);
}
}
}
}
return PLUGIN_CONTINUE;
}
public plugin_init()
{
plugin_registerinfo("Biohazards Enemy Counter ","Tells you how many enemies are left.",STRING_VERSION);
plugin_registercmd("logd_enemycount", "logd_enemycount", ACCESS_CONSOLE);
plugin_registercmd("ec_ondisconnect", "ec_ondisconnect", ACCESS_CONSOLE);
plugin_registercmd("ec_onsuicide", "ec_onsuicide", ACCESS_CONSOLE);
plugin_registercmd("admin_ec_off", "admin_ec_off", ACCESS_EC, "admin_ec_off: Turns off enemy counting.");
plugin_registercmd("admin_ec_on", "admin_ec_on", ACCESS_EC, "admin_ec_on: Turns on enemy counting.");
plugin_registercmd("admin_ecaudio_off", "admin_ecaudio_off", ACCESS_EC, "admin_ecaudio_off: Turns off HL-Speech.");
plugin_registercmd("admin_ecaudio_on", "admin_ecaudio_on", ACCESS_EC, "admin_ecaudio_on: Turns on HL-Speech.");
plugin_registercmd("admin_ec_style", "admin_ec_style", ACCESS_EC, "admin_ec_style: Sets the style of messages.");
plugin_registercmd("admin_ec_range", "admin_ec_range", ACCESS_EC, "admin_ec_range: Sets the range in which Enemy Counter will act.");
exec( "logd_reg 57 admin_command logd_enemycount" );
exec( "logd_reg 52 admin_command ec_ondisconnect" );
exec( "logd_reg 53 admin_command ec_onsuicide" );
return PLUGIN_CONTINUE;
}
Das is die Fehler Meldung beim compilieren
Code:
plugin_logd_enemycount_alt.sma(97) Error [1]: expected token: ";", but found "-identifier-"
plugin_logd_enemycount_alt.sma(101) Error [1]: expected token: ";", but found "-identifier-"
plugin_logd_enemycount_alt.sma(105) Error [1]: expected token: ";", but found "-identifier-"
plugin_logd_enemycount_alt.sma(109) Error [1]: expected token: ";", but found "-identifier-"
ps: wollte für mich ne Statsme Funktion einbauen so das oben rechts in der ecke erscheint:
5 CTs left <-- das in Blau
3 Ter left <-- das in Rot