Hallo,
wollte ein Account System schreiben und es später auch noch erweitern.
Ich hab jetzt einfach nur drauf los geschrieben, wollte es eben compilen zum testen und
nun extrem viele Fehler. NUr weiß ich nicht wo :s
Naja hier der Code:
#include <a_samp>
#include <dini>
#pragma tabsize 0
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define c_Rot 0xBA0000FF
#define c_Grau 0xC8C8C8FF
#define c_Blau 0x00A2DFFF
#define c_Gruen 0x86E300FF
#define c_Gelb 0xFFE300FF
#define c_Orange 0xDF7900FF
#define c_Weiss 0xFFFFFFFF
enum pInfo {
Passwort,
AdminLevel,
Score,
Team,
Money,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new LoggedIn[MAX_PLAYERS];
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Account System by Flaver aKa hooK ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n--------------------------------------");
print(" Account System by Flaver aKa hooK ");
print("--------------------------------------\n");
}
#endif
public OnPlayerConnect(playerid) {
new pName[MAX_PLAYER_NAME],
uFile[128];
GetPlayerName(playerid,pName,sizeof(pName));
format(uFile,sizeof(uFile),"%s.ini");
LoggedIn[playerid] = 0;
if(dini_Exist(uFile)){
SendClientMessage(playerid,c_Orange,"Herzlich WIllkommen zurueck %s",pName);
SendClientMessage(playerid,c_Orange,"Dein Account wurde gefunden, benutze");
SendClientMessage(playerid,c_Orange,"/login [passwort] um dich einzuloggen");
return 1;
}else{
SendClientMessage(playerid,c_Orange,"Herzlich Willkommen %s",pName);
SendClientMessage(playerid,c_Orange,"Dein Account wurde nicht gefunden, benutze");
SendClientMessage(playerid,c_Orange,"/register passwort um dich zu registrieren!");
return 1;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason){
new pName[MAX_PLAYER_NAME],
uFile[128];
GetPlayerName(playerid,pName,sizeof(pName));
format(uFile,sizeof(uFile),"%s.ini",pName);
dini_IntSet(uFile,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
dini_IntSet(uFile,"Score",GetPlayerScore(playerid));
dini_IntSet(uFile,"Team",GetPlayerTeam(playerid));
dini_IntSet(uFile,"Money",GetPlayerMoney(playerid));
LoggedIn[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/register", true) ==0){
new tmp[128];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid,c_Rot,"Benutze: /register [passwort]");
new pName[MAX_PLAYER_NAME],
uFile[64];
GetPlayerName(playerid,pName,sizeof(pName));
format(uFile,sizeof(uFile),"%s.ini",pName);
dini_Create(uFile);
dini_Set(uFile,"Passwort", tmp);
dini_Set(uFile,"AdminLevel", 1);
dini_Set(uFile,"Score", 0);
dini_Set(uFile,"Team", 0);
dini_Set(uFile,"Money", 25000);
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid) {
if(LoggedIn[playerid] == 0){
SendClientMessage(playerid,c_Rot,"Du musst dich zuerst einloggen!!");
Kick(playerid);
return 1;
}
return 1;
}
stock strtok(const string[], &index,seperator=' ') {
new length = strlen(string);
new offset = index;
new result[255];
while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
if ((index < length) && (string[index] == seperator))
{
index++;
}
return result;
}
Hier die Liste mit den Fehlern
\samp03asvr_R3_win32\pawno\include\dutils.inc(27) : warning 235: public function lacks forward declaration (symbol "mktime")
\samp03asvr_R3_win32\pawno\include\dutils.inc(34) : warning 217: loose indentation
C:\Dokumente und Einstellungen\Florian\Desktop\GTA Script\TooLZZ\samp03asvr_R3_win32\pawno\include\dutils.inc(37) : warning 217: loose indentation
\samp03asvr_R3_win32\pawno\include\dutils.inc(40) : warning 217: loose indentation
\samp03asvr_R3_win32\pawno\include\dutils.inc(51) : warning 217: loose indentation
\samp03asvr_R3_win32\pawno\include\dutils.inc(61) : warning 235: public function lacks forward declaration (symbol "Time")
\samp03asvr_R3_win32\pawno\include\dutils.inc(144) : warning 235: public function lacks forward declaration (symbol "StripNewLine")
\samp03asvr_R3_win32\pawno\include\dutils.inc(185) : warning 235: public function lacks forward declaration (symbol "copy")
\samp03asvr_R3_win32\pawno\include\dutils.inc(207) : warning 235: public function lacks forward declaration (symbol "copyEx")
\samp03asvr_R3_win32\pawno\include\dutils.inc(227) : warning 235: public function lacks forward declaration (symbol "del")
\samp03asvr_R3_win32\pawno\include\dutils.inc(242) : warning 235: public function lacks forward declaration (symbol "set")
\samp03asvr_R3_win32\pawno\include\dutils.inc(257) : warning 235: public function lacks forward declaration (symbol "equal")
\samp03asvr_R3_win32\pawno\include\dutils.inc(297) : warning 235: public function lacks forward declaration (symbol "getElement")
\samp03asvr_R3_win32\pawno\include\dutils.inc(325) : warning 235: public function lacks forward declaration (symbol "mod")
\samp03asvr_R3_win32\pawno\include\dutils.inc(330) : warning 235: public function lacks forward declaration (symbol "div")
\samp03asvr_R3_win32\pawno\include\dutils.inc(339) : warning 235: public function lacks forward declaration (symbol "num_hash")
\samp03asvr_R3_win32\pawno\include\dutils.inc(358) : warning 235: public function lacks forward declaration (symbol "hash")
\samp03asvr_R3_win32\pawno\include\dutils.inc(363) : error 090: public functions may not return arrays (symbol "hash")
\samp03asvr_R3_win32\pawno\include\dini.inc(26) : warning 235: public function lacks forward declaration (symbol "dini_Exists")
\samp03asvr_R3_win32\pawno\include\dini.inc(31) : warning 235: public function lacks forward declaration (symbol "dini_Remove")
\samp03asvr_R3_win32\pawno\include\dini.inc(37) : warning 235: public function lacks forward declaration (symbol "dini_Create")
\samp03asvr_R3_win32\pawno\include\dini.inc(45) : warning 235: public function lacks forward declaration (symbol "dini_PRIVATE_ExtractKey")
\samp03asvr_R3_win32\pawno\include\dini.inc(48) : error 090: public functions may not return arrays (symbol "dini_PRIVATE_ExtractKey")
\samp03asvr_R3_win32\pawno\include\dini.inc(50) : error 090: public functions may not return arrays (symbol "dini_PRIVATE_ExtractKey")
\samp03asvr_R3_win32\pawno\include\dini.inc(53) : warning 235: public function lacks forward declaration (symbol "dini_PRIVATE_ExtractValue")
\samp03asvr_R3_win32\pawno\include\dini.inc(57) : error 090: public functions may not return arrays (symbol "dini_PRIVATE_ExtractValue")
\samp03asvr_R3_win32\pawno\include\dini.inc(60) : error 090: public functions may not return arrays (symbol "dini_PRIVATE_ExtractValue")
\samp03asvr_R3_win32\pawno\include\dini.inc(63) : warning 235: public function lacks forward declaration (symbol "dini_Set")
\samp03asvr_R3_win32\pawno\include\dini.inc(99) : warning 235: public function lacks forward declaration (symbol "dini_IntSet")
\samp03asvr_R3_win32\pawno\include\dini.inc(105) : warning 235: public function lacks forward declaration (symbol "dini_Int")
\samp03asvr_R3_win32\pawno\include\dini.inc(109) : warning 235: public function lacks forward declaration (symbol "dini_Bool")
\samp03asvr_R3_win32\pawno\include\dini.inc(113) : warning 235: public function lacks forward declaration (symbol "dini_BoolSet")
\samp03asvr_R3_win32\pawno\include\dini.inc(119) : warning 235: public function lacks forward declaration (symbol "dini_Unset")
\samp03asvr_R3_win32\pawno\include\dini.inc(149) : warning 235: public function lacks forward declaration (symbol "dini_Get")
\samp03asvr_R3_win32\pawno\include\dini.inc(155) : error 090: public functions may not return arrays (symbol "dini_Get")
\samp03asvr_R3_win32\pawno\include\dini.inc(163) : error 090: public functions may not return arrays (symbol "dini_Get")
\samp03asvr_R3_win32\pawno\include\dini.inc(167) : error 090: public functions may not return arrays (symbol "dini_Get")
\samp03asvr_R3_win32\pawno\include\dini.inc(171) : warning 235: public function lacks forward declaration (symbol "dini_Isset")
\Register_Login.pwn(68) : error 017: undefined symbol "dini_Exist"
\Register_Login.pwn(69) : warning 202: number of arguments does not match definition
\Register_Login.pwn(74) : warning 202: number of arguments does not match definition
\Register_Login.pwn(79) : warning 225: unreachable code
Register_Login.pwn(97) : error 047: array sizes do not match, or destination array is too small
\Register_Login.pwn(100) : error 047: array sizes do not match, or destination array is too small
\Register_Login.pwn(108 error 035: argument type mismatch (argument 3)
\Register_Login.pwn(109) : error 035: argument type mismatch (argument 3)
\Register_Login.pwn(110) : error 035: argument type mismatch (argument 3)
\Register_Login.pwn(111) : error 035: argument type mismatch (argument 3)
\Register_Login.pwn(130) : error 021: symbol already defined: "strtok"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
16 Errors.
Hoffe ihr könnt mir wenigstens ein bisschen helfen
-hooK