// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <Dini>
#define COLOR_DARKRED 0x660000AA
#define ROT 0xB35959AA
#define BLAU 0x0000BBAA
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
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 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,"Einlogen","Wenn du dein Passwort vergessen schreibe eine Email an mannekkarl9@gmail.com","Login","Abbrechen");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Bitte gib dein Gewünschtets Passwort ein ","Register","Abbrechen");
}
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("/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)//login
{
if(response==0)
{
Kick(playerid);
return 1;
}
if(response==1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,ROT,"Das Passwort ist Falsch");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Einlogen","Bitte gib dein Passwort","Login","Abbrechen");
return 1;
}
else
{
Login(playerid,inputtext);
StopAudioStreamForPlayer(playerid);
return 1;
}
}
}
//Register
if(dialogid==DIALOG_REGISTER)//Register
{
if(response==0)
{
Kick(playerid);
return 1;
}
if(response==1)
if(!strlen(inputtext))
{
SendClientMessage(playerid,ROT,"Dein Passwort ist zu kurz");
ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Bitte gib dein Passwort ein","Register","Abbrechen");
}
else
{
Register(playerid,inputtext);
return 1;
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
//register stock
stock Register(playerid,key[])
{
new string[123];
new Spielerdatei[64];
new 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);
SendClientMessage(playerid,BLAU,"");
format(string,sizeof(string),"Du hast den Account: %s erfolgreich erstellt mit dem Passwort: %s",SpielerName(playerid),key);
SendClientMessage(playerid,COLOR_DARKRED,string);
SetPlayerScore(playerid,0);
SpawnPlayer(playerid);
//hier wird der PlayerGespeichert
SpielerSpeichern(playerid);
return 1;
}
//login stock
stock Login(playerid,key[])
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
if(!strcmp(key,dini_Get(Spielerdatei,"Passwort"),true))
{
LoadAccount(playerid);
SendClientMessage(playerid,BLAU,"Erfolgreich eingelogt");
return 1;
}
else
{
SendClientMessage(playerid,ROT,"Das Passwort ist falsch");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Einlogen","es gibt dein Account schon bitte loge dich ein","login","Abbrechen");
return 1;
}
}
//geladen
stock LoadAccount(playerid)
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
SetPlayerScore(playerid,dini_Int(Spielerdatei,"Level"));
GivePlayerMoney(playerid,dini_Int(Spielerdatei,"Geld"));
SetPVarInt(playerid,"Adminlevel",dini_Int(Spielerdatei,"Adminlevel"));
SetPVarInt(playerid,"Fraktion",dini_Int(Spielerdatei,"Fraktion"));
SetPVarInt(playerid,"Baned",dini_Int(Spielerdatei,"Baned"));
SetPVarInt(playerid,"jailtime",dini_Int(Spielerdatei,"jailtime"));
SetPVarInt(playerid,"PayDay",dini_Int(Spielerdatei,"PayDay"));//Der PayDay Timer sitzt oben im script
SetPVarInt(playerid,"Monate",dini_Int(Spielerdatei,"Monate"));//hier das selbe nur mit den monaten
SetPVarInt(playerid,"AUTO",dini_Int(Spielerdatei,"AUTO"));
SetPVarInt(playerid,"FLUG",dini_Int(Spielerdatei,"FLUG"));
SetPVarInt(playerid,"BOOT",dini_Int(Spielerdatei,"BOOT"));
SetPVarInt(playerid,"LKW",dini_Int(Spielerdatei,"LKW"));
SetPVarInt(playerid,"MOTOR",dini_Int(Spielerdatei,"MOTOR"));
SetPVarInt(playerid,"Skin",dini_Int(Spielerdatei,"Skin"));
SetPVarInt(playerid,"kekse",dini_Int(Spielerdatei,"kekse"));
SetPVarInt(playerid,"wanted",dini_Int(Spielerdatei,"wanted"));
SetPVarInt(playerid,"tottime",dini_Int(Spielerdatei,"tottime"));
SetPVarInt(playerid,"pgeld",dini_Int(Spielerdatei,"pgeld"));
SetPVarInt(playerid,"gschein",dini_Int(Spielerdatei,"gschein"));
SetPVarInt(playerid,"frank",dini_Int(Spielerdatei,"frank"));
SpielerSpeichern(playerid);
if(GetPVarInt(playerid,"Baned")==1)
{
SendClientMessage(playerid,COLOR_DARKRED,"Du wurdest von MSR[Realife] Gebannt");
SendClientMessage(playerid,COLOR_DARKRED,"Wenn du meinst du wurdest zu Unrecht gebannt da´n schreib ein entbann Antrag ");
SetTimer("ban",900,false);
}
return 1;
}
//SpilerSpeicher
stock SpielerSpeichern(playerid)
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
dini_IntSet(Spielerdatei,"Skin",GetPlayerSkin(playerid));
format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
dini_IntSet(Spielerdatei,"Level",GetPlayerScore(playerid));
dini_IntSet(Spielerdatei,"Geld",GetPlayerMoney(playerid));
dini_IntSet(Spielerdatei,"Adminlevel",GetPVarInt(playerid,"Adminlevel"));
dini_IntSet(Spielerdatei,"Fraktion",GetPVarInt(playerid,"Fraktion"));
dini_IntSet(Spielerdatei,"Baned",GetPVarInt(playerid,"Baned"));
dini_IntSet(Spielerdatei,"jailtime",GetPVarInt(playerid,"jailtime"));
dini_IntSet(Spielerdatei,"Autoschein",GetPVarInt(playerid,"Autoschein"));
dini_IntSet(Spielerdatei,"PayDay",GetPVarInt(playerid,"PayDay"));
dini_IntSet(Spielerdatei,"AUTO",GetPVarInt(playerid,"AUTO"));
dini_IntSet(Spielerdatei,"FLUG",GetPVarInt(playerid,"FLUG"));
dini_IntSet(Spielerdatei,"BOOT",GetPVarInt(playerid,"BOOT"));
dini_IntSet(Spielerdatei,"LKW",GetPVarInt(playerid,"LKW"));
dini_IntSet(Spielerdatei,"MOTOR",GetPVarInt(playerid,"MOTOR"));
dini_IntSet(Spielerdatei,"Skin",GetPVarInt(playerid,"skin"));
dini_IntSet(Spielerdatei,"kekse",GetPVarInt(playerid,"kekse"));
dini_IntSet(Spielerdatei,"wanted",GetPVarInt(playerid,"wanted"));
dini_IntSet(Spielerdatei,"tottime",GetPVarInt(playerid,"tottime"));
dini_IntSet(Spielerdatei,"pgeld",GetPVarInt(playerid,"pgeld"));
dini_IntSet(Spielerdatei,"gschein",GetPVarInt(playerid,"gschein"));
dini_IntSet(Spielerdatei,"ageschein",GetPVarInt(playerid,"agschein"));
dini_IntSet(Spielerdatei,"frank",GetPVarInt(playerid,"frank"));
return 1;
}
//SpielerName
stock SpielerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}
Alles anzeigen