Die kompletten Zeilen:
#define DIALOG_LOGIN 1
#define DIALOG_REGISTER 2
#define COLOR_RED 0xAA3333AA
#define COLOR_GREEN 0x33AA33AA
#include <a_samp>
#include <dini>
enum PlayerDA
{
Level,
Admin
}
new Spieler[MAX_PLAYERS][PlayerDA];
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetGameModeText("Blank Script");
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)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new Playerdatei[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name)); // Findet den Namen des Spielers heraus
format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name); // Gibt den Pfad zu den Accounts an.
if(dini_Exists(Playerdatei))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Bitte geben sie nun ihr Passwort ein","Login","Abbrechen");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registration","Bitte geben sie ihr gewünschtes Passwort ein","Registerieren","Abbrechen");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(GetPVarInt(playerid,"Eingeloggt") == 1) // Fragt ab ob wir Eingeloggt sind.
{
SpielerSpeichern(playerid); // Speichert uns wenn wir Disconnecten - Funktionen erstellen wir jetzt!
}
return 1;
}
public OnPlayerSpawn(playerid)
{
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[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
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[])
{
if(dialogid == DIALOG_LOGIN) // DIALOG_LOGIN wird abgerufen.
{
if(response == 0) // Der Abbrech Button
{
SendClientMessage(playerid,COLOR_RED,"Du hast den Login Vorgang abgebrochen!");
Kick(playerid); // Kickt den Spieler
return 1;
}
if(response == 1) // Der Login Button
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,COLOR_GREEN,"Dein eingegebenes Passwort war nicht lang genug!");
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Login","Ihr Account wurde in unserer Datenbank gefunden!\nBitte gib nun dein Passwort ein! ","Login", "Abbrechen");
return 1;
}
else
{
Login(playerid,inputtext); // Diese Funktion erstellen wir gleich
return 1;
}
}
}
return 1;
}
if(dialogid == DIALOG_REGISTER) // Ruft DIALOG_REGISTER auf
{
if(response == 0) // Der Abbrech Button
{
SendClientMessage(playerid,COLOR_RED,"Sie haben die Registrierung abgebrochen!");
Kick(playerid); // Kickt den Spieler
return 1;
}
if(response == 1) // Der Register Button
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,COLOR_GREEN,"Dein eingegebenes Passwort war nicht lang genug!");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Registrierung auf DeinRL","Willkommen auf DeinRL City!\nBitte geben sie nun ihr gewünschtes Passwort ein","Register","Abbrechen");
return 1;
}
else
{
Register(playerid,inputtext); // Funktion wird gleich erstellt.
return 1;
}
}
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock Register(playerid,key[])
{
new Playerdatei[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name);
dini_Create(Playerdatei);
dini_Set(Playerdatei,"Passwort",key);
SetPlayerScore(playerid,0);
dini_IntSet(Playerdatei,"Admin",0);
SetPVarInt(playerid,"Eingeloggt",1);
return 1;
}
stock Login(playerid,key[])
{
new Playerdatei[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name);
if(!strcmp(key,dini_Get(Playerdatei,"Passwort"),false))
{
AccountLaden(playerid); // Machen wir gleich!
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"Du hast ein falsches Passwort eingegeben!");
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Login","Dein Account wurde in unserer Datenbank gefunden!\nBitte gib nun dein Passwort ein! ","Login", "Abbrechen");
}
return 1;
}
stock AccountLaden(playerid)
{
new Playerdatei[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name);
Spieler[playerid][Level] = dini_Int(Playerdatei,"Level");
Spieler[playerid][Admin] = dini_Int(Playerdatei,"Admin");
SetPVarInt(playerid,"Eingeloggt",1);
return 1;
}
stock SpielerSpeichern(playerid)
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
new Playerdatei[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Playerdatei,sizeof(Playerdatei),"/Accounts/%s.ini",name);
dini_IntSet(Playerdatei,"Level", Spieler[playerid][Level]);
dini_IntSet(Playerdatei, "Admin", Spieler[playerid][Admin]);
}
}
Errors:
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(259) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(261) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(265) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(267) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(269) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(273) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(275) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(278) : error 010: invalid function or declaration
C:\Dokumente und Einstellungen\User\Desktop\gserver\gamemodes\selfmade.pwn(287) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
9 Errors.
Danke im Vorraus