Guten Abend, BreadFish-Nutzer.
Ich schreibe ein SelfMade Script, Habe ein Problem bei meinem Dialog Alter. Also das Abspeichern des Alter's.
Der Speichert das Alter nicht, Es bleibt immer auf 0. Bei der .txt Datei.
Hier mal der DIALOG_ALTER
if(dialogid==DIALOG_ALTER)
{
if(response==0)
{
Kick(playerid);
}
if(response==1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,Gelb,"Du musst ein Alter angeben!");
ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"{FFFF00}New-{FF0000}Vegas{FFFFFF} RealLife Alter angeben!","Bitte wählen sie ihr Alter aus!\nz.B. 15","Fertig","");
}
else
{
new Account[64];
format(Account,sizeof(Account),"/Accounts/%s",SpielerName(playerid));
dini_IntSet(Account,"Alter",strval(inputtext));
}
}
}
Hier die Stock's wo es Speichert.
stock SpielerLaden(playerid)
{
new Account[64],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Account,sizeof(Account),"/Accounts/%s.txt",name);
SetPlayerScore(playerid,dini_Int(Account,"Level"));
GivePlayerMoney(playerid,dini_Int(Account,"Bargeld"));
SetPVarInt(playerid,"Adminlevel",dini_Int(Account,"Adminlevel"));
SetPVarInt(playerid,"fLeader",dini_Int(Account,"fLeader"));
SetPVarInt(playerid,"fMember",dini_Int(Account,"fMember"));
SetPVarInt(playerid,"Geschlecht",dini_Int(Account,"Geschlecht"));
SetPVarInt(playerid,"Alter",dini_Int(Account,"Alter"));
SetPVarInt(playerid,"Banned",dini_Int(Account,"Banned"));
if(GetPVarInt(playerid,"Banned")==1)
{
GameTextForPlayer(playerid,"~r~Du bist Gebannt!",1000,4);
Kick(playerid);
}
SetPVarInt(playerid,"Eingeloggt",1);
return 1;
}
stock SpielerSpeichern(playerid)
{
if(GetPVarInt(playerid,"Eingeloggt")==1)
{
new Account[64],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Account,sizeof(Account),"/Accounts/%s.txt",name);
dini_IntSet(Account,"Level",GetPlayerScore(playerid));
dini_IntSet(Account,"Bargeld",GetPlayerMoney(playerid));
dini_IntSet(Account,"Adminlevel",GetPVarInt(playerid,"Adminlevel"));
dini_IntSet(Account,"fLeader",GetPVarInt(playerid,"fLeader"));
dini_IntSet(Account,"fMember",GetPVarInt(playerid,"fMember"));
dini_IntSet(Account,"Geschlecht",GetPVarInt(playerid,"Geschlecht"));
dini_IntSet(Account,"Alter",GetPVarInt(playerid,"Alter"));
dini_IntSet(Account,"Banned",GetPVarInt(playerid,"Banned"));
}
return 1;
}
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
-
-
Mache das hier
dini_IntSet(Account,"Alter",strval(inputtext));
zu
PlayerInfo[playerid][Alter] = strval(inputtext);
-
Ich Arbeite mit PVar's, Und nicht mit einem Enum.
-
SetPVarInt(playerid,"Alter",strval(inputtext));
-
SetPVarInt(playerid,"Alter",strval(inputtext));
Sauber geht. Danke -
breadfish.de
Hat das Thema geschlossen.