Mysql r39 to r6
#1

Hello I have some code's my gamemode is compitable with r6 anyone can help me pls for converting this codes to r6 ?

pawn Код:
new query[128];
        mysql_format(SQLHandle, query, sizeof(query), "INSERT INTO housevisitors SET HouseID=%d, Visitor='%e', Date=UNIX_TIMESTAMP()", id, name);
        mysql_tquery(SQLHandle, query, "", "");
pawn Код:
new query[64];
    mysql_format(SQLHandle, query, sizeof(query), "DELETE FROM houseguns WHERE HouseID=%d", id);
    mysql_tquery(SQLHandle, query, "", "");
pawn Код:
mysql_format(SQLHandle, query, sizeof(query), "DELETE FROM housefurnitures WHERE HouseID=%d", id);
    mysql_tquery(SQLHandle, query, "", "");
   
    mysql_format(SQLHandle, query, sizeof(query), "DELETE FROM housevisitors WHERE HouseID=%d", id);
    mysql_tquery(SQLHandle, query, "", "");
pawn Код:
new query[256];
    mysql_format(SQLHandle, query, sizeof(query), "UPDATE houses SET HouseName='%e', HouseOwner='%e', HousePassword='%e', HouseLock=%d, HouseMoney=%d, LastEntered=%d WHERE ID=%d",
    HouseData[id][Name], HouseData[id][Owner], HouseData[id][Password], HouseData[id][LockMode], HouseData[id][SafeMoney], HouseData[id][LastEntered], id);
    mysql_tquery(SQLHandle, query, "", "");
pawn Код:
new rows = cache_num_rows();
    if(rows)
    {
        new id, loaded, owned, label[256];
        while(loaded < rows)
        {
            id = cache_get_field_content_int(loaded, "ID");
            cache_get_field_content(loaded, "HouseName", HouseData[id][Name], .max_len = MAX_HOUSE_NAME);
            cache_get_field_content(loaded, "HouseOwner", HouseData[id][Owner], .max_len = MAX_PLAYER_NAME);
            cache_get_field_content(loaded, "HousePassword", HouseData[id][Password], .max_len = MAX_HOUSE_PASSWORD);
            HouseData[id][houseX] = cache_get_field_content_float(loaded, "HouseX");
            HouseData[id][houseY] = cache_get_field_content_float(loaded, "HouseY");
            HouseData[id][houseZ] = cache_get_field_content_float(loaded, "HouseZ");
            HouseData[id][Price] = cache_get_field_content_int(loaded, "HousePrice");
            HouseData[id][Interior] = cache_get_field_content_int(loaded, "HouseInterior");
            HouseData[id][LockMode] = cache_get_field_content_int(loaded, "HouseLock");
            HouseData[id][SafeMoney] = cache_get_field_content_int(loaded, "HouseMoney");
            HouseData[id][LastEntered] = cache_get_field_content_int(loaded, "LastEntered");
Reply
#2

Anyone can help me please ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)