What is wrong with this?
#1

I have a command which creates a house in the position set which works but it doesn't get added to the mysql database. I've checked the Debug text and it's successfully executed.
pawn Код:
CMD:createhouse(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 5) {
        new Float:Pos[3], query[512], string[128];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        HouseInfo[houses][hX] = Pos[0];
        HouseInfo[houses][hY] = Pos[1];
        HouseInfo[houses][hZ] = Pos[2];
        HouseInfo[houses][hPrice] = random(100000)+555555;
        format(query, sizeof(query), "INSERT INTO `houses` (`X`, `Y`, `Z`, `Price`) VALUES (%f, %f, %f, %d)", Pos[0], Pos[1], Pos[2], HouseInfo[houses][hPrice]);
        mysql_query(query);
        print(query);
        SendClientMessageToAll(COLOR_WHITE, query);
        HouseInfo[houses][hPickup] = CreateDynamicPickup(1273, 1, Pos[0], Pos[1], Pos[2], -1, -1, -1, 50.0);
        format(string, sizeof(string), "[HOUSE]\n{FFFFFF}Owner: For Sale\nPrice: $%d\nID: %d", HouseInfo[houses][hPrice], houses);
        HouseInfo[houses][hLabel] = CreateDynamic3DTextLabel(string, COLOR_LIGHTBLUE, Pos[0], Pos[1], Pos[2], 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0);
        houses++;
        format(string, sizeof(string), "INFO: {FFFFFF}%s has created a house, house id: %d.", Name(playerid), houses);
        SendClientMessageToAll(COLOR_ORANGE, string);
    }
    else {
        SendClientMessage(playerid, COLOR_GREY, "ERROR: You don't seem to be an admin.");
    }
    return 1;
}
Reply


Messages In This Thread
What is wrong with this? - by Luis- - 24.03.2012, 00:23
Re: What is wrong with this? - by Luis- - 24.03.2012, 00:29
Re: What is wrong with this? - by MP2 - 24.03.2012, 01:55
Re: What is wrong with this? - by fordawinzz - 24.03.2012, 08:51

Forum Jump:


Users browsing this thread: 1 Guest(s)