Jump to content
  • 0

Problema /createhouse


lordhell12

Question

Problema intalnita (descriere):Cand creez o casa cu comanda /createhouse,dupa ce dau restart nu se salveaza.
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul(obligatoriu):

CMD:createhouse(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You need to be RCON Admin to use this command!");
	//--------------------------------------------------------------------------
	new HouseCost, H, Float:X, Float:Y, Float:Z, DD[512]; eString[0] = EOS; eQuery[0] = EOS;
	//--------------------------------------------------------------------------
	if(sscanf(params, "i", HouseCost)) return SendUsage(playerid, "/CreateHouse [Cost]");
	//--------------------------------------------------------------------------
	GetPlayerPos(playerid, X, Y, Z);
	//--------------------------------------------------------------------------
	format(eQuery, 512, "INSERT INTO `Houses`(`ID`, `HouseName`, `HouseCost`, `HouseSell`, `HouseInterior`, `HouseLocked`, `HouseIntX`, `HouseIntY`, `HouseIntZ`, `HouseX`, `HouseY`, `HouseZ`, `HouseRent`) VALUES (0,'ForSale',%d,%d,0,1,0.00,0.00,0.00,%.2f,%.2f,%.2f,0,0.00,0.00,0.00,0)", HouseCost, HouseCost / 2, X, Y, Z);
	mysql_tquery(DB_Connect, eQuery, "OnHouseCreated", "i", H);
    //--------------------------------------------------------------------------
  	format(HouseInfo[H][Name], 24, "ForSale");
	HouseInfo[H][Rent] = 1000;
	HouseInfo[H][Cost] = HouseCost;
	HouseInfo[H][Sell] = HouseCost / 2;
	HouseInfo[H][Interior] = 0;
	HouseInfo[H][Locked] = 1;
	HouseInfo[H][InteriorX] = 0.00;
	HouseInfo[H][InteriorY] = 0.00;
	HouseInfo[H][InteriorZ] = 0.00;
	HouseInfo[H][HX] = X;
	HouseInfo[H][HY] = Y;
	HouseInfo[H][HZ] = Z;
	//--------------------------------------------------------------------------
	HousePickup[H] = CreateDynamicPickup(1273, 1, HouseInfo[H][HX], HouseInfo[H][HY], HouseInfo[H][HZ]);
	//--------------------------------------------------------------------------
	format(DD, 512, "{FF0000}House\n\
					 {1DEE01}Owner: {00BBF6}ForSale\n\
					 {1DEE01}House Cost: {00BBF6}%d Coins\n\
					 {1DEE01}Type {FF9900}/House {1DEE01}for more.", HouseInfo[H][Cost]);
	//--------------------------------------------------------------------------
    housei[H] = CreateDynamic3DTextLabel(DD, ~1, HouseInfo[H][HX], HouseInfo[H][HY], HouseInfo[H][HZ], 30.0);
	//--------------------------------------------------------------------------
	SetPlayerPos(playerid, X - 5, Y, Z), SendClientMessage(playerid, COLOR_YELLOW, "House Created.");
    //--------------------------------------------------------------------------
	strcat(eString, "Madd Doggs Mansion (5)\n\
					 The Johnsons House (3)\n\
                     Verdant Bluffs Safehouse (8)\n\
                     Hashbury House (10)\n\
                     Golden Bed Motel Room (9)\n");
    strcat(eString, "Big Smoke's Crack Palace (2)\n\
    				 House 1 (3)\n\
                     House 2 (2)\n\
                     House 3 (1)\n\
                     House 4 (7)\n");
    strcat(eString, "House 5 (15)\n\
                     House 6 (15)\n\
                     House 7 (15)\n\
  		             Ryder's House (2)\n\
				     Sweets House (1)\n\
				     Jefferson Motel (15)");
	//--------------------------------------------------------------------------
    return ShowPlayerDialog(playerid, DIALOG_HOUSE_INTERIOR_CHANGE, DIALOG_STYLE_LIST, "{FFFFFF}House Interior", eString, "Select", "Cancel");
}


Imagini / Video (optional):
Ati incercat sa rezolvati singur?:Nu,pentru ca nu prea ma pricep.

Edited by lordhell12
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.