Hea,
ich bin noch ein anfänger beim Scripten und kriege die Errors hier nicht raus..
Habe mir ein Tutorial für ein Login/Register Script nachgemacht und da kamen die Errors
#include <a_samp>
#include <Dini>
#include <dudb>
#pragma tabsize 0
#define COLOR_ROT 0xFF0000FF
#define COLOR_GRUEN 0x00FE00FF
#define COLOR_BLAU 0x0000FFFF
#define COLOR_GELB 0xFFFF00FF
#define COLOR_ORANGE 0xFF9A00FF
#define COLOR_SCHWARZ 0x000000FF
#define COLOR_LILA 0xA800FFFF
#define COLOR_PINK 0xFF00FFFF
#define COLOR_HELLBLAU 0x00FFFFFF
#define COLOR_WEISS 0xFFFFFFFF
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("blabla");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print("Testserver");
print("----------------------------------\n");
}
#endif
enum Info
{
passwort[128],
skin,
new pInfo[MAX_PLAYERS][Info];
new bool:loggedin[MAX_PLAYERS];
};
public OnGameModeInit()
{
EnableStuntBonusForAll(0);
UsePlayerPedAnims();
DisableInteriorEnterExits();
SetGameModeText("Karad´s Selfmade");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SpawnPlayer(playerid);
SetCameraBehindPlayer(playerid);
return 1;
}
public OnPlayerConnect(playerid)
{
new name[128], save[128];
new spieler[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Spieler/%s.ini",name);
if(dini_Exists(save))
{
SendClientMessage(playerid, COLOR_ORANGE, "Willkommen bei SA:MP 0.3 Server");
SendClientMessage(playerid, COLOR_ROT, "Dein Account wurde wiedererkannt.");
SendClientMessage(playerid, COLOR_ROT, "Du kannst dich jetzt einloggen.");
SendClientMessage(playerid, COLOR_ROT, "Benutze dazu /login [passwort].");
GivePlayerMoney(playerid,dini_Int(save,"Geld"));
SetPlayerSkin(playerid,dini_Int(save,"Skin"));
}
else
{
if(!dini_Exists(save))
{
SendClientMessage(playerid, COLOR_ORANGE, "Willkommen bei SA:MP 0.3 Server");
SendClientMessage(playerid, COLOR_ROT, "Du hast noch keinen Account.");
SendClientMessage(playerid, COLOR_ROT, "Du kannst dich jetzt registrieren.");
SendClientMessage(playerid, COLOR_ROT, "Benutze dazu /register [passwort].");
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new name[128], save[128];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Spieler/%s.ini",name);
if(dini_Exists(save))
{
dini_IntSet(save,"Geld",GetPlayerMoney(playerid));
dini_IntSet(save,"Skin",GetPlayerSkin(playerid));
}
return 1;
}
public OnPlayerSpawn(playerid)
{
new name[128], save[128];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Spieler/%s.ini",name);
if(loggedin[playerid] == false)
{
SendClientMessage(playerid, COLOR_ROT, "Du musst dich Einloggen bevor du spawnst!");
Kick(playerid);
}
SetPlayerSkin(playerid,dini_Int(save,"Skin"));
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
//-----------------------------LOGIN SCRIPT--------------------------
if(strcmp(strget(cmdtext,0), "/register", true) == 0)
{
new save[40];
GetPlayerName(playerid,spieler,sizeof(spieler));
format(save, sizeof(save),"Spieler/%s.ini",spieler);
if(!dini_Exists(save))
{
dini_Create(save);
dini_IntSet(save,"passwort",udb_hash(strget(cmdtext,1)));
SendClientMessage(playerid, COLOR_GRUEN, "***Dein Account wurde erfolgreich registriert***");
SendClientMessage(playerid, COLOR_ROT, "***Nutze /login [Passwort] um dich einzuloggen***");
}
else
{
if(dini_Exists(save))
{
SendClientMessage(playerid, COLOR_ROT, "Der Account ist bereits registriert");
}
}
return 1;
}
if(strcmp(strget(cmdtext,0), "/login", true) == 0)
{
new save[40], s2[256];
GetPlayerName(playerid,spieler,sizeof(spieler));
format(save,sizeof(save),"Spieler/%s.ini",spieler);
if(dini_Exists(save))
{
s2=dini_Get(save,"passwort");
if(strval(s2)==udb_hash(strget(cmdtext,1)))
{
loggedin[playerid] = true;
SendClientMessage(playerid, COLOR_GRUEN, "***Du hast dich erfolgreich eingeloggt***");
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid, COLOR_ROT, "Passwort Falsch!");
}
}
return 1;
}
//-----------------------------------------------------------------------------
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
//----------------STRGET---------------------
stock strget(strx[], pos, search = ' ') {
new arg, ret[128], idxx;
for (new i = 0; i < strlen(strx); i++) {
if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
arg++;
if (arg == pos + 1){
ret[i-idxx] = EOS;
return ret;
} else if (arg == pos)
idxx= i+1;
}
else if (arg == pos)
ret[i - idxx] = strx[i];
}
return ret;
}
C:\Dokumenteund Einstellungen\*************\Desktop\Sa-MP Server\gamemodes\Untitled2.pwn(50) : error 001: expected token: "-identifier-", but found"new"
C:\Dokumente und Einstellungen\*************\Desktop\Sa-MP Server\gamemodes\Untitled2.pwn(54) : error 054: unmatched closing brace ("}")
C:\Dokumente und Einstellungen\*************\Desktop\Sa-MP Server\gamemodes\Untitled2.pwn(54) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\*************\Desktop\Sa-MP Server\gamemodes\Untitled2.pwn(84) : warning 204: symbol is assigned a value that is never used: "spieler"
C:\Dokumente und Einstellungen\*************\Desktop\Sa-MP Server\gamemodes\Untitled2.pwn(166) : error 017: undefined symbol "spieler"
C:\Dokumente und Einstellungen\*************\Desktop\Sa-MP Server\gamemodes\Untitled2.pwn(166) : error 017: undefined symbol "spieler"
C:\Dokumente und Einstellungen\*************\Desktop\Sa-MP Server\gamemodes\Untitled2.pwn(166) : error 029: invalid expression, assumed zero
C:\Dokumente und Einstellungen\*************\Desktop\Sa-MP Server\gamemodes\Untitled2.pwn(166) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
7 Errors.
Bräuchte mal hilfe
Mit freundlichen Grüßen,
Jaystar