Ein neues Thema erstellen  Auf das Thema antworten  [ 12 Beiträge ] 
Autor Nachricht
BeitragVerfasst: 21.11.2002, 05:10 

Registriert: 19.11.2002, 18:35
Beiträge: 6
Moin Leutz,

habe mir das Plugin gesaugt und bekomme des net compiliert :o
Nachdem ich die *.sma in den Ordner "myscripts" kopiert habe bekomme ich beim compilieren mit der "compile_all.bat" immer nur ne Fehlermeldung :

plugin_cavey_votemap.sma(310) Error [21]: symbol already defined: "ChangeMap"

Da ich net scripten kann werde ich den Fehler bestimmt net selbst beseitigen können :roll:
Vieleicht weiss ja jemand wie ich den Fehler beseitigen kann oder lässt mir seine *.amx zukommen !? Thx im voraus !

ps. Habe AM 2.50.26, metamod 1.13.1 auf Win

greetz Seth


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 21.11.2002, 09:48 
AM.de Team
Benutzeravatar

Registriert: 23.11.2001, 00:00
Beiträge: 3842
Wohnort: Vor König Arthus
Das muss ein älteres Plugin sein, in dem Cavey wohl eine Funktion namens ChangeMap deklariert hat.
Inzwischen ist eine Funktion diesen Namens allerdings auch in der adminlib.inc zu finden und wird via include automatisch eingebunden. Da kollidiert natürlich die selbstgeschriebene Funktion mit der vorgegebenen.
Cavey ist ziemlich stark in die AdminMod Erstellung insbesondere die Plugins eingebunden. Es kann sein, dass es sich dabei um die gleiche Funktion wie in der adminlib.inc handelt.
Müsstest mal den Code posten, so dass man die beiden Funktionen vergleichen kann.

_________________
Der schwarze Ritter triumphiert immer...
WING-Clan


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 21.11.2002, 21:13 

Registriert: 19.11.2002, 18:35
Beiträge: 6
Hi,

hier die *.sma :

edit: gelöscht


Zuletzt geändert von Seth| am 22.11.2002, 05:42, insgesamt 1-mal geändert.

Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 21.11.2002, 21:34 

Registriert: 27.05.2002, 12:14
Beiträge: 541
Wohnort: im Osten ;)
nimm doch rinde`s...

http://board.battlenation.de/viewtopic. ... 5&start=30

:wink:


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 21.11.2002, 23:21 

Registriert: 19.11.2002, 18:35
Beiträge: 6
Zitat:
Hmm Danke *nachschaut*

arrrg :-?

plugin_rindy_votemap_error

plugin_rindy_votemap.sma(333) Error [17]: undefined symbol "setstrvar"
plugin_rindy_votemap.sma(333) Warning [215]: expression has no effect

greetz Seth


Zuletzt geändert von Seth| am 21.11.2002, 23:23, insgesamt 1-mal geändert.

Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 21.11.2002, 23:22 
AM.de Team

Registriert: 04.10.2002, 16:14
Beiträge: 1212
kauf dir mal adminmod 2.50.50


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 21.11.2002, 23:31 

Registriert: 19.11.2002, 18:35
Beiträge: 6
Zitat:
kauf dir mal adminmod 2.50.50
Hää, wie bitte ?¿?


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 21.11.2002, 23:32 
AM.de Team

Registriert: 04.10.2002, 16:14
Beiträge: 1212
du gehen auf www.adminmod.org und laden neuste version


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 21.11.2002, 23:41 

Registriert: 19.11.2002, 18:35
Beiträge: 6
Zitat:
du gehen auf www.adminmod.org und laden neuste version
Nee eben nicht !!! Ich möchte das Plugin da oben zum laufen bekommen und deswegen habe ich hier um hilfe gebeten. Wenn ich dein Plugin install will dann sauge ich mir schon noch die neue Version sollte es dann eben notwendig sein :wink:

Und im übrigen kannste auch normal mit mir reden ! Danke !


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 22.11.2002, 00:21 
AM.de Team
Benutzeravatar

Registriert: 23.11.2001, 00:00
Beiträge: 3842
Wohnort: Vor König Arthus
Hmmm, würdest Du uns erklären, warum Du 2.50.50 nicht installieren willst?

BTW, ich kann keinen Fehler im Skript entdecken!

_________________
Der schwarze Ritter triumphiert immer...
WING-Clan


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 22.11.2002, 05:42 

Registriert: 19.11.2002, 18:35
Beiträge: 6
Oh sorry hab die falsche *.sma gepostet :oops:
Hatte vorher noch bissl selber rumprobiert und einen teil einfach gelöscht es lies sich zwar compilieren aber machte im Spiel keine Anstalten...
Zitat:
Hmmm, würdest Du uns erklären, warum Du 2.50.50 nicht installieren willst?
Jo hatte arge Probs 2.50.50 zu install K.a. lief net also hab ich erstamal die 26er genommen und mit Hilfe Anleitung von adminmod-hilfe.de install

Hier nun die richtige *.sma den Teil den ich einfach gelöscht hatte hab ich mal rot makiert :roll:
Code:
/**************************************************************************
 *		Who, what, why, where, when, how?                         *
 * WHO?  Joe "Caveman Noyes						  *
 * WHAT? A replacement for admin_vote_map that allows more than one map   *
 *       nomination, plugin_cavey_votemap.sma v1.3                        *
 * WHY?  Gazbo ran a server called Frog (long story) and at the end of the*
 *       year he went back to the states with his girlfriend. Lots of 2nd *
 *       year students remembered his scripts, but they were never on the *
 *       adminmod plugins download page, so they are now back by popular  *
 *       demand.                                                          *
 * WHERE?Oh yeah, we are in Exeter University.                            *
 *  	 - http://guild.ex.ac.uk/netgamer                                 *
 * WHEN? This was last saved 13:13 13/12/2001                             *
 * HOW?	 To install this, compile the script and place it in the dlls     *
 *       directory in CStrike. Then add a line at the TOP of your         *
 *       plugin.ini file that lists the compiled .amx.  It MUST go at the *
 *       top so that it stops the original admin_vote_map from running.   *
 * Help! ICQ me on 70710878 with any bugs and issues.  I will NOT help    *
 *       compiling or installing this plugin as it is all included on     *
 * 	 - www.adminmod.org 						  *
 * 	 or in this file.  Enjoy ;)					  *
 * 	 								  *
 * 	 Caveman							  *
 **************************************************************************/


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

/*Settings you can screw with*/
#define ACCESS_CANCEL_VOTE 2
	/*EXPLANATION Defines what level admin can cancel a vote.         */
#define NOMINATION_INTERVAL_SEC 120
	/*EXPLANATION Determins how long to allow for more maps to be     *
	 * added                                                          */
#define NOMINATION_RETRY_INTERVAL_SEC 30
	/*EXPLANATION If a vote fails due to another vote being called    *
	 * it will retry in this many seconds.                            */
#define MAX_NOMINATIONS 8
	/*EXPLANATION The maximum number of maps you will allow to be     *
	 * nominated. NOTE, this CANNOT exceed 8!!!! If you do, you run   *
	 * out of numbers in the vote menu, and do you really need more?  */
#define DEBUG 1
	/*EXPLANATION Basically, there are a few bits further down that   *
	 * dont add to the script and cause it to bail repeatedly.  They  *
	 * are bits from Gazbos original code that I dont think should be *
	 * necessary, so I removed them through #'s                       *
	 * Set to 1 to disable some of the features which may contain bugs*/
#define REMEMBER_MAPS 5
	/*EXPLANATION This sets the number of maps it remembers from past *
	 * votes.  The higher you set it, the more it remembers.  It will *
	 * not let you nominate any map that it remembers, so only enable *
	 * if you are sick of the same few maps.  Set it to 0 to disable. */

/*Static global variables*/
new NOMINATIONS_BEGUN_MSG1[] = "Map nominations have begun, map vote starts in 2 minutes."
new NOMINATIONS_BEGUN_MSG2[] = "To nominate a map press the ^"~^", type ^"admin_vote_map <map_name>^", press ^"~^" again"
	/*EXPLANATION these are the strings that appear when somone starts*
	 * a map vote and should be used to explain how to add more maps  */


/*Global variables you should NOT screw with!*/
new NominatedMaps[MAX_NOMINATIONS][MAX_NAME_LENGTH];
new NominatedMapsIndex = 0;
new NewMap[MAX_NAME_LENGTH];
new vote_canceled;
#if REMEMBER_MAPS != 0
new RememberedMaps[REMEMBER_MAPS][MAX_NAME_LENGTH]
#endif

new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.2";

	/*EXPLANATION This resets the map vote array of maps, the number  *
	 * of maps counted in.                                            */
InitializeNominatedMaps() {
	new MapCount;
	for(MapCount=0;MapCount<MAX_NOMINATIONS;MapCount++) {
		NominatedMaps[MapCount][0] = NULL_CHAR;
	}
	NominatedMapsIndex = 0;
	return PLUGIN_HANDLED;
}

	/*EXPLANATION THis is the function users can make use of          */
public admin_vote_map(HLCommand,HLData,HLUserName,UserIndex) {
	new flag = 0;
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new MapCount;
	new msg[MAX_TEXT_LENGTH] = "";
	new temp[MAX_NAME_LENGTH];
	

		/*Set up the variables*/
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);

	for(MapCount=0;MapCount<MAX_NOMINATIONS;MapCount++) {
		if (streq(Data,NominatedMaps[MapCount])==1) {
			flag=1;
		}
	}
#if REMEMBER_MAPS != 0
	for(MapCount=0;MapCount<REMEMBER_MAPS;MapCount++) {
		readfile("lastmaps.ini",RememberedMaps[MapCount],(MapCount+1),MAX_NAME_LENGTH);
		if (streq(Data,RememberedMaps[MapCount])==1) {
			flag=2;
		}
	}
#endif
	if (vote_allowed()!=1) {
		selfmessage( "Vote not allowed at this time.");
		return PLUGIN_HANDLED;

	} else if (valid_map(Data) != 1) {
		selfmessage( "Invalid map name, please try again or use admin_listmaps");
		return PLUGIN_HANDLED;

	} else if (NominatedMapsIndex >= MAX_NOMINATIONS-1) {
		selfmessage("The maximum number of nominations has already been reached.");
		return PLUGIN_HANDLED;

	} else if (flag==1) {
	  		strcat(msg, "Map already nominated: ",  MAX_TEXT_LENGTH);
			strcat(msg, Data,  MAX_TEXT_LENGTH);
			selfmessage(msg);
			return PLUGIN_HANDLED;
#if REMEMBER_MAPS != 0
	} else if (flag==2) {
	  		strcat(msg, "Map nomination DENIED: ",  MAX_TEXT_LENGTH);
			strcat(msg, Data,  MAX_TEXT_LENGTH);
			strcat(msg, " Reason: Won recent vote",  MAX_TEXT_LENGTH);
			selfmessage(msg);
			return PLUGIN_HANDLED;
#endif
	} else { 
		strcpy(NominatedMaps[NominatedMapsIndex],Data, MAX_NAME_LENGTH);
		if (NominatedMapsIndex == 0) {
			say(NOMINATIONS_BEGUN_MSG1);
			say(NOMINATIONS_BEGUN_MSG2);
			vote_canceled=0;  /*Un-cancels the vote*/
			set_timer("VoteOnNominatedMaps",NOMINATION_INTERVAL_SEC,1,"");
		}
		NominatedMapsIndex++;
		strcpy(" ",msg,  MAX_TEXT_LENGTH);
		numtostr(NominatedMapsIndex,temp);
		strcat(msg,temp,  MAX_TEXT_LENGTH);
		strcat(msg," (",  MAX_TEXT_LENGTH);
		strcat(msg,Data,  MAX_TEXT_LENGTH);
		strcat(msg,") has been added by ",  MAX_TEXT_LENGTH);
		strcat(msg,User,  MAX_TEXT_LENGTH);
		say(msg);
	}
	return PLUGIN_HANDLED;
}

	/*EXPLANATION Called after the correct time by admin_vote_map and handles the vote *
	 * It makes the menu using a switch to declare enough variables. Almost all of this*
	 * was written by Gazbo.  For version 1.1 I changed it so that if a map vote is    *
	 * called before the vote occurs, it waits for another NOMINATION_INTERVAL_SEC and *
	 * delays the vote. Previously, if you vote_kicked duing the runnup time, the vote *
	 * bailed and you could not use the map vote at all until the next map. Now it     *
	 * should work come rain or shine*/
public VoteOnNominatedMaps () {
	new msg[MAX_TEXT_LENGTH] = "Change map to";
	new nochange[MAX_TEXT_LENGTH] = "No change of map";
	new strNumber[MAX_NUMBER_LENGTH];
	new iserror = 0;

	if(vote_allowed()!=1) {
		say("Vote DELAYED for change map.");
		/*If it goes tits up cause someone held a vote, it tries again.*/
		set_timer("VoteOnNominatedMaps",NOMINATION_RETRY_INTERVAL_SEC,1,"");
		return PLUGIN_HANDLED;
	} else if(vote_canceled==1) {
		say("Map vote successully canceled");
		/*If an admin has canceled the vote, it bails and resets*/
		InitializeNominatedMaps();
		vote_canceled=0;
		return PLUGIN_HANDLED;
	} else {
	/* NominatedMapsIndex should already be one past the player entered  *
	 * maps, this is okay becaue the nochange option uses a vote option. */
		switch(NominatedMapsIndex) {
			case 1:
				vote(msg,nochange,NominatedMaps[0],"HVoteMap","");
				// break;
			case 2:
				vote(msg,nochange,NominatedMaps[0],NominatedMaps[1],"HVoteMap","");
				// break;
			case 3:
				vote(msg,nochange,NominatedMaps[0],NominatedMaps[1],NominatedMaps[2],"HVoteMap","");
				// break;
			case 4:
				vote(msg,nochange,NominatedMaps[0],NominatedMaps[1],NominatedMaps[2],NominatedMaps[3],"HVoteMap","");
				// break;
			case 5:
				vote(msg,nochange,NominatedMaps[0],NominatedMaps[1],NominatedMaps[2],NominatedMaps[3],NominatedMaps[4],"HVoteMap","");
				// break;
			case 6:
				vote(msg,nochange,NominatedMaps[0],NominatedMaps[1],NominatedMaps[2],NominatedMaps[3],NominatedMaps[4],NominatedMaps[5],"HVoteMap","");
				// break;
			case 7:
				vote(msg,nochange,NominatedMaps[0],NominatedMaps[1],NominatedMaps[2],NominatedMaps[3],NominatedMaps[4],NominatedMaps[5],NominatedMaps[6],"HVoteMap","");
				// break;
			case 8:
				vote(msg,nochange,NominatedMaps[0],NominatedMaps[1],NominatedMaps[2],NominatedMaps[3],NominatedMaps[4],NominatedMaps[5],NominatedMaps[6],NominatedMaps[7],"HVoteMap","");
				// break;
			default:
				iserror = 1;
		}
		// It seems the Small compiler has a bug which allows only one
		// statement per case.
		if(iserror) {
			strcpy("Voting CANCLED. Internal script error.",msg,  MAX_TEXT_LENGTH);
			numtostr(NominatedMapsIndex,strNumber);
			strcat(msg, strNumber,  MAX_TEXT_LENGTH);
			say(msg);
			InitializeNominatedMaps();
		}
	}
	return PLUGIN_HANDLED;
}

	/*EXPLANATION This function acts on the decision of the vote. The #'s in here*
	 * contain the code that caused the vote to fail EVERY time.  As far as I can*
	 * tell, it is not needed as the vote has already gone through, but Gazbo    *
	 * included it for some reason.                                              */
public HVoteMap(WinningOption,HLData,VoteCount,UserCount) {
	new VoteSubject[MAX_DATA_LENGTH];
	new VoteMap[MAX_NAME_LENGTH];
	new msg[MAX_TEXT_LENGTH] = "";
	new strNumber[MAX_NUMBER_LENGTH];
#if REMEMBER_MAPS != 0
	new MapCount;
#endif

	// WinningOption == 0 if nothing was vote for.
	// WinningOption == 1 referrs to the vote to not change the map.
	if (WinningOption==0 || WinningOption==1) {
		strcat(VoteSubject,"keeping current map",  MAX_TEXT_LENGTH);
	} else {
		strcpy(VoteMap,NominatedMaps[WinningOption-2], MAX_NAME_LENGTH);
		if(valid_map(VoteMap) != 1) {
			// This should only happen if "NominatedMapsIndex++;"
			// was run but map was not yet added to NominatedMaps,
			// and most players voted for the null string map.
			// So, in practive, this is very unlikley.
			strcat(msg,"Vote IGNORED for ",  MAX_TEXT_LENGTH);
			strcat(msg,VoteSubject,  MAX_TEXT_LENGTH);
			strcat(msg,".",  MAX_TEXT_LENGTH);
			say(msg);
			say("An invalid map won the vote.");
			InitializeNominatedMaps();
			return PLUGIN_HANDLED;
		} else {
			strcat(VoteSubject,"changing map to ",  MAX_TEXT_LENGTH);
			strcat(VoteSubject,VoteMap,  MAX_TEXT_LENGTH);
		}
	}
	if( vote_canceled!=0 ) {
		strcat(msg,"Vote CANCELED for map change by admin",  MAX_TEXT_LENGTH);
		say(msg);
	} else {
		strcat(msg,"Vote passed FOR ",  MAX_TEXT_LENGTH);
		strcat(msg,VoteSubject,  MAX_TEXT_LENGTH);
		strcat(msg,". ",  MAX_TEXT_LENGTH);
		say(msg);

		msg = "";
		strcat(msg,"Map selection based on which recieved the most votes, this one recieved ",  MAX_TEXT_LENGTH);
		numtostr(VoteCount,strNumber);
		strcat(msg,strNumber,  MAX_TEXT_LENGTH);
		strcat(msg," votes.",  MAX_TEXT_LENGTH);
		say(msg);

#if REMEMBER_MAPS != 0
		resetfile("lastmaps.ini");
		writefile("lastmaps.ini",VoteMap,-1);
		for(MapCount=1;MapCount<REMEMBER_MAPS;MapCount++) {
			writefile("lastmaps.ini",RememberedMaps[MapCount],-1);
		}
#endif

		if (WinningOption !=0 && WinningOption !=1 && vote_canceled==0 ) {
			strcpy(NewMap,VoteMap,MAX_NAME_LENGTH);
			/*exec("mp_timelimit 15");*/
			set_timer("ChangeMap",10,1);
		}
	}
	InitializeNominatedMaps();
	return PLUGIN_HANDLED;
}

public admin_cancelmapvote(HLCommand,HLData,HLUserName,UserIndex) {
	new Text[MAX_TEXT_LENGTH];

	vote_canceled=1;	
	snprintf(Text, MAX_TEXT_LENGTH, "Admin attempting to cancel map vote");
	say(Text);
	return PLUGIN_HANDLED;
}

public ChangeMap() {
	if(NewMap[0]!=NULL_CHAR) {
		changelevel(NewMap);
	}
}

public plugin_init() {

	plugin_registerinfo("Caveys Menu Map Vote 1.3","Allows multiple maps to be nominated",STRING_VERSION);
	plugin_registercmd("admin_vote_map","admin_vote_map",ACCESS_VOTE_MAP,"admin_vote_map <map>: Starts map nominations before the vote to change the map.");
	plugin_registercmd("admin_cancelmapvote","admin_cancelmapvote",ACCESS_CANCEL_VOTE,"admin_cancelmapvote: Cancels the current map vote");

	return PLUGIN_CONTINUE;
}
Edit: Huch hier gehen ja garkeine farben inna codeansicht :lol:
Code:
if (WinningOption !=0 && WinningOption !=1 && vote_canceled==0 ) {
			strcpy(NewMap,VoteMap,MAX_NAME_LENGTH);
			/*exec("mp_timelimit 15");*/
			set_timer("ChangeMap",10,1);
		}
	}
	InitializeNominatedMaps();
	return PLUGIN_HANDLED;
}
THX ! Seth


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 22.11.2002, 10:22 
AM.de Team
Benutzeravatar

Registriert: 23.11.2001, 00:00
Beiträge: 3842
Wohnort: Vor König Arthus
Code:
public ChangeMap() { 
  if(NewMap[0]!=NULL_CHAR) { 
    changelevel(NewMap); 
  } 
}
Das ist Dein Problemcode (leider nicht identisch mit der Funktion in adminlib.inc). Die Funktion sieht aber identisch aus. Die Beschreibung dabei ist etwas verwirrend, ich werde daraus nicht ganz schlau. Daher würde ich vorschlagen die Funktion umzubennenen z.B.:
Code:
public ChangeMap2(Timer,Repeat,HLUser,HLParam) { 
  if(NewMap[0]!=NULL_CHAR) { 
    changelevel(NewMap); 
  } 
}
Dann müsste man noch den Aufruf des Timers ändern:
Code:
set_timer("ChangeMap2",10,1);
Dann probier es nochmal.

BTW, würde ich Dir wirklich empfehlen 2.50.50 zu installieren. Die neue Struktur ist zwar etwas verwirrend, aber logischer als die alte. Außerdem wurde eine Menge Fehler ausgebügelt sowie diverse Sicherheitslöcher gestopft.

_________________
Der schwarze Ritter triumphiert immer...
WING-Clan


Nach oben
   
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen  Auf das Thema antworten  [ 12 Beiträge ] 


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Powered by phpBB® Forum Software © phpBB Limited
Deutsche Übersetzung durch phpBB.de
Original Design von "[ Half-Life Admin Mod © Alfred Reynolds 2000-2003 ] - [ site design by Jägermeister ]"