[.ini] Hilfe gesucht

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
  • Ich habe ein Trucking script aber es speichert nicht.
    Heist ich registriere mich und will neu einloggen steht da ich soll mich wieder neu registrieren.
    Kann mir jmd über teamviewer helfen? Oder vllt hier sagen ich posten soll.
    wäre nett wenn mir jmd helfen könnte


    mfg
    96ViruZ

  • if(dialogid == Registerdialog)
    {
    new string[200],file[128];
    format(string,sizeof(string),""lred"Please put in a password \n"lgreen"Welcome to "lyellow"Ultimate Trucking"lgreen", "lyellow2"%s"lgreen"! \nYou are "lred"not registered"lgreen".\n"lgrey"Please input the desired "lyellow2"password"lgreen"to register!",GetPName(playerid));
    format(string,sizeof(string),"||- "lwhite"%s "lred" has been kicked for not "lyellow2"registering "lred"-||",GetPName(playerid));
    if(!response) return Kick(playerid) && SendClientMessage(playerid,red,""lred"You must "lgreen"register "lred"to play in this server") && SendClientMessageToAll(red,string);
    if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,Registerdialog,1,""lyellow"REGISTER AN ACCOUNT",string,"Register","Cancel");
    format(file,sizeof(file),"Admin/Users/%s.ini",GetPName(playerid));
    INI_Open(file);
    INI_WriteString("Password",inputtext);
    INI_WriteInt("Truckingdone",0);
    INI_WriteInt("Missionsdone",0);
    INI_WriteInt("Missionsfailed",0);
    INI_WriteInt("Truckingdone",0);
    INI_WriteInt("Level",0);
    INI_WriteInt("Money",0);
    INI_WriteInt("Phone",0);
    INI_WriteInt("GPS",0);
    INI_WriteInt("Fuel",0);
    INI_WriteInt("KM",0);
    INI_WriteInt("Jailed",0);
    INI_WriteInt("Frozen",0);
    INI_WriteInt("Arrested",0);
    INI_WriteInt("Suspected",0);
    INI_WriteInt("Deposited",0);
    INI_WriteInt("Banned",0);
    INI_Save();
    INI_Close();
    SendClientMessage(playerid,red,""lgreen"» You have successfully "lyellow"registered"lgreen"!");
    format(string,sizeof(string),""lgreen"Welcome back, "lyellow2"%s"lgreen"! Please enter your "lred"password "lgreen"to log in!",GetPName(playerid));
    ShowPlayerDialog(playerid,Logindialog,1,""lyellow"LOGIN YOUR ACCOUNT",string,"Login","Cancel");
    }
    if(dialogid == Logindialog)
    {
    new string[200],password[128],file[128];
    format(string,sizeof(string),""lgreen"Welcome back, "lyellow2"%s"lgreen"! Please enter your "lred"password "lgreen"to log in!",GetPName(playerid));
    if(!response) return SendClientMessage(playerid,red,"Please put in a "lgreen"password"lred"!") && ShowPlayerDialog(playerid,Logindialog,1,""lyellow"LOGIN YOUR ACCOUNT",string,"Login","Cancel");
    if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,Logindialog,1,""lyellow"LOGIN YOUR ACCOUNT",string,"Login","Cancel");
    format(file,sizeof(file),"Admin/Users/%s.ini",GetPName(playerid));
    INI_Open(file);
    if (INI_ReadString(password, "Password", 25))
    {
    if (!strcmp(password, inputtext, false))
    {
    PInfo[playerid][Level] = INI_ReadInt("Level");
    PInfo[playerid][Missionspassed] = INI_ReadInt("Missionsdone");
    PInfo[playerid][Missionsfailed] = INI_ReadInt("Missionsfailed");
    PInfo[playerid][hasphone] = INI_ReadInt("Phone");
    PInfo[playerid][hasfuelcan] = INI_ReadInt("Fuel");
    PInfo[playerid][hasgps] = INI_ReadInt("GPS");
    PInfo[playerid][Jailed] = INI_ReadInt("Jailed");
    PInfo[playerid][arrestedppl] = INI_ReadInt("Arrested");
    PInfo[playerid][wantedlevel] = INI_ReadInt("Suspected");
    PInfo[playerid][depositcash] = INI_ReadInt("Deposited");
    PInfo[playerid][Failedlogins] = 0;
    PInfo[playerid][Logged] = 1;
    SetPlayerMoney(playerid,INI_ReadInt("Money"));
    SetPlayerScore(playerid,PInfo[playerid][Missionspassed]);
    SetPlayerWantedLevel(playerid,PInfo[playerid][wantedlevel]);
    pKMs[playerid] = INI_ReadInt("KM");
    SendClientMessage(playerid,red,""lgreen"» You have successfully "lyellow"logged in"lgreen"!");
    }
    else
    {
    PInfo[playerid][Failedlogins]++;
    format(string,sizeof(string),""lred"Failed: %i/3\n"lgreen"Welcome back, "lyellow2"%s"lgreen"! Please enter your "lred"password "lgreen"to log in!",PInfo[playerid][Failedlogins],GetPName(playerid));
    ShowPlayerDialog(playerid,Logindialog,1,""lyellow"LOGIN YOUR ACCOUNT",string,"Login","Cancel");
    }
    if(PInfo[playerid][Failedlogins] >= 3)
    {
    SendFMessageToAll(red,"||- "lwhite"%s "lred"has been kicked for max failed logins. -||",GetPName(playerid));
    Kick(playerid);
    }
    }
    INI_Close();
    }