Ich bin momenan ein GF auf MYSQL am umschreiben......
ich habe da allerdings so einige probleme das so sachen wie geld usw. nicht gespeichert/geladen werden und andere sachen wie Password und Level aber richtig geladen werden
hier mal das ganze login system:
public OnPlayerLogin(playerid,password[])
{
new tmp2[256];
new string2[128];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
new PassData[256];
new keytmp[256], valtmp[256];
/*fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Key" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}*/
if(!strcmp(password, (mysql_ReturnPasswort(playername2)), false))
{
GetPlayerName(playerid, PlayerInfo[playerid][pUserName], MAX_PLAYER_NAME); //Wir Speichern den Namen des Spielers in der Variable [i]PlayerInfo[playerid][pName][/i]
// PlayerInfo[playerid][pKey] = mysql_GetInt("accounts", "Passwort", "Name", PlayerInfo[playerid][pUserName]); //Wir holen uns den wert der unter "Level" eingetragen ist und Speichern ihn in unserer Variable.
PlayerInfo[playerid][pLevel] = mysql_GetInt("accounts", "Level", "Name", PlayerInfo[playerid][pUserName]); //Wir holen uns den wert der unter "Geld" eingetragen ist und Speichern ihn in unserer Variable.
PlayerInfo[playerid][pAdmin] = mysql_GetInt("accounts", "Admin", "Name", PlayerInfo[playerid][pUserName]); //Wir holen uns den wert der unter "Kills" eingetragen ist und Speichern ihn in unserer Variable.
PlayerInfo[playerid][pSupporter] = mysql_GetInt("accounts", "Supporter", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pDonateRank] = mysql_GetInt("accounts", "DonateRank", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][gPupgrade] = mysql_GetInt("accounts", "UpgradePoints", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pConnectTime] = mysql_GetInt("accounts", "ConnectedTime", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pReg] = mysql_GetInt("accounts", "Registered", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pSex] = mysql_GetInt("accounts", "Sex", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pAge] = mysql_GetInt("accounts", "Age", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pOrigin] = mysql_GetInt("accounts", "Origin", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pCK] = mysql_GetInt("accounts", "CK", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMuted] = mysql_GetInt("accounts", "Muted", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pExp] = mysql_GetInt("accounts", "Respect", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pCash] = mysql_GetInt("accounts", "Money", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pAccount] = mysql_GetInt("accounts", "Bank", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pCrimes] = mysql_GetInt("accounts", "Crimes", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pKills] = mysql_GetInt("accounts", "Kills", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pDeaths] = mysql_GetInt("accounts", "Deaths", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pArrested] = mysql_GetInt("accounts", "Arrested", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pWantedDeaths] = mysql_GetInt("accounts", "WantedDeaths", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPhoneBook] = mysql_GetInt("accounts", "Phonebook", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pLottoNr] = mysql_GetInt("accounts", "LottoNr", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pFishes] = mysql_GetInt("accounts", "Fishes", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pBiggestFish] = mysql_GetInt("accounts", "BiggestFish", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pJob] = mysql_GetInt("accounts", "Job", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPayCheck] = mysql_GetInt("accounts", "Paycheck", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pHeadValue] = mysql_GetInt("accounts", "HeadValue", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pJailed] = mysql_GetInt("accounts", "Jailed", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pJailTime] = mysql_GetInt("accounts", "JailTime", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMats] = mysql_GetInt("accounts", "Materials", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pDrugs] = mysql_GetInt("accounts", "Drugs", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pLeader] = mysql_GetInt("accounts", "Leader", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMember] = mysql_GetInt("accounts", "Member", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pFMember] = mysql_GetInt("accounts", "FMember", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pRank] = mysql_GetInt("accounts", "Rank", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pChar] = mysql_GetInt("accounts", "Char", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pContractTime] = mysql_GetInt("accounts", "ContractTime", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pDetSkill] = mysql_GetInt("accounts", "DetSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pSexSkill] = mysql_GetInt("accounts", "SexSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pBoxSkill] = mysql_GetInt("accounts", "BoxSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pLawSkill] = mysql_GetInt("accounts", "LawSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMechSkill] = mysql_GetInt("accounts", "MechSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pJackSkill] = mysql_GetInt("accounts", "JackSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pCarSkill] = mysql_GetInt("accounts", "CarSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pNewsSkill] = mysql_GetInt("accounts", "NewsSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pDrugsSkill] = mysql_GetInt("accounts", "DrugsSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pCookSkill] = mysql_GetInt("accounts", "CookSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pFishSkill] = mysql_GetInt("accounts", "FishSkill", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][Float:pHealth] = mysql_GetInt("accounts", "pSHealth", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][Float:pSHealth] = mysql_GetInt("accounts", "pHealth", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pInt] = mysql_GetInt("accounts", "Int", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pLocal] = mysql_GetInt("accounts", "Local", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pTeam] = mysql_GetInt("accounts", "Team", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pModel] = mysql_GetInt("accounts", "Model", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPnumber] = mysql_GetInt("accounts", "PhoneNr", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPhousekey] = mysql_GetInt("accounts", "House", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPbiskey] = mysql_GetInt("accounts", "Bizz", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pHandyGeld] = mysql_GetInt("accounts", "HandyGeld", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pHandyVer] = mysql_GetInt("accounts", "HandyVer", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][Float:pPos_x] = mysql_GetInt("accounts", "Pos_x", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][Float:pPos_y] = mysql_GetInt("accounts", "Pos_x", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][Float:pPos_z] = mysql_GetInt("accounts", "Pos_z", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pCarLic] = mysql_GetInt("accounts", "CarLic", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pNewLic] = mysql_GetInt("accounts", "NewLic", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pFlyLic] = mysql_GetInt("accounts", "FlyLic", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pBoatLic] = mysql_GetInt("accounts", "BoatLic", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pFishLic] = mysql_GetInt("accounts", "FishLic", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pGunLic] = mysql_GetInt("accounts", "GunLic", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pLKWLic] = mysql_GetInt("accounts", "LKWLic", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMotoLic] = mysql_GetInt("accounts", "MotoLic", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pZig] = mysql_GetInt("accounts", "Zig", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pZigSucht] = mysql_GetInt("accounts", "ZigSucht", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pSprengstoff] = mysql_GetInt("accounts", "Sprengstoff", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pGun1] = mysql_GetInt("accounts", "Gun1", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pGun2] = mysql_GetInt("accounts", "Gun2", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pGun3] = mysql_GetInt("accounts", "Gun3", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pGun4] = mysql_GetInt("accounts", "Gun4", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pAmmo1] = mysql_GetInt("accounts", "Ammo1", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pAmmo2] = mysql_GetInt("accounts", "Ammo2", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pAmmo3] = mysql_GetInt("accounts", "Ammo3", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pAmmo4] = mysql_GetInt("accounts", "Ammo4", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pCarTime] = mysql_GetInt("accounts", "CarTime", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPayDay] = mysql_GetInt("accounts", "PayDay", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPayDayHad] = mysql_GetInt("accounts", "PayDayHad", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pCDPlayer] = mysql_GetInt("accounts", "CDPlayer", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pWins] = mysql_GetInt("accounts", "Wins", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pLoses] = mysql_GetInt("accounts", "Loses", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pAlcoholPerk] = mysql_GetInt("accounts", "AlcoholPerk", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pDrugPerk] = mysql_GetInt("accounts", "DrugPerk", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMiserPerk] = mysql_GetInt("accounts", "MiserPerk", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPainPerk] = mysql_GetInt("accounts", "PainPerk", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pTraderPerk] = mysql_GetInt("accounts", "TraderPerk", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pTut] = mysql_GetInt("accounts", "Tutorial", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pWarns] = mysql_GetInt("accounts", "Warnings", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pAdjustable] = mysql_GetInt("accounts", "Adjustable", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pFuel] = mysql_GetInt("accounts", "Fuel", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMarried] = mysql_GetInt("accounts", "Married", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMarriedTo] = mysql_GetInt("accounts", "MarriedTo", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pRoadblock] = mysql_GetInt("accounts", "Roadblock", "Name", PlayerInfo[playerid][pUserName]);
SpawnChange[playerid] = mysql_GetInt("accounts", "SpawnChange", "Name", PlayerInfo[playerid][pUserName]);
WantedLevel[playerid] = mysql_GetInt("accounts", "WantedLevel", "Name", PlayerInfo[playerid][pUserName]);
WantedPoints[playerid] = mysql_GetInt("accounts", "WantedPoints", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pPlayMinutes] = mysql_GetInt("accounts", "PlayMinutes", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pGesamtMinutes] = mysql_GetInt("accounts", "GesamtMinutes", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMinutesSinceLogin] = mysql_GetInt("accounts", "MinutesSinceLogin", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pMinutesSinceAn] = mysql_GetInt("accounts", "MinutesSinceAn", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pSFPASS] = mysql_GetInt("accounts", "SFPASS", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pLVPASS] = mysql_GetInt("accounts", "LVPASS", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pHandyGeld] = mysql_GetInt("accounts", "HandyGeld", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pHandyVer] = mysql_GetInt("accounts", "HandyVer", "Name", PlayerInfo[playerid][pUserName]);
OfflineFlucht[playerid] = mysql_GetInt("accounts", "Offflucht", "Name", PlayerInfo[playerid][pUserName]);
Knast[playerid] = mysql_GetInt("accounts", "Knast", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pHandyID] = mysql_GetInt("accounts", "Handy", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pUhrID] = mysql_GetInt("accounts", "Uhr", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pTot] = mysql_GetInt("accounts", "pTot", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pTx] = mysql_GetInt("accounts", "pTx", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pTy] = mysql_GetInt("accounts", "pTz", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pTz] = mysql_GetInt("accounts", "pTy", "Name", PlayerInfo[playerid][pUserName]);
KnastTime[playerid] = mysql_GetInt("accounts", "KnastTime", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pOwnPerso] = mysql_GetInt("accounts", "Perso", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pFrakSperre] = mysql_GetInt("accounts", "FrakSperre", "Name", PlayerInfo[playerid][pUserName]);
PlayerInfo[playerid][pGebannt] = mysql_GetInt("accounts", "Gebannt", "Name", PlayerInfo[playerid][pUserName]);
}