Beiträge von aytef

    Ich wär dafür, dass man Sektionsmoderatoren einstellt, die die gute Serverwerbungen freischalten und die weniger guten halt ablehnen. Und das man unter den Serverwerbungen nicht antworten kann. Ebenfalls sollen dann die Werbung nach einigen Wochen oder Monate automatisch gelöscht werden, sodass andere gute Serverwerbungen auch noch ne Chance haben und nicht in den anderen hinteren Seiten verschluckt werden.

    #Edit:
    Ich habe das Problem behoben, indem ich einfach 26 Spalten mit den TeamIDs erstellt habe.


    Der Inhalt dieses Themas

    Spoiler anzeigen

    Hey Leute.
    Ich wollte etwas was auf Dini war zu MySQL machen und das hab ich dann so gemacht:

    SQL
    public LoadGangmotd(){	 	new string[128];		for(new t = 0; t < MAX_TEAMIDS; t++)		{			format(string, sizeof(string),"SELECT * FROM `gangmotd` WHERE `TeamID` = '%d'", t);			self_mysql_query(string);			mysql_store_result(MySQLConnection);			if(mysql_num_rows(MySQLConnection) != 0)			{				mysql_fetch_row_format(string);				new var[ 128 ];				self_mysql_get_field("Nachricht", var); KassenInfo[t][GangMotd] = strval( var );			}		}	return 1;}public SaveGangmotd(){		new string[128];		for(new t = 0; t < MAX_TEAMIDS; t++)		{			format(string, sizeof(string),"SELECT * FROM `gangmotd` WHERE `TeamID` = '%d'", t);			self_mysql_query(string);			mysql_store_result(MySQLConnection);			new var[768];			format(var, sizeof(var), "UPDATE `gangmotd` SET `Nachricht`='%s' WHERE `TeamID`='%d'", KassenInfo[t][GangMotd], t);			self_mysql_query(var);		}		return 1;}

    Spoiler anzeigen
    Das Problem aber ist - Es speichert nichts ab ?(
    Die Tabelle hab ich so erstellt:

    Es wäre verdammt nett, wenn mir einer dabei helfen könnte.

    Spoiler anzeigen
    Mit freundlichen Grüßen,
    Voxa

    Firerfan: Hier bitte


    Der Speicherbefehl:

    if(strcmp("/saveall", cmd, true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
    SaveAll();
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_KEINADMIN, "*** INFO: Dies ist ein Adminbefehl, du bist kein Admin.");
    }
    }
    return 1;
    }


    Die SaveAll Funktion:

    public SaveAll()
    {
    SendClientMessageToAll(COLOR_ORANGE,""#SERVERFARBE"ACHTUNG! Server wird nur gespeichert, es kann zu kleinen Laggs führen!");
    SavePlayers();
    SaveServer();
    SendClientMessageToAll(COLOR_GRAD2,"Server erfolgreich gespeichert!");
    return 1;
    }


    Die Anderen Funktionen
    - SaveServer

    public SaveServer()
    {
    OnPropUpdate();
    SaveKassenInfo();
    SaveGangAutos();
    SaveStuff();
    SaveGangfightZones();
    SaveGangWarInfos();
    SaveGangmotd();
    SaveGangBNDInfos();
    return 1;
    }


    - SavePlayers

    public SavePlayers()
    {
    ForAllPlayers(i){
    if(IsPlayerConnected(i) && gPlayerLogged[i]){
    if(strcmp(PlayerInfo[i][pForceName], "Niemand", true) != 0)
    {
    SetPlayerName(i,PlayerInfo[i][pForceName]);
    SetPlayerScore(i, PlayerInfo[i][pLevel]);
    }
    PlayerUpdate(i);
    PlayerCarUpdate(i);
    }
    }
    return 1;
    }


    - OnPropUpdate

    public OnPropUpdate()
    {
    new string[128];
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    format(string, sizeof(string),"SELECT * FROM `haeuser` WHERE `HouseID` = '%d'", i);
    self_mysql_query(string);
    mysql_store_result(MySQLConnection);
    if(mysql_num_rows(MySQLConnection) == 0)
    {
    format(string, sizeof(string), "INSERT INTO `haeuser` (`HouseID`) VALUES ('%d')", i);
    self_mysql_query(string);
    }
    mysql_free_result(MySQLConnection);
    new var[768];
    format(var, sizeof(var), "UPDATE `haeuser` SET `Owner`='%s', `Beschreibung`='%s', `Preis`='%d', `HealUpgrade`='%d', `ArmorUpgrade`='%d', `Lock`='%d', `Owned`='%d', `Rooms`='%d', `Rent`='%d', `Rentabil`='%d', `Kasse`='%d', `Level`='%d' WHERE `HouseID`='%d'",
    HouseInfo[i][hOwner],
    HouseInfo[i][hBeschreibung],
    HouseInfo[i][hPreis],
    HouseInfo[i][hHealUpgrade],
    HouseInfo[i][hArmorUpgrade],
    HouseInfo[i][hLock],
    HouseInfo[i][hOwned],
    HouseInfo[i][hRooms],
    HouseInfo[i][hRent],
    HouseInfo[i][hRentabil],
    HouseInfo[i][hKasse],
    //HouseInfo[i][hDate],
    HouseInfo[i][hLevel],
    i);
    self_mysql_query(var);
    }
    for(new i = 0; i < sizeof(BizInfo); i++) //MySQL Speicherung
    {
    format(string, sizeof(string),"SELECT * FROM `buissnes` WHERE `BizID` = '%d'", i);
    self_mysql_query(string);
    mysql_store_result(MySQLConnection);
    if(mysql_num_rows(MySQLConnection) == 0)
    {
    format(string, sizeof(string), "INSERT INTO `buissnes` (`BizID`) VALUES ('%d')", i);
    self_mysql_query(string);
    }
    mysql_free_result(MySQLConnection);
    new var[768];
    format(var, sizeof(var), "UPDATE `buissnes` SET `Owned`='%d', `Owner`='%s', `Message`='%s', `Extortion`='%s', `LevelNeeded`='%d', `BuyPrice`='%d', `EntranceCost`='%d', `Till`='%d', `Locked`='%d', `Products`='%d', `MaxProducts`='%d', `PriceProd`='%d' WHERE `BizID`='%d'",
    BizInfo[i][bOwned],
    BizInfo[i][bOwner],
    BizInfo[i][bMessage],
    BizInfo[i][bExtortion],
    BizInfo[i][bLevelNeeded],
    BizInfo[i][bBuyPrice],
    BizInfo[i][bEntranceCost],
    BizInfo[i][bTill],
    BizInfo[i][bLocked],
    BizInfo[i][bProducts],
    BizInfo[i][bMaxProducts],
    BizInfo[i][bPriceProd],
    i);
    self_mysql_query(var);
    }
    for(new i = 0; i < sizeof(SBizInfo); i++)
    {
    format(string, sizeof(string),"SELECT * FROM `sbuissnes` WHERE `SBizID` = '%d'", i);
    self_mysql_query(string);
    mysql_store_result(MySQLConnection);
    if(mysql_num_rows(MySQLConnection) == 0)
    {
    format(string, sizeof(string), "INSERT INTO `sbuissnes` (`SBizID`) VALUES ('%d')", i);
    self_mysql_query(string);
    }
    mysql_free_result(MySQLConnection);
    new var[768];
    format(var, sizeof(var), "UPDATE `sbuissnes` SET `Owned`='%d', `Owner`='%s', `Message`='%s', `Extortion`='%s', `LevelNeeded`='%d', `BuyPrice`='%d', `EntranceCost`='%d', `Till`='%d', `Locked`='%d', `Products`='%d', `MaxProducts`='%d', `PriceProd`='%d' WHERE `SBizID`='%d'",
    SBizInfo[i][sbOwned],
    SBizInfo[i][sbOwner],
    SBizInfo[i][sbMessage],
    SBizInfo[i][sbExtortion],
    SBizInfo[i][sbLevelNeeded],
    SBizInfo[i][sbBuyPrice],
    SBizInfo[i][sbEntranceCost],
    SBizInfo[i][sbTill],
    SBizInfo[i][sbLocked],
    SBizInfo[i][sbProducts],
    SBizInfo[i][sbMaxProducts],
    SBizInfo[i][sbPriceProd],
    i);
    self_mysql_query(var);
    }
    for(new i = 0; i < sizeof(TankenBizInfo); i++)
    {
    format(string, sizeof(string),"SELECT * FROM `tankstellen` WHERE `TankenBizID` = '%d'", i);
    self_mysql_query(string);
    mysql_store_result(MySQLConnection);
    if(mysql_num_rows(MySQLConnection) == 0)
    {
    format(string, sizeof(string), "INSERT INTO `tankstellen` (`TankenBizID`) VALUES ('%d')", i);
    self_mysql_query(string);
    }
    mysql_free_result(MySQLConnection);
    new var[768];
    format(var, sizeof(var), "UPDATE `tankstellen` SET `Owned`='%d', `Owner`='%s', `Message`='%s', `Extortion`='%s', `LevelNeeded`='%d', `KaufPreis`='%d', `SpritPreis`='%d', `Kasse`='%d', `Locked`='%d', `Products`='%d', `MaxProducts`='%d', `ProdPreis`='%d' WHERE `TankenBizID`='%d'",
    TankenBizInfo[i][TBOwned],
    TankenBizInfo[i][TBOwner],
    TankenBizInfo[i][TBMessage],
    TankenBizInfo[i][TBExtortion],
    TankenBizInfo[i][TBLevelNeeded],
    TankenBizInfo[i][TBKaufPreis],
    TankenBizInfo[i][TBSpritPreis],
    TankenBizInfo[i][TBKasse],
    TankenBizInfo[i][TBLocked],
    TankenBizInfo[i][TBProducts],
    TankenBizInfo[i][TBMaxProducts],
    TankenBizInfo[i][TBProdPreis],
    i);
    self_mysql_query(var);
    }
    return 1;
    }


    - Gangautos

    public SaveGangAutos()
    {
    new string[128];
    for(new i = 0; i < sizeof(GangAutoInfo); i++)
    {
    if(TankSave == 1)
    {
    if(GangAutoInfo[i][cID] != -1)
    {
    GangAutoInfo[i][cTank] = Gas[GangAutoInfo[i][cID]];
    }
    }
    format(string, sizeof(string), "SELECT * FROM `gangautos` WHERE `SlotID` = '%d'", i);
    self_mysql_query(string);
    mysql_store_result(MySQLConnection);
    if(mysql_num_rows(MySQLConnection) == 0)
    {
    format(string, sizeof(string), "INSERT INTO `gangautos` (`SlotID`) VALUES ('%d')", i);
    self_mysql_query(string);
    }
    mysql_free_result(MySQLConnection);
    new var[256];
    format(var, sizeof(var), "UPDATE `gangautos` SET `CarID`='%d', `OwnerID`='%d', `TypID`='%d', `PosX`='%.1f', `PosY`='%.1f', `PosZ`='%.1f', `Rotation`='%.1f', `Farbe1`='%d', `Farbe2`='%d', `Status`='%d', `Tank`='%d', `ReSpawnTime`='%d' WHERE `SlotID`='%d'",
    GangAutoInfo[i][cID],
    GangAutoInfo[i][cOwner],
    GangAutoInfo[i][cTyp],
    GangAutoInfo[i][cPosX],
    GangAutoInfo[i][cPosY],
    GangAutoInfo[i][cPosZ],
    GangAutoInfo[i][cRot],
    GangAutoInfo[i][cColor1],
    GangAutoInfo[i][cColor2],
    GangAutoInfo[i][cStatus],
    GangAutoInfo[i][cTank],
    GangAutoInfo[i][cReSpawnTime],
    //GangAutoInfo[i][cStandTime],
    i);
    self_mysql_query(var);
    }
    return 1;
    }