so, ich wollte 2 Repeat Messages haben, auf meinem Server, darum hab ich plugin_message erweitert, und in der server.cfg steht nun folgendes:
// How often, in seconds, the repeat_message should be shown on
// the screen during the game. Minimum value is 15 seconds.
// So, a value of 600 = 10 minutes between messages.
admin_repeat_freq 240
admin_repeat_freqi 300
// Message that is show to everyone on the server every
// ten minutes by the message plugin.
admin_repeat_msg ":: CoWs & [UFoS] Clanserver ::"
admin_repeat_msgi "::visit | games-net.ch::"
und hier das PLugin:
Code:
/* This plugin will show a message to everyone who connects,
* and will show another message every ten minutes.
*/
/* $Id: plugin_message.sma,v 1.2.2.5 2002/03/17 01:53:29 sbrownlow Exp $ */
#include <core>
#include <string>
#include <admin>
#include <adminlib>
new STRING_VERSION[] = "2.50.0";
public say_hello(Timer,Repeat,HLName,HLParam) {
new User[MAX_NAME_LENGTH];
new Msg[MAX_TEXT_LENGTH];
getstrvar("admin_connect_msg",Msg,MAX_TEXT_LENGTH);
if ( Msg[0] == '0' && Msg[1] == '^0' ) return;
convert_string(HLName,User,MAX_NAME_LENGTH);
messageex(User,Msg,print_center);
}
public say_stuff(Timer,Repeat,HLName,HLParam) {
new Msg[MAX_TEXT_LENGTH];
getstrvar("admin_repeat_msg",Msg,MAX_TEXT_LENGTH);
if ( Msg[0] == '0' && Msg[1] == '^0' ) return;
centersay(Msg,10,255,255,10);
}
public say_stuffi(Timer,Repeat,HLName,HLParam) {
new Msgi[MAX_TEXT_LENGTH];
getstrvar("admin_repeat_msgi",Msgi,MAX_TEXT_LENGTH);
if ( Msgi[0] == '0' && Msgi[1] == '^0' ) return;
centersay(Msgi,10,255,255,0);
}
public plugin_connect(HLUserName, HLIP, UserIndex) {
set_timer("say_hello",45,0);
return PLUGIN_CONTINUE;
}
public plugin_init() {
plugin_registerinfo("Auto-Messaging Plugin","Zeigt eine Nachricht alle x Minuten, sowie am Anfang.",STRING_VERSION);
new iRepeatInterval = getvar("admin_repeat_freq");
new iRepeatIntervali = getvar("admin_repeat_freqi");
if ( iRepeatInterval >= 15 ) {
set_timer("say_stuff", iRepeatInterval, 99999);
}
if ( iRepeatIntervali >= 15 ) {
set_timer("say_stuffi", iRepeatIntervali, 99999);
}
return PLUGIN_CONTINUE;
}
Ich hoffe jemand findet den Fehler, die 2. nachricht wird naemlich nicht angezeigt...
ich weiss bin nicht der beste im programmieren, aber eigentlich sollt ich sowas schon noch hinbekommen...