// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <Dini>
#define BLAU 0x00C3FFFF
#define ROT 0xFF1E00FF
#define GRÜN 0x05FF00FF
#define DIALOG1 1
#define DIALOG2 2
#define DIALOG_REGISTER 3
#define DIALOG_LOGIN 4
new sfpdenter;
new sfpdspawnpoint;
main()
{
print("\n----------------------------------");
print(" Reallife by PoTTii");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetGameModeText("Reallife Server by PoTTii.de");
DisableInteriorEnterExits();
UsePlayerPedAnims();
sfpdenter=CreatePickup(1559,1,-1605.4022,711.7268,13.8672);
sfpdspawnpoint=CreatePickup(1559,1,246.4158,107.2988,1003.2188);
AddPlayerClass(0,-1969.6477,137.7644,27.6875,90.7923,0,0,0,0,0,0);
AddPlayerClass(2,-1969.6477,137.7644,27.6875,90.7923,0,0,0,0,0,0);
AddPlayerClass(7,-1969.6477,137.7644,27.6875,90.7923,0,0,0,0,0,0);
AddPlayerClass(18,-1969.6477,137.7644,27.6875,90.7923,0,0,0,0,0,0);
AddPlayerClass(19,-1969.6477,137.7644,27.6875,90.7923,0,0,0,0,0,0);
AddPlayerClass(65,-1969.6477,137.7644,27.6875,90.7923,0,0,0,0,0,0);
AddStaticVehicle(599,-1587.6982,651.3381,7.3750,359.8280,0,1); // PDR1
AddStaticVehicle(599,-1582.0466,651.3381,7.3750,359.7484,0,1); // PDR2
AddStaticVehicle(599,-1593.7988,651.3381,7.3750,359.0668,0,1); // PDR3
AddStaticVehicle(599,-1990.1294,152.7237,27.7307,180.1338,0,1); // test1
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,-1969.6477,137.7644,27.6875);
SetPlayerFacingAngle(playerid,90.7923);
SetPlayerCameraPos(playerid,-1976.7086,138.1311,27.6875);
SetPlayerCameraLookAt(playerid,-1969.6477,137.7644,27.6875);
return 1;
}
public OnPlayerConnect(playerid)
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/accounts/%s.txt",name);
if(dini_Exists(Spielerdatei))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden. Gib Bitte das Passwort ein","Login","Abbrechen");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Du Spielst das erste mal auf diesem Server.\nUm dich zu registrieren gib bitte ein Passwort ein,\nmit dem du dich später einloggen kannst","Registrieren","Abrechen");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
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(cmdtext,"/tp SFPD",true)==0)
{
ShowPlayerDialog(playerid,DIALOG1,DIALOG_STYLE_MSGBOX,"Teleport zum SFPD?","Willst du dich wirklich zum SFPD teleportieren?","Ja","Nein");
return 1;
}
//---------------------------------------------------------------
if(strcmp(cmdtext,"/restart",true)==0)
{
ShowPlayerDialog(playerid,DIALOG2,DIALOG_STYLE_MSGBOX,"Server neustarten?","Willst du den Server wirklich neustarten?","Ja","Nein");
return 1;
}
//---------------------------------------------------------------
if(strcmp(cmdtext,"/showmoney playerid",true)==0)
{
GetPlayerMoney(playerid);
return 1;
}
//-----------------Jemanden Töten----------------------------
if(strcmp(cmdtext,"/slay",true)==0)
{
SetPlayerHealth(playerid,0);
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)
{
if(pickupid==sfpdenter)
{
SetPlayerPos(playerid,246.5970,111.1240,1003.2188);
SetPlayerInterior(playerid,10);
SetPlayerFacingAngle(playerid,0.0);
SetCameraBehindPlayer(playerid);
GameTextForPlayer(playerid,"~g~Du hast das SFPD ~n~Betreten!",3000,3);
}
if(pickupid==sfpdspawnpoint)
{
SetPlayerPos(playerid, -1605.6549,719.2516,11.9877);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,0);
SetPlayerFacingAngle(playerid,360.0);
GameTextForPlayer(playerid,"~g~Du hast das SFPD ~n~Verlassen!",3000,3);
return 1;
}
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[])
{
//----------Dialog: Zum SFPD porten?----------
if(dialogid==DIALOG1)
{
if(response==1)
{
SetPlayerPos(playerid,-1605.6549,719.2516,11.9877);
SendClientMessage(playerid,0x05FF00FF,"Du wurdest erfolgreich zum SFPD teleportiert");
SetCameraBehindPlayer(playerid);
return 1;
}
if(response==0)
{
SendClientMessage(playerid,0xFF1E00FF,"Du willst nicht zum SFPD teleportiert werden");
return 1;
}
}
//--------------------------------------------------
//-------------Dialog: Server neustarten?-----------
if(dialogid==DIALOG2)
{
if(response==1)
{
SendRconCommand("gmx");
return 1;
}
if(response==0)
{
SendClientMessage(playerid,0xFF1E00FF,"Du willst den Server nicht neustarten");
return 1;
}
}
//------------Dialog: Registrieren--------------------
if(dialogid==DIALOG_REGISTER)
{
if(response==1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,ROT,"Das Passwort war nicht lang genug");
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Du Spielst das erste mal auf diesem Server.\nUm dich zu registrieren gib bitte ein Passwort ein,\nmit dem du dich später einloggen kannst","Registrieren","Abrechen");
return 1;
}
else
{
Register(playerid,inputtext);
return 1;
}
}
if(response==0)
{
SendClientMessage(playerid,0xFF1E00FF,"Um hier Spielen zu können musst du dich registrieren!");
Kick(playerid);
return 1;
}
}
//----------------------------------------------------
//-----------------Diealog:Login------------------
if(dialogid==DIALOG_LOGIN)
{
if(response==1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,ROT,"Das Passwort war nicht lang genug");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden. Gib Bitte das Passwort ein","Login","Abbrechen");
return 1;
}
else
{
Register(playerid,inputtext);
return 1;
}
}
if(response==0)
{
SendClientMessage(playerid,0xFF1E00FF,"Um hier Spielen zu können musst du dich registrieren!");
Kick(playerid);
return 1;
}
}
//--------------------------------------
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock Register(playerid,key[])
{
new Spielerdatei[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
format(Spielerdatei, sizeof Spielerdatei, "accounts/%s.txt", name);
dini_Create(Spielerdatei);
dini_Set(Spielerdatei, "Passwort", key);
dini_IntSet(Spielerdatei, "Level", 0);
return SendClientMessage(playerid, GRÜN, "Erfolgreich Registriert!");
}
stock Login(playerid,key[])
{
new Spielerdatei[64];
name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
format(Spielerdatei,sizeof(Spielerdatei),"accounts/%s.txt",name);
if(!strcmp(key[]dini_Get(Spielerdatei,"Passwort"),false))
{
SetPlayerScore(playerid,dini_Int(Spielerdatei,"Level"));
SendClientMessage(playerid,GRÜN,"Erfolgreich Eingeloggt!");
}
else
{
SendClientMessage(playerid,GRÜN,"Falsches Passwort, bitte erneut versuchen");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden. Gib Bitte das Passwort ein","Login","Abbrechen");
}
return 1;
}
Meine Probleme: Er erstellt keine Datei mit NAME.txt, liegt das am Schreibschutz?Er schreibt "account gefunden obwohls keine datei gibt" wenn ich nach account gefunden irgendein passwort eingebe schreibt er "erfolgreich registriert".
wie kann ich das beheben?danke