Ich habe mich mit Logopäde via ICQ verständigt, da es wohl die schnellste Art und Weise ist das Plugin seinen Wünschen entsprechend anzupassen. Damit ihr anderen auch etwas davon habt, poste ich hier den geänderten Quellcode. Wichtig ist, das der Code für
Adminmod 2.50.09 geschrieben ist, somit bekommt ihr
zwei Fehlermeldungen, wenn ihr versucht ihn mit dem neuen Adminmod und seinen Include Dateien zu kompilieren. Solltet ihr nicht wissen wie ihr diesen Fehlermeldungen entgegenwirken könnt, postet hier.
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,"Administrator ",MAX_DATA_LENGTH);
strcat(Text, strName,MAX_DATA_LENGTH);
strcat(Text, " joined the game...",MAX_DATA_LENGTH);
} else {
strcat(Text,"Administrator ",MAX_DATA_LENGTH);
strcat(Text, strName,MAX_DATA_LENGTH);
strcat(Text, " has left the game...",MAX_DATA_LENGTH);
}
centersay(Text, 15, 190, 0, 0);
}
public plugin_connect(HLName,HLIP,UserIndex)
{
new strName[MAX_NAME_LENGTH];
convert_string(HLName, strName, MAX_NAME_LENGTH);
set_timer("ann_timer",ANNOUNCE_DELAY, 1, strName);
return PLUGIN_CONTINUE;
}
public plugin_disconnect(HLName, UserIndex)
{
new strName[MAX_NAME_LENGTH];
convert_string(HLName, 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;
}
Bio