26.11.2016, 16:39
I've made a /createhouse command and it doesn't work..
This is my house info:
How can i solve this?
Код:
CMD:createhouse(playerid, params[]) { new query[1000]; new house; new Float:iX, Float:iY, Float:iZ; // These end up being empty floats new Float:X, Float:Y, Float:Z; // These end up being the players position but used for the exit new level, value, idi; if(sscanf(params,"dfffdd",idi,iX,iY,iZ,level, value)) return SendClientMessage(playerid, COLOR_WHITE, "{B8DBFF}Synthax: [IDinterieur] [Interieur] [Level] [Prix]"); GetPlayerPos(playerid, X,Y,Z); HouseInfo[house][hEntrancex] = iX; HouseInfo[house][hEntrancex] = iY; HouseInfo[house][hEntrancex] = iZ; HouseInfo[house][hExitx] = X; HouseInfo[house][hExity] = Y; HouseInfo[house][hExitz] = Z; HouseInfo[house][hLevel] = level; HouseInfo[house][hInterior] = idi; HouseInfo[house][hID] = HouseInfo[house][hVirtual]; HouseInfo[house][hValue] = value; HouseInfo[house][hHel] = 0; HouseInfo[house][hArm] = 0; HouseInfo[house][hLock] = 1; HouseInfo[house][hOwned] = 0; HouseInfo[house][hOwner] = 0; HouseInfo[house][hTakings] = 0; HouseInfo[house][hRent] = 0; HouseInfo[house][hRentabil] = 0; CreatePickup(1273, 1, iX, iY, iZ, -1); strmid(HouseInfo[house][hOwner], "The State", 0, strlen("strlen"), 255); format(query,sizeof(query), "INSERT INTO `houses`(`ID`, `Entrancex`, `Entrancey`, `Entrancez`, `Exitx`, `Exity`, `Exitz`, `Owner`, `Discription`, `Value`, 'Hel', 'Arm', `Interior`, `Lockk`, `Owned`, `Rent`, `Rentabil`, `Takings`, `Level`, `Virtual`) VALUES ('%d', '%f', '%f', '%f', '%f', '%f', '%f', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", idi, X,Y,Z,iX,iY,iZ,hOwner,hDiscription,hValue,hHel,hArm,hInterior,hLock,hOwned, hRent,hRentabil,hTakings,hLevel,hVirtual); mysql_query(SQL,query); return 1; }
Код:
enum hInfo { hID, Float:hEntrancex, Float:hEntrancey, Float:hEntrancez, Float:hExitx, Float:hExity, Float:hExitz, hOwner[25], hDiscription[64], hValue, hHel, hArm, hInterior, hLock, hOwned, hRent, hRentabil, hTakings, hLevel, hVirtual }; new HouseInfo[57][hInfo];