Ja, deshalb lass mal _GetLeader für Fraktion 2 in dem Befehl - vor der Ausgabe - ausführen.
[SAMMELTHREAD] Kleine Scripting Fragen
- Rafelder
- Unerledigt
Dein Problem konnte durch einen User gelöst werden? Bedank dich bei ihm indem du seinen Beitrag als Hilfreich markierst sowie einen Daumen oben dalässt
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
-
-
Ja, deshalb lass mal _GetLeader für Fraktion 2 in dem Befehl - vor der Ausgabe - ausführen.
Habs mal bei LoadFraktionen eingefügt, aber klappt leider immer noch nicht.
C
Alles anzeigenFunction LoadFraktion() { new num_fields,num_rows,colorString[12]; cache_get_data(num_rows,num_fields); if(!num_rows)return print("LoadFraktion - num_rows = 0"); for(new i = 0; i < num_rows; i++) { fData[i+1][fId] = cache_get_field_content_int(i, "frakid"); cache_get_field_content(i, "fname", fData[i+1][fName], dbhandle, 100); fData[i+1][f_X] = cache_get_field_content_float(i, "x"); fData[i+1][f_Y] = cache_get_field_content_float(i, "y"); fData[i+1][f_Z] = cache_get_field_content_float(i, "z"); fData[i+1][f_R] = cache_get_field_content_float(i, "r"); cache_get_field_content(i, "fcolor", colorString, dbhandle, 50); fData[i+1][fMoney] = cache_get_field_content_int(i, "fmoney"); //sscanf(colorString,"%x",fData[i+1][fColor]); GetFracMemberInt(i+1); GetFracLeader(i+1); GetFracCarInt(i+1); print("[1] GetFracLeader --> ausfuehren"); GetFracLeader(2); print("[2] GetFracLeader --> ausgefuehrt"); printf("[3] Fraktionsname: %s - Fraktionsid: %d - Leader: %s",fData[2][fName],fData[2][fId],fData[2][fLeaderName]); } return 1; }
-
Wie sieht die GetFracLeader Funktion aus? Finde sie in dem Thread nicht mehr.
-
C
stock GetFracLeader(fid){ new str[128]; format(str,sizeof(str),"SELECT * FROM `player_account` WHERE `pFraktion` = '%d' AND `pRang` = '6'",fid); mysql_function_query(dbhandle, str, true, "_GetLeader", "i",fid); return 1; }
C
Alles anzeigenFunction _GetLeader(fid){ new rows, fields; cache_get_data(rows, fields); if(rows) { cache_get_field_content(0, "playername", fData[fid][fLeaderName], dbhandle, MAX_PLAYER_NAME+10); printf("Leadername: %s - Frakid: %d",fData[fid][fLeaderName],fid); }else{ format(fData[fid][fLeaderName],15,"Niemand"); } return 1; }
-
Findet grade jemand den Fehler im Sytax? Updated irgendwie nur Teile der Querry
CSS
Alles anzeigennew query[3000]; mysql_format(handle, query, sizeof(query), "UPDATE Benutzer SET Level = '%d', AdminLevel = '%d', Supporter = '%d', DonateRank = '%d', UpgradePoints = '%d', Spielzeit = '%d', Registered = '%d', Geschlecht = '%d', Age = '%d', Herkunft = '%d', CK = '%d', Muted = '%d', Respect = '%d', Money = '%d', Bank = '%d', Kredit = '%d', KreditDauer = '%d', Crimes = '%d', Kills = '%d', Deaths = '%d', Arrested = '%d', ", // PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSupporter], PlayerInfo[playerid][pDonateRank], PlayerInfo[playerid][gPupgrade], PlayerInfo[playerid][pConnectTime], PlayerInfo[playerid][pReg], PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pOrigin], PlayerInfo[playerid][pCK], PlayerInfo[playerid][pMuted], PlayerInfo[playerid][pExp], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pPlayerKredit], PlayerInfo[playerid][pPlayerKreditDauer], PlayerInfo[playerid][pCrimes], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pArrested]); // mysql_format(handle, query, sizeof(query), "WantedDeaths = '%d', Phonebook = '%d', LottoNr = '%d', Fishes = '%d', BiggestFish = '%d', Job = '%d', HeadValue = '%d', Jailed = '%d', GangJailed = '%d', Mauled = '%d', JailTime = '%d', Materials = '%d', Drugs = '%d', BoxMaterials = '%d', BoxDrugs = '%d', FightingStyle = '%d', Leader = '%d', Member = '%d', FMember = '%d', Rank = '%d', ",query, PlayerInfo[playerid][pWantedDeaths], PlayerInfo[playerid][pPhoneBook], PlayerInfo[playerid][pLottoNr], PlayerInfo[playerid][pFishes], PlayerInfo[playerid][pBiggestFish], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pHeadValue], PlayerInfo[playerid][pJailed], PlayerInfo[playerid][pGangJailed], PlayerInfo[playerid][pMauled], PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pMats], PlayerInfo[playerid][pDrugs], PlayerInfo[playerid][pBoxMats], PlayerInfo[playerid][pBoxDrugs], GetPlayerFightingStyle(playerid), PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pFMember], PlayerInfo[playerid][pRank]); // mysql_format(handle, query, sizeof(query), "Skin = '%d', ContractTime = '%d', DetSkill = '%d', SexSkill = '%d', BoxSkill = '%d', LawSkill = '%d', MechSkill = '%d', JackSkill = '%d', CarSkill = '%d', NewsSkill = '%d', DrugsSkill = '%d', CookSkill = '%d', FishSkill = '%d', pSHealth = '%f', pHealth = '%f', Interior = '%d', Local = '%d', Team = '%d', Model = '%d', PhoneNr = '%d', ",query, PlayerInfo[playerid][pChar], PlayerInfo[playerid][pContractTime], PlayerInfo[playerid][pDetSkill], PlayerInfo[playerid][pSexSkill], PlayerInfo[playerid][pBoxSkill], PlayerInfo[playerid][pLawSkill], PlayerInfo[playerid][pMechSkill], PlayerInfo[playerid][pJackSkill], PlayerInfo[playerid][pCarSkill], PlayerInfo[playerid][pNewsSkill], PlayerInfo[playerid][pDrugsSkill], PlayerInfo[playerid][pCookSkill], PlayerInfo[playerid][pFishSkill],PlayerInfo[playerid][pSHealth], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pInt], PlayerInfo[playerid][pLocal], PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPnumber]); // mysql_format(handle, query, sizeof(query), "House = '%d', Bizz = '%d', HandyGeld = '%d', HandyVer = '%d', Pos_x = '%f', Pos_y = '%f', Pos_z = '%f', CarLic = '%d', NewLic = '%d', FlyLic = '%d', BoatLic = '%d', FishLic = '%d', GunLic = '%d', LKWLic = '%d', RollerLic = '%d', MotoLic = '%d', Zig = '%d', Kekse = '%d', ZigSucht = '%d', Gun1 = '%d', ",query, PlayerInfo[playerid][pPhousekey], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pHandyGeld], PlayerInfo[playerid][pHandyVer], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pCarLic], PlayerInfo[playerid][pNewLic], PlayerInfo[playerid][pFlyLic], PlayerInfo[playerid][pBoatLic], PlayerInfo[playerid][pFishLic], PlayerInfo[playerid][pGunLic],PlayerInfo[playerid][pLKWLic], PlayerInfo[playerid][pRollerLic], PlayerInfo[playerid][pMotoLic], PlayerInfo[playerid][pZig], PlayerInfo[playerid][pKekse], PlayerInfo[playerid][pZigSucht], PlayerInfo[playerid][pGun1]); // mysql_format(handle, query, sizeof(query), "Gun2 = '%d', Gun3 = '%d', Gun4 = '%d', Ammo1 = '%d', Ammo2 = '%d', Ammo3 = '%d', Ammo4 = '%d', CarTime = '%d', Mulltime = '%d', PayDay = '%d', PayDayHad = '%d', CDPlayer = '%d', Wins = '%d', Loses = '%d', AlcoholPerk = '%d', DrugPerk = '%d', MiserPerk = '%d', PainPerk = '%d', TraderPerk = '%d', Tutorial = '%d', Warnings = '%d', ",query, PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pGun3], PlayerInfo[playerid][pGun4], PlayerInfo[playerid][pAmmo1], PlayerInfo[playerid][pAmmo2], PlayerInfo[playerid][pAmmo3], PlayerInfo[playerid][pAmmo4], PlayerInfo[playerid][pCarTime], PlayerInfo[playerid][pMulltime], PlayerInfo[playerid][pPayDay], PlayerInfo[playerid][pPayDayHad], PlayerInfo[playerid][pCDPlayer], PlayerInfo[playerid][pWins],PlayerInfo[playerid][pLoses], PlayerInfo[playerid][pAlcoholPerk], PlayerInfo[playerid][pDrugPerk], PlayerInfo[playerid][pMiserPerk], PlayerInfo[playerid][pPainPerk], PlayerInfo[playerid][pTraderPerk], PlayerInfo[playerid][pTut], PlayerInfo[playerid][pWarns]); // mysql_format(handle, query, sizeof(query), "Adjustable = '%d', Fuel = '%d', Married = '%d', MarriedTo = '%e', SpawnChange = '%d', WantedLevel = '%d', WantedPoints = '%d', PlayMinutes = '%d', GesamtMinutes = '%d', MinutesSinceAn = '%d', SFPASS = '%d', LVPASS = '%d', Offflucht = '%d', Knast = '%d', Uhr = '%d', Handy = '%d', KnastTime = '%d', Perso = '%d', FrakSperre = '%d', Gehalt = '%d', ",query, PlayerInfo[playerid][pAdjustable], PlayerInfo[playerid][pFuel], PlayerInfo[playerid][pMarried], PlayerInfo[playerid][pMarriedTo], SpawnChange[playerid], WantedLevel[playerid], WantedPoints[playerid], PlayerInfo[playerid][pPlayMinutes], PlayerInfo[playerid][pGesamtMinutes], PlayerInfo[playerid][pMinutesSinceAn], PlayerInfo[playerid][pSFPASS], PlayerInfo[playerid][pLVPASS], OfflineFlucht[playerid],Knast[playerid], PlayerInfo[playerid][pUhrID], PlayerInfo[playerid][pHandyID], KnastTime[playerid], PlayerInfo[playerid][pOwnPerso], PlayerInfo[playerid][pFrakSperre], PlayerInfo[playerid][pGehalt]); // mysql_format(handle, query, sizeof(query), "InvWeapon = '%d', InvAmmo = '%d', InvWeapon2 = '%d', InvAmmo2 = '%d', InvMats = '%d', InvDrugs = '%d', FlugTime = '%d', FarmTime = '%d', GDeaths = '%d', GKills = '%d', Meldung = '%d', Tanke = '%d', Zollpass = '%d', ZollpassTime = '%d', Gesperrt = '%d', ",query, PlayerInfo[playerid][pInvWeapon], PlayerInfo[playerid][pInvAmmo], PlayerInfo[playerid][pInvWeapon2], PlayerInfo[playerid][pInvAmmo2], PlayerInfo[playerid][pInvMats], PlayerInfo[playerid][pInvDrugs], PlayerInfo[playerid][pFlugTime], PlayerInfo[playerid][pFarmTime], PlayerInfo[playerid][pGDeaths], PlayerInfo[playerid][pGKills], PlayerInfo[playerid][pMeldung], PlayerInfo[playerid][pPtankekey], PlayerInfo[playerid][pZollPass],PlayerInfo[playerid][pZollPassTime], PlayerInfo[playerid][pGesperrt]); // mysql_format(handle, query, sizeof(query), "waffenslot1 = '%d', waffenslot2 = '%d', waffenslot3 = '%d', waffenslot4 = '%d', waffenslot5 = '%d', waffenslot6 = '%d', waffenslot7 = '%d', waffenslot8 = '%d', waffenslot9 = '%d', waffenslot10 = '%d', waffenslot11 = '%d', waffenslot12 = '%d', waffenslot13 = '%d', ", query, Weapons25[0], Weapons25[1], Weapons25[2], Weapons25[3], Weapons25[4], Weapons25[5], Weapons25[6], Weapons25[7], Weapons25[8], Weapons25[9], Weapons25[10], Weapons25[11], Weapons25[12]); // mysql_format(handle, query, sizeof(query), "%eammoslot1 = '%d', ammoslot2 = '%d', ammoslot3 = '%d', ammoslot4 = '%d', ammoslot5 = '%d', ammoslot6 = '%d', ammoslot7 = '%d', ammoslot8 = '%d', ammoslot9 = '%d', ammoslot10 = '%d', ammoslot11 = '%d', ammoslot12 = '%d', ammoslot13 = '%d' WHERE id = '%d'",query, Ammo25[0], Ammo25[1], Ammo25[2], Ammo25[3], Ammo25[4], Ammo25[5], Ammo25[6], Ammo25[7], Ammo25[8], Ammo25[9], Ammo25[10], Ammo25[11], Ammo25[12], PlayerInfo[playerid][pDB_ID]); mysql_pquery(handle, query, "", "");
//Edit: Fehler gefunden, string war zu kurz, habe es nun in mehrere kleinere Querry's aufgeteilt
Ab dem 2ten Query, steht ein %e davor, ist dies so gewollt? Wenn nicht, dann so:
C
Alles anzeigennew query[3000]; mysql_format(handle, query, sizeof(query), "UPDATE Benutzer SET Level = '%d', AdminLevel = '%d', Supporter = '%d', DonateRank = '%d', UpgradePoints = '%d', Spielzeit = '%d', Registered = '%d', Geschlecht = '%d', Age = '%d', Herkunft = '%d', CK = '%d', Muted = '%d', Respect = '%d', Money = '%d', Bank = '%d', Kredit = '%d', KreditDauer = '%d', Crimes = '%d', Kills = '%d', Deaths = '%d', Arrested = '%d', ", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSupporter], PlayerInfo[playerid][pDonateRank], PlayerInfo[playerid][gPupgrade], PlayerInfo[playerid][pConnectTime], PlayerInfo[playerid][pReg], PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pOrigin], PlayerInfo[playerid][pCK], PlayerInfo[playerid][pMuted], PlayerInfo[playerid][pExp], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pPlayerKredit], PlayerInfo[playerid][pPlayerKreditDauer], PlayerInfo[playerid][pCrimes], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pArrested]); mysql_format(handle, query, sizeof(query), "WantedDeaths = '%d', Phonebook = '%d', LottoNr = '%d', Fishes = '%d', BiggestFish = '%d', Job = '%d', HeadValue = '%d', Jailed = '%d', GangJailed = '%d', Mauled = '%d', JailTime = '%d', Materials = '%d', Drugs = '%d', BoxMaterials = '%d', BoxDrugs = '%d', FightingStyle = '%d', Leader = '%d', Member = '%d', FMember = '%d', Rank = '%d', ", query, PlayerInfo[playerid][pWantedDeaths], PlayerInfo[playerid][pPhoneBook], PlayerInfo[playerid][pLottoNr], PlayerInfo[playerid][pFishes], PlayerInfo[playerid][pBiggestFish], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pHeadValue], PlayerInfo[playerid][pJailed], PlayerInfo[playerid][pGangJailed], PlayerInfo[playerid][pMauled], PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pMats], PlayerInfo[playerid][pDrugs], PlayerInfo[playerid][pBoxMats], PlayerInfo[playerid][pBoxDrugs], GetPlayerFightingStyle(playerid), PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pFMember], PlayerInfo[playerid][pRank]); mysql_format(handle, query, sizeof(query), "Skin = '%d', ContractTime = '%d', DetSkill = '%d', SexSkill = '%d', BoxSkill = '%d', LawSkill = '%d', MechSkill = '%d', JackSkill = '%d', CarSkill = '%d', NewsSkill = '%d', DrugsSkill = '%d', CookSkill = '%d', FishSkill = '%d', pSHealth = '%f', pHealth = '%f', Interior = '%d', Local = '%d', Team = '%d', Model = '%d', PhoneNr = '%d', ", query, PlayerInfo[playerid][pChar], PlayerInfo[playerid][pContractTime], PlayerInfo[playerid][pDetSkill], PlayerInfo[playerid][pSexSkill], PlayerInfo[playerid][pBoxSkill], PlayerInfo[playerid][pLawSkill], PlayerInfo[playerid][pMechSkill], PlayerInfo[playerid][pJackSkill], PlayerInfo[playerid][pCarSkill], PlayerInfo[playerid][pNewsSkill], PlayerInfo[playerid][pDrugsSkill], PlayerInfo[playerid][pCookSkill], PlayerInfo[playerid][pFishSkill], PlayerInfo[playerid][pSHealth], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pInt], PlayerInfo[playerid][pLocal], PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPnumber]); mysql_format(handle, query, sizeof(query), "House = '%d', Bizz = '%d', HandyGeld = '%d', HandyVer = '%d', Pos_x = '%f', Pos_y = '%f', Pos_z = '%f', CarLic = '%d', NewLic = '%d', FlyLic = '%d', BoatLic = '%d', FishLic = '%d', GunLic = '%d', LKWLic = '%d', RollerLic = '%d', MotoLic = '%d', Zig = '%d', Kekse = '%d', ZigSucht = '%d', Gun1 = '%d', ", query, PlayerInfo[playerid][pPhousekey], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pHandyGeld], PlayerInfo[playerid][pHandyVer], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pCarLic], PlayerInfo[playerid][pNewLic], PlayerInfo[playerid][pFlyLic], PlayerInfo[playerid][pBoatLic], PlayerInfo[playerid][pFishLic], PlayerInfo[playerid][pGunLic], PlayerInfo[playerid][pLKWLic], PlayerInfo[playerid][pRollerLic], PlayerInfo[playerid][pMotoLic], PlayerInfo[playerid][pZig], PlayerInfo[playerid][pKekse], PlayerInfo[playerid][pZigSucht], PlayerInfo[playerid][pGun1]); mysql_format(handle, query, sizeof(query), "Gun2 = '%d', Gun3 = '%d', Gun4 = '%d', Ammo1 = '%d', Ammo2 = '%d', Ammo3 = '%d', Ammo4 = '%d', CarTime = '%d', Mulltime = '%d', PayDay = '%d', PayDayHad = '%d', CDPlayer = '%d', Wins = '%d', Loses = '%d', AlcoholPerk = '%d', DrugPerk = '%d', MiserPerk = '%d', PainPerk = '%d', TraderPerk = '%d', Tutorial = '%d', Warnings = '%d', ", query, PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pGun3], PlayerInfo[playerid][pGun4], PlayerInfo[playerid][pAmmo1], PlayerInfo[playerid][pAmmo2], PlayerInfo[playerid][pAmmo3], PlayerInfo[playerid][pAmmo4], PlayerInfo[playerid][pCarTime], PlayerInfo[playerid][pMulltime], PlayerInfo[playerid][pPayDay], PlayerInfo[playerid][pPayDayHad], PlayerInfo[playerid][pCDPlayer], PlayerInfo[playerid][pWins], PlayerInfo[playerid][pLoses], PlayerInfo[playerid][pAlcoholPerk], PlayerInfo[playerid][pDrugPerk], PlayerInfo[playerid][pMiserPerk], PlayerInfo[playerid][pPainPerk], PlayerInfo[playerid][pTraderPerk], PlayerInfo[playerid][pTut], PlayerInfo[playerid][pWarns]); mysql_format(handle, query, sizeof(query), "Adjustable = '%d', Fuel = '%d', Married = '%d', MarriedTo = '%e', SpawnChange = '%d', WantedLevel = '%d', WantedPoints = '%d', PlayMinutes = '%d', GesamtMinutes = '%d', MinutesSinceAn = '%d', SFPASS = '%d', LVPASS = '%d', Offflucht = '%d', Knast = '%d', Uhr = '%d', Handy = '%d', KnastTime = '%d', Perso = '%d', FrakSperre = '%d', Gehalt = '%d', ", query, PlayerInfo[playerid][pAdjustable], PlayerInfo[playerid][pFuel], PlayerInfo[playerid][pMarried], PlayerInfo[playerid][pMarriedTo], SpawnChange[playerid], WantedLevel[playerid], WantedPoints[playerid], PlayerInfo[playerid][pPlayMinutes], PlayerInfo[playerid][pGesamtMinutes], PlayerInfo[playerid][pMinutesSinceAn], PlayerInfo[playerid][pSFPASS], PlayerInfo[playerid][pLVPASS], OfflineFlucht[playerid], Knast[playerid], PlayerInfo[playerid][pUhrID], PlayerInfo[playerid][pHandyID], KnastTime[playerid], PlayerInfo[playerid][pOwnPerso], PlayerInfo[playerid][pFrakSperre], PlayerInfo[playerid][pGehalt]); mysql_format(handle, query, sizeof(query), "InvWeapon = '%d', InvAmmo = '%d', InvWeapon2 = '%d', InvAmmo2 = '%d', InvMats = '%d', InvDrugs = '%d', FlugTime = '%d', FarmTime = '%d', GDeaths = '%d', GKills = '%d', Meldung = '%d', Tanke = '%d', Zollpass = '%d', ZollpassTime = '%d', Gesperrt = '%d', ", query, PlayerInfo[playerid][pInvWeapon], PlayerInfo[playerid][pInvAmmo], PlayerInfo[playerid][pInvWeapon2], PlayerInfo[playerid][pInvAmmo2], PlayerInfo[playerid][pInvMats], PlayerInfo[playerid][pInvDrugs], PlayerInfo[playerid][pFlugTime], PlayerInfo[playerid][pFarmTime], PlayerInfo[playerid][pGDeaths], PlayerInfo[playerid][pGKills], PlayerInfo[playerid][pMeldung], PlayerInfo[playerid][pPtankekey], PlayerInfo[playerid][pZollPass], PlayerInfo[playerid][pZollPassTime], PlayerInfo[playerid][pGesperrt]); mysql_format(handle, query, sizeof(query), "waffenslot1 = '%d', waffenslot2 = '%d', waffenslot3 = '%d', waffenslot4 = '%d', waffenslot5 = '%d', waffenslot6 = '%d', waffenslot7 = '%d', waffenslot8 = '%d', waffenslot9 = '%d', waffenslot10 = '%d', waffenslot11 = '%d', waffenslot12 = '%d', waffenslot13 = '%d', ", query, Weapons25[0], Weapons25[1], Weapons25[2], Weapons25[3], Weapons25[4], Weapons25[5], Weapons25[6], Weapons25[7], Weapons25[8], Weapons25[9], Weapons25[10], Weapons25[11], Weapons25[12]); mysql_format(handle, query, sizeof(query), "ammoslot1 = '%d', ammoslot2 = '%d', ammoslot3 = '%d', ammoslot4 = '%d', ammoslot5 = '%d', ammoslot6 = '%d', ammoslot7 = '%d', ammoslot8 = '%d', ammoslot9 = '%d', ammoslot10 = '%d', ammoslot11 = '%d', ammoslot12 = '%d', ammoslot13 = '%d' WHERE id = '%d'", query, Ammo25[0], Ammo25[1], Ammo25[2], Ammo25[3], Ammo25[4], Ammo25[5], Ammo25[6], Ammo25[7], Ammo25[8], Ammo25[9], Ammo25[10], Ammo25[11], Ammo25[12], PlayerInfo[playerid][pDB_ID]); mysql_pquery(handle, query, "", "");
-
printf("Leadername: %s - Frakid: %d",fData[fid][fLeaderName],fid);
Dieser print ist im Log nicht drin, sprich die Funktion wurde auch nicht aufgerufen.
Außerdem:
Da du den Cache ausliest ist das Ergebnis im Befehl nicht direkt zu sehen, sondern erst nachdem du ihn ein zweites mal ausführst, sofern die _GetLeader Funktion ausgeführt wird.Poste eventuell den MySQL Log in einem neuen Thread mit aktuellem Code, das wird hier zu unübersichtlich.
-
neuen Thread mit aktuellem Code, das wird hier zu unübersichtlich.
-
Ab dem 2ten Query, steht ein %e davor, ist dies so gewollt? Wenn nicht, dann so:
C
Alles anzeigennew query[3000]; mysql_format(handle, query, sizeof(query), "UPDATE Benutzer SET Level = '%d', AdminLevel = '%d', Supporter = '%d', DonateRank = '%d', UpgradePoints = '%d', Spielzeit = '%d', Registered = '%d', Geschlecht = '%d', Age = '%d', Herkunft = '%d', CK = '%d', Muted = '%d', Respect = '%d', Money = '%d', Bank = '%d', Kredit = '%d', KreditDauer = '%d', Crimes = '%d', Kills = '%d', Deaths = '%d', Arrested = '%d', ", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSupporter], PlayerInfo[playerid][pDonateRank], PlayerInfo[playerid][gPupgrade], PlayerInfo[playerid][pConnectTime], PlayerInfo[playerid][pReg], PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pOrigin], PlayerInfo[playerid][pCK], PlayerInfo[playerid][pMuted], PlayerInfo[playerid][pExp], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pPlayerKredit], PlayerInfo[playerid][pPlayerKreditDauer], PlayerInfo[playerid][pCrimes], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pArrested]); mysql_format(handle, query, sizeof(query), "WantedDeaths = '%d', Phonebook = '%d', LottoNr = '%d', Fishes = '%d', BiggestFish = '%d', Job = '%d', HeadValue = '%d', Jailed = '%d', GangJailed = '%d', Mauled = '%d', JailTime = '%d', Materials = '%d', Drugs = '%d', BoxMaterials = '%d', BoxDrugs = '%d', FightingStyle = '%d', Leader = '%d', Member = '%d', FMember = '%d', Rank = '%d', ", query, PlayerInfo[playerid][pWantedDeaths], PlayerInfo[playerid][pPhoneBook], PlayerInfo[playerid][pLottoNr], PlayerInfo[playerid][pFishes], PlayerInfo[playerid][pBiggestFish], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pHeadValue], PlayerInfo[playerid][pJailed], PlayerInfo[playerid][pGangJailed], PlayerInfo[playerid][pMauled], PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pMats], PlayerInfo[playerid][pDrugs], PlayerInfo[playerid][pBoxMats], PlayerInfo[playerid][pBoxDrugs], GetPlayerFightingStyle(playerid), PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pFMember], PlayerInfo[playerid][pRank]); mysql_format(handle, query, sizeof(query), "Skin = '%d', ContractTime = '%d', DetSkill = '%d', SexSkill = '%d', BoxSkill = '%d', LawSkill = '%d', MechSkill = '%d', JackSkill = '%d', CarSkill = '%d', NewsSkill = '%d', DrugsSkill = '%d', CookSkill = '%d', FishSkill = '%d', pSHealth = '%f', pHealth = '%f', Interior = '%d', Local = '%d', Team = '%d', Model = '%d', PhoneNr = '%d', ", query, PlayerInfo[playerid][pChar], PlayerInfo[playerid][pContractTime], PlayerInfo[playerid][pDetSkill], PlayerInfo[playerid][pSexSkill], PlayerInfo[playerid][pBoxSkill], PlayerInfo[playerid][pLawSkill], PlayerInfo[playerid][pMechSkill], PlayerInfo[playerid][pJackSkill], PlayerInfo[playerid][pCarSkill], PlayerInfo[playerid][pNewsSkill], PlayerInfo[playerid][pDrugsSkill], PlayerInfo[playerid][pCookSkill], PlayerInfo[playerid][pFishSkill], PlayerInfo[playerid][pSHealth], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pInt], PlayerInfo[playerid][pLocal], PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPnumber]); mysql_format(handle, query, sizeof(query), "House = '%d', Bizz = '%d', HandyGeld = '%d', HandyVer = '%d', Pos_x = '%f', Pos_y = '%f', Pos_z = '%f', CarLic = '%d', NewLic = '%d', FlyLic = '%d', BoatLic = '%d', FishLic = '%d', GunLic = '%d', LKWLic = '%d', RollerLic = '%d', MotoLic = '%d', Zig = '%d', Kekse = '%d', ZigSucht = '%d', Gun1 = '%d', ", query, PlayerInfo[playerid][pPhousekey], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pHandyGeld], PlayerInfo[playerid][pHandyVer], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pCarLic], PlayerInfo[playerid][pNewLic], PlayerInfo[playerid][pFlyLic], PlayerInfo[playerid][pBoatLic], PlayerInfo[playerid][pFishLic], PlayerInfo[playerid][pGunLic], PlayerInfo[playerid][pLKWLic], PlayerInfo[playerid][pRollerLic], PlayerInfo[playerid][pMotoLic], PlayerInfo[playerid][pZig], PlayerInfo[playerid][pKekse], PlayerInfo[playerid][pZigSucht], PlayerInfo[playerid][pGun1]); mysql_format(handle, query, sizeof(query), "Gun2 = '%d', Gun3 = '%d', Gun4 = '%d', Ammo1 = '%d', Ammo2 = '%d', Ammo3 = '%d', Ammo4 = '%d', CarTime = '%d', Mulltime = '%d', PayDay = '%d', PayDayHad = '%d', CDPlayer = '%d', Wins = '%d', Loses = '%d', AlcoholPerk = '%d', DrugPerk = '%d', MiserPerk = '%d', PainPerk = '%d', TraderPerk = '%d', Tutorial = '%d', Warnings = '%d', ", query, PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pGun3], PlayerInfo[playerid][pGun4], PlayerInfo[playerid][pAmmo1], PlayerInfo[playerid][pAmmo2], PlayerInfo[playerid][pAmmo3], PlayerInfo[playerid][pAmmo4], PlayerInfo[playerid][pCarTime], PlayerInfo[playerid][pMulltime], PlayerInfo[playerid][pPayDay], PlayerInfo[playerid][pPayDayHad], PlayerInfo[playerid][pCDPlayer], PlayerInfo[playerid][pWins], PlayerInfo[playerid][pLoses], PlayerInfo[playerid][pAlcoholPerk], PlayerInfo[playerid][pDrugPerk], PlayerInfo[playerid][pMiserPerk], PlayerInfo[playerid][pPainPerk], PlayerInfo[playerid][pTraderPerk], PlayerInfo[playerid][pTut], PlayerInfo[playerid][pWarns]); mysql_format(handle, query, sizeof(query), "Adjustable = '%d', Fuel = '%d', Married = '%d', MarriedTo = '%e', SpawnChange = '%d', WantedLevel = '%d', WantedPoints = '%d', PlayMinutes = '%d', GesamtMinutes = '%d', MinutesSinceAn = '%d', SFPASS = '%d', LVPASS = '%d', Offflucht = '%d', Knast = '%d', Uhr = '%d', Handy = '%d', KnastTime = '%d', Perso = '%d', FrakSperre = '%d', Gehalt = '%d', ", query, PlayerInfo[playerid][pAdjustable], PlayerInfo[playerid][pFuel], PlayerInfo[playerid][pMarried], PlayerInfo[playerid][pMarriedTo], SpawnChange[playerid], WantedLevel[playerid], WantedPoints[playerid], PlayerInfo[playerid][pPlayMinutes], PlayerInfo[playerid][pGesamtMinutes], PlayerInfo[playerid][pMinutesSinceAn], PlayerInfo[playerid][pSFPASS], PlayerInfo[playerid][pLVPASS], OfflineFlucht[playerid], Knast[playerid], PlayerInfo[playerid][pUhrID], PlayerInfo[playerid][pHandyID], KnastTime[playerid], PlayerInfo[playerid][pOwnPerso], PlayerInfo[playerid][pFrakSperre], PlayerInfo[playerid][pGehalt]); mysql_format(handle, query, sizeof(query), "InvWeapon = '%d', InvAmmo = '%d', InvWeapon2 = '%d', InvAmmo2 = '%d', InvMats = '%d', InvDrugs = '%d', FlugTime = '%d', FarmTime = '%d', GDeaths = '%d', GKills = '%d', Meldung = '%d', Tanke = '%d', Zollpass = '%d', ZollpassTime = '%d', Gesperrt = '%d', ", query, PlayerInfo[playerid][pInvWeapon], PlayerInfo[playerid][pInvAmmo], PlayerInfo[playerid][pInvWeapon2], PlayerInfo[playerid][pInvAmmo2], PlayerInfo[playerid][pInvMats], PlayerInfo[playerid][pInvDrugs], PlayerInfo[playerid][pFlugTime], PlayerInfo[playerid][pFarmTime], PlayerInfo[playerid][pGDeaths], PlayerInfo[playerid][pGKills], PlayerInfo[playerid][pMeldung], PlayerInfo[playerid][pPtankekey], PlayerInfo[playerid][pZollPass], PlayerInfo[playerid][pZollPassTime], PlayerInfo[playerid][pGesperrt]); mysql_format(handle, query, sizeof(query), "waffenslot1 = '%d', waffenslot2 = '%d', waffenslot3 = '%d', waffenslot4 = '%d', waffenslot5 = '%d', waffenslot6 = '%d', waffenslot7 = '%d', waffenslot8 = '%d', waffenslot9 = '%d', waffenslot10 = '%d', waffenslot11 = '%d', waffenslot12 = '%d', waffenslot13 = '%d', ", query, Weapons25[0], Weapons25[1], Weapons25[2], Weapons25[3], Weapons25[4], Weapons25[5], Weapons25[6], Weapons25[7], Weapons25[8], Weapons25[9], Weapons25[10], Weapons25[11], Weapons25[12]); mysql_format(handle, query, sizeof(query), "ammoslot1 = '%d', ammoslot2 = '%d', ammoslot3 = '%d', ammoslot4 = '%d', ammoslot5 = '%d', ammoslot6 = '%d', ammoslot7 = '%d', ammoslot8 = '%d', ammoslot9 = '%d', ammoslot10 = '%d', ammoslot11 = '%d', ammoslot12 = '%d', ammoslot13 = '%d' WHERE id = '%d'", query, Ammo25[0], Ammo25[1], Ammo25[2], Ammo25[3], Ammo25[4], Ammo25[5], Ammo25[6], Ammo25[7], Ammo25[8], Ammo25[9], Ammo25[10], Ammo25[11], Ammo25[12], PlayerInfo[playerid][pDB_ID]); mysql_pquery(handle, query, "", "");
Klar ist das gewollt, ich muss ja den Rest der Query übernehmen, damit am ende alles angeschickt wird aber wie gesagt ist gelöst
-
Hey,
ich bräuchte etwas Hilfe, ich möchte aus der Datenbank für die Fraktionen Informationen in einem Dialogfenster auflisten lassen...
Code:
Code
Alles anzeigenif(strcmp(cmd, "/frakinfo", true) == 0) { new str1[145], str2[145], str3[145], str4[145]; for(new i = 0; i < sizeof(FraktionInfo); i++) { if(IsPlayerInFrac(playerid, GetPlayerFaction(playerid)) == FraktionInfo[i][Info_Fraktion]) { if(FraktionInfo[i][Info_id] == 1) format(str2, sizeof(str2), "1. Name: %s", FraktionInfo[i][Info_Name]); if(FraktionInfo[i][Info_id] == 2) format(str3, sizeof(str3), "2. Name: %s", FraktionInfo[i][Info_Name]); if(FraktionInfo[i][Info_id] == 3) format(str4, sizeof(str4), "3. Name: %s", FraktionInfo[i][Info_Name]); } else SendClientMessage(playerid, COLOR_WHITE, "Deine Fraktion ist {FF8484}nicht{FFFFFF} eingetragen!"); break; } format(str1, sizeof(str1), "%s\n%s\n%s\n%s", str2, str3, str4); ShowPlayerDialog(playerid, DIALOG_FRAK_INFO, DIALOG_STYLE_LIST, "FraktionInfo", str1, "Auswählen", "Abbrechen"); return 1; }
Mein Problem ist es nun, dass ich in der Datenbank jede Zeile die richtige Fraktionsid und die Info_id eingetragen habe, die auch geladen werden sollen.
Wenn ich es per Befehl aufrufen möchte wird mir nur der erste Name angezeigt und die restlichen nicht...Hier beim Laden der Daten die prints:
Code[18:23:59] FraktionID: 1 [18:23:59] Info_id: 1 [18:23:59] Info_Name: Testzweck1 [18:23:59] FraktionID: 1 [18:23:59] Info_id: 2 [18:23:59] Info_Name: Testzweck2
Irgendwie wollen die 2 Daten nicht im Dialogfenster aufgelistet werden...
Ich vermute ich habe erneut einen Denkfehler....Kann mir jemand weiterhelfen?
-
Die FraktionID ist beim Laden beides mal die 1. Damit wird das erste vom zweiten Überschrieben.
-
hmmm, stimmt...
Aber, wenn es 3 Zeilen der Frakionen gibt muss ja eingetragen werden zu welcher FraktionsID diese gehört,
damit man dann vergleichen kann ob der Spieler seine FraktionsID übereinstimmt und diese auflistet. -
Jede Fraktion soll 3 verschiedene Info IDs haben, oder wie meinst du das?
-
Jede Fraktion soll 3 verschiedene Info IDs haben, oder wie meinst du das?
ja genau.
Diese können jederzeit InGame bearbeitet werden etc.
Nur das auslesen komme ich nicht weiter -
Dann brauchst du in deinem enum:
Info_id1,
Info_id2,
Info_id3,
Info_Name1[MAX_PLAYER_NAME],
Info_Name2[MAX_PLAYER_NAME],
Info_Name3[MAX_PLAYER_NAME],Sonst kannst du keine drei verschiedenen Namen speichern.
-
Bitte um Hilfe 7 Errors.
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70959) : error 010: invalid function or declaration
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70963) : error 010: invalid function or declaration
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70985) : error 021: symbol already defined: "SetPlayerCameraPos"
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987) : warning 215: expression has no effect
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987) : warning 215: expression has no effect
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987) : error 001: expected token: ";", but found ")"
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987) : error 010: invalid function or declaration
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987 -- 70996) : error 021: symbol already defined: "SetPlayerToPoS"
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987 -- 70996) : fatal error 107: too many error messages on one line]7 Errors.
-
Dann brauchst du in deinem enum:
Info_id1,Info_id2,Info_id3,Info_Name1[MAX_PLAYER_NAME],Info_Name2[MAX_PLAYER_NAME],Info_Name3[MAX_PLAYER_NAME],Sonst kannst du keine drei verschiedenen Namen speichern.
Also dementsprechend auch die Ladefunktion:Code
Alles anzeigenFunction LoadFraktionInfo() { new num_fields, num_rows; cache_get_data(num_rows, num_fields, dbhandle); if(num_rows > 0) { for(new i = 0; i < num_rows; i++) { FraktionInfo[i][I_id] = cache_get_field_content_int(i,"id",dbhandle); FraktionInfo[i][Info_Fraktion] = cache_get_field_content_int(i,"Fraktion",dbhandle); FraktionInfo[i][Info_Rang] = cache_get_field_content_int(i,"Rang",dbhandle); cache_get_field_content(i, "Info_Paket", FraktionInfo[i][Info_Paketname], dbhandle, 50); FraktionInfo[i][Info_Name] = cache_get_field_content_int(i,"InfoID",dbhandle); printf("FraktionID: %i", FraktionInfo[i][Info_Fraktion]); printf("Info_id: %i", FraktionInfo[i][I_id]); printf("Info_Name: %s", FraktionInfo[i][Info_Paketname]); } } return 1; }
zu:
Code
Alles anzeigenFunction LoadFraktionInfo() { new num_fields, num_rows; cache_get_data(num_rows, num_fields, dbhandle); if(num_rows > 0) { for(new i = 0; i < num_rows; i++) { FraktionInfo[i][I_id] = cache_get_field_content_int(i,"id",dbhandle); FraktionInfo[i][Info_Fraktion] = cache_get_field_content_int(i,"Fraktion",dbhandle); FraktionInfo[i][Info_Rang] = cache_get_field_content_int(i,"Rang",dbhandle); cache_get_field_content(i, "Info_Paket1", FraktionInfo[i][Info_Paketname]1, dbhandle, 50); cache_get_field_content(i, "Info_Paket2", FraktionInfo[i][Info_Paketname]2, dbhandle, 50); cache_get_field_content(i, "Info_Paket3", FraktionInfo[i][Info_Paketname]3, dbhandle, 50); FraktionInfo[i][Info_Name1] = cache_get_field_content_int(i,"InfoID1",dbhandle); FraktionInfo[i][Info_Name2] = cache_get_field_content_int(i,"InfoID2",dbhandle); FraktionInfo[i][Info_Name3] = cache_get_field_content_int(i,"InfoID3",dbhandle); printf("FraktionID: %i", FraktionInfo[i][Info_Fraktion]); printf("Info_id: %i", FraktionInfo[i][I_id]); printf("Info_Name: %s", FraktionInfo[i][Info_Paketname]); } } return 1; }
?
//Hinzugefügt:
@walter.BISHOP, könntest du uns noch den Code dazu schreiben dann können wir dir besser helfen -
Bitte um Hilfe 7 Errors.
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70959) : error 010: invalid function or declaration
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70963) : error 010: invalid function or declaration
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70985) : error 021: symbol already defined: "SetPlayerCameraPos"
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987) : warning 215: expression has no effect
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987) : warning 215: expression has no effect
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987) : error 001: expected token: ";", but found ")"
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987) : error 010: invalid function or declaration
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987 -- 70996) : error 021: symbol already defined: "SetPlayerToPoS"
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70987 -- 70996) : fatal error 107: too many error messages on one line]7 Errors.
Code:
Zeile: 70959 if(tuts[playerid] !=999){
Zeile: 70963 if(tuts[playerid] == 2){]
Zeile: 70985 SetPlayerCameraPos(playerid, 470.52, -2045.70, 40.68);
Zeile: 70987 SetPlayerToPoS(playerid, 379.8153,-2033.6333,7.8301); -
-
Code
if(tuts[playerid] != 999) { if(tuts[playerid] == 2) { SetPlayerCameraPos(playerid, 470.52, -2045.70, 40.68); SetPlayerToPos(playerid, 379.8153, -2033.6333, 7.8301); } }
Versuchs mal so
geändert wurde nur:
SetPlayerToPoS zu SetPlayerToPos
und eine gescheifte Klammer war noch der Fehler
Jetzt sind es 9 Errors
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70996 -- 71004) : error 021: symbol already defined: "SetPlayerToPoS"
-
Jetzt sind es 9 Errors
C:\Users\Markus\Desktop\Life of San Andreas\gamemodes\script3.3.2.pwn(70996 -- 71004) : error 021: symbol already defined: "SetPlayerToPoS"Du musst von SetPlayerToPoS zu SetPlayerToPos ändern....