Jetzt habe ich vieles ausprobiert und tutoirals auch angeschaut finde aber nicht denn fehler warum der Script
meine Scheine nicht als "Vorhanden" Anzeigt , es zeig immer Nicht vorhanden an ! Obwohl ich Füherschein habe..
dcmd_licenses(playerid, params[]) {
#pragma unused params // unterdrückt denn Params
if(gPlayerLogged[playerid] == 0)
return
SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht eingeloggt !");
ShowLicenses(playerid, playerid);
return 1;
}
public ShowLicenses(playerid,targetid)
#pragma tabsize 0
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new carlic[128];
new planelic[128];
new boatlic[128];
new bikelic[128];
if(PlayerInfo[targetid][car] ==1) { carlic= "Vorhanden"; } else { carlic= "Nicht Vorhanden"; }
if(PlayerInfo[targetid][boat] ==1) { planelic= "Vorhanden"; } else { planelic= "Nicht Vorhanden"; }
if(PlayerInfo[targetid][plane] ==1) { boatlic= "Vorhanden"; } else { boatlic= "Nicht Vorhanden"; }
if(PlayerInfo[targetid][bike] ==1) { bikelic= "Vorhanden"; } else { bikelic= "Nicht Vorhanden"; }
new Float:px,Float:py,Float:pz;
GetPlayerPos(targetid, px, py, pz);
new string[128];
SendClientMessage(playerid, WEIS, "|__________________ Scheine __________________|");
format(string, sizeof(string), "** Führerschein: %s.", planelic);
SendClientMessage(playerid, GRAU, string);
format(string, sizeof(string), "** Motoschein: %s.", bikelic);
SendClientMessage(playerid, GRAU, string);
format(string, sizeof(string), "** Flugschein: %s.", carlic);
SendClientMessage(playerid, GRAU, string);
format(string, sizeof(string), "** Bootschein: %s.", boatlic);
SendClientMessage(playerid, GRAU, string);
SendClientMessage(playerid, WEIS, "|______________________________________________|");
}
}
======================
strmid(PlayerInfo[playerid][pPasswort], tmp, 0, strlen(cmdtext), 255);
Encrypt(PlayerInfo[playerid][pPasswort]);
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s.cer", playername);
new File: file = fopen(string, io_read);
if (file)
{
SendClientMessage(playerid, GRAU, " Der Name ist bereits registriert");
fclose(file);
return 1;
}
new File:hFile;
hFile = fopen(string, io_append);
new var[50];//
format(var, 50, "%s\n", PlayerInfo[playerid][pPasswort]);fwrite(hFile, var);
format(var, 50, "Kills=%d\n", PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 50, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
format(var, 50, "Geld=%d\n", PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 50, "Level=%d\n", PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
format(var, 50, "Mats=%d\n", PlayerInfo[playerid][pMats]);fwrite(hFile, var);
format(var, 50, "carlic=%d\n",PlayerInfo[playerid][car]);fwrite(hFile, var);
format(var, 32, "carlic=%d\n",PlayerInfo[playerid][car]);fwrite(hFile, var);
format(var, 50, "planelic=%d\n",PlayerInfo[playerid][plane]);fwrite(hFile, var);
format(var, 50, "boatlic=%d\n",PlayerInfo[playerid][boat]);fwrite(hFile, var);
format(var, 50, "bikelic=%d\n",PlayerInfo[playerid][bike]);fwrite(hFile, var);
fclose(hFile);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
==================
public OnPlayerLogin(playerid,const string[])
{
new pname2[MAX_PLAYER_NAME];
new pname3[MAX_PLAYER_NAME];
new string2[64];
new string3[128];
GetPlayerName(playerid, pname2, sizeof(pname2));
format(string2, sizeof(string2), "%s.cer", pname2);
new File: UserFile = fopen(string2, io_read);
if (UserFile)
{
new valtmp[128];
fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPasswort], valtmp, 0, strlen(valtmp)-1, 255);
if (!strcmp(PlayerInfo[playerid][pPasswort], string, true) && strlen(PlayerInfo[playerid][pPasswort]) == strlen(string))
{
new key[128],val[128];
new Data[128];
while(fread(UserFile,Data,sizeof(Data)))
{
key = ini_GetKey(Data);
if( strcmp( key , "Kills" ,true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Deaths",true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
if( strcmp( key , "Geld" ,true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
if( strcmp( key , "Bank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBank] = strval( val ); }
if( strcmp( key , "Level" ,true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
if( strcmp( key , "Mats" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMats] = strval( val ); }
if( strcmp( key , "carlic" ,true ) == 0 ){ val = ini_GetValue( Data ); PlayerInfo[playerid][car] = strval( val ); }
if( strcmp( key , "planelic",true ) == 0 ){ val = ini_GetValue( Data );PlayerInfo[playerid][plane] = strval( val ); }
if( strcmp( key , "boatlic" ,true ) == 0 ){ val = ini_GetValue( Data );PlayerInfo[playerid][boat] = strval( val ); }
if( strcmp( key , "bikelic" ,true ) == 0 ){ val = ini_GetValue( Data );Licenses[playerid][bike] = strval( val ); }
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]); // wenn ich das lösche dann wird das geld nicht gespeichert!
}
fclose(UserFile);
gPlayerLogged[playerid] = 1;
gPlayerAccount[playerid] = 1;
new kills = PlayerInfo[playerid][pKills];
SetPlayerScore(playerid, kills);
GetPlayerName(playerid, pname3, sizeof(pname3));
format(string3, sizeof(string3), "Willkommen %s, du hast dich erfolgreich eingeloggt! Für Hilfe gib /help ein!", pname3);
SpawnPlayer(playerid);
SendClientMessage(playerid, WEIS,string3);
}
else
{
Versuche[playerid]++;
if(Versuche[playerid] == 1) { SendClientMessage(playerid, ROT, "Falsches Passwort noch 2 versuche"); }
else if(Versuche[playerid] == 2){ SendClientMessage(playerid, ROT, "Falsches Passwort letzte chance bevor du gekickt wirst"); }
else if(Versuche[playerid] > 2) { Kick(playerid); }
fclose(UserFile);
}
}
return 1;
}
Hoffe jemand kann helfen! Speichern tut er schon wie gesagt anzeigen soll er auch noch! Damit ich auch weiß das ich die scheine habe!#
Danke schön