House Problem
#1

I made my House system week ago.Of course first it was only Load and save.No commands for creating houses.When I type /createhouse near one which I create in PHPMyAdmin.The first house disappeard and new one create.I don`t know why.Code is good but I don`t know why first house disappeard and new one create...Also when I take look into PHP my admin there was no row for new house only old one (first house).Here is code take a look please.

pawn Код:
CMD:createhouse(playerid,params[])
{

    new price,Query[256],houseid = GetHouseFreeSlot();
   
    if(pInfo[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR] "embed_white"You are not authorized to use this command!");
    if(sscanf(params, "i", price)) return SendClientMessage(playerid,0xFFBF00FF,"[Usage] {FFFFFF}/createhouse [Price]");

    hInfo[houseid][hPrice] = price;
    GetPlayerPos(playerid,hInfo[houseid][hEnterX],hInfo[houseid][hEnterY],hInfo[houseid][hEnterZ]);
    hInfo[houseid][hInterior] = 12;
    hInfo[houseid][hExitX] = 2807.619873;
    hInfo[houseid][hExitY] = -1171.899902;
    hInfo[houseid][hExitZ] = 1025.570312;
    hInfo[houseid][hWorld] = 0;
    hInfo[houseid][hLocked] = 0;
    hInfo[houseid][hOnSale] = 1;

    format(Query, sizeof(Query),"INSERT INTO `samp_houses` SET \
                                `Owner` = 'None',\
                                `EnterX` = '%f', \
                                `EnterY` = '%f', \
                                `EnterZ` = '%f', \
                                `ExitX` = '%f', \
                                `ExitY` = '%f', \
                                `ExitZ` = '%f', \
                                `World` = '%d', \
                                `Locked` = '%d', \
                                `OnSale` = '%d', \
                                `Price` = '%d'"
,
                                hInfo[houseid][hEnterX],
                                hInfo[houseid][hEnterY],
                                hInfo[houseid][hEnterZ],
                                hInfo[houseid][hExitX],
                                hInfo[houseid][hExitY],
                                hInfo[houseid][hExitZ],
                                hInfo[houseid][hWorld],
                                hInfo[houseid][hLocked],
                                hInfo[houseid][hOnSale],
                                hInfo[houseid][hPrice]);
    mysql_query(Query);
    UpdateHouseLabel(houseid);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)