AdminMod.de
https://www.adminmod.de/

plugin_sharp_cconnect
https://www.adminmod.de/viewtopic.php?t=2884
Seite 1 von 1

Autor:  Alf [ 07.05.2002, 19:14 ]
Betreff des Beitrags:  plugin_sharp_cconnect

/* This plugin was made by: Sharpsniper it is a revision of Fah-Q[Dio]' plugin but this * pluin announces every person that connects to your server in a typesay form and * greets them.
* Plugin Created: October 13, 2001, 12:48 AM
* Sharpsniper: $harp$sniper Enjoy!
* Changes Made: Announce Delay is now 30 seconds, Everyone gets announced
*/

#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>

#define ACCESS_ALL 0
#define ANNOUNCE_DELAY 30

new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.07";

plr_announce(strName[], lConnect=0) {

new Text[MAX_TEXT_LENGTH] = "";

if (lConnect == 1) {
strcat(Text,"Welcome ^n ",MAX_DATA_LENGTH);
strcat(Text, strName,MAX_DATA_LENGTH);
strcat(Text, " Enjoy playing here!!",MAX_DATA_LENGTH);
} else {
strcat(Text, strName,MAX_DATA_LENGTH);
strcat(Text, "^n has left but will return again!",MAX_DATA_LENGTH);
}
typesay(Text, 7, 12, 125, 12);
}

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_ALL, 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_ALL, strName)!=0)
plr_announce(strName, 1);

}

public plugin_init() {
plugin_registerinfo("Client Connect Greeting!","Announces and Greets Every Player That Connects!",STRING_VERSION);

return PLUGIN_CONTINUE;
}

Dieses Plugin ist von www.adminmod.org/ascript/plugin.php und soll jedem der connectet eine Nachricht anzeigen.
Da es nur als sma vorlag wollte ich es compilieren bekam aber 2 Errors.
Könnt ihr mir helfen?

Autor:  sentinel [ 07.05.2002, 19:28 ]
Betreff des Beitrags: 

wie lauten die errors

Autor:  [COLA]*Whiskey [ 07.05.2002, 19:34 ]
Betreff des Beitrags: 

also ich benutz das auch und bei mir siehts so aus:
Code:
/* This plugin was made by: Sharpsniper it is a revision of Fah-Q[Dio]' plugin but this 
 * pluin announces every person that connects to your server in a typesay form and 
 * greets them.
 * Plugin Created: October 13, 2001, 12:48 AM 
 * Sharpsniper: $harp$sniper Enjoy!
 * Changes Made: Announce Delay is now 30 seconds, Everyone gets announced
*/

#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>

#define ACCESS_ALL 0
#define ANNOUNCE_DELAY 30

new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.07";

plr_announce(strName[], lConnect=0) {

  new Text[MAX_TEXT_LENGTH] = "";

  if (lConnect == 1) {
    strcat(Text," Moin, ",MAX_DATA_LENGTH);
    strcat(Text, strName,MAX_DATA_LENGTH);
    strcat(Text, "^n Viel Spass beim CS heizen !!!",MAX_DATA_LENGTH);
  } 
  else {
    strcat(Text, strName,MAX_DATA_LENGTH);
    strcat(Text, "^nhat den Server verlassen !",MAX_DATA_LENGTH);
  }
  typesay(Text,6,12,125,12);
}

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_ALL, strName)!=0)
    plr_announce(strName, 0);

  return PLUGIN_CONTINUE;
}

public ann_timer(Timer,Repeat,HLUserName,HLParam) {
  new strName[MAX_NAME_LENGTH];

  convert_string(HLParam,strName,MAX_NAME_LENGTH);

  if (access(ACCESS_ALL, strName)!=0)
		plr_announce(strName, 1);

}

public plugin_init() {
  plugin_registerinfo("Client Connect Greeting!","Announces and Greets Every Player That Connects!",STRING_VERSION);  

  return PLUGIN_CONTINUE;
}
bin mir zwar nich mehr sicher aber ich denk ma das ich bei plugin_connect und plugin_disconnect aus HLName --> HLUsername gemacht hab is seit AM 2.50.26 so geändert worden

Autor:  Alf [ 08.05.2002, 14:35 ]
Betreff des Beitrags: 

Dein Quellcode funktioniert.
DANKE für die Hilfe!!!!!!!!!!!!!

Seite 1 von 1 Alle Zeiten sind UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/