Moin Leutz,
ich hab mich mal rangesetzt und versucht das plugin_joe_awp ins deutsche zu übersetzten --> ziemlich viele Errors und Warnings beim kompilieren.
Könntet ihr euch das mal anschauen ?
Ich weiss nicht genau was man laut den Errors ändern muss ...
plugin_joe_awp_ger.sma
Code:
*/
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ITEM_INVALID -1
#define MAX_MENU_CHOICES 10
#define MAX_MENUS 10
#define MENU_EQUIPMENT 8
#define MENU_INVALID -1
#define MENU_TOP 0
#define AWP_SLAP 16
#define AWP_SLAY 32
#define AWP_KICK 64
#define AWP_BAN 128
#define ACCESS_LOGD 131072
///////////////////////////////////////////////////////////////////////////////////////
/// EDIT THESE FOUR SETTINGS!!! ///
///////////////////////////////////////////////////////////////////////////////////////
//////// THESE NEXT TWO LINES ARE USED WHEN SOMEONE IS PERMANENTLY BANNED.
//////// IT GIVES THEM AN OPTION TO EMAIL THE ADMIN FOR FORGIVENESS.
/// Edit the name and email address, making sure to keep the "" where htey are.
/* NOTE that leaving tAdminsEmail="" will disable the notification
that offenders received upon being banned. This means they do
not know whom they should contact, and thus may never be able
to join your server again! Add the e-mail address to be safe =) */
new tAdminsName[MAX_NAME_LENGTH] = "NONE CONFIGURED" ; // <-- PUT YOUR NAME HERE!!!
new tAdminsEmail[MAX_DATA_LENGTH] = "" ; // <-- PUT YOUR EMAIL HERE!!
new iPermBanAfterTempBan=1; // Set this to 0 if you want it to always ONLY ban people
// For 15 minutes at a time. Setting this to 1 will ban a
// Person permanently if he comes back and awps after being
// banned once for 15 minutes.
new AwpCheck=1; // Default awp-checking status (on startup)
/* OK, now you're done with customizing the script. If you know what you're doing, feel
free to tinker with it ;). Otherwise, just save this (into your Admin/scripting/myscripts
Directory and run 'compile_all.bat' (or compile_all.sh in linux) in the same directory.
Then move plugin_joe_awp.amx from Admin/scripting/mybinaries into Half-Life/cstrike/dlls and
then edit the Half-Life/cstrike/plugin.ini file, adding the line:
dlls/plugin_joe_awp.amx
To the file; Save it, then restart the server. You're done.
*/
///////////////////////////////////////////////////////////////////////////////////////
/// YOU SHOULD NOT NEED TO EDIT BEYOND THIS... ///
///////////////////////////////////////////////////////////////////////////////////////
// Totals for slaps, slays, kicks, bans
new AwpSlap=0;
new AwpSlay=0;
new AwpKick=0;
new AwpBan=0;
new AwpWarns[MAX_PLAYERS];
new tKick[MAX_NAME_LENGTH]="";
new tSlay[MAX_NAME_LENGTH]="";
new tNote[MAX_NAME_LENGTH]="";
new STRING_VERSION[MAX_DATA_LENGTH]="1.5b";
new UserMenu[MAX_PLAYERS];
new UserFlags[MAX_PLAYERS];
public plugin_init() {
plugin_registerinfo("Joe's AWP buying detection","Auto detects, warns, slaps, and kicks AWP-buyers when enabled.",STRING_VERSION);
plugin_registercmd("admin_AwpCheck","admin_AwpCheck",ACCESS_KICK,"admin_AwpCheck 1/0: Turns AWP-checking on or off.");
plugin_registercmd("admin_awpstat","awpstat",ACCESS_KICK,"admin_awpstat: Displayes current status of all users and their AWP buys and warnings.");
plugin_registercmd("buy","SetMenuData",ACCESS_ALL);
plugin_registercmd("admin_drops", "admin_drops", ACCESS_IMMUNITY, "admin_drops <user> <slot to drop> Drop the user's weapon in a given slot.");
plugin_registercmd("showbriefing","BriefThis",ACCESS_ALL);
plugin_registercmd("menuselect","SetSelectData",ACCESS_ALL);
plugin_registercmd("logd_kill", "awp_kill", ACCESS_LOGD, "");
return PLUGIN_CONTINUE;
}
public drops(target[],slot) { // This will drop the weapon in <target>'s <slot> slot.
new TargetName[MAX_NAME_LENGTH];
get_username(target,TargetName,MAX_NAME_LENGTH);
new msg[MAX_TEXT_LENGTH];
snprintf(msg,MAX_TEXT_LENGTH,"slot%i",slot);
execclient(target, msg);
execclient(target,"+attack");
execclient(target,"-attack");
execclient(target,"drop");
msg="ADMIN dropped ";
strcat(msg, TargetName, MAX_DATA_LENGTH);
strcat(msg, "'s weapon.", MAX_DATA_LENGTH);
say(msg);
}
public admin_drops(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_DATA_LENGTH];
new Data[MAX_DATA_LENGTH];
new iSlot;
new strT2[MAX_DATA_LENGTH];
new strT1[MAX_DATA_LENGTH];
new User[MAX_DATA_LENGTH];
new TargetName[MAX_NAME_LENGTH];
new target[MAX_NAME_LENGTH];
new strSlot[MAX_DATA_LENGTH];
new Text[MAX_DATA_LENGTH];
convert_string(HLCommand,Command,MAX_DATA_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_DATA_LENGTH);
strbreak(Data,strT1,strT2, MAX_DATA_LENGTH);
strbreak(Data,target,strSlot, MAX_DATA_LENGTH);
iSlot = strtonum(strSlot);
get_username(target,TargetName,MAX_NAME_LENGTH);
if (check_user(TargetName)==1) {
if(check_immunity(TargetName)!=0) {
strcat(Text, "LoL... du kannst sie nicht wegwerfen ", MAX_TEXT_LENGTH);
strcat(Text,TargetName,MAX_DATA_LENGTH);
strcat(Text, "'s Waffe.",MAX_DATA_LENGTH);
say(Text);
return PLUGIN_HANDLED;
} else {
if(iSlot>9 || iSlot <1) {
selfmessage("Invalid slot to drop.");
} else {
drops(target,iSlot);
}
}
} else {
selfmessage( "Unrecognized player: ");
selfmessage( TargetName );
}
return PLUGIN_HANDLED;
}
AddUserFlag(UserIndex, Flag) {
new Name[MAX_NAME_LENGTH];
new strWONID[MAX_NUMBER_LENGTH];
new UserID;
new VaultData[MAX_DATA_LENGTH];
new WONID;
UserFlags[UserIndex] = UserFlags[UserIndex] | Flag;
if (Flag == AWP_SLAP && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpslap") == -1) {
strcat(VaultData," awpslap", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
} else {
strcpy(VaultData, " awpkick", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
}
}
if (Flag == AWP_SLAY && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpslay") == -1) {
strcat(VaultData," awpslay", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
} else {
strcpy(VaultData, " awpslay", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
}
}
if (Flag == AWP_KICK && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpkick") == -1) {
strcat(VaultData," awpkick", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
} else {
strcpy(VaultData, " awpkick", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
}
}
if (Flag == AWP_BAN && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpban") == -1) {
strcat(VaultData," awpban", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
} else {
strcpy(VaultData, " awpban", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
}
}
}
CheckVaultFlags(UserIndex) {
new Name[MAX_NAME_LENGTH];
new strWONID[MAX_NUMBER_LENGTH];
new UserID;
new VaultData[MAX_DATA_LENGTH];
new WONID;
if (getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpslap") != -1) {
UserFlags[UserIndex] = UserFlags[UserIndex] | AWP_SLAP;
}
if (strcasestr(VaultData," awpslay") != -1) {
UserFlags[UserIndex] = UserFlags[UserIndex] | AWP_SLAY;
}
if (strcasestr(VaultData," awpkick") != -1) {
UserFlags[UserIndex] = UserFlags[UserIndex] | AWP_KICK;
}
if (strcasestr(VaultData," awpban") != -1) {
UserFlags[UserIndex] = UserFlags[UserIndex] | AWP_BAN;
}
}
}
}
}
RemoveUserFlag(UserIndex, Flag) {
new Name[MAX_NAME_LENGTH];
new strWONID[MAX_NUMBER_LENGTH];
new UserID;
new VaultData[MAX_DATA_LENGTH];
new WONID;
UserFlags[UserIndex] = UserFlags[UserIndex] & ~Flag;
if (Flag == AWP_SLAP && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpslap") != -1) {
strsubst(VaultData," awpslap", "", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
}
}
}
if (Flag == AWP_SLAY && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpslay") != -1) {
strsubst(VaultData," awpslay", "", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
}
}
}
if (Flag == AWP_KICK && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpkick") != -1) {
strsubst(VaultData," awpkick", "", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
}
}
}
if (Flag == AWP_BAN&& getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
numtostr(WONID,strWONID);
if(get_vaultdata(strWONID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData," awpban") != -1) {
strsubst(VaultData," awpban", "", MAX_DATA_LENGTH);
set_vaultdata(strWONID,VaultData);
}
}
}
}
}
PlayThunderClap() {
new i;
new iMaxPlayers = maxplayercount();
new Name[MAX_NAME_LENGTH];
new UserID;
new WONID;
if (getvar("admin_fx") != 0) {
for (i = 1; i <= iMaxPlayers; i++) {
if (playerinfo(i,Name,MAX_NAME_LENGTH,UserID,WONID) != 0) {
playsound(Name, "ambience/thunder_clap.wav");
}
}
}
}
public doSlay() {
teleport(tSlay,5000,5000,5000);
execclient(tSlay,"kill");
strinit(tSlay);
return PLUGIN_CONTINUE;
}
public doKick() {
teleport(tKick,5000,5000, 5000);
execclient(tKick,"disconnect");
//kick(tKick);
strinit(tKick);
return PLUGIN_CONTINUE;
}
public telladmin(Text[])
{
new Name[MAX_NAME_LENGTH];
new SessionID;
new Team;
new WONID;
new maxplayers=maxplayercount();
new i;
new tLog[MAX_TEXT_LENGTH]="To Admins: ";
for(i=1; i<=maxplayers; i++) {
strinit(Name);
if(playerinfo(i,Name,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
if(access(ACCESS_BAN,Name)!=0) {
messageex(Name, Text, print_chat);
}
}
}
strcat(tLog,Text,MAX_TEXT_LENGTH);
log(tLog);
return PLUGIN_HANDLED;
}
public admin_AwpCheck(HLCommand,HLData,HLUserName,UserIndex) {
/* Use this to turn checking on/off */
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
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);
if (strlen(Data)==0) {
snprintf(Text,MAX_TEXT_LENGTH,"AWP-Checking: %i",AwpCheck);
selfmessage(Text);
}
else if(check_param(Data)==1) {
selfmessage("AWP-Checking ist jetzt an!");
AwpCheck=1;
say_command(User,Command,Data);
}
else {
selfmessage("AWP-Checking ist jetzt aus!");
AwpCheck=0;
say_command(User,Command,Data);
}
return PLUGIN_HANDLED;
}
public HandleAwp(sUser[], iWarns) {
new Text[MAX_TEXT_LENGTH]="";
new tText[MAX_TEXT_LENGTH]="";
strcat(Text,sUser,MAX_NAME_LENGTH);
new iUser;
get_userindex(sUser,iUser);
if(iWarns==1) {
for(new i=0;i<19;i++) {
slap(sUser);
}
execclient(sUser,"say AUA! Das tat weh!!!");
/*What he says when he buys first */
AwpSlap++;
/* v-- What Admin's see when first buy occurs: */
strcat(Text," hat seine erste AWP gekauft und wurde dafuer auf 5hp geslappt.",MAX_TEXT_LENGTH);
telladmin(Text);
}
else if(iWarns==2) {
execclient(sUser,"say Hilfe! Die toeten mich ");
// Said on second buy.
execclient(sUser,"say /me screams horrifically..."); // Only works with the IRC-action plugin
strinit(tText);
strcat(tText,sUser,MAX_NAME_LENGTH);
strcat(tText," hat jetzt vermutlich begriffen warum die AWP verboten ist ... nachdem ihm jemand richtig den Arsch versohlt hat.",MAX_TEXT_LENGTH); // Be creative... =P
say(tText);
strinit(tSlay);
strcat(tSlay,sUser,MAX_NAME_LENGTH);
set_timer("doSlay",2,1);
AwpSlay++;
messageex(sUser,"Das war deine zweite AWP!^nNaechstes mal wirst du gekcikt!!",print_center);
strcat(Text," kaufte seine zweite AWP und wurde dafuer umgebracht.",MAX_TEXT_LENGTH);
telladmin(Text);
}
else if(iWarns==3) {
PlayThunderClap();
RemoveUserFlag(iUser,AWP_SLAY);
AddUserFlag(iUser,AWP_KICK); // Add flag so we know next time he connects that he's been kicked
execclient(sUser,"say Ich bin ein AWP-Kleinschwanztraeger...");
messageex(sUser,"Du hast 3 AWPs gekauft... Du wurdest gewarnt^nLes naechstes mal die Connect-Messages^n...und tschuess",print_center);
messageex(sUser,"Du hast 3 AWPs gekauft... Du wurdest gewarnt^nLes naechstes mal die Connect-Messages^n...und tschuess",print_console);
strinit(tKick);
strcat(tKick,sUser,MAX_NAME_LENGTH);
set_timer("doKick",2,1);
AwpKick++;
strcat(Text," hat jetzt seine letzte AWP gekauft... und tschuess...",MAX_TEXT_LENGTH);
telladmin(Text);
AddUserFlag(iUser,AWP_KICK);
strinit(Text);
strcat(Text,sUser,MAX_NAME_LENGTH);
strcat(Text," wurde wegen 3 AWPs gekickt!",MAX_TEXT_LENGTH);
centersay(Text,10,255,0,0);
} else if(iPermBanAfterTempBan==1 && iWarns==4) {
PlayThunderClap();
RemoveUserFlag(iUser,AWP_KICK);
AddUserFlag(iUser,AWP_BAN); // Change KICK vault flag to BAN flag
messageex(sUser,"Du wurdest wegen 3 AWPs gekickt. Du bist nun fuer 15 minuten gebannt!",print_center);
messageex(sUser,"Du wurdest wegen 3 AWPs gekickt. Du bist nun fuer 15 minuten gebannt!",print_console);
snprintf(Text,MAX_TEXT_LENGTH,"%s wurde wegen 3 AWPs fuer 15 Minuten gebannt",sUser);
say(Text);
log(Text);
ban(sUser,15);
AwpBan++;
} else if(iPermBanAfterTempBan==1 && iWarns>4) {
PlayThunderClap();
RemoveUserFlag(iUser,AWP_KICK);
AddUserFlag(iUser,AWP_BAN); // Change KICK vault flag to BAN flag
messageex(sUser,"Du wurdest vorher wegen AWPs gebannt. Also, komm nicht schon wieder...",print_center);
messageex(sUser,"Du wurdest vorher wegen AWPs gebannt. Also, komm nicht schon wieder...",print_console);
if(strlen(tAdminsEmail)>0){
snprintf(Text,MAX_TEXT_LENGTH,"^nE-mail %s an %s um ueber den Bann zu reden.",tAdminsName,tAdminsEmail);
messageex(sUser,Text,print_console);
} else {
snprintf(Text,MAX_TEXT_LENGTH,"Der Admin (^"%s^") hat keine E-Mail Adresse angegeben.",tAdminsName);
messageex(sUser,Text,print_console);
messageex(sUser,"Das heisst du musst einen anderen Weg finden um ihn zu kontaktieren.",print_console);
}
snprintf(Text,MAX_TEXT_LENGTH,"%s wurde wegen AWPs dauerhaft gebannt!",sUser);
say(Text);
log(Text);
ban(sUser,0);
AwpBan++;
} else if(iPermBanAfterTempBan==0 && iWarns>=4) {
PlayThunderClap();
RemoveUserFlag(iUser,AWP_KICK);
AddUserFlag(iUser,AWP_BAN); // Change KICK vault flag to BAN flag
messageex(sUser,"Du wurdest wegen 3 AWPs gekickt. Du bist nun fuer 15 minuten gebannt!",print_center);
messageex(sUser,"Du wurdest wegen 3 AWPs gekickt. Du bist nun fuer 15 minuten gebannt!",print_console);
snprintf(Text,MAX_TEXT_LENGTH,"%s wirde wegen AWPs gebannt!",sUser);
log(Text);
telladmin(Text);
ban(sUser,30);
AwpBan++;
} else {
log("Joe's AWP had a weird experience... iWarns Out of Range...");
}
return PLUGIN_CONTINUE;
}
public BriefThis(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new i;
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
for(i=0;i<3;i++)
slap( User );
messageex(User,"Dieser Server erlaubt den Command ^"showbriefing^ nicht"",print_console);
messageex(User,"Wenn du ihn mit der Absicht zu Cheaten benutzt,",print_console);
messageex(User,"VERLASSE DN SERVER JETZT.",print_console);
messageex(User," ",print_console);
messageex(User,"Brief THIS",print_tty);
snprintf(Text,MAX_TEXT_LENGTH,"%s versuchte den 'showbriefing' Command zu benutzen!",User);
telladmin(Text);
return PLUGIN_HANDLED;
}
public awpstat(HLCommand,HLData,HLUserName,UserIndex) {
// Shows status of all users in game and # of awp buys for each.
// Also shows total number of each step of buy since server start
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
new Name[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new i;
new tempstr[MAX_TEXT_LENGTH]="";
new swon[MAX_TEXT_LENGTH]="";
new ssess[MAX_TEXT_LENGTH]="";
new iind=0;
new SessionID;
new Team;
new WONID;
new maxplayers=maxplayercount();
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
selfmessage("[ADMIN] Joe's AWP-Checking Vergeltung! =)");
// This works beautifully from server console because of non-scalable fonts...
// game console it looks funny. =P
for(i=1;i<maxplayers;i++) {
strinit(Name);
if(playerinfo(i,Name,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
snprintf(tempstr,MAX_TEXT_LENGTH,"%i. %s",i, Name);
strcat(tempstr," ",30);
snprintf(ssess,MAX_TEXT_LENGTH,"L: %i",SessionID);
strcat(ssess," ",6);
snprintf(swon,MAX_TEXT_LENGTH,"W: %i",WONID);
strcat(swon," ",11);
snprintf(Text,MAX_TEXT_LENGTH,"%s %s %s Awps: %i",tempstr,ssess,swon,AwpWarns[i]);
if(get_userindex(User,iind)==1)
if(iind!=0)
messageex(User,Text,print_console);
log(Text);
}
}
snprintf(Text,MAX_TEXT_LENGTH,"AwpSlaps: %i; AwpSlays: %i; AwpKicks: %i; AwpBans: %i",AwpSlap,AwpSlay,AwpKick,AwpBan);
if(get_userindex(User,iind)==1)
if(iind!=0) {
messageex(User,"=====TOTALS=====",print_console);
messageex(User,Text,print_console);
}
log("=====TOTALS=====");
log(Text);
return PLUGIN_HANDLED;
}
/*********************************************************************************************
* I can't lie... These are modified versions of the functions from the plugin_CS file for *
* weapons restrictions... I took out the stuff I didn't need, and added a function call *
* if(AwpCheck is 1) -- set by default at top or by admin_awpcheck 0/1 command *
*********************************************************************************************/
public SetMenuData(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
if (streq(Command, "buyequip")==1) {
UserMenu[UserIndex] = MENU_EQUIPMENT;
}
else if (streq(Command, "buy")==1) {
UserMenu[UserIndex] = MENU_TOP;
}
else if (streq(Command, "showbriefing")==1) {
if (UserMenu[UserIndex] == MENU_INVALID) {
UserMenu[UserIndex] = 1;
}
}
return PLUGIN_CONTINUE;
}
public SetSelectData(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new Text[MAX_DATA_LENGTH]="";
new User[MAX_NAME_LENGTH];
new iMenu;
new iUser;
new iUserInd;
new Name[MAX_NAME_LENGTH];
new SessionID;
new Team;
new WONID;
new maxplayers=maxplayercount();
new i;
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
iMenu = UserMenu[UserIndex];
if (iMenu == MENU_TOP) {
new iNewMenu = strtonum(Data);
if (iNewMenu == 6 || iNewMenu == 7 || iNewMenu == 10) {
UserMenu[UserIndex] = MENU_INVALID;
}
else {
UserMenu[UserIndex] = iNewMenu;
}
}
else if (iMenu > MENU_INVALID) {
new iNewItem = strtonum(Data);
if(iMenu==4 && iNewItem==6) {
for(i=1; i<=maxplayers; i++) {
strinit(Name);
if(playerinfo(i,Name,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
if(streq(Name,User)) {
iUser=WONID;
iUserInd=i;
}
}
}
snprintf(Text, MAX_TEXT_LENGTH, "NOTE: <%i>%s kauft eine AWP!! Fertig machen zum kick... =P", iUser,User);
if(AwpCheck==1)
{
AwpWarns[iUserInd]+=1;
HandleAwp(User, AwpWarns[iUserInd]);
}
else {
telladmin(Text);
}
}
if (iNewItem==10) {
UserMenu[UserIndex] = MENU_INVALID;
}
else {
UserMenu[UserIndex] = MENU_INVALID;
}
}
else if (iMenu >= MENU_INVALID) {
UserMenu[UserIndex] = MENU_INVALID;
}
return PLUGIN_CONTINUE;
}
public awp_kill(HLCommand,HLData,HLUserName,UserIndex)
{
new sID1[MAX_NUMBER_LENGTH];
new sID2[MAX_NUMBER_LENGTH];
new NameA[MAX_NAME_LENGTH];
new NameV[MAX_NAME_LENGTH];
new Params[MAX_DATA_LENGTH];
new Log[MAX_DATA_LENGTH];
new Weapon[MAX_NAME_LENGTH];
new Data[MAX_DATA_LENGTH];
new iID1 = strtonum(sID1);
new iID2 = strtonum(sID2);
new dmy;
new WONID;
new sWONID[MAX_TEXT_LENGTH];
convert_string(HLData,Params,MAX_DATA_LENGTH);
convert_string(HLData, Data, MAX_DATA_LENGTH);
strsplit(Data, " ", sID1, MAX_NUMBER_LENGTH, sID2, MAX_NUMBER_LENGTH, Weapon, MAX_NAME_LENGTH);
if( !playerinfo(iID1,NameA,MAX_NAME_LENGTH,dmy,WONID) ) {
return PLUGIN_FAILURE;
}
if( !playerinfo(iID2,NameV,MAX_NAME_LENGTH) ) {
return PLUGIN_FAILURE;
}
numtostr(WONID,sWONID);
if( strcmp( Weapon, "weapon_awp") == 0 && AwpCheck==1)
{
RemoveUserFlag(iID1,AWP_SLAY);
AddUserFlag(iID1,AWP_KICK); /*Das war nur ein AWP-Kick, naechstes mal wird gleich gebannt! */
snprintf(Log,MAX_DATA_LENGTH,"%s brach die Regeln weil er eine AWP benutzt hat!!",NameA);
log(Log);
messageex(NameA,"Du hast eine verbotene Waffe gekauft. Du Doedel!",print_console);
ban(NameA,1);
/*ban(sWONID, 24 * 60);*/
telladmin("AWP-Killer wurde gekickt!");
}
return PLUGIN_CONTINUE;
}
public notifyofawp() {
// Couldn't figure out how to use variables for things like a timeout, so did it the complicated way =(
messageex(tNote,"Du wurdest schon mal wegen der AWP gekickt!^nDu WIRST GEBANNT wenn du nochmal eine kaufst!!",print_console);
messageex(tNote,"Du wurdest schon mal wegen der AWP gekickt!^nDu WIRST GEBANNT wenn du nochmal eine kaufst!!",print_tty);
strinit(tNote);
}
public plugin_connect(HLUserName, HLIP, UserIndex) {
new name[MAX_NAME_LENGTH];
new tText[MAX_TEXT_LENGTH];
strinit(tText);
convert_string(HLUserName,name,MAX_NAME_LENGTH);
consgreet("WARNUNG, DIESER SERVER UEBERWACHT AWPßKAEUFE MIT JOE'S AM-PLUGIN!");
consgreet("KAUF KEINE AWPs!");
if(AwpCheck==1) { consgreet("AWP-Checking ist zur Zeit AKTIVIERT!"); }
consgreet("Admin: McHudel@web.de");
consgreet("");
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
UserMenu[UserIndex] = MENU_INVALID;
CheckVaultFlags(UserIndex);
if ((UserFlags[UserIndex] & AWP_SLAP) == AWP_SLAP) {
AwpWarns[UserIndex]=1;
} else if ((UserFlags[UserIndex] & AWP_SLAY) == AWP_SLAY) {
AwpWarns[UserIndex]=2;
} else if ((UserFlags[UserIndex] & AWP_KICK) == AWP_KICK) {
AwpWarns[UserIndex]=3;
strcat(tText,"WARNING: ",MAX_NAME_LENGTH);
strcat(tText,name,MAX_TEXT_LENGTH);
// This tells everyone that this guy's been kicked before for buying 3 awps
strcat(tText," AWPs und wurde^nschon einmal dafuer gekickt!",MAX_TEXT_LENGTH);
centersay(tText,10,255,0,0);
strinit(tNote);
strcat(tNote,name,MAX_NAME_LENGTH);
set_timer("notifyofawp",25,1);
} else if ((UserFlags[UserIndex] & AWP_BAN) == AWP_BAN) {
strcat(tText,name,MAX_NAME_LENGTH);
// This tells them that this guy has bought 4+ awps...
strcat(tText," hat schon alles ueber die AWP gewusst^nund wurde schon einmal dafuer gebannt!!",MAX_TEXT_LENGTH);
AwpWarns[UserIndex]=4;
centersay(tText,10,255,0,0);
set_timer("notifyofawp",25,1); // Tells AWPer that he'll be banned next time
} else {
AwpWarns[UserIndex] = 0;
}
}
return PLUGIN_CONTINUE;
}
public plugin_disconnect(HLUserName, UserIndex) {
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
UserMenu[UserIndex] = MENU_INVALID;
AwpWarns[UserIndex] = 0;
}
return PLUGIN_CONTINUE;
}
Error-File:
Code:
plugin_joe_awp.sma(498) Error [27]: invalid character constant
plugin_joe_awp.sma(499) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(499) Error [1]: expected token: ",", but found ";"
plugin_joe_awp.sma(500) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(500) Error [1]: expected token: ",", but found ";"
plugin_joe_awp.sma(501) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(501) Error [1]: expected token: ",", but found ";"
plugin_joe_awp.sma(502) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(502) Error [1]: expected token: ",", but found ";"
plugin_joe_awp.sma(503) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(503) Error [1]: expected token: ",", but found ";"
plugin_joe_awp.sma(504) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(504) Error [1]: expected token: ",", but found ";"
plugin_joe_awp.sma(505) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(505) Error [1]: expected token: ",", but found "return"
plugin_joe_awp.sma(505) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(505) Error [1]: expected token: ",", but found ";"
plugin_joe_awp.sma(508) Warning [202]: number of arguments does not match definition
plugin_joe_awp.sma(508) Error [1]: expected token: ",", but found "public"
plugin_joe_awp.sma(511) Warning [219]: local variable "Command" shadows a variable at a preceding level
plugin_joe_awp.sma(512) Warning [219]: local variable "Data" shadows a variable at a preceding level
plugin_joe_awp.sma(513) Warning [219]: local variable "User" shadows a variable at a preceding level
plugin_joe_awp.sma(515) Warning [219]: local variable "Text" shadows a variable at a preceding level
plugin_joe_awp.sma(516) Warning [219]: local variable "i" shadows a variable at a preceding level
plugin_joe_awp.sma(565) Error [29]: invalid expression, assumed zero
plugin_joe_awp.sma(567) Error [1]: expected token: "}", but found "new"
THX