I want to create a house
#1

Hei all, i want to create a house and i can't use Interior id becouse this is the code, and i don't know how to create it, pls help
PHP код:
INSERT INTO `houses` (`ID`, `Entrancex`, `Entrancey`, `Entrancez`, `Exitx`, `Exity`, `Exitz`, `Owner`, `Discription`, `Value`, `Hel`, `Arm`, `Interior`, `Lockk`, `Owned`, `Rent`, `Rentabil`, `Takings`, `Level`, `Virtual`) VALUES 
Reply
#2

Your missing a bit in that code (the stuff between brackets behind values)
Ontop of that, we dont know what admin or housing system/plugin you run, so we dont know either.

Try be a bit more descriptive
Reply
#3

look here is an example, i have 33 house, but i want more and i don't know how to make..
PHP код:
(11421.85, -885.6450.6647225.941022.691084.01'The State''>>>> <<<<<'500000000700101550), 
Reply
#4

Код:
INSERT INTO `houses` (`ID`, `Entrancex`, `Entrancey`, `Entrancez`, `Exitx`, `Exity`, `Exitz`, `Owner`, `Discription`, `Value`, `Hel`, `Arm`, `Interior`, `Lockk`, `Owned`, `Rent`, `Rentabil`, `Takings`, `Level`, `Virtual`) VALUES (1, 1421.85, -885.64, 50.6647, 225.94, 1022.69, 1084.01, 'The State', '>>>> <<<<<', 5000000, 0, 0, 7, 0, 0, 1, 0, 15, 5, 0)
Just use that string, run it as a query in the database, the keys and values are matching pairs, so for example:
ID = 1
Entrancex = 1421.85
Entrancey = -885.64
etc etc

That said, theres some things to take into account:
- You prolly already have a house with ID 1, so instead, omit ID, and it should auto_increment it (assuming its a properlly set up database table)
- "Discription" seems like a typo, it should prolly be "Description"
- "Lockk" should prolly be "Lock"

Try this:
Код:
INSERT INTO `houses` (`Entrancex`, `Entrancey`, `Entrancez`, `Exitx`, `Exity`, `Exitz`, `Owner`, `Description`, `Value`, `Hel`, `Arm`, `Interior`, `Lock`, `Owned`, `Rent`, `Rentabil`, `Takings`, `Level`, `Virtual`) VALUES (1421.85, -885.64, 50.6647, 225.94, 1022.69, 1084.01, 'The State', '>>>> <<<<<', 5000000, 0, 0, 7, 0, 0, 1, 0, 15, 5, 0)
Reply
#5

Not work
Reply
#6

Can you send me your contact details, I'll contact with you and i'll support on TeamViewer.
Reply
#7

i'm sorry, no
Reply
#8

Good call, that was a very sketchy suggestion from that xRoy feller..
Anyway, share more details, or nobody will be able to help you.
- Are you using a plugin too manage houses? if so, which?
- If you are not using a pre-built housing plugin but wrote one yourself, please show us the pwn file you wrote (or just the bits about housing if you dont wanna share your entire script)
- What kind of database is it? (MySQL, SQLite, etc) and are you sure its acually up and running?
- Can you show us an export of the houses table? (so we can check that the field names are correct etc)
- How did you try to run the query i provided? via an SA-MP script? via something like MySQL Workbench? or maybe even PhpMyAdmin?
Reply
#9

Yes i try, i don't have a plugin to manage houses, i show you now the mysql tabele to house database
PHP код:
CREATE TABLE IF NOT EXISTS `houses` (
  `
IDint(11NOT NULL AUTO_INCREMENT,
  `
Entrancexfloat NOT NULL,
  `
Entranceyfloat NOT NULL,
  `
Entrancezfloat NOT NULL,
  `
Exitxfloat NOT NULL,
  `
Exityfloat NOT NULL,
  `
Exitzfloat NOT NULL,
  `
Ownervarchar(25NOT NULL DEFAULT 'The State',
  `
Discriptionvarchar(50NOT NULL,
  `
Valueint(20NOT NULL,
  `
Helint(11NOT NULL,
  `
Armint(11NOT NULL,
  `
Interiorint(11NOT NULL,
  `
Lockkint(11NOT NULL,
  `
Ownedint(11NOT NULL,
  `
Rentint(11NOT NULL,
  `
Rentabilint(11NOT NULL,
  `
Takingsint(11NOT NULL,
  `
Levelint(11NOT NULL,
  `
Virtualint(11NOT NULL,
  
PRIMARY KEY (`ID`)
ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=58 ;
--
-- 
Salvarea datelor din tabel `houses`
--
INSERT INTO `houses` (`ID`, `Entrancex`, `Entrancey`, `Entrancez`, `Exitx`, `Exity`, `Exitz`, `Owner`, `Discription`, `Value`, `Hel`, `Arm`, `Interior`, `Lockk`, `Owned`, `Rent`, `Rentabil`, `Takings`, `Level`, `Virtual`) VALUES
(11421.85, -885.6450.6647225.941022.691084.01'The State''>>>> <<<<<'500000000700101550),
(
21468.62, -904.89854.8359225.881022.951084.01'The State''De vanzare'55000001071021174651),
(
31539.26, -851.50864.3361235.1881187.541080.26'The State''De vanzare'430000010300111583452),
(
41534.06, -800.18872.8495491.2031399.241080.26'The State''De vanzare'40000001120011118053),
(
51527.3, -773.18880.5781491.2031399.241080.26'STH..Deea''Paradis - dis -dis.'41000001020110154),
(
61497.06, -688.23995.50861262.14, -785.3311091.91'NMD''Blue.qZone.ro'170000001150150001500085),
(
71112.11, -742.075100.133227.0211114.341081'The State''De vanzare'390000010510140430356),
(
81034.74, -812.627101.852447.0431397.91084.3'The State''De vanzare'7000000002001145730178),
(
91094.91, -647.068113.64822.97341404.151084.43'The State''De vanzare'1500000010500111589),
(
10980.352, -676.742121.976140.171366.071083.65'The State''De vanzare'280000001150011108810),
(
11990.004, -828.54795.46861262.14, -785.3311091.91'The State''De vanzare'33000001050021449511),
(
12937.327, -847.40593.7796223.0051287.61082.14'The State''De vanzare'67000001010011478712),
(
13836.166, -894.34168.7689386.4021471.71080.19'The State''De vanzare'420000010150011995513),
(
14827.889, -858.71870.3308376.1361417.341081.33'The State''De vanzare'250000000150011290514),
(
151854.1, -1914.8715.25682259.74, -1135.831050.63'The State''De vanzare'25000001010001147517),
(
161872.32, -1912.3615.25682259.86, -1135.861050.63'The State''De vanzare'250000010100011205518),
(
172191.42, -1276.3725.15632233.57, -1114.621050.88'The State''De vanzare'53000001050011378522),
(
181050.96, -1057.9534.79692237.52, -1081.161049.02'The State''De vanzare'3000000102101131262526),
(
19315.85, -1769.754.6312196, -1204.321049.02'BB.KaTa.KaTaLyN''Casa'90000001160111283828),
(
201331.87, -632.87109.1352317.82, -1026.41050.22'Shoom''>>>.<<<'600000009011014575631),
(
21300.255, -1154.4681.391140.0751367.211083.86'The State''Casa Donat'11051011375459932),
(
22952.289, -909.9945.7656234.1661064.051084.21'The State''Casa Donat'1106001112909936),
(
231378.71, -1753.2214.14062196.09, -1204.051049.02'The State''De vanzare'90000001161011262737),
(
241258.7, -785.37992.0302225.681021.451084.02'The State''Casa Donat'10071010156019940),
(
25254.887, -1366.6953.1094234.191063.731084.21'The State''Cea mai tare casa!! '103000000060011271844),
(
26189.638, -1308.3270.2492225.681021.451084.02'The State''De Vanzare'90000001170010175845),
(
27251.765, -1220.6775.9508235.341186.681080.26'The State''De Vanzare'80000001130011457846),
(
281442.69, -629.35295.7186225.681021.451084.02'The State''Tattaglia Boss'25000000070011457550),
(
29298.488, -1338.0253.4415235.341186.681080.26'The State''De vanzare '1100000010310112135852),
(
30, -691.853939.66613.6328226.31114.241080.99'The State''Casa Donat'11050011289955),
(
31813.187, -1456.6313.988224.04061340.791084.38'The State''De Vanzare'600000010100011247756),
(
32901.021, -1447.3414.1477235.341186.681080.26'The State''De vanzare'45000001130011169565),
(
331411.24, -920.88238.4219140.3251366.661083.86'The State''De vanzare'53000001051011345566); 
this ia sll houses, but i want more becouse i make a map with house,and i want to sell the jouse to players
Reply
#10

Here i founde something:
PHP код:
if (newkeys KEY_SECONDARY_ATTACK)
   {
       new 
string[300];
       if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
       {
           if(
IsPlayerConnected(playerid))
           {
               for(new 
1sizeof(HouseInfo); i++)
               {
                   if(
IsPlayerInRangeOfPoint(playerid,2,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
                   {
                       if(
PlayerInfo[playerid][pPhousekey] == || HouseInfo[i][hLock] == 0)
                       {
                           
SetPlayerInterior(playerid,HouseInfo[i][hInterior]);
                           
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
                           
GameTextForPlayer(playerid"~w~Welcome Home"50001);
                           
PlayerInfo[playerid][pInt] = HouseInfo[i][hInterior];
                           
PlayerInfo[playerid][pLocal] = i;
                           
SetPlayerVirtualWorld(playerid,HouseInfo[i][hVirtual]);
                           
InHouse[playerid] = i;
                       }
                       else
                       {
                           
GameTextForPlayer(playerid"~r~~h~Locked"50001);
                       }
                   }
               } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)