Hallo alle zusammen habe aus einem Tut aus diesem forum ein register&Login geschrieben doch jetzt nach dem ich bei register meine daten eingegeben habe und bestätigt habe,
und dann halt noch mal auf login und register geklickt habe will er wieder das ich mich registriere ?! bitte um dringend um hilfe
#include <a_samp>
#include <dini>
#include <streamer>
#include <sscanf>
#define DIA_LOG 2
#define DIA_REG 1
//Spielderdaten
enum SpielerDaten
{
passwort,
geld,
level
}
new playerD[MAX_PLAYERS][SpielerDaten];
new Text:RegisterBackground;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
new Text:Textdraw5;
new Text:Textdraw6;
new Text:Textdraw7;
new Text:Textdraw8;
new PlayerText:RegsiterLogin[MAX_PLAYERS];
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("test");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
RegisterBackground = TextDrawCreate(517.111145, 123.455535, "usebox");
TextDrawLetterSize(RegisterBackground, 0.000000, 22.415184);
TextDrawTextSize(RegisterBackground, 133.555541, 0.000000);
TextDrawAlignment(RegisterBackground, 1);
TextDrawColor(RegisterBackground, 0);
TextDrawUseBox(RegisterBackground, true);
TextDrawBoxColor(RegisterBackground, -1);
TextDrawSetShadow(RegisterBackground, 0);
TextDrawSetOutline(RegisterBackground, 0);
TextDrawFont(RegisterBackground, 0);
Textdraw1 = TextDrawCreate(508.666687, 131.419998, "usebox");
TextDrawLetterSize(Textdraw1, 0.000000, 20.534690);
TextDrawTextSize(Textdraw1, 142.888885, 0.000000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, 0);
TextDrawUseBox(Textdraw1, true);
TextDrawBoxColor(Textdraw1, -2147483393);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 0);
TextDrawFont(Textdraw1, 0);
Textdraw2 = TextDrawCreate(263.111083, 145.351089, "Willkommen");
TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 2);
TextDrawSetProportional(Textdraw2, 1);
Textdraw3 = TextDrawCreate(302.222290, 176.213287, "Auf");
TextDrawLetterSize(Textdraw3, 0.449999, 1.600000);
TextDrawAlignment(Textdraw3, 1);
TextDrawColor(Textdraw3, -1);
TextDrawSetShadow(Textdraw3, 0);
TextDrawSetOutline(Textdraw3, 1);
TextDrawBackgroundColor(Textdraw3, 51);
TextDrawFont(Textdraw3, 2);
TextDrawSetProportional(Textdraw3, 1);
Textdraw4 = TextDrawCreate(231.999801, 217.031112, "test");
TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
TextDrawAlignment(Textdraw4, 1);
TextDrawColor(Textdraw4, -1);
TextDrawSetShadow(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 1);
TextDrawBackgroundColor(Textdraw4, 51);
TextDrawFont(Textdraw4, 2);
TextDrawSetProportional(Textdraw4, 1);
Textdraw5 = TextDrawCreate(641.555541, 1.500000, "usebox");
TextDrawLetterSize(Textdraw5, 0.000000, 4.273950);
TextDrawTextSize(Textdraw5, -2.000000, 0.000000);
TextDrawAlignment(Textdraw5, 1);
TextDrawColor(Textdraw5, 0);
TextDrawUseBox(Textdraw5, true);
TextDrawBoxColor(Textdraw5, 102);
TextDrawSetShadow(Textdraw5, 0);
TextDrawSetOutline(Textdraw5, 0);
TextDrawFont(Textdraw5, 0);
Textdraw6 = TextDrawCreate(41.111110, 43.811111, "usebox");
TextDrawLetterSize(Textdraw6, 0.000000, 44.704566);
TextDrawTextSize(Textdraw6, -2.000000, 0.000000);
TextDrawAlignment(Textdraw6, 1);
TextDrawColor(Textdraw6, 0);
TextDrawUseBox(Textdraw6, true);
TextDrawBoxColor(Textdraw6, 102);
TextDrawSetShadow(Textdraw6, 0);
TextDrawSetOutline(Textdraw6, 0);
TextDrawFont(Textdraw6, 0);
Textdraw7 = TextDrawCreate(641.555541, 407.686676, "usebox");
TextDrawLetterSize(Textdraw7, 0.000000, 4.273950);
TextDrawTextSize(Textdraw7, 37.555553, 0.000000);
TextDrawAlignment(Textdraw7, 1);
TextDrawColor(Textdraw7, 0);
TextDrawUseBox(Textdraw7, true);
TextDrawBoxColor(Textdraw7, 102);
TextDrawSetShadow(Textdraw7, 0);
TextDrawSetOutline(Textdraw7, 0);
TextDrawFont(Textdraw7, 0);
Textdraw8 = TextDrawCreate(641.555541, 407.686676, "usebox");
TextDrawLetterSize(Textdraw8, 0.000000, -40.857902);
TextDrawTextSize(Textdraw8, 594.888916, 0.000000);
TextDrawAlignment(Textdraw8, 1);
TextDrawColor(Textdraw8, 0);
TextDrawUseBox(Textdraw8, true);
TextDrawBoxColor(Textdraw8, 102);
TextDrawSetShadow(Textdraw8, 0);
TextDrawSetOutline(Textdraw8, 0);
TextDrawFont(Textdraw8, 0);
return 1;
}
public OnPlayerConnect(playerid)
{
RegsiterLogin[playerid] = CreatePlayerTextDraw(playerid, 185.778076, 280.248840, "Login oder Register");
PlayerTextDrawLetterSize(playerid, RegsiterLogin[playerid], 0.616666, 1.575111);
PlayerTextDrawAlignment(playerid, RegsiterLogin[playerid], 1);
PlayerTextDrawColor(playerid, RegsiterLogin[playerid], -1);
PlayerTextDrawSetShadow(playerid, RegsiterLogin[playerid], 0);
PlayerTextDrawSetOutline(playerid, RegsiterLogin[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, RegsiterLogin[playerid], 51);
PlayerTextDrawFont(playerid, RegsiterLogin[playerid], 2);
PlayerTextDrawSetProportional(playerid, RegsiterLogin[playerid], 1);
PlayerTextDrawSetSelectable(playerid, RegsiterLogin[playerid], true);
TextDrawShowForPlayer(playerid,RegisterBackground);
TextDrawShowForPlayer(playerid,Textdraw1);
TextDrawShowForPlayer(playerid,Textdraw2);
TextDrawShowForPlayer(playerid,Textdraw3);
TextDrawShowForPlayer(playerid,Textdraw4);
TextDrawShowForPlayer(playerid,Textdraw5);
TextDrawShowForPlayer(playerid,Textdraw6);
TextDrawShowForPlayer(playerid,Textdraw7);
TextDrawShowForPlayer(playerid,Textdraw8);
PlayerTextDrawShow(playerid,RegsiterLogin[playerid]);
TogglePlayerSpectating(playerid, 1);
SelectTextDraw(playerid, 0x00FF00FF);
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid==RegsiterLogin[playerid])// Also wenn playertextid TextDraw0 ist dann ....
{
//Hier wird dann der Dialog zum Register und Login gezeigt ich mach das jetzt auf dini...
new Datei[64];
format(Datei,sizeof(Datei),"/Acc/%s.txt",SpielerName(playerid));
if(dini_Exists(Datei))
{
ShowPlayerDialog(playerid,DIA_LOG,DIALOG_STYLE_PASSWORD,"Login","Gebe dein passwort zum login ein","Login","Abbruch");
}
else
{
ShowPlayerDialog(playerid,DIA_REG,DIALOG_STYLE_PASSWORD,"Register","Gebe ein passwort zum register ein","Register","Abbruch");
}
return 1;
}
return 1;
}
stock loadPlayer(playerid)
{
new Datei[64];
format(Datei,sizeof(Datei),"/Acc/%s.txt",SpielerName(playerid));
playerD[playerid][geld] = dini_Int(Spieler,"Geld");
playerD[playerid][level] = dini_Int(Spieler,"Level");
setPlayerMoney(playerid,playerD[playerid][geld]);
SetPlayerScore(playerid,playerD[playerid][level]);
return 1;
}
stock SpielerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}
stock setPlayerMoney(playerid, betrag)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,betrag);
return 1;
}