Hallo leute,
Ich habe von Blackfox GUI Login system geld speichern wollen aber es funktioniert nicht,
wie ihr sehen könnt habe ich es schon probiert ohne erfolg wenn mir jemand helfen könnte
wäre ich sehr dankbar.
Habe denn Script hier eingefügt + angehängt ... falls es jemand runter laden will und es sich anschauen will...
Danke
MFG Haybeat
#include <a_samp>
#include <dini>
//define//
#define DIALOG_LOGIN 3
#define DIALOG_REG 4
//Enum//
enum spieler_daten
{
wanted,
skin,
Float:lastx,Float:lasty,Float:lastz,
eingeloggt
}
//New//
new Spieler[MAX_PLAYERS][spieler_daten];
//Sonstiges//
#pragma tabsize 0
main()
{
print("\n----------------------------------");
print(" Haybeat´s Gamemode");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetGameModeText("Haybeat´s gamemode");
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 pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
if(fexist(accFormat))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Zurück");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Zurück");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
if(fexist(accFormat) && Spieler[playerid][eingeloggt])
{
dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
dini_IntSet(accFormat,"Score",GetPlayerScore(playerid));
dini_FloatSet(accFormat,"lastx",Spieler[playerid][lastx]);
dini_FloatSet(accFormat,"lasty",Spieler[playerid][lasty]);
dini_FloatSet(accFormat,"lastz",Spieler[playerid][lastz]);
}
Spieler[playerid][eingeloggt] = 0;
Spieler[playerid][wanted] = 0;
Spieler[playerid][skin] = 0;
Spieler[playerid][lastx] = (0.0);
Spieler[playerid][lasty] = (0.0);
Spieler[playerid][lastz] = (0.0);
return 1;
}
public OnPlayerSpawn(playerid)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
if(dini_Isset(accFormat,"lastx"))
{
SetPlayerPos(playerid,Spieler[playerid][lastx],Spieler[playerid][lasty],Spieler[playerid][lastz]);
}
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[])
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
if(response)
{
switch(dialogid) // dialogid auswählen
{
case DIALOG_LOGIN: // ID Login
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Zurück");
return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
}
if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Passwort Direkt aus der Datei Laden
{
Spieler[playerid][wanted] = dini_Int(accFormat,"wanted");
Spieler[playerid][skin] = dini_Int(accFormat,"skin");
GivePlayerMoney(playerid,dini_Int(accFormat,"Geld"));
Spieler[playerid][lastx] = dini_Float(accFormat,"lastx");
Spieler[playerid][lasty] = dini_Float(accFormat,"lasty");
Spieler[playerid][lastz] = dini_Float(accFormat,"lastz");
GivePlayerMoney(playerid,dini_Int(accFormat,"Geld"));
SetPlayerScore(playerid,dini_Int(accFormat,"Score"));
Spieler[playerid][eingeloggt] = 1; // Spieler ist nun erfolgreich eingeloggt
SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt.");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Zurück");
SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war Falsch!");
}
}
case DIALOG_REG: // ID Registrieren
{
if(!strlen(inputtext)) // Text darf nicht = Null sein Null im Sinne von nichts
{
ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Zurück");
return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
}
dini_Create(accFormat);
dini_Set(accFormat,"Passwort",inputtext);
Spieler[playerid][eingeloggt] = 1;
SendClientMessage(playerid,0xFFFFFFFF,"Account wurde angelegt und du wurdest eingeloggt.");
}
}
}
else
{
switch(dialogid)
{
case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Zurück");
case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Zurück");
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}