[SAMMELTHREAD] Kleine Scripting Fragen

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
  • so hab ich das jetzt



    switch(Spieler[playerid][pAdmin])
    {
    case 1: format(string,sizeof(string),"Meldung: %s geht in den Probe Supporterdienst.",SpielerName(playerid));
    case 2: format(string,sizeof(string),"Meldung: %s geht in den Supportdienst.",SpielerName(playerid));
    case 3: format(string,sizeof(string),"Meldung: %s geht in den Support Leitungsdienst.",SpielerName(playerid));
    case 4: format(string,sizeof(string),"Meldung: %s geht in den Admindienst.",SpielerName(playerid));
    case 5: format(string,sizeof(string),"Meldung: %s geht in den Super Admindienst.",SpielerName(playerid));
    case 6: format(string,sizeof(string),"Meldung: %s geht in den CommunityManager Dienst.",SpielerName(playerid));
    case 7: format(string,sizeof(string),"Meldung: %s geht in den Admindienst.",SpielerName(playerid));
    case 8: format(string,sizeof(string),"Meldung: %s geht in den Admindienst.",SpielerName(playerid));
    }
    SendClientMessageToAll(NEONGRUEN, string);


  • format(squery,sizeof(squery),"UPDATE accounts SET `WantedDeaths` = '%d', `PhoneBook` = '%d', `LottoNr` = '%d', `Fishes` = '%d', `BiggestFish` = '%d', `Job` = '%d', `Paycheck` = '%d', `Rest` = '%d', `Jailed` = '%d', `JailTime` = '%d', `GangJailed` = '%d', `Mauled` = '%d', `Mats` = '%d', `Drugs` = '%d', `Leader` = '%d', `Punkte` = '%d', `Member` = '%d', `Rank` = '%d', `ContractTime` = '%d', `DetSkill` = '%d',",
    squery,PlayerInfo[playerid][pWantedDeaths],PlayerInfo[playerid][pPhoneBook],PlayerInfo[playerid][pLottoNr],PlayerInfo[playerid][pFishes],PlayerInfo[playerid][pBiggestFish],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pPayCheck],PlayerInfo[playerid][pRest], PlayerInfo[playerid][pJailed], PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pGangJailed],
    PlayerInfo[playerid][pMauled],PlayerInfo[playerid][pMats],PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pLeader],PlayerInfo[playerid][pPunkte], PlayerInfo[playerid][pMember],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pContractTime], PlayerInfo[playerid][pDetSkill]);
    strcat(mainquery, squery);
    strdel(squery, 0, sizeof(squery));

  • Beitrag von Anti. ()

    Dieser Beitrag wurde vom Autor aus folgendem Grund gelöscht: Problem hat sich behoben ().
  • Keine Ahnung was da los war, aber als ich den zuletzt verwendet habe hat er immer zum Crash geführt, jetzt funktioniert der Log.


    Muss wohl den stock falsch angewand haben statt, dass der stock an sich ein Problem war ^^

    SA:MP in 2020?

  • Ja das: format(squery,sizeof(squery),"UPDATE accounts SET `Level` = '%d', `Admin` = '%d', `Ptankekey` = '%d', `DonateRank` = '%d', `Pupgrade` = '%d', `Reg` = '%d', `Sex` = '%d', `Age` = '%d', `Origin` = '%d', `Muted` = '%d', `Exp` = '%d', `Cash` = '%d', `Account` = '%d', `PlayerKreditDauer` = '%d', `PlayerKredit` = '%d', `Crimes` = '%d', `Kills` = '%d', `Deaths` = '%d', `Arrested` = '%d', `ConnectTime` = '%d',",
    PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pPtankekey],PlayerInfo[playerid][pDonateRank],PlayerInfo[playerid][pUpgrade],PlayerInfo[playerid][pReg],PlayerInfo[playerid][pSex],PlayerInfo[playerid][pAge],PlayerInfo[playerid][pOrigin],PlayerInfo[playerid][pMuted],PlayerInfo[playerid][pRespekt],GetPlayerMoney(playerid),PlayerInfo[playerid][pAccount],
    PlayerInfo[playerid][pPlayerKreditDauer],PlayerInfo[playerid][pPlayerKredit],PlayerInfo[playerid][pCrimes],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pArrested],PlayerInfo[playerid][pConnectTime]);
    strcat(mainquery, squery);
    strdel(squery, 0, sizeof(squery));


    format(squery,sizeof(squery),"UPDATE accounts SET `WantedDeaths` = '%d', `PhoneBook` = '%d', `LottoNr` = '%d', `Fishes` = '%d', `BiggestFish` = '%d', `Job` = '%d', `Paycheck` = '%d', `Rest` = '%d', `Jailed` = '%d', `JailTime` = '%d', `GangJailed` = '%d', `Mauled` = '%d', `Mats` = '%d', `Drugs` = '%d', `Leader` = '%d', `Punkte` = '%d', `Member` = '%d', `Rank` = '%d', `ContractTime` = '%d', `DetSkill` = '%d',",
    squery,PlayerInfo[playerid][pWantedDeaths],PlayerInfo[playerid][pPhoneBook],PlayerInfo[playerid][pLottoNr],PlayerInfo[playerid][pFishes],PlayerInfo[playerid][pBiggestFish],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pPayCheck],PlayerInfo[playerid][pRest], PlayerInfo[playerid][pJailed], PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pGangJailed],
    PlayerInfo[playerid][pMauled],PlayerInfo[playerid][pMats],PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pLeader],PlayerInfo[playerid][pPunkte], PlayerInfo[playerid][pMember],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pContractTime], PlayerInfo[playerid][pDetSkill]);
    strcat(mainquery, squery);
    strdel(squery, 0, sizeof(squery));


    format(query,sizeof(query),"UPDATE accounts SET `SexSkill` = '%d', `BoxSkill` = '%d', `LawSkill` = '%d', `MechSkill` = '%d', `JackSkill` = '%d', `CarSkill` = '%d', `NewsSkill` = '%d', `DrugsSkill` = '%d', `CookSkill` = '%d', `FishSkill` = '%d', `pHealth` = '%.2f', `pSHealth` = '%.2f', `Local` = '%d', `Team` = '%d', `Model` = '%d', `Pnumber` = '%d', `Phousekey` = '%d', `Pbiskey` = '%d', `Pos_x` = '%.2f', `Pos_y` = '%.2f', `Pos_z` = '%.2f' WHERE Name = '%s'",
    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][pHealth],
    PlayerInfo[playerid][pSHealth],PlayerInfo[playerid][pLocal],PlayerInfo[playerid][pTeam],PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPhoneNumber],PlayerInfo[playerid][pHouseKey],PlayerInfo[playerid][pBizKey],PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z], pName);
    strcat(mainquery, squery);
    strdel(squery, 0, sizeof(squery));


    mysql_function_query(dbHandle, mainquery, false, "", "");
    strdel(mainquery, 0, sizeof(mainquery));


    //=======: Query 2 :=======//
    format(query,sizeof(query),"UPDATE accounts SET `CarLic` = '%d', `FlyLic` = '%d', `BoatLic` = '%d', `FishLic` = '%d', `GunLic` = '%d', `LKWLic` = '%d', `RollerLic` = '%d', `MotoLic` = '%d', `Zig` = '%d', `Kekse` = '%d', `ZigSucht` = '%d', `CarTime` = '%d',",
    PlayerInfo[playerid][pCarLic],PlayerInfo[playerid][pFlyLic], PlayerInfo[playerid][pBoatLic],PlayerInfo[playerid][pFishLic],PlayerInfo[playerid][pGunLic],PlayerInfo[playerid][pTruckLic],PlayerInfo[playerid][pMotoLic],PlayerInfo[playerid][pRollerLic],PlayerInfo[playerid][pZig],PlayerInfo[playerid][pKekse],PlayerInfo[playerid][pZigSucht],PlayerInfo[playerid][pCarTime]);
    strcat(mainquery, squery);
    strdel(squery, 0, sizeof(squery));
    format(query,sizeof(query),"`Plastiksprengstoff` = '%d', `PayDay` = '%d', `PayDayHad` = '%d', `CDPlayer` = '%d', `Loses` = '%d', `DrugPerk` = '%d', `MiserPerk` = '%d', `PainPerk` = '%d', `AlcoholPerk` = '%d', `TraderPerk` = '%d', `Warns` = '%d', `GWD` = '%d', `Fuel` = '%d', `Married` = '%d', `MarriedTo` = '%s', `InvDrugs` = '%d', `InvMats` = '%d', `FlugTime` = '%d',",
    PlayerInfo[playerid][pPlastikSprengstoff],PlayerInfo[playerid][pPayDay],PlayerInfo[playerid][pPayDayHad],PlayerInfo[playerid][pCDPlayer],PlayerInfo[playerid][pLoses],PlayerInfo[playerid][pDrugPerk],PlayerInfo[playerid][pMiserPerk],PlayerInfo[playerid][pPainPerk],PlayerInfo[playerid][pAlcoholPerk],PlayerInfo[playerid][pTraderPerk],
    PlayerInfo[playerid][pWarns],PlayerInfo[playerid][pGWD], PlayerInfo[playerid][pFuel],PlayerInfo[playerid][pMarried],PlayerInfo[playerid][pMarriedTo],PlayerInfo[playerid][pInvDrugs],PlayerInfo[playerid][pInvMats],PlayerInfo[playerid][pFlugTime]);
    strcat(mainquery, squery);
    strdel(squery, 0, sizeof(squery));
    format(query,sizeof(query),"`ErntTimer` = '%d', `InvadeTime` = '%d', `Roadblock` = '%d', `PlayMinutes` = '%d', `GesamtMinutes` = '%d', `MinutesSinceLogin` = '%d', `MinutesSinceAn` = '%d', `SFPASS` = '%d', `LVPASS` = '%d', `HandyGeld` = '%d', `HandyVer` = '%d', `UhrID` = '%d', `HandyID` = '%d', `OwnPerso` = '%d', `Tx` = '%.2f', `Ty` = '%.2f', `Tz` = '%.2f',",
    PlayerInfo[playerid][pErntTimer],PlayerInfo[playerid][pInvadeTime],PlayerInfo[playerid][pRoadblock],PlayerInfo[playerid][pPlayMinutes],PlayerInfo[playerid][pGesamtMinutes],PlayerInfo[playerid][pMinutesSinceLogin],PlayerInfo[playerid][pMinutesSinceAn],PlayerInfo[playerid][pSFPASS],PlayerInfo[playerid][pLVPASS],PlayerInfo[playerid][pHandyGeld],PlayerInfo[playerid][pHandyVer], PlayerInfo[playerid][pUhrID],
    PlayerInfo[playerid][pHandyID], PlayerInfo[playerid][pOwnPerso],PlayerInfo[playerid][pTx],PlayerInfo[playerid][pTy],PlayerInfo[playerid][pTz],pName);
    strcat(mainquery, squery);
    strdel(squery, 0, sizeof(squery));
    format(query,sizeof(query),"`Gehalt` = '%d',`FrakSperre` = '%d',`BoxMats` = '%d',`BoxDrugs` = '%d',`ban` = '%d',`Tot` = '%d',`FarmTime` = '%d',`GDeaths` = '%d',`GKills` = '%d',`Meldung` = '%d',`EXP` = '%d',`Akku` = '%d',`Fahrzeuge` = '%d',`Online` = '0',`Fahndungslevel` = '%d',`AcceptTickets` = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pGehalt],PlayerInfo[playerid][pFrakSperre],PlayerInfo[playerid][pBoxMats],PlayerInfo[playerid][pBoxDrugs],PlayerInfo[playerid][pban],PlayerInfo[playerid][pTot],PlayerInfo[playerid][pFarmTime],PlayerInfo[playerid][pGDeaths],PlayerInfo[playerid][pGKills],PlayerInfo[playerid][pMeldung],PlayerInfo[playerid][pRespekt],PlayerInfo[playerid][pHandyAkku],PlayerInfo[playerid][pVehicles],WantedLevel[playerid],PlayerInfo[playerid][AcceptTickets],pName);
    strcat(mainquery, squery);
    strdel(squery, 0, sizeof(squery));
    mysql_function_query(dbHandle, mainquery, false, "", "");
    strdel(mainquery, 0, sizeof(mainquery));

  • was is der fehler es muss doch gehen oder nich

    C:\Users\BlackD0wns\Desktop\Selfmade_edit\gamemodes\Script.pwn(63263) : error 001: expected token: ",", but found "."
    C:\Users\BlackD0wns\Desktop\Selfmade_edit\gamemodes\Script.pwn(63263) : error 029: invalid expression, assumed zero
    C:\Users\BlackD0wns\Desktop\Selfmade_edit\gamemodes\Script.pwn(63263) : warning 215: expression has no effect
    C:\Users\BlackD0wns\Desktop\Selfmade_edit\gamemodes\Script.pwn(63263) : warning 215: expression has no effect
    C:\Users\BlackD0wns\Desktop\Selfmade_edit\gamemodes\Script.pwn(63263) : warning 215: expression has no effect
    C:\Users\BlackD0wns\Desktop\Selfmade_edit\gamemodes\Script.pwn(63263) : error 001: expected token: ";", but found ")"
    C:\Users\BlackD0wns\Desktop\Selfmade_edit\gamemodes\Script.pwn(63263) : fatal error 107: too many error messages on one line



    if(listitem==1)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5.0,1482.3235,-1005.3563,26.8159))
    {
    SendClientMessage(playerid,SAMP_WEISS,""ERROR"Du bist nicht in der Bank of San Andreas");
    return 0;
    }

  • Entferne in Zeile 7 und 13 dasUPDATE accounts SET




    Welches ist die Zeile mit den Errors?

    das is die die ich da mit rein gemacht habe wo is den da ein fehler


    also die

    if(listitem==1)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5.0,1482.3235,-1005.3563,26.8159))
    {
    SendClientMessage(playerid,SAMP_WEISS,""ERROR"Du bist nicht in der Bank of San Andreas");
    return 0;
    }

  • Das ist mir klar, aber welches ist die 63263?

    ja er sagt das der fehler wo ganz anders is




    if(listitem==1)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5.0,233.7506,159.2763,1003.0234))
    {
    SendClientMessage(playerid,SAMP_WEISS,""ERROR"Nicht in der Bank!");
    return 0;
    }
    if(Spieler[playerid][pBankSafeSafe] == 1)
    {
    SendClientMessage(playerid,SAMP_WEISS,""ERROR"Sie haben bereits ein Bankschließfach.");
    return 0;
    }
    if(Spieler[playerid][pPersoLic] == 0)
    Hier soll der fehler sein {
    SendClientMessage(playerid,SAMP_WEISS,""ERROR" Sie besitzen keinen Personalausweis.");
    return 0;
    }
    if((GetACMoney(playerid) - 125) < 0)
    {
    SendClientMessage(playerid,SAMP_WEISS,""ERROR" Sie haben nicht genug Geld.");
    return 0;
    }

  • Es kommt immer noch das: [16:14:53 10/30/16] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 (Query: "UPDATE accounts SET `Level` = '1', `Admin` = '1338', `Ptankekey` = '0', `DonateRank` = '0', `Pupgrade` = '0', `Reg` = '2', `Sex` = '1', `Age` = '0', `Origin` = '0', `Muted` = '0', `Exp` = '0', `Cash` = '50000', `Account` = '0', `PlayerKreditDauer` = '0', `PlayerKredit` = '0', `Crimes` = '0', `Kills` = '0', `Deaths` = '1', `Arrested` = '0', `ConnectTime` = '0',`WantedDeaths` = '0', `PhoneBook` = '0', `LottoNr` = '0', `Fishes` = '0', `BiggestFish` = '0', `Job` = '0', `Paycheck` = '0', `Rest` = '0', `Jailed` = '0', `JailTime` = '0', `GangJailed` = '0', `Mauled` = '0', `Mats` = '0', `Drugs` = '0', `Leader` = '0', `Punkte` = '0', `Member` = '0', `Rank` = '0', `ContractTime` = '0', `DetSkill` = '0',")
    [16:14:53 10/30/16] [ERROR] CMySQLQuery::Execute[] - (error #1065) Query was empty (Query: "")