Ein neues Thema erstellen  Auf das Thema antworten  [ 3 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Wie kompiliere ich?
BeitragVerfasst: 12.11.2002, 17:47 

Registriert: 01.11.2002, 13:22
Beiträge: 7
Hi!

Also, ich schildere euch mal meine Situation... Ich habe hier einen Windows-Rechner stehen und möchte mein sma-file ins Linux-Format kompilieren, damit ich sie nur noch auf den Server, der mit Linux läuft, kopieren kann. Ich ahbe kein Tool gefunden. Ihr habt doch sicher eins für mich, oder? WEnn nicht, wie kompiliere ich denn die file auf dem Server?

Freundliche Grüße! - Micha


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 12.11.2002, 17:55 
HLDS Team
Benutzeravatar

Registriert: 21.10.2002, 14:08
Beiträge: 1205
zuerst einmal musst du deine sma in eine windows-amx KOMPILIEREN. das steht hier beschrieben.
dann noch unten auf den link KONVERTIEREN gehen, da kannste dir dann über nen link die datei amxconv.exe saugen. steht da auch beschrieben. damit wandelt man dann die windows-amx in eine linux-amx um.

_________________
Die Expansion der Knolle verhält sich reziprok proportional zur intellektuellen Kapazität der kultivierenden Agrar-Ökonomen.


Nach oben
   
 Betreff des Beitrags:
BeitragVerfasst: 13.11.2002, 16:41 

Registriert: 01.11.2002, 13:22
Beiträge: 7
Hehe, mist, hätte ich das mal eher gelesen, denn jetzt bi ich schon selbst drauf gekommen :) aber ich danke dir, Lessie!

allerdings habe ich jetzt auch schon das nächste Problem. Und zwar bekomme ich folgende Fehlermeldung beim Kompilieren:

plugin_consgreet.sma(60) Error [25]: function heading differs from prototype

Das heißt wohl, das in Zeile 60 ein Fehler vorliegt. Alelrdings habe ich nicht wirklich etwas verändert, was dem zu Grunde liegen könnte, wie mir scheint. Ich hab die entsprechende Zeile unten hervorgehoben...

/* $Id: plugin_consgreet.sma,v 1.0.0.5 04/01/01 10:36:20 Ascad Exp $ */

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

new STRING_VERSION[MAX_DATA_LENGTH] = "1.0.0.5";

addstr(strBegin[],strEnd[]) {
new i=0;
new Length = strlen(strEnd);
new j;
while(strBegin!=0) i++;
for(j=0;j<Length;j++)
strBegin[i+j]=strEnd[j];
/* Null-terminate the string. */
strBegin[i+j] = NULL_CHAR;
}

public NumToStr(num,str[])
{
new Base = 1;
new Digits = 1;
new i = 0;

/* Special case: 0 */
if (num == 0) {
str[i++] = ´0´;
str[i++] = NULL_CHAR;
} else {
/* If we´ve got a negative number, add a negative sign
to the string, and multiply the number by -1 */
if (num < 0) {
str[i++] = ´-´;
num *= -1;
}

/* Ok. We´ve got at least one digit. Keep multiplying by
10 till we get a higher number than what we´ve got. Note
that this will leave Digits 1 higher than what we want (eg,
if Num was 7, Digits will be 2 */
while (Base <= num) {
Base *= 10;
Digits++;
}

/* Because Digits is higher, use --Digits rather than Digits--.
Also, divide Base before using it. */
while (--Digits > 0) {
Base /= 10;
str[i++] = ´0´ + (num - (num % Base)) / Base;
num = num % Base;
}
str[i++] = NULL_CHAR;
}
}

public plugin_connect(HLName,HLIP,UserIndex) {
new strName[MAX_NAME_LENGTH],strIP[MAX_DATA_LENGTH];
new strSeconds[MAX_NUMBER_LENGTH];
new strNumber[MAX_NUMBER_LENGTH];
new NextMap[MAX_NAME_LENGTH];
nextmap(NextMap,MAX_NAME_LENGTH);
new conmsg[MAX_TEXT_LENGTH];
new host[MAX_TEXT_LENGTH];
new CurrentMap[MAX_NAME_LENGTH];
new Seconds = timeleft(0);
new numPlayers = playercount();
new numMaxPlayers = maxplayercount();
Seconds /= 60;
NumToStr(Seconds, strSeconds);
currentmap(CurrentMap,MAX_NAME_LENGTH);
getstrvar("hostname",host,MAX_TEXT_LENGTH);
convert_string(HLName, strName,MAX_NAME_LENGTH);
convert_string(HLIP,strIP,MAX_DATA_LENGTH);

/* Stuff to do to the client as they connect */
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("------------------Something to read for now---------------------");
consgreet("");
consgreet("================================================================");
addstr(conmsg,"Hallo, ");
addstr(conmsg,strName);
addstr(conmsg,", Willkommen auf dem: ");
addstr(conmsg,host);
consgreet("");
consgreet(conmsg);
conmsg = "";
addstr(conmsg,"Deine Ip lautet: ");
addstr(conmsg,strIP);
consgreet(conmsg);
conmsg = "";
consgreet("================================================================");
addstr(conmsg,"Dieser Server benutzt AdminMod v25026a");
consgreet(conmsg);
conmsg = "";
consgreet("================================================================");
consgreet("");
consgreet("url : [url]http://www.headshotcrew.net&quot[/url];);
consgreet("");
consgreet("mail: server@headshotcrew.net");
consgreet("================================================================");
consgreet("-------------------------Aktuelle Infos-------------------------");
conmsg = "";
addstr(conmsg,"Aktuelle Map: ");
addstr(conmsg,CurrentMap);
consgreet(conmsg);
conmsg = "";
addstr(conmsg,"Verbleibende Zeit: ");
addstr(conmsg,strSeconds);
addstr(conmsg," Minutes");
consgreet(conmsg);
conmsg = "";
addstr(conmsg,"Naechste Map: ");
addstr(conmsg,NextMap);
consgreet(conmsg);
conmsg = "";
addstr(conmsg, "Aktuelle Spieleranzahl: ");
NumToStr(numPlayers, strNumber);
addstr(conmsg, strNumber);
addstr(conmsg, " / ");
NumToStr(numMaxPlayers, strNumber);
addstr(conmsg, strNumber);
consgreet(conmsg);
consgreet("");
conmsg = "";
consgreet("================================================================");
consgreet("-------------------------Server-Regeln--------------------------");
consgreet("consgreet.txt");
consgreet("");
consgreet("");
consgreet("---------------G-O-O-D--L-U-C-K--&--H-A-V-E--F-U-N--------------");
consgreet("");
consgreet("");
consgreet("");
return PLUGIN_CONTINUE;
}

public plugin_init() {
plugin_registerinfo("Ascad´s consgreet","Shows message on connect.",STRING_VERSION);

return PLUGIN_CONTINUE;
}


Hier nun as Original:

/* $Id: plugin_consgreet.sma,v 1.0.0.5 04/01/01 10:36:20 Ascad Exp $ */

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

new STRING_VERSION[MAX_DATA_LENGTH] = "1.0.0.5";

addstr(strBegin[],strEnd[]) {
new i=0;
new Length = strlen(strEnd);
new j;
while(strBegin!=0) i++;
for(j=0;j<Length;j++)
strBegin[i+j]=strEnd[j];
/* Null-terminate the string. */
strBegin[i+j] = NULL_CHAR;
}

public NumToStr(num,str[])
{
new Base = 1;
new Digits = 1;
new i = 0;

/* Special case: 0 */
if (num == 0) {
str[i++] = ´0´;
str[i++] = NULL_CHAR;
} else {
/* If we´ve got a negative number, add a negative sign
to the string, and multiply the number by -1 */
if (num < 0) {
str[i++] = ´-´;
num *= -1;
}

/* Ok. We´ve got at least one digit. Keep multiplying by
10 till we get a higher number than what we´ve got. Note
that this will leave Digits 1 higher than what we want (eg,
if Num was 7, Digits will be 2 */
while (Base <= num) {
Base *= 10;
Digits++;
}

/* Because Digits is higher, use --Digits rather than Digits--.
Also, divide Base before using it. */
while (--Digits > 0) {
Base /= 10;
str[i++] = ´0´ + (num - (num % Base)) / Base;
num = num % Base;
}
str[i++] = NULL_CHAR;
}
}

public plugin_connect(HLName,HLIP,UserIndex) {
new strName[MAX_NAME_LENGTH],strIP[MAX_DATA_LENGTH];
new strSeconds[MAX_NUMBER_LENGTH];
new strNumber[MAX_NUMBER_LENGTH];
new NextMap[MAX_NAME_LENGTH];
nextmap(NextMap,MAX_NAME_LENGTH);
new conmsg[MAX_TEXT_LENGTH];
new host[MAX_TEXT_LENGTH];
new CurrentMap[MAX_NAME_LENGTH];
new Seconds = timeleft(0);
new numPlayers = playercount();
new numMaxPlayers = maxplayercount();
Seconds /= 60;
NumToStr(Seconds, strSeconds);
currentmap(CurrentMap,MAX_NAME_LENGTH);
getstrvar("hostname",host,MAX_TEXT_LENGTH);
convert_string(HLName, strName,MAX_NAME_LENGTH);
convert_string(HLIP,strIP,MAX_DATA_LENGTH);

/* Stuff to do to the client as they connect */
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("");
consgreet("------------------Something to read for now---------------------");
consgreet("");
consgreet("================================================================");
addstr(conmsg,"Hello, ");
addstr(conmsg,strName);
addstr(conmsg,", Welcome to ");
addstr(conmsg,host);
consgreet("");
consgreet(conmsg);
conmsg = "";
addstr(conmsg,"Your ip address is: ");
addstr(conmsg,strIP);
consgreet(conmsg);
conmsg = "";
consgreet("================================================================");
addstr(conmsg,"This server is running Admin-Mod with multiple Plugins");
consgreet(conmsg);
conmsg = "";
consgreet("");
consgreet("");
consgreet("If you have any problems with this server, contact the admin");
consgreet("or visit http://www.adminmod.de!");
consgreet("================================================================");
consgreet("--------------------------Current info--------------------------");
conmsg = "";
addstr(conmsg,"The current map is: ");
addstr(conmsg,CurrentMap);
consgreet(conmsg);
conmsg = "";
addstr(conmsg,"Time remaining on map is: ");
addstr(conmsg,strSeconds);
addstr(conmsg," Minutes");
consgreet(conmsg);
conmsg = "";
addstr(conmsg,"The next map in the mapcycle is: ");
addstr(conmsg,NextMap);
consgreet(conmsg);
conmsg = "";
addstr(conmsg, "The current playercount is: ");
NumToStr(numPlayers, strNumber);
addstr(conmsg, strNumber);
addstr(conmsg, " / ");
NumToStr(numMaxPlayers, strNumber);
addstr(conmsg, strNumber);
consgreet(conmsg);
consgreet("");
conmsg = "";
consgreet("================================================================");
consgreet("-------------------------server stuff---------------------------");
consgreet("consgreet.txt");
consgreet("");
consgreet("================================================================");
consgreet("-----------------------------MOTD-------------------------------");
consgreet("motd.txt");
consgreet("");
consgreet("================================================================");
consgreet("");
consgreet("");
consgreet("--------------------Now just wait to get connected--------------------");
consgreet("");
consgreet("");
consgreet("");
return PLUGIN_CONTINUE;
}

public plugin_init() {
plugin_registerinfo("Ascad´s consgreet","Shows message on connect.",STRING_VERSION);

return PLUGIN_CONTINUE;
}


Im Prinzip habe ich nur übersetzt ...

Freundliche Grüße! - Micha


Nach oben
   
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen  Auf das Thema antworten  [ 3 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 ]"