CowTurbo Posted March 5, 2011 Share Posted March 5, 2011 (edited) An edit of JasperNL=D House system Rules: 1.Do not edit this script without asking! 2.Dont say you have make it! This script is maked by JasperNL=D and edited by mR|TurboCow! Install: To install this resource, go to your resources folder, usuly it is: C:/Program Files/MTA San Andreas/Server/Mods/Deathmatch/Resources Download the file from community !!!!!!!!!!Unzip it!!!!!!!!!!!! You must do it before make it work!!! Put the folder to your resources folder Refresh resources Start script, go in server and make house, and have fun Info: This script is based by JasperNL=D Home system. Now it got much edits. Don't say i stole it, i have asked premission to edit it, and upload it to here. Updates: * New House GUI * Lock/Unlock System * 1 Pickup and 1 Marker ( Green/blue house pickup, Entering marker ) * House Making GUI * Sell Price and Street have added * Maybe was something more .. How to make Home? Login using your admin account Press F5 or do /createhome ( Only for admins ) You getted house creting gui Fill in all edits Press Create! button restart script Buy a home! If you got eny problems, ask in comments! Please rate! =D Forgoted to say, do /keyhouse to lock/unlock your home, or do /home to warp to your home Press Mouse 2 when u are creating house to hide cursor/show cursor! Good luck. © mR|TurboCow --------------------------- Change log 1.3.0 Added destroy house command do /destroyHouse for that Added houses reload, no need to restart script enymore! --------------------------- Change log 1.3.2 Fixed Green/blue house bug. Added 3 interiors. --------------------------- Change Log 1.4.0 Added (Un)lock button to house gui, no more /keyhouse using! Added Some settings, see server.lua for them. Now you can chose marker type, marker color, size, and how much houses player can buy ( currently 1 or 2 ) Thx to sE|Villr for idea. Link:https://community.multitheftauto.com/index.php?p=resources&s=details&id=1841 Edited July 9, 2011 by Guest 1 Link to comment
Bullseye_Sing Posted March 8, 2011 Share Posted March 8, 2011 I am a new player, how to Login using my admin account?? please help me Link to comment
Castillo Posted March 8, 2011 Share Posted March 8, 2011 This is not the right topic/section to ask for help, but you can read this manual and you will know how to add yourself as admin. https://wiki.multitheftauto.com/wiki/Server_Manual Link to comment
JasperNL=D Posted March 11, 2011 Share Posted March 11, 2011 Well done marek, now you get a cookie :'D Link to comment
CowTurbo Posted March 11, 2011 Author Share Posted March 11, 2011 choclate one please Link to comment
Resmurf Posted April 25, 2011 Share Posted April 25, 2011 can you make it the marker a arrow to join and exit? that would be nicee cause here i tried and faild enterMarkerType = "corona" -- Default ( corona ) enterMarkerSize = 0.5 -- Default ( 0.5 ) enterMarkerColor = 255, 100, 255 -- Default ( 255,100,255 ) housesCanBuy = 2 -- You can chose 1 or 2, if u but 3,4,5... or 0 then script wont gonna work, dont tell i havent warn you. Default ( 1 ) i chaned the corona to arrow and i get a underground arrow lol Link to comment
CowTurbo Posted April 25, 2011 Author Share Posted April 25, 2011 (edited) enterMarkerType = "arrow" -- Default ( corona ) enterMarkerSize = 1.2 -- Default ( 0.5 ) enterMarkerColor = 255, 100, 255 -- Default ( 255,100,255 ) housesCanBuy = 2 -- You can chose 1 or 2, if u but 3,4,5... or 0 then script wont gonna work, dont tell i havent warn you. Default ( 1 ) houseMarkerHigh = 0.6 -- The 0 point is placed as 'corona' marker normal place. You can move the arrow up(+)/down(-) with it. The arrow gots some sort of bug. If you set it more then 0.5 then it goes underground. Do no what cause it. gResRoot = getResourceRootElement(getThisResource()) function loadAllHouses () local root = xmlLoadFile ("homes.xml") local houseroot = xmlFindChild (root,"houses",0) if (houseroot) then allHouses = {} for i,v in ipairs (xmlNodeGetChildren(houseroot)) do local x = xmlNodeGetAttribute (v,"x") local y = xmlNodeGetAttribute (v,"y") local z = xmlNodeGetAttribute (v,"z") local lx = xmlNodeGetAttribute (v,"lx") local ly = xmlNodeGetAttribute (v,"ly") local lz = xmlNodeGetAttribute (v,"lz") local number = xmlNodeGetAttribute (v,"num") if not (xmlNodeGetAttribute (v,"owner") == "") then local marker = createMarker (tonumber(x),tonumber(y),tonumber(z),"corona",0.8,255,0,0,0) setElementData (marker,"housenumber",tonumber(number)) local marker2 = createMarker (tonumber(lx),tonumber(ly),tonumber(lz+houseMarkerHigh),enterMarkerType,enterMarkerSize,enterMarkerColor,255) setElementData (marker2,"housenumber2",tonumber(number)) pickup = createPickup (tonumber(x),tonumber(y),tonumber(z),3,1272,0) setElementData ( pickup, "housenumber", number ) else local marker2 = createMarker (tonumber(lx),tonumber(ly),tonumber(lz+houseMarkerHigh),enterMarkerType,enterMarkerSize,enterMarkerColor,255) setElementData (marker2,"housenumber2",tonumber(number)) local marker = createMarker (tonumber(x),tonumber(y),tonumber(z),"corona",0.8,0,255,0,0) setElementData (marker,"housenumber",tonumber(number)) pickup = createPickup (tonumber(x),tonumber(y),tonumber(z),3,1273,0) setElementData ( pickup, "housenumber", number ) end -- outputDebugString ("House " .. tostring(number) .. " loaded!") end end end addEventHandler("onResourceStart",gResRoot, loadAllHouses) addEventHandler ("onMarkerHit",getRootElement(), function(hitElement, dimension) if (getElementType (hitElement) == "player") and not (isPedInVehicle (hitElement)) then if (getElementData (source,"housenumber")) then local housenumber = getElementData (source,"housenumber") --outputChatBox (tostring(housenumber),hitElement,255,0,0,false) local root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) if (tostring(xmlNodeGetAttribute (houseRootNode,"owner")) == "") then triggerClientEvent (hitElement,"viewHouseGUIwindow",hitElement,"For Sell!",tostring(xmlNodeGetAttribute (houseRootNode,"cost")),housenumber,tostring(xmlNodeGetAttribute (houseRootNode,"sellprice")),tostring(xmlNodeGetAttribute (houseRootNode,"street"))) xmlUnloadFile (root) else triggerClientEvent (hitElement,"viewHouseGUIwindow",hitElement,tostring(xmlNodeGetAttribute (houseRootNode,"owner")),tostring(xmlNodeGetAttribute (houseRootNode,"cost")),housenumber,tostring(xmlNodeGetAttribute (houseRootNode,"sellprice")),tostring(xmlNodeGetAttribute (houseRootNode,"street"))) xmlUnloadFile (root) end end end end) addEventHandler ("onMarkerHit",getRootElement(), function(hitElement, dimension) if (getElementType (hitElement) == "player") and not (isPedInVehicle (hitElement)) then if (getElementData (source,"housenumber2")) then local housenumber = getElementData (source,"housenumber2") --outputChatBox (tostring(housenumber),hitElement,255,0,0,false) triggerEvent ("HouseSystemEnterHouse",hitElement,housenumber) xmlUnloadFile (root) end end end) addEvent("HouseSystemEnterHouse",true) addEvent("HouseSystemBuyHouse",true) addEvent("HouseSystemSellHouse",true) addEvent("tryInterior",true) addEvent("createhome",true) addEventHandler ("HouseSystemBuyHouse", getRootElement(), function(housenumber) if ( housesCanBuy == 1 ) then local root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) local price = xmlNodeGetAttribute (houseRootNode,"cost") local owner = xmlNodeGetAttribute (houseRootNode,"owner") local sellPrice = xmlNodeGetAttribute (houseRootNode,"sellprice") local street = xmlNodeGetAttribute (houseRootNode,"street") local x,y,z = getElementPosition ( source ) if not (isGuestAccount (getPlayerAccount(source))) then if (owner == "") and (getPlayerMoney (source) >= tonumber(price)) then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local house = getAccountData ( playeraccount, "house" ) if (house ~= "yes" ) then setAccountData ( playeraccount, "house", "yes" ) setAccountData ( playeraccount, "price", price ) setAccountData ( playeraccount, "number", housenumber ) setAccountData ( playeraccount, "sell", sellPrice ) setAccountData ( playeraccount, "street", street ) setAccountData ( playeraccount, "housex", x ) setAccountData ( playeraccount, "housey", y ) setAccountData ( playeraccount, "housez", z ) takePlayerMoney (source,tonumber(price)) xmlNodeSetAttribute (houseRootNode,"owner",getAccountName(getPlayerAccount(source))) outputChatBox ("Congratulations, you are the new owner!",source,255,200,0,false) outputChatBox ("Price: ".. tostring(price) .. "$!",source,255,200,0,false) for i,v in ipairs ( getElementsByType("pickup")) do local number = getElementData ( v, "housenumber" ) if ( number == housenumber ) then setPickupType ( v, 3, 1272 ) end end xmlSaveFile (root) else outputChatBox ("You have house already!",source,255,0,0,false) end elseif not (owner == "") then outputChatBox ("Sorry, This house is already bought!",source,255,0,0,false) elseif (getPlayerMoney (source) < tonumber(price)) then outputChatBox ("Sorry, you are too poor!",source,255,0,0,false) end else outputChatBox ("You are too poor or house is bought!",source,255,0,0,false) end end xmlUnloadFile (root) elseif ( housesCanBuy == 2 ) then local root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) local price = xmlNodeGetAttribute (houseRootNode,"cost") local owner = xmlNodeGetAttribute (houseRootNode,"owner") local sellPrice = xmlNodeGetAttribute (houseRootNode,"sellprice") local street = xmlNodeGetAttribute (houseRootNode,"street") local x,y,z = getElementPosition ( source ) if not (isGuestAccount (getPlayerAccount(source))) then if (owner == "") and (getPlayerMoney (source) >= tonumber(price)) then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local house = getAccountData ( playeraccount, "house" ) if (house ~= "yes" ) then setAccountData ( playeraccount, "house", "yes" ) setAccountData ( playeraccount, "price", price ) setAccountData ( playeraccount, "number", housenumber ) setAccountData ( playeraccount, "sell", sellPrice ) setAccountData ( playeraccount, "street", street ) setAccountData ( playeraccount, "housex", x ) setAccountData ( playeraccount, "housey", y ) setAccountData ( playeraccount, "housez", z ) takePlayerMoney (source,tonumber(price)) xmlNodeSetAttribute (houseRootNode,"owner",getAccountName(getPlayerAccount(source))) outputChatBox ("Congratulations, you are the new owner!",source,255,200,0,false) outputChatBox ("Price: ".. tostring(price) .. "$!",source,255,200,0,false) for i,v in ipairs ( getElementsByType("pickup")) do local number = getElementData ( v, "housenumber" ) if ( number == housenumber ) then setPickupType ( v, 3, 1272 ) end end xmlSaveFile (root) else local house2 = getAccountData ( playeraccount, "house2" ) if (house2 ~= "yes" ) then setAccountData ( playeraccount, "house2", "yes" ) setAccountData ( playeraccount, "price2", price ) setAccountData ( playeraccount, "number2", housenumber ) setAccountData ( playeraccount, "sell2", sellPrice ) setAccountData ( playeraccount, "street2", street ) setAccountData ( playeraccount, "housex2", x ) setAccountData ( playeraccount, "housey2", y ) setAccountData ( playeraccount, "housez2", z ) takePlayerMoney (source,tonumber(price)) xmlNodeSetAttribute (houseRootNode,"owner",getAccountName(getPlayerAccount(source))) outputChatBox ("Congratulations, you are the new owner!",source,255,200,0,false) outputChatBox ("Price: ".. tostring(price) .. "$!",source,255,200,0,false) for i,v in ipairs ( getElementsByType("pickup")) do local number = getElementData ( v, "housenumber" ) if ( number == housenumber ) then setPickupType ( v, 3, 1272 ) end end xmlSaveFile (root) else outputChatBox ( "You cant buy more than 2 houses!", source, 255,0,0 ) end end elseif not (owner == "") then outputChatBox ("Sorry, This house is already bought!",source,255,0,0,false) elseif (getPlayerMoney (source) < tonumber(price)) then outputChatBox ("Sorry, you are too poor!",source,255,0,0,false) end else outputChatBox ("You are too poor or house is bought!",source,255,0,0,false) end end xmlUnloadFile (root) end end) addEventHandler ("HouseSystemSellHouse", getRootElement(), function(housenumber) if ( housesCanBuy == 1 ) then root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) local price = xmlNodeGetAttribute (houseRootNode,"sellprice") local owner = xmlNodeGetAttribute (houseRootNode,"owner") if not (isGuestAccount (getPlayerAccount(source))) then if (owner == getAccountName(getPlayerAccount(source))) then local playeraccount = getPlayerAccount ( source ) setAccountData ( playeraccount, "house", "no" ) setAccountData ( playeraccount, "price", "---" ) setAccountData ( playeraccount, "number", "---" ) setAccountData ( playeraccount, "sell", "---" ) setAccountData ( playeraccount, "street", "---" ) setAccountData ( playeraccount, "housex", "---" ) setAccountData ( playeraccount, "housey", "---" ) setAccountData ( playeraccount, "housez", "---" ) givePlayerMoney (source,tonumber(price)) xmlNodeSetAttribute (houseRootNode,"owner","") xmlNodeSetAttribute (houseRootNode,"lockStatus","unlock") outputChatBox ("Congratulations, you have sold the home!",source,255,200,0,false) outputChatBox ("Obtain: ".. tostring(price) .. "$!",source,255,200,0,false) xmlSaveFile (root) for i,v in ipairs ( getElementsByType("pickup")) do local number = getElementData ( v, "housenumber" ) if ( number == housenumber ) then setPickupType ( v, 3, 1273 ) end end elseif not (owner == getAccountName(getPlayerAccount(source))) then outputChatBox ("This isn't your house!",source,255,200,0,false) end else outputChatBox ("Please log in!",source,255,200,0,false) end xmlSaveFile(root) elseif ( housesCanBuy == 2 ) then local root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) local price = xmlNodeGetAttribute (houseRootNode,"sellprice") local owner = xmlNodeGetAttribute (houseRootNode,"owner") if not (isGuestAccount (getPlayerAccount(source))) then if (owner == getAccountName(getPlayerAccount(source))) then local playeraccount = Edited April 25, 2011 by Guest Link to comment
Castillo Posted April 25, 2011 Share Posted April 25, 2011 You did an empty reply, correct it? Link to comment
CowTurbo Posted April 25, 2011 Author Share Posted April 25, 2011 WTF?! Why the text wasnt apper, i gonna edit it. EDIT: Some admins? Why the text wont apper even when i press edit button there is text ? EDIT2:http://www.mediafire.com/?wl9gyc41u1sdpd2 i have upload it for you, and heres the text down the code which i added to earlier post: I added for you new option. You can chose enter marker high. This is for uping arrow more higher. Change the code from here with your server.lua ( was i'm right ? ) with that one ( if its not server.lua, then its the server side script replace with that one ) Good luck, and thx for choosing housing system The marker is done for you ( size and high is chosen with my eyes, do no does it good for u ? ) Link to comment
AMARANT Posted May 6, 2011 Share Posted May 6, 2011 And where is the link to download the system? Link to comment
diegofkda Posted May 6, 2011 Share Posted May 6, 2011 I am a new player, how to Login using my admin account?? please help me Wrong section! post that in "Scripting" category. Well, nice resource, I liked it (it's like Dakilla's system anyway nice) Link to comment
Castillo Posted May 14, 2011 Share Posted May 14, 2011 I am a new player, how to Login using my admin account?? please help me Wrong section! post that in "Scripting" category. Well, nice resource, I liked it (it's like Dakilla's system anyway nice) No, actually, Dakilla's house system is better, since they have big differences, one uses XML, and the other SQL. Link to comment
CowTurbo Posted May 14, 2011 Author Share Posted May 14, 2011 he means the way of it, like, u are creating houses same way... Link to comment
Castillo Posted May 15, 2011 Share Posted May 15, 2011 Oh yeah, that's kinda same, but has some bugs Link to comment
CowTurbo Posted May 16, 2011 Author Share Posted May 16, 2011 mine have bugs ? tell me ? Link to comment
AMARANT Posted May 16, 2011 Share Posted May 16, 2011 CowTurbo, I have absolutely no idea where I can get your system. There is no link in this topic besides the one with "server.lua" file... I would like to look at this system, thank you in advance. Link to comment
Razerclaus Posted May 16, 2011 Share Posted May 16, 2011 This company is for real.. They make good stuff and I love the freeroam mode. Link to comment
Castillo Posted May 16, 2011 Share Posted May 16, 2011 mine have bugs ? tell me ? Yes it does, but i'm lazy to check download it again. Link to comment
CowTurbo Posted May 16, 2011 Author Share Posted May 16, 2011 This company is for real.. They make good stuff and I love the freeroam mode. Thx. mine have bugs ? tell me ? Yes it does, but i'm lazy to check download it again. Hmm, i havent found ... CowTurbo, I have absolutely no idea where I can get your system. There is no link in this topic besides the one with "server.lua" file... I would like to look at this system, thank you in advance. Im sorry, haven't noticed ur earlyer post, and yeah, i have deleted link by fault. Thx for saying, Link: https://community.multitheftauto.com/index.php?p= ... ls&id=1841 Try out my other resources Link to comment
GameZoneX Posted May 16, 2011 Share Posted May 16, 2011 Isn't working for me. I can't destroy the houses. It still says you can't buy more than 2 houses. Link to comment
CowTurbo Posted May 17, 2011 Author Share Posted May 17, 2011 founded out that if u enter enableHouses = 2 then it isnt working well. if u add 1 then it is. Link to comment
GameZoneX Posted May 17, 2011 Share Posted May 17, 2011 And i can't buy houses. It keeps green, and not going to blue... Link to comment
CowTurbo Posted May 17, 2011 Author Share Posted May 17, 2011 you have added something wrong, tell me what did u do ? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now