22.11.2010, 18:34
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==HouseD)
{
if(response)
{
SendClientMessage(playerid,COLOR_WHITE,"Something");
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, HouseD, DIALOG_STYLE_INPUT, "House Price", "Price:", "Accept", "Cancel");
new Float:PosX,Float:PosY,Float:PosZ,str[256],string[256];
LastHouseID(playerid);
GetPlayerPos(playerid,PosX,PosY,PosZ);
format(str,sizeof(str),"%f,%f,%f",PosX,PosY,PosZ);
if(!isNumeric(inputtext) || strval(inputtext)<0 || strval(inputtext)>9999999) return ShowPlayerDialog(playerid, HouseD, DIALOG_STYLE_INPUT, "Houses Price", "Price between 0-99999999", "Accept", "Cancel");
format(string,sizeof(string),"INSERT INTO `rHouses` (`ID`,`Owner`,`Price`, `Lock`,`Level`,`IconPos`,`IntPos`,`Interior`,`Renter`,`RentPrice`) VALUES (%d,'ForSale',%d,'1',0,'%s','2308.79,-1212.88,1048.03',6,'None',-1)",hCount,inputtext,str);
mysql_query(string);
mysql_free_result();
HousePickup[hCount] = CreatePickup(1273, 23, PosX, PosY, PosZ);
new txt[128];
format(txt,sizeof(txt),"You Created House Number %d",hCount);
return SendClientMessage(playerid,COLOR_WHITE,txt);
}
}
return 1;
}