Daraus schließe ich das du die AdminMod Version 2.50.26 nutzt. Da das Plugin aber für die Version 2.50.09 gedacht war kommt es zu jenen Fehlern. Im nachfolgenden liste ich den etwas geänderten Code nocheinmal auf. So sollte er sowohl mit AM 2.50.09
und AM 2.50.26 funktionieren. Die Änderungen sind fettgedruckt.
Code:
/* This plugin will announce the connection/disconnection of clients with the
* correct access level.
*
* Setup:
* 1) Setup users with 2048 access.
*
* Known issues:
* 1) If a person with 2048 access is the first to join the server after a map
* change, they may recieve a warning message in the console. That ADMIN
* cannot find the user. Ignore it. :)
*
* This seems to be due to AM loading the users.ini and not finding the user
* in time to validate the accesslevel.
*
* This is just a test but for v2.50.1 I have added a timer so that after 20
* seconds from the connection, the announcment is attempted.
*
* [fah-q] Dio
*
* Some changes for =[ Xeipa sYs©]=[WfC] by Biohazard on April 2002
*/
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_ANNOUNCE 2048
#define ANNOUNCE_DELAY 20
new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.1";
plr_announce(strName[], lConnect=0) {
new Text[MAX_TEXT_LENGTH] = "";
if (lConnect == 1) {
strcat(Text, "Admin ",MAX_DATA_LENGTH);
strcat(Text, strName,MAX_DATA_LENGTH);
strcat(Text, "^nhas connected",MAX_DATA_LENGTH);
playsoundall("sound/connect.wav");
} else {
strcat(Text, "Admin ",MAX_DATA_LENGTH);
strcat(Text, strName,MAX_DATA_LENGTH);
strcat(Text, "^nhas left the game",MAX_DATA_LENGTH);
playsoundall("sound/disconnect.wav");
}
centersay(Text, 7, 25, 25, 125);
}
public plugin_connect(HLUserName,HLIP,UserIndex)
{
new strName[MAX_NAME_LENGTH];
convert_string(HLUserName, strName, MAX_NAME_LENGTH);
set_timer("ann_timer",ANNOUNCE_DELAY, 1, strName);
return PLUGIN_CONTINUE;
}
public plugin_disconnect(HLUserName, UserIndex)
{
new strName[MAX_NAME_LENGTH];
convert_string(HLUserName, strName, MAX_NAME_LENGTH);
if (access(ACCESS_ANNOUNCE, strName)!=0) {
plr_announce(strName, 0);
}
return PLUGIN_CONTINUE;
}
public ann_timer(Timer,Repeat,HLName,HLParam)
{
new strName[MAX_NAME_LENGTH];
convert_string(HLParam,strName,MAX_NAME_LENGTH);
if (access(ACCESS_ANNOUNCE, strName)!=0) {
plr_announce(strName, 1);
}
}
public plugin_init()
{
plugin_registerinfo("Admin Connection Announcment Plugin","Announces the (dis)connection of players with correct access level.",STRING_VERSION);
return PLUGIN_CONTINUE;
}
//////////////////////////////////////////////////////////////////////////////
// This function used to be in the SOUND.INC file, but too many people emailed
// me asking where to put the sound.inc file, so I stopped using the file, as
// its usefulness was outlived anyway.
//////////////////////////////////////////////////////////////////////////////
stock playsoundall(sound[], IfDead = -1)
{
new maxplayers = maxplayercount();
new Name[MAX_NAME_LENGTH];
new i;
for(i=1; i<=maxplayers; i++)
{
new iDead;
new dummy;
if (playerinfo(i, Name, MAX_NAME_LENGTH, dummy, dummy, dummy, iDead) == 1)
{
if (IfDead == -1)
playsound(Name, sound);
else if (IfDead == iDead)
playsound(Name, sound);
}
}
}
Da das Fettdrucken im Code anscheinend nicht mehr geht vergleich einfach den obenstehenden Code mit dem den du vorliegen hast.
Bio