16.09.2014, 14:31
So, I'm trying to create a house and insert it into the database, yet I'm getting errors, I've tried fixing them yet nothing freaking works.
Here's the code, I'd like an explanation why it doesn't work an how to fix it, thanks
Here's the code, I'd like an explanation why it doesn't work an how to fix it, thanks
pawn Код:
new query[180];
if(dialogid == DIALOG_SET_HOUSE_INTERIOR)
{
if(!response) return SendClientMessage(playerid, 0xFF0000FF, "You chose not to create any house and set an interior for it.");
if(response)
{
switch(listitem)
{
case 0:
{
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid, 1000);
new Float:x, Float:y, Float:z;
new own = 0;
new ownr[MAX_PLAYER_NAME] = "ForSale";
GetPlayerPos(playerid, x, y, z);
mysql_format(g_Write, query, sizeof(query), "INSERT INTO houses (HouseOwner, Owned, Price, PosX, PosY, PosZ, ePosX, ePosY, ePosZ, InteriorID, VirtualWorld) VALUES ('%s', %d, %d,%f, %f, %f, %f, %f, %f, %d, %d)", ownr, own, g_Price, x, y, z, 244.411987, 305.032989, 999.148437, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
mysql_pquery(g_Write, query, "OnHouseCreation_1", "d", playerid);
CreatePickup(1239, 23, x, y, z, -1);
SetTimerEx("HouseTimer_1", false, 1000, "d", playerid);
}
}
}
return 1;
}
return 0;
}