Heyho Leute,
hatte mal wieder Lust zu scripten, natürlich war das erste das Login & Register System.
Was nich klappt.
Die %s.ini wird einfach nich erstellt...
Register
Spoiler anzeigen
[pwn]
new Player_Name[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, Player_Name, sizeof(Player_Name));
switch(dialogid)
{
case Dialog_Register:
{
if(!response)
{
Kick(playerid);
}
else
{
new pwlength = strlen(inputtext);
if(pwlength > 0)
{
dini_Create(path);
dini_Set(path, "Key", inputtext);
Player_Data[playerid][Level] = GetPlayerScore(playerid);
Player_Data[playerid][Money] = GetPlayerMoney(playerid);
Player_Data[playerid][Skin] = GetPlayerSkin(playerid);
Player_Data[playerid][Faction] = dini_Int(path, "Faction");
Player_Data[playerid][Faction_Rank] = dini_Int(path, "Faction_Rank");
Player_Data[playerid][Faction_Leader] = dini_Int(path, "Faction_Leader");
Player_Data[playerid][Admin_Level] = dini_Int(path, "Admin_Level");
Player_Data[playerid][Banned] = dini_Int(path, "Banned");
echo(playerid, Color_Info, "[Info]Du hast dich erfolgreich registriert!");
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "Caseego-Roleplay", "Dein Account wurde in unserer Datenbank gefunden.\nLogge dich nun mit deinem Passwort ein.", "Loggin", "Cancel");
}
else
{
echo(playerid, Color_Error, "[Error]Du hast kein Passwort eingegeben!");
ShowPlayerDialog(playerid, Dialog_Register, DIALOG_STYLE_INPUT, "Caseego-Roleplay", "Dein Account wurde leider nicht in der Datenbank gefunden.\nWenn du hier spielen möchtest brauchst du einen Account.\nGebe einfach dein gewünschtes Passwort ein und drücke auf Register", "Register", "Cancel");
}
}
}
[/pwn]
Speichern
Spoiler anzeigen
[pwn]
public OnPlayerDisconnect(playerid, reason)
{
/*new Player_Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Player_Name, sizeof(Player_Name));
format(path, 200, "/Accounts/%s.ini", Player_Name);
dini_IntSet(path, "Level", GetPlayerScore(playerid));
dini_IntSet(path, "Money", GetPlayerMoney(playerid));
dini_IntSet(path, "Skin", GetPlayerSkin(playerid));
dini_IntSet(path, "Faction", Player_Data[playerid][Faction]);
dini_IntSet(path, "Faction_Rank", Player_Data[playerid][Faction_Rank]);
dini_IntSet(path, "Faction_Leader", Player_Data[playerid][Faction_Leader]);
dini_IntSet(path, "Admin_Level", Player_Data[playerid][Admin_Level]);
dini_IntSet(path, "Banned", Player_Data[playerid][Banned]);
Player_Data[playerid][Loggedin] = 0;*/
SavePlayerAccount(playerid);
new string[56];
switch(reason)
{
case 0: format(string, 56, "%s hat den Server verlassen (Error/Exe)", Player_Name);
case 1: format(string, 56, "%s hat den Server verlassen (Verlassen)", Player_Name);
case 2: format(string, 56, "%s hat den Server verlassen (Kick/Ban)", Player_Name);
}
echoall(Color_Leave, string);
return 1;
}
stock SavePlayerAccount(playerid)
{
new Player_Name[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, Player_Name, sizeof(Player_Name));
format(path, 200, "/Accounts/%s.ini", Player_Name);
dini_IntSet(path, "Level", GetPlayerScore(playerid));
dini_IntSet(path, "Money", GetPlayerMoney(playerid));
dini_IntSet(path, "Skin", GetPlayerSkin(playerid));
dini_IntSet(path, "Faction", Player_Data[playerid][Faction]);
dini_IntSet(path, "Faction_Rank", Player_Data[playerid][Faction_Rank]);
dini_IntSet(path, "Faction_Leader", Player_Data[playerid][Faction_Leader]);
dini_IntSet(path, "Admin_Level", Player_Data[playerid][Admin_Level]);
dini_IntSet(path, "Banned", Player_Data[playerid][Banned]);
Player_Data[playerid][Loggedin] = 0;
}
[/pwn]
GamemodeExit
Spoiler anzeigen
[pwn]
public OnGameModeExit()
{
for(new i=0; i< MAX_PLAYERS; i++)
{
SaveAllPlayerAccounts();
}
return 1;
}
stock SaveAllPlayerAccounts()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && i != INVALID_PLAYER_ID)
{
SavePlayerAccount(i);
}
}
return 1;
}
[/pwn]
Hoffe ihr könnt mir helfen.
hatte mal wieder Lust zu scripten, natürlich war das erste das Login & Register System.
Was nich klappt.

Die %s.ini wird einfach nich erstellt...
Register
[pwn]
new Player_Name[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, Player_Name, sizeof(Player_Name));
switch(dialogid)
{
case Dialog_Register:
{
if(!response)
{
Kick(playerid);
}
else
{
new pwlength = strlen(inputtext);
if(pwlength > 0)
{
dini_Create(path);
dini_Set(path, "Key", inputtext);
Player_Data[playerid][Level] = GetPlayerScore(playerid);
Player_Data[playerid][Money] = GetPlayerMoney(playerid);
Player_Data[playerid][Skin] = GetPlayerSkin(playerid);
Player_Data[playerid][Faction] = dini_Int(path, "Faction");
Player_Data[playerid][Faction_Rank] = dini_Int(path, "Faction_Rank");
Player_Data[playerid][Faction_Leader] = dini_Int(path, "Faction_Leader");
Player_Data[playerid][Admin_Level] = dini_Int(path, "Admin_Level");
Player_Data[playerid][Banned] = dini_Int(path, "Banned");
echo(playerid, Color_Info, "[Info]Du hast dich erfolgreich registriert!");
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "Caseego-Roleplay", "Dein Account wurde in unserer Datenbank gefunden.\nLogge dich nun mit deinem Passwort ein.", "Loggin", "Cancel");
}
else
{
echo(playerid, Color_Error, "[Error]Du hast kein Passwort eingegeben!");
ShowPlayerDialog(playerid, Dialog_Register, DIALOG_STYLE_INPUT, "Caseego-Roleplay", "Dein Account wurde leider nicht in der Datenbank gefunden.\nWenn du hier spielen möchtest brauchst du einen Account.\nGebe einfach dein gewünschtes Passwort ein und drücke auf Register", "Register", "Cancel");
}
}
}
[/pwn]
Speichern
[pwn]
public OnPlayerDisconnect(playerid, reason)
{
/*new Player_Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Player_Name, sizeof(Player_Name));
format(path, 200, "/Accounts/%s.ini", Player_Name);
dini_IntSet(path, "Level", GetPlayerScore(playerid));
dini_IntSet(path, "Money", GetPlayerMoney(playerid));
dini_IntSet(path, "Skin", GetPlayerSkin(playerid));
dini_IntSet(path, "Faction", Player_Data[playerid][Faction]);
dini_IntSet(path, "Faction_Rank", Player_Data[playerid][Faction_Rank]);
dini_IntSet(path, "Faction_Leader", Player_Data[playerid][Faction_Leader]);
dini_IntSet(path, "Admin_Level", Player_Data[playerid][Admin_Level]);
dini_IntSet(path, "Banned", Player_Data[playerid][Banned]);
Player_Data[playerid][Loggedin] = 0;*/
SavePlayerAccount(playerid);
new string[56];
switch(reason)
{
case 0: format(string, 56, "%s hat den Server verlassen (Error/Exe)", Player_Name);
case 1: format(string, 56, "%s hat den Server verlassen (Verlassen)", Player_Name);
case 2: format(string, 56, "%s hat den Server verlassen (Kick/Ban)", Player_Name);
}
echoall(Color_Leave, string);
return 1;
}
stock SavePlayerAccount(playerid)
{
new Player_Name[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, Player_Name, sizeof(Player_Name));
format(path, 200, "/Accounts/%s.ini", Player_Name);
dini_IntSet(path, "Level", GetPlayerScore(playerid));
dini_IntSet(path, "Money", GetPlayerMoney(playerid));
dini_IntSet(path, "Skin", GetPlayerSkin(playerid));
dini_IntSet(path, "Faction", Player_Data[playerid][Faction]);
dini_IntSet(path, "Faction_Rank", Player_Data[playerid][Faction_Rank]);
dini_IntSet(path, "Faction_Leader", Player_Data[playerid][Faction_Leader]);
dini_IntSet(path, "Admin_Level", Player_Data[playerid][Admin_Level]);
dini_IntSet(path, "Banned", Player_Data[playerid][Banned]);
Player_Data[playerid][Loggedin] = 0;
}
[/pwn]
GamemodeExit
[pwn]
public OnGameModeExit()
{
for(new i=0; i< MAX_PLAYERS; i++)
{
SaveAllPlayerAccounts();
}
return 1;
}
stock SaveAllPlayerAccounts()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && i != INVALID_PLAYER_ID)
{
SavePlayerAccount(i);
}
}
return 1;
}
[/pwn]
Hoffe ihr könnt mir helfen.

[Blockierte Grafik: https://dl.dropboxusercontent.com/u/92256724/vrp/siggi.png]