Hey . . .
Ehm ich hab mal versucht einen Perso in mein GM zu Zaubern
also so siehts bis jetzt aus.
enum pInfo
{
passwort[128],
. . .
perso,
alter,
vorname,
nachname,
wohnort,
. . .
};
public OnPlayerUpdate(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
new string3[32];
new pname3[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname3, sizeof(pname3));
format(string3, sizeof(string3), "%s.drl", pname3);
new File: pFile = fopen(string3, io_write);
if (pFile)
{
new var[32];
format(var, 32, "%s\n", PlayerInfo[playerid][passwort]);fwrite(pFile, var);
fclose(pFile);
new File: hFile = fopen(string3, io_append);
PlayerInfo[playerid][geld] = GetPlayerMoney(playerid);
format(var, 32, "Morde=%d\n",PlayerInfo[playerid][morde]);fwrite(hFile, var);
format(var, 32, "Tode=%d\n",PlayerInfo[playerid][tode]);fwrite(hFile, var);
format(var, 32, "Geld=%d\n",PlayerInfo[playerid][geld]);fwrite(hFile, var);
format(var, 32, "carlic=%d\n",Licenses[playerid][car]);fwrite(hFile, var);
format(var, 32, "planelic=%d\n",Licenses[playerid][plane]);fwrite(hFile, var);
format(var, 32, "boatlic=%d\n",Licenses[playerid][boat]);fwrite(hFile, var);
format(var, 32, "bikelic=%d\n",Licenses[playerid][bike]);fwrite(hFile, var);
format(var, 32, "score=%d\n",PlayerInfo[playerid][score]);fwrite(hFile, var);
format(var, 32, "team=%d\n",PlayerInfo[playerid][team]);fwrite(hFile, var);
format(var, 32, "adminlvl=%d\n",PlayerInfo[playerid][adminlvl]);fwrite(hFile, var);
format(var, 32, "leader=%d\n",PlayerInfo[playerid][leader]);fwrite(hFile, var);
format(var, 32, "SkinID=%d\n",PlayerInfo[playerid][skin]);fwrite(hFile, var);
format(var, 32, "Wantedlvl=%d\n",PlayerInfo[playerid][wantedlvl]);fwrite(hFile, var);
format(var, 32, "Perso=%d\n",PlayerInfo[playerid][perso]);fwrite(hFile, var);
format(var, 32, "Alter=%d\n",PlayerInfo[playerid][alter]);fwrite(hFile, var);
format(var, 32, "Vorname=%d\n",PlayerInfo[playerid][vorname]);fwrite(hFile, var);
format(var, 32, "Nachname=%d\n",PlayerInfo[playerid][nachname]);fwrite(hFile, var);
format(var, 32, "Wohnort=%d\n",PlayerInfo[playerid][wohnort]);fwrite(hFile, var);
fclose(hFile);
}
}
}
return 1;
}
Bei register hab ich das
format(var, 32, "Wohnort=%d\n",PlayerInfo[playerid][wohnort]);fwrite(hFile, var);
auch noch hingetan. Aber brauch ich ja hier jetzt net posten.
Dann
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == stadthalle)
{
ShowPlayerDialog(playerid,DIALOG_STADTHALLE,DIALOG_STYLE_LIST,"Stadthalle","Jobs\nArbeitslosengeld\nPersonalausweis","Auswählen", "Abbrechen");
return 1;
}
return 1;
}
if(dialogid == DIALOG_STADTHALLE) //
{
if(response)
{
if(listitem == 0) // Jobs
{
ShowPlayerDialog(playerid,DIALOG_STADTHALLE,DIALOG_STYLE_LIST,"Jobcenter","Straßenfeger\nMechaniker\nMüllmann\nBusfahrer\nPizzaboy\nHotdogverkäufer\nEisverkäufer","Auswählen", "Abbrechen");
}
if(listitem == 1) // Arbeitslosengeld
{
ShowPlayerDialog(playerid,DIALOG_HARTZ,DIALOG_STYLE_LIST,"Jobcenter","Beantragen\nKündigen","Auswählen", "Abbrechen");
}
if(listitem == 2) // Personalausweis
{
ShowPlayerDialog(playerid,DIALOG_PERSOKAUF,DIALOG_STYLE_LIST,"Personalausweis","Beantragen","Auswählen", "Abbrechen");
}
return 1;
}
}
if(dialogid == DIALOG_PERSOKAUF) //
{
if(response)
{
if(listitem == 0) // Beantragen
{
ShowPlayerDialog(playerid,DIALOG_PERSOVORNAME,DIALOG_STYLE_INPUT,"Perso - Beantragung","Gebe hier deinen gewünschten Ingame Vorname ein :","OK","Abbrechen");
}
return 1;
}
}
if(dialogid == DIALOG_PERSOVORNAME)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_PERSOVORNAME,DIALOG_STYLE_INPUT,"Perso - Beantragung","Gebe hier deinen gewünschten Ingame Vorname ein :","OK","Abbrechen");
return 1;
}
new message[196];
format(message, sizeof(message), "Okay, Du möchtest also %s mit Vornamen heißen.", inputtext);
SendClientMessage(playerid, COLOR_YELLOW2, message);
PlayerInfo[playerid][vorname] = strval(inputtext);
if(response == 1)
{
ShowPlayerDialog(playerid,DIALOG_PERSONACHNAME,DIALOG_STYLE_INPUT,"Perso - Beantragung","Gebe hier deinen gewünschten Ingame Nachname ein :","OK","Abbrechen");
}
return 1;
}
if(dialogid == DIALOG_PERSONACHNAME)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_PERSONACHNAME,DIALOG_STYLE_INPUT,"Perso - Beantragung","Gebe hier deinen gewünschten Ingame Nachname ein :","OK","Abbrechen");
return 1;
}
new message[196];
format(message, sizeof(message), "Okay, Du möchtest also %s mit Nachname heißen.", inputtext);
SendClientMessage(playerid, COLOR_YELLOW2, message);
PlayerInfo[playerid][nachname] = strval(inputtext);
if(response == 1)
{
ShowPlayerDialog(playerid,DIALOG_PERSOALTER,DIALOG_STYLE_INPUT,"Perso - Beantragung","Gebe hier dein Alter ein :","OK","Abbrechen");
}
return 1;
}
if(dialogid == DIALOG_PERSOALTER)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_PERSOALTER,DIALOG_STYLE_INPUT,"Perso - Beantragung","Gebe hier dein Alter ein :","OK","Abbrechen");
return 1;
}
new message[196];
format(message, sizeof(message), "Okay, Du bist also %s Jahre alt.", inputtext);
SendClientMessage(playerid, COLOR_YELLOW2, message);
PlayerInfo[playerid][alter] = strval(inputtext);
if(response == 1)
{
ShowPlayerDialog(playerid,DIALOG_PERSOWOHNORT,DIALOG_STYLE_INPUT,"Perso - Beantragung","Gebe hier dein Wohnort ein :\n(Los Santos / San Fierro / Las Venturas)","OK","Abbrechen");
}
return 1;
}
if(dialogid == DIALOG_PERSOWOHNORT)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_PERSOWOHNORT,DIALOG_STYLE_INPUT,"Perso - Beantragung","Gebe hier dein Alter ein :","OK","Abbrechen");
return 1;
}
new message[196];
format(message, sizeof(message), "Okay, Du wohnst also in %s .", inputtext);
SendClientMessage(playerid, COLOR_YELLOW2, message);
PlayerInfo[playerid][wohnort] = strval(inputtext);
if(response == 1)
{
PlayerInfo[playerid][perso] = 1;
}
return 1;
}
return 0;
}
Nur speicher er in der Userdatei nur
Mehr nicht also da fehlen ja noch Vorname Nachname und Wohnort
PS: Es klappt alles mit den Dialogen nur saved er es iwie net.
Kann mir vllt einer helfen ?