Jump to content

Search the Community

Showing results for tags 'san andreas'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 22 results

  1. Coopera San Andreas Online Gang War And Police Server Main Language: Arabic (Other languages could be spoken through our language-chat) Server Game-mode: Gang War Server IP: mtasa://23.88.73.88:35369 Discord Link: Click Here :سيرفر حرب العصابات تبع ميمون كاش https://www.youtube.com/@MimounX Gangs: { 11 Gangs } https://i.postimg.cc/2j4LsQ3X/Gangs.png Gangs Clothes: https://i.postimg.cc/Ss9VFnz7/Gangs-Clothes.png Some Gangs Headquarters: Police: https://i.postimg.cc/PJ4WTYfZ/Police1.png https://i.postimg.cc/sf99YdPX/Police2.png Vagos: https://i.postimg.cc/26jjgZtg/Vagos.png Triads: https://i.postimg.cc/bJ6YPvcr/Triads.png Rifa: https://i.postimg.cc/8P7c1LCS/Rifa.png Jobs: Cleaner Job Dustman Job Icecream Job Pizza Job Towtruck Job https://i.postimg.cc/xdvqwY1N/Pizza-Job1.png https://i.postimg.cc/J40DG9PS/Pizza-Job2.png Rob Bank: https://i.postimg.cc/VvpYSHNc/Bank-rob1.png https://i.postimg.cc/gJ0dgPXW/Bank-rob2.png Clothes Store: https://i.postimg.cc/RCXJCMQc/Clothes-Store1.png https://i.postimg.cc/J0D8Wc5Y/Clothes-Store2.png Ammunition Store: https://i.postimg.cc/gJBp5B86/Ammunition-Store1.png https://i.postimg.cc/J0GrzWMq/Ammunition-Store2.png Pizza Shop: https://i.postimg.cc/W1r4ZjrY/Pizza-Shop.png and you can to play DeathMatch: https://i.postimg.cc/QCyMQd0w/Death-Match.png Map DeathMatch: https://i.postimg.cc/Gms4jv0Q/Death-Match-Map1.png https://i.postimg.cc/zfZV2381/Death-Match-Map2.png https://i.postimg.cc/8c2SkJyp/Death-Match-Map3.png "والمزيد من الاشياء رح اخليكم تستكشفونها في سيرفر اتمنى ان يعجبكم محتوى السيرفر ورح تكون هناك تحديثات قوية ومستمرة انشاء الله " |* مع السلامة *| --
  2. Hey Gamers, yes i am making a new server and yes its sound dumb because there are alot of servers now but im gonna do it. Guys im planing to make an international server, and i got some questions to ask from you guys because you guys are experts in this. 1.What host you recommend me to start? I need some cheap hosting. 2.Is there any other website where i can get resources for MTA rather than this website? 3.i couldn't find a character makimg system, can someone please tell me where i can get a character making system?. 4.is there a readymade RP server resources? Is available can i please get a link?.
  3. İP: mtasa://213.238.166.21:22003 GoodFellas Roleplay Kaliteli MTA:SA Roleplay Sunucusu Türk/Medium/Global/Sesli Discord Adresi:https://discord.gg/G3shD4ksMC
  4. Hi everybody, I'll start to publish my creations here in this forum. Today I show off this modelling. Replaces the circus hotel of Las Venturas by a cinema based on a real life building. The cinema screen is a resource called: Loki's Cinema Experience, you can find it in the mta community. Please contact me by Discord: Andrewss2#2404. UNIQUE DISCORD!!!!. Images:
  5. Hi, I'll showcase in this post the custom maps & 3D models that are available on the San Andreas Roleplay server (you can find the link for + info in my signature). 1. New roads near Angel Pine Remodelled the mountain terrain near the Angel Pine junkyard adding a paved road and a dirt road next to it. Seamless textures. Fits the game's atmosphere. Perfect collisions. BEFORE: AFTER: 2. New Palomino wooden bridge Remodelled the Palomino terrain that includes: - a wooden bridge that has flawless collisions and perfect textures - fixed the famous collision bug on the red bridge next to it BEFORE: AFTER: More creative 3D models and other interesting maps will be added to this post in the future.
  6. PAY METHOD: PAYPAL. PRICE: TALKING WITH CLIENT. Hi, I made this project a month ago, and finally is finished. I've recreated the Dubai's Audi Terminal (Audi Dubai Showroom Al Nabooda Automobiles LLC), in a 3D Model for GTA San Andreas, I tried to texturize the most HD possible, but you can change it whenever you want from the TXD file. If you want to load this model in your roleplay server of MTA (Multi Theft Auto), contact me on DISCORD! My user is below: ---[[[[[[[[[[[[[[[[[[[[[----Andrewss2#2404----]]]]]]]]]]]]]]]]]]]---- If you want the map (Decoration) too, let me know and we can make a deal. Details of the model on Discord :), feel comfortable asking me!. See ya :D. Shaders were used in the video: MTA San Andreas - Carshow Audi [Model 3D] - Vídeo Dailymotion
  7. Code: Website: http://www.nfssa.com IP: 178.33.54.30:20256 Slots: 350 Discord: https://discord.gg/QA7sXce A Need For Speed: San Andreas valójában NFS az MTA-ban. Ez egy olyan játékmód ami a NFS UG/UG2 alapján készült. Ez itt a garázsod. Erről a helyről tudsz a versenyekre jelentkezni,szabad módban bejárhatod a várost,tuningolhatod/testreszabhatod az autódat,talákozhatsz a barátaiddal illetve a többi játékossal, lecserélheted a kocsidat bármelyikre amelyiket már megvetted,nézd meg a statisztikádat és a helyezésedet és más emberek/barátaid helyézéseit,nézd meg a kocsid jelenlegi állását,kihívásaidat/napi kihívásaidat. A Need For Speed: San Andreas-ban 5 féle verseny található: A Sprint versenyek egyszerü egykörös versenyek ahol ponttól pontig tart a verseny. Az győz aki elsőnek halad át a célvonalon A Circuit versenyek hasonlóak a Sprint versenyekhez csak több körösek A Drift rendszer a saját script rendszerünk szerint működik. Teljesen új irányítás,pontszorzó és kritikus zónák. A Drag rendszer teljesen új. Ugyan olyan mint a UG/UG2-ben. Drag-ban manuális a sebesség váltás a + al fel illetve a - al le tudsz váltani. A Drag lényege, hogy a legjobb pillanatban váltsunk. Válthatsz: korán,jókor,tökéletesen,későn. Törekedj arra hogy mindig a lehetőleg legjobban válts az az tökéletesen. Street-X versenyek rövid versenyek Drift pályákon ahol nem használhatsz nitrót. A Szabad módban tuningolhatod/testreszabhatod az autódat,talákozhatsz a barátaiddal illetve a többi játékossal. 5 különböző tuning bolt/műhely van: kaszni bolt,festő műhely,tuning műhely,kiegészítő bolt,autó kereskedés. Kaszni Bolt Itt testreszabhatod a kocsid kaszniját. Leválthatod a lökhárítód,tehetsz rá spoilert,leválthatod a felniket. Hogy feloldj dolgokat mint például a lökhárítót,testcsomagokat,spoilereket szükséged lesz Body pontokra. Ezeket a pontokat véletlenszerűen kapsz versenyek után. Festő Műhely Itt testreszabhatod a kocsid kinézetét. Megváltoztathatod a kocsid színét,felnik színét,rakhatsz rá matricákat illetve fóliákat (Ezek mind ingyenesek). Tuning Bolt Itt növelheted a kocsid teljesítményét. 3 különböző féle tuningcsomag van: motor, kezelhetőség, gyorsulás. Minden csomagnak 3 szintje van: Utcai, Verseny, Profi. Akkor növelheted a teljesítményed miután elég reputation-t az az Hírnév Pontot szereztél (az első utcai csomaghoz nem szükséges Hírnév). Kiegészítő Bolt Itt tehetsz a kocsidra neont, leváthatod a lámpáid színét, ablakok színét illetve a sebességmérőd és annak színét. Autó Kereskedés Itt megveheted az alap illetve a Hírnév pontból feloldott kocsikat. Úgy mehetsz vissza a garázsodba ha elmész a Garázshoz . Ha megakarod változtatni a kezdőhelyedet elmehetsz egy másik Garázshoz és legközelebb onnan fogsz indulni. Az Előrehaladás a reputation-ön az az a Hírnévpontokon alapszik. Hírnévpontokat bármilyen versenyben szerezhetsz. Következő Autó ez a Sáv mutatja, hogy mennyi hírnév kell még, hogy felold az adott kocsit. Sáv belső ez a sáv azt mutatja hogy mennyi hírnév kell hogy felold a következő teljesítmény csomagot. Kétféle különböző feladat tipus létezik: GGlobális és Napi. Globális a feladatok egyszerűek amiket a versenyek során illetve szabad módban teljesíthetsz. Minden globális feladatért Task point az az Feladat Pont jár. Napi ezek a feladatok naponta csak egyszer teljesíthetőek valamint jutalmul Vinyl Pontot az az Fólia Pontot kapsz. Jutalmak itt feloldhatsz dolgokat Feladat Pont és Fólia Pont ból. Minden Feladat Pont beváltható a következőkre: Kártya,2 Kaszni Pont,Véletlenszerű Sebességmérő,1000$,vagy egy Fóliára. Mi van a kártyákkal? Nos a kártyák különböző dolgokat oldanak fel minden autódra: Festés Tipusokat: Metál,Matt. 6 Féle felnit, fényes és villogó neonokat, sötét és gyöngyház ablakokat, fényes lámpákat, egyéb fóliákat, tető nyílásokat vagy carbon részeket.Fólia Pontok Beválthatod őket Fóliákra. Az autók különböző osztályokra vannak beosztva. Jelenleg 6 osztály van: E, D, C, B, V és U. Ezek az autók találhatóak az osztályokban: E: Intruder, Bravura, Primo, Manana, Washington D: Vincent, Emperor, Previon, Cadrona, Fortune C: Sentinel, Uranus, Blista Compact, Euros, Flash B: ZR-130, Sultan, Jester, Elegy V: Hermes, Broadway, Hustler U: Futo, Buggy, Monroe, Mamba E-től V-ig Osztály Hírnévpontokkal elérhető. Az U Osztály csak különleges módon érhető el mégozzá autórészek gyűjtésével. A szerveren egy különleges feloldó rendszer van az U Osztály autóihoz. Hogy felold őket meg kell találnod 10 alkatrészt hogy felold ezeket az autókat. 50 különböző lelőhelyük van minden egyes autónak ami minden játékosnak teljesen véletlenszerű. Megtalálhatod az alkatrészeket a térképen amit a Különleges Autók fülön találsz és bizonyos kijelőlt pontokon vannak. Előrehaladás és Jutalmak. Web felhasználói panel egy teljesen új funkció. hozzákötheted a játékbéli accountodat/fiókodat a weboldalon lévő accountoddal/fiókkal hogy hozzájuss néhány exta tartalomhoz. megnézheted a versenyzőid statisztikáit,barátaid statisztikáit és a ranksorolásokat is. A játékbéli garázsban feltöltheted a kocsid fotóját amit megnézhetsz később a veboldalon. valamint megnézheted más emberek garázsait,megnézheted az autóikat illetve az előrehaladásukat is. Egy új funkció bemutatása - Kezdő Bónusz. ez a funkció segíteni fogja az új játékosokat Hírnévvel és Pénzel($). Valamint Csökkentettük a szükséges Hívrnévpontot minden autónál, hogy könnyebben elérhetőek legyenek mindenkinek hogy ne keljen túlontúl sokat játszania érte. Hogy a szervert életbe tudjuk tartani létrehoztunk egy szolgáltatást a Prémium Accountot. Jelenleg 2 módja van hogy Prémium Accountot vásárolj: Megveheted SMS-ben illetve Paypal-on keresztül,vagy megkaphatod mint jutalom szerver eseményeken/Event-eken amiket mi szervezünk . A Prémiumos felhasználók ezeket a bónuszokat élvezhetik: Hozzáadhatod a saját zene számaidat a lejátszási listához Bármennyi autód lehet a garázsodban Bármennyi versenyzőt kreálhatsz Segítség az autódarabok gyűjtésében a különleges autókhoz (U osztály) Testreszabható név szín Megvátoztathatod a versenyződ nevét illetve kinézetét (7 naponta 1x) +6 Fólia réteg(több matricát illetve fóliát tehetsz az autódra) +10% Hírnévpont(RP) és Pénz bónusz a versenyek után Mikor eladod a kocsidat a kocsi értékének 70% a helyett 85% ot kapsz Privát üzenet beállítások (spammerek blokkolása stb.) Találkozzunk Need For Speed: San Andreas..on Ezek a leírások több mint egy évesek,azóta rengeteget fejlődött a szerver,bármi kérdésetek lenne írjatok nyugodtan.
  8. I have one question about client objects, if I use the "TriggerClientEvent" function on the server side script, whether the object that was saved on the client side and will be set with the triggerClientEvent function on the server side, will every player see it and will work in the same way as normally I would call it in the server side script "createObject (object, x, y, z)"? For example, such -- client addEvent("createObject", true) addEventHandler("createObject", root, function(object, x, y, z) createObject(x, y, z) end ) -- server triggerClientEvent(root, "createObject", root, 1372, 0, 0, 5) -- Would that be the same as this? -- server createObject(1372, 0, 0, 5)
  9. I have a problem with my script and I don't know what the problem is, in the debug I write to me that in line 6,7 there is arg 1 in "nil" and I don't know why what's going on? local screenW, screenH = guiGetScreenSize() function CommuncationMouse() local cursrox, cursory = getCursorPosition() local cursrox = tonumber(cursrox) local cursory = tonumber(cursory) dxDrawImage(cursrox, cursory, screenW * 0.0766, screenH * 0.0593, ":test/guiBackgroundLongsquareLines.png", 0, 0, 0, 255, 0, 0, 255), true) dxDrawImage(cursrox, cursory, screenW * 0.0766, screenH * 0.0593, ":test/guiBackgroundLongsquare.png", 0, 0, 0, tocolor(0, 0, 0, 150), false) dxDrawText("TEST", (cursrox) - 1, (cursory) - 1, (screenW * 0.3948) - 1, (screenH * 0.1657) - 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("TEST", (cursrox) + 1, (cursory) - 1, (screenW * 0.3948) + 1, (screenH * 0.1657) - 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("TEST", (cursrox) - 1, (cursory) + 1, (screenW * 0.3948) - 1, (screenH * 0.1657) + 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("TEST", (cursrox) + 1, (cursory) + 1, (screenW * 0.3948) + 1, (screenH * 0.1657) + 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("TEST", cursrox, cursory, screenW * 0.3948, screenH * 0.1657, tocolor(255, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) end
  10. Guys when i open the game from steam, everything works fine but when I open it from mta client it says that cannot find my audio card. Plz help me fix this i have already installed the latest drivers and I don't know what to do. "Grand Theft Auto SA cannot find Audio card installed" My MTA Diag results: https://pastebin.mtasa.com/796172962
  11. When I'm installing mta they tell me that ,,a valid windows version of gta san andreas was not detected. However the installation will continue''. When it's already installed I try to launch it and then the another notification comes up: ,,It appears you have a Steam version of gta sa''. The problem is that I have a CD version of San Andreas, I've never had a steam version. Do you know how to fix it?
  12. Всем привет! Поглядываю я на MTA и вспоминается мне игра All Point Bulleting! вот подумываю сделать полную копию этой игрушки на MTA! что скажите ? никто не хочет объединиться и заняться со мной данным проектом ? к примеру интерфейс, HUD, автомобили, города, вытянуть с Unreal Engine и перенеси в GTASA не проблема а вот на счёт сценария игры не знаю, кто сталкивался ? возможно ли скриптами написать свой сценарий игры ? взаимодействовать его в онлайне ? на сколько это тяжело ?
  13. Hello everyone! As the title says I made a frag montage pubg in mta https://youtu.be/8Baaddm3CaI ►IP MTA: mtasa://185.158.114.144:23003 ►Music Used: ►Lenka Blue Skies REVOKE Remix ►Two Feet Go F*ck Yourself
  14. Hi. I reaally need help with interior-system and interior-manager files in United Gaming file resources. I dont know how to scripting but i know the problem. When i enter and exit any building i cant get in any car. But when i restart interior-system script i will get in all the cars. What should i do ? this is interior system.lua server based. addEvent("onPlayerInteriorChange", true) intTable = {} safeTable = {} mysql = exports.mysql -- to check: -- payday -- to test -- /sell --[[ Interior types: TYPE 0: House TYPE 1: Business TYPE 2: Government (Unbuyable) TYPE 3: Rentable --]] -- Small hack function setElementDataEx(source, field, parameter, streamtoall, streamatall) exports['anticheat-system']:changeProtectedElementDataEx( source, field, parameter, streamtoall, streamatall) end -- End small hack function SmallestID( ) -- finds the smallest ID in the SQL instead of auto increment local result = mysql:query_fetch_assoc("SELECT MIN(e1.id+1) AS nextID FROM interiors AS e1 LEFT JOIN interiors AS e2 ON e1.id +1 = e2.id WHERE e2.id IS NULL") if result then local id = tonumber(result["nextID"]) or 1 return id end return false end function findProperty(thePlayer, dimension) local dbid = dimension or (thePlayer and getElementDimension( thePlayer ) or 0) if dbid > 0 then local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local intID = getElementData(interior, "dbid") if intID == dbid then local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") local interiorStatus = getElementData(interior, "status") return dbid, interiorEntrance, interiorExit, interiorStatus[INTERIOR_TYPE], interior end end end return 0 end function cleanupProperty( id, donotdestroy) if id > 0 then if exports.mysql:query_free( "DELETE FROM dancers WHERE dimension = " .. mysql:escape_string(id) ) then local res = getResourceRootElement( getResourceFromName( "dancer-system" ) ) if res then for key, value in pairs( getElementsByType( "ped", res ) ) do if getElementDimension( value ) == id then destroyElement( value ) end end end end if exports.mysql:query_free( "DELETE FROM shops WHERE dimension = " .. mysql:escape_string(id) ) then local res = getResourceRootElement( getResourceFromName( "shop-system" ) ) if res then for key, value in pairs( getElementsByType( "ped", res ) ) do if getElementDimension( value ) == id then local npcID = getElementData( value, "dbid" ) exports.mysql:query_free( "DELETE FROM `shop_products` WHERE `npcID` = " .. mysql:escape_string(npcID) ) destroyElement( value ) end end end end if exports.mysql:query_free( "DELETE FROM atms WHERE dimension = " .. mysql:escape_string(id) ) then local res = getResourceRootElement( getResourceFromName( "bank-system" ) ) if res then for key, value in pairs( getElementsByType( "object", res ) ) do if getElementDimension( value ) == id then destroyElement( value ) end end end end -- if exports.mysql:query_free( "DELETE FROM `elevators` WHERE `dimensionwithin` = '" .. mysql:escape_string(id).."' OR `dimension` = '" .. mysql:escape_string(id).."'" ) then -- local res = getResourceRootElement( getResourceFromName( "elevator-system" ) ) -- if res then -- for key, value in pairs( getElementsByType( "elevator", res ) ) do -- if getElementDimension( value ) == id then -- destroyElement( value ) -- call( getResourceFromName( "elevator-system" ), "reloadOneElevator", value ) -- end -- end -- end -- end local resE = getResourceRootElement( getResourceFromName( "elevator-system" ) ) if resE then call( getResourceFromName( "elevator-system" ), "delElevatorsFromInterior", "MAXIME" , "PROPERTYCLEANUP", id ) end if not donotdestroy then local res1 = getResourceRootElement( getResourceFromName( "object-system" ) ) if res1 then exports['object-system']:removeInteriorObjects( tonumber(id) ) end end if safeTable[id] then local safe = safeTable[id] call( getResourceFromName( "item-system" ), "clearItems", safe ) destroyElement(safe) safeTable[id] = nil end setTimer ( function () call( getResourceFromName( "item-system" ), "deleteAllItemsWithinInt", id, 0, "CLEANUPINT" ) end, 3000, 1) end end function sellProperty(thePlayer, commandName, bla) if bla then outputChatBox("Use /sell to sell this place to another player.", thePlayer, 255, 0, 0) return end local dbid, entrance, exit, interiorType, interiorElement = findProperty( thePlayer ) if dbid > 0 then if interiorType == 2 then outputChatBox("You cannot sell a government property.", thePlayer, 255, 0, 0) elseif interiorType ~= 3 and commandName == "unrent" then outputChatBox("You do not rent this property.", thePlayer, 255, 0, 0) else local interiorStatus = getElementData(interiorElement, "status") if interiorStatus[INTERIOR_OWNER] == getElementData(thePlayer, "dbid") then publicSellProperty(thePlayer, dbid, true, true, false) cleanupProperty(dbid, true) exports.logs:dbLog(thePlayer, 37, { "in"..tostring(dbid) } , "SELLPROPERTY "..dbid) local addLog = mysql:query_free("INSERT INTO `interior_logs` (`intID`, `action`, `actor`) VALUES ('"..tostring(dbid).."', '"..commandName.."', '"..getElementData(thePlayer, "account:id").."')") or false if not addLog then outputDebugString("Failed to add interior logs.") end else outputChatBox("You do not own this property.", thePlayer, 255, 0, 0) end end else outputChatBox("You are not in a property.", thePlayer, 255, 0, 0) end end addCommandHandler("sellproperty", sellProperty, false, false) addCommandHandler("unrent", sellProperty, false, false) function publicSellProperty(thePlayer, dbid, showmessages, givemoney, CLEANUP) local dbid, entrance, exit, interiorType, interiorElement = findProperty( thePlayer, dbid ) local query = mysql:query_free("UPDATE interiors SET owner=-1, locked=1, safepositionX=NULL, safepositionY=NULL, safepositionZ=NULL, safepositionRZ=NULL WHERE id='" .. dbid .. "'") if query then local interiorStatus = getElementData(interiorElement, "status") if getElementDimension(thePlayer) == dbid and not CLEANUP then setElementInterior(thePlayer, entrance[INTERIOR_INT]) setCameraInterior(thePlayer, entrance[INTERIOR_INT]) setElementDimension(thePlayer, entrance[INTERIOR_DIM]) setElementPosition(thePlayer, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "interiormarker", false, false, false) end if safeTable[dbid] then local safe = safeTable[dbid] if safe then exports['item-system']:clearItems(safe) destroyElement(safe) safeTable[dbid] = nil else end end if interiorType == 0 or interiorType == 1 then if interiorStatus[INTERIOR_OWNER] == getElementData(thePlayer, "dbid") then local money = math.ceil(interiorStatus[INTERIOR_COST] * 2/3) if givemoney then exports.global:giveMoney(thePlayer, money) exports.global:takeMoney(getTeamFromName("Government of Los Santos"), money, true) end if showmessages then if CLEANUP == "FORCESELL" then local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) local adminUsername = getElementData(thePlayer, "account:username") if hiddenAdmin == 0 then exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(thePlayer):gsub("_", " ").." ("..adminUsername..") has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") else exports.global:sendMessageToAdmins("[INTERIOR]: A hidden admin has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") end else outputChatBox("You sold your property for " .. exports.global:formatMoney(money) .. "$.", thePlayer, 0, 255, 0) end end -- take all keys call( getResourceFromName( "item-system" ), "deleteAll", 4, dbid ) call( getResourceFromName( "item-system" ), "deleteAll", 5, dbid ) triggerClientEvent(thePlayer, "removeBlipAtXY", thePlayer, interiorType, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) else if showmessages then if CLEANUP == "FORCESELL" then local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) local adminUsername = getElementData(thePlayer, "account:username") if hiddenAdmin == 0 then exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(thePlayer):gsub("_", " ").." ("..adminUsername..") has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") else exports.global:sendMessageToAdmins("[INTERIOR]: A hidden admin has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") end else outputChatBox("You set this property to unowned.", thePlayer, 0, 255, 0) end end end else if showmessages then if CLEANUP == "FORCESELL" then local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) local adminUsername = getElementData(thePlayer, "account:username") if hiddenAdmin == 0 then exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(thePlayer):gsub("_", " ").." ("..adminUsername..") has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") else exports.global:sendMessageToAdmins("[INTERIOR]: A hidden admin has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") end else outputChatBox("You are no longer renting this property.", thePlayer, 0, 255, 0) end end call( getResourceFromName( "item-system" ), "deleteAll", 4, dbid ) call( getResourceFromName( "item-system" ), "deleteAll", 5, dbid ) triggerClientEvent(thePlayer, "removeBlipAtXY", thePlayer, interiorType, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) end realReloadInterior(dbid) else outputChatBox("Error 504914 - Report on forums.", thePlayer, 255, 0, 0) end end function sellTo(thePlayer, commandName, targetPlayerName) -- only works in dimensions local dbid, entrance, exit, interiorType, interiorElement = findProperty( thePlayer ) if dbid > 0 and not isPedInVehicle( thePlayer ) then local interiorStatus = getElementData(interiorElement, "status") if interiorStatus[INTERIOR_TYPE] == 2 then outputChatBox("You cannot sell a government property.", thePlayer, 255, 0, 0) elseif not targetPlayerName then outputChatBox("SYNTAX: /" .. commandName .. " [partial player name / id]", thePlayer, 255, 194, 14) outputChatBox("Sells the Property you're in to that Player.", thePlayer, 255, 194, 14) outputChatBox("Ask the buyer to use /pay to recieve the money for the Property.", thePlayer, 255, 194, 14) else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayerName) if targetPlayer and getElementData(targetPlayer, "dbid") then local px, py, pz = getElementPosition(thePlayer) local tx, ty, tz = getElementPosition(targetPlayer) if getDistanceBetweenPoints3D(px, py, pz, tx, ty, tz) < 10 and getElementDimension(targetPlayer) == getElementDimension(thePlayer) then if interiorStatus[INTERIOR_OWNER] == getElementData(thePlayer, "dbid") or exports.global:isPlayerFullAdmin(thePlayer) or exports.donators:hasPlayerPerk(thePlayer, 14) then if getElementData(targetPlayer, "dbid") ~= interiorStatus[INTERIOR_OWNER] then if exports.global:hasSpaceForItem(targetPlayer, 4, dbid) then local query = mysql:query_free("UPDATE interiors SET owner = '" .. getElementData(targetPlayer, "dbid") .. "' WHERE id='" .. dbid .. "'") if query then local keytype = 4 if interiorType == 1 then keytype = 5 end call( getResourceFromName( "item-system" ), "deleteAll", 4, dbid ) call( getResourceFromName( "item-system" ), "deleteAll", 5, dbid ) exports.global:giveItem(targetPlayer, keytype, dbid) triggerClientEvent(thePlayer, "removeBlipAtXY", thePlayer, interiorType, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) triggerClientEvent(targetPlayer, "createBlipAtXY", targetPlayer, interiorType, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) if interiorType == 0 or interiorType == 1 then outputChatBox("You've successfully sold your property to " .. targetPlayerName .. ".", thePlayer, 0, 255, 0) outputChatBox((getPlayerName(thePlayer):gsub("_", " ")) .. " sold you this property.", targetPlayer, 0, 255, 0) else outputChatBox(targetPlayerName .. " has taken over your rent contract.", thePlayer, 0, 255, 0) outputChatBox("You did take over " .. getPlayerName(thePlayer):gsub("_", " ") .. "'s renting contract.", targetPlayer, 0, 255, 0) end exports.logs:dbLog(thePlayer, 37, { targetPlayer, "in"..tostring(dbid) } , "SELLPROPERTY "..getPlayerName(thePlayer).." => "..targetPlayerName) local adminID = getElementData(thePlayer, "account:id") local addLog = mysql:query_free("INSERT INTO `interior_logs` (`intID`, `action`, `actor`) VALUES ('"..tostring(dbid).."', '"..commandName.." to "..targetPlayerName.."', '"..adminID.."')") or false if not addLog then outputDebugString("Failed to add interior logs.") end realReloadInterior(dbid) else outputChatBox("Error 09002 - Report on Forums.", thePlayer, 255, 0, 0) end else outputChatBox(targetPlayerName .. " has no space for the property keys.", thePlayer, 255, 0, 0) end else outputChatBox("You can't sell your own property to yourself.", thePlayer, 255, 0, 0) end else outputChatBox("This property is not yours.", thePlayer, 255, 0, 0) end else outputChatBox("You are too far away from " .. targetPlayerName .. ".", thePlayer, 255, 0, 0) end end end end end addCommandHandler("sell", sellTo) function realReloadInterior(interiorID) local dbid, entrance, exit, inttype, interiorElement = exports['interior-system']:findProperty( false, interiorID ) if dbid > 0 then if safeTable[dbid] then destroyElement(safeTable[dbid]) safeTable[dbid] = false end triggerClientEvent("deleteInteriorElement", interiorElement, tonumber(dbid)) destroyElement(interiorElement) reloadOneInterior(tonumber(dbid), false) else --outputChatBox("You suck") --outputDebugString("Tried to reload interior without ID.") end end local stats_numberOfInts = 0 -- CONVERTED function reloadOneInterior(id) --[[if (hasCoroutine==nil) then hasCoroutine = false end]] local row = mysql:query_fetch_assoc("SELECT * FROM `interiors` LEFT JOIN `interior_business` ON `interiors`.`id` = `interior_business`.`intID` WHERE `id` = '" .. id .."' AND `deleted` = '0'") if row then --[[if (hasCoroutine) then coroutine.yield() end]] if row then for k, v in pairs( row ) do if v == null then row[k] = nil else row[k] = tonumber(v) or v end end local interiorElement = createElement("interior", "int"..tostring(row.id)) setElementDataEx(interiorElement, "dbid", row.id, true) setElementDataEx(interiorElement, "entrance", { row.x, row.y, row.z, row.interiorwithin, row.dimensionwithin, row.angle, 0 }, true) setElementDataEx(interiorElement, "exit", {row.interiorx, row.interiory, row.interiorz, row.interior, row.id, row.angleexit, 0 }, true ) setElementDataEx(interiorElement, "status", { row.type, row.disabled == 1, row.locked == 1, row.owner, row.cost, row.supplies}, true ) setElementDataEx(interiorElement, "name", row.name, true ) setElementDataEx(interiorElement, "adminnote", string.sub(tostring(row.adminnote),1,100) , true ) --setElementDataEx(interiorElement, "isLightOn", row.isLightOn == 1, true) if row.safepositionX and row.safepositionY and row.safepositionZ ~= mysql_null() and row.safepositionRZ then setElementDataEx(interiorElement, "safe", {row.safepositionX, row.safepositionY, row.safepositionZ, 0, 0, row.safepositionRZ}, false) local tempobject = createObject(2332, row.safepositionX, row.safepositionY, row.safepositionZ, 0, 0, row.safepositionRZ) setElementInterior(tempobject, row.interior) setElementDimension(tempobject, row.id) safeTable[row.id] = tempobject else setElementDataEx(interiorElement, "safe", false, true) end if row.businessNote then setElementDataEx(interiorElement, "business:note", row.businessNote , true) end outputDebugString( "[INTERIOR] LOADED INT #" .. id.." ("..row.name..")" ) return true else outputDebugString( "[INTERIOR] LOADING FAILED Invalid Int #" .. id ) return false end end end --[[local threads = { } function resume() for key, value in ipairs(threads) do coroutine.resume(value) end end]] function loadAllInteriors() local players = exports.pool:getPoolElementsByType("player") for k, thePlayer in ipairs(players) do exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "interiormarker", false, false, false) end local timerDelay = 100 local result = mysql:query("SELECT `id` FROM `interiors` WHERE `deleted` = '0'") if (result) then while true do local row = mysql:fetch_assoc(result) if not row then break end setTimer(reloadOneInterior, timerDelay, 1, row.id) timerDelay = timerDelay + 100 stats_numberOfInts = stats_numberOfInts + 1 end mysql:free_result(result) setTimer(function () triggerClientEvent("interior:showLoadingProgress" ,getRootElement(), stats_numberOfInts, timerDelay) end, 5000, 1) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), loadAllInteriors) function buyInterior(player, pickup, cost, isHouse, isRentable) if isRentable then local result = mysql:query_fetch_assoc( "SELECT COUNT(*) as 'cntval' FROM `interiors` WHERE `owner` = " .. getElementData(player, "dbid") .. " AND `type` = 3" ) if result then local count = tonumber(result['cntval']) if count ~= 0 then outputChatBox("You are already renting another house.", player, 255, 0, 0) return end end elseif not exports.global:hasSpaceForItem(player, 4, 1) then outputChatBox("You do not have the space for the keys.", player, 255, 0, 0) return end if exports.global:takeMoney(player, cost) then if (isHouse) then outputChatBox("Congratulations! You have just bought this house for $" .. exports.global:formatMoney(cost) .. ".", player, 255, 194, 14) exports.global:giveMoney( getTeamFromName("Government of Los Santos"), cost ) elseif (isRentable) then outputChatBox("Congratulations! You are now renting this property for $" .. exports.global:formatMoney(cost) .. ".", player, 255, 194, 14) else outputChatBox("Congratulations! You have just bought this business for $" .. exports.global:formatMoney(cost) .. ".", player, 255, 194, 14) exports.global:giveMoney( getTeamFromName("Government of Los Santos"), cost ) end local charid = getElementData(player, "dbid") local pickupid = getElementData(pickup, "dbid") mysql:query_free( "UPDATE interiors SET owner='" .. charid .. "', locked=0 WHERE id='" .. pickupid .. "'") local interiorEntrance = getElementData(pickup, "entrance") -- make sure it's an unqiue key call( getResourceFromName( "item-system" ), "deleteAll", 4, pickupid ) call( getResourceFromName( "item-system" ), "deleteAll", 5, pickupid ) if (isHouse) or (isRentable) then exports.global:giveItem(player, 4, pickupid) else exports.global:giveItem(player, 5, pickupid) end exports.logs:dbLog(thePlayer, 37, { "in"..tostring(pickupid) } , "BUYPROPERTY $"..cost) realReloadInterior(tonumber(pickupid)) triggerClientEvent(player, "createBlipAtXY", player, interiorEntrance[INTERIOR_TYPE], interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y]) else outputChatBox("Sorry, you cannot afford to purchase this property.", player, 255, 194, 14) end end --[[ function vehicleStartEnter(thePlayer) local marker = getElementData(thePlayer, "interiormarker") local x, y, z = getElementPosition(thePlayer) if marker then cancelEvent() end end addEventHandler("onVehicleStartEnter", getRootElement(), vehicleStartEnter) addEventHandler("onVehicleStartExit", getRootElement(), vehicleStartEnter)]] -- I guess I'll test this on my local server before we put it in, make sure miniguns dont fall from the sky and everyone turns into a clown. -Bean --[[function vehicleStartEnter(thePlayer) local marker = getElementData(thePlayer, "interiormarker") local x, y, z = getElementPosition(thePlayer) local lastDistance = 1 -- This is the distanceBetweenPoints3D, I'm sure we could make it less, but this should do if they are on the interior marker, right? for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") local posX, posY, posZ = getElementPosition(thePlayer) local dimension = getElementDimension(thePlayer) for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[5] == dimension) then local distance = getDistanceBetweenPoints3D(posX, posY, posZ, point[1], point[2], point[3]) if (distance < lastDistance) then found = interior -- Set it to the interior ID so that it knows there's something there. lastDistance = distance end end end end if marker and found then -- If it's there, then you cancel, not just because the event wants us to. cancelEvent() else exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "interiormarker", nil, nil, nil) -- If it's not found, then let them enter the car, and clear the element data so it's not there anymore. end end addEventHandler("onVehicleStartEnter", getRootElement(), vehicleStartEnter) addEventHandler("onVehicleStartExit", getRootElement(), vehicleStartEnter)]] function enterInterior( ) if source and client then local canEnter, errorCode, errorMsg = canEnterInterior(source) -- Checks for disabled and locked ints. if canEnter then setPlayerInsideInterior( source, client ) elseif isInteriorForSale(source) then local interiorStatus = getElementData(source, "status") local cost = interiorStatus[INTERIOR_COST] local isHouse = interiorStatus[INTERIOR_TYPE] == 0 local isRentable = interiorStatus[INTERIOR_TYPE] == 3 buyInterior(client, source, cost, isHouse, isRentable) else outputChatBox(errorMsg, client, 255, 0, 0) end end end addEvent("interior:enter", true) addEventHandler("interior:enter", getRootElement(), enterInterior) -- NOT CONVERTED function setPlayerInsideInterior(theInterior, thePlayer) local teleportTo = nil -- does the player want to go in? local pedCurrentDimension = getElementDimension( thePlayer ) local interiorEntrance = getElementData(theInterior, "entrance") local interiorExit = getElementData(theInterior, "exit") local interiorStatus = getElementData(theInterior, "status") if (interiorEntrance[INTERIOR_DIM] == pedCurrentDimension) then --[[ We want to go inside, Check for a fee ***REMOVED.*** if getElementData( thePlayer, "adminduty" ) ~= 1 and not exports.global:hasItem( thePlayer, 5, getElementData( theInterior, "dbid" ) ) and not (getElementData(thePlayer,"ESbadge")) and not (getElementData(thePlayer,"PDbadge"))and not (getElementData(thePlayer,"SheriffBadge")) and not (getElementData(thePlayer,"GOVbadge")) and not (getElementData(thePlayer,"SANbadge")) then local fee = interiorEntrance[INTERIOR_FEE] if fee and fee > 0 then if not exports.global:takeMoney( thePlayer, fee ) then outputChatBox( "You don't have enough money with you to enter this interior.", thePlayer, 255, 0, 0 ) return else local ownerid = interiorStatus[INTERIOR_OWNER] local query = mysql:query_free( "UPDATE characters SET bankmoney = bankmoney + " .. fee .. " WHERE id = " .. ownerid ) if query then for k, v in pairs( getElementsByType( "player" ) ) do if isElement( v ) then if getElementData( v, "dbid" ) == ownerid then exports['anticheat-system']:changeProtectedElementDataEx( v, "businessprofit", getElementData( v, "businessprofit" ) + fee, false ) break end end end else outputChatBox( "Error 100.6 - Report on Forums.", thePlayer, 255, 0, 0 ) end end end end]] -- We've passed the feecheck, yet we still want to go inside. teleportTo = interiorExit else -- We'd like to leave this building, kthxhopefullybye. if (getElementData(thePlayer, "snake")==true) then return end teleportTo = interiorEntrance end if teleportTo then triggerClientEvent(thePlayer, "setPlayerInsideInterior", theInterior, teleportTo, theInterior) doorGoThru(theInterior) local dbid = getElementData(theInterior, "dbid") mysql:query_free("UPDATE `interiors` SET `lastused`=NOW() WHERE `id`='" .. mysql:escape_string(dbid) .. "'") end end --[[ SAFES ]] function addSafeAtPosition( thePlayer, x, y, z, rotz ) local dbid = getElementDimension( thePlayer ) local interior = getElementInterior( thePlayer ) if dbid == 0 then return 2 elseif dbid >= 20000 then -- Vehicle Interiors local vid = dbid - 20000 if exports['vehicle-system']:getSafe( vid ) then outputChatBox("There is already a safe in this property. Type /movesafe to move it.", thePlayer, 255, 0, 0) return 1 elseif exports.global:hasItem( thePlayer, 3, vid ) then z = z - 0.5 rotz = rotz + 180 if exports.mysql:query_free( "UPDATE vehicles SET safepositionX='" .. x .. "', safepositionY='" .. y .. "', safepositionZ='" .. z .. "', safepositionRZ='" .. rotz .. "' WHERE id='" .. vid .. "'") then if exports['vehicle-system']:addSafe( vid, x, y, z, rotz, interior ) then return 0 end end return 1 end elseif dbid >= 19000 then -- temp vehicle interiors return 2 elseif ((exports.global:hasItem( thePlayer, 5, dbid ) or exports.global:hasItem( thePlayer, 4, dbid))) then if safeTable[dbid] then outputChatBox("There is already a safe in this property. Type /movesafe to move it.", thePlayer, 255, 0, 0) return 1 else z = z - 0.5 rotz = rotz + 180 mysql:query_free( "UPDATE interiors SET safepositionX='" .. x .. "', safepositionY='" .. y .. "', safepositionZ='" .. z .. "', safepositionRZ='" .. rotz .. "' WHERE id='" .. dbid .. "'") local tempobject = createObject(2332, x, y, z, 0, 0, rotz) setElementInterior(tempobject, interior) setElementDimension(tempobject, dbid) safeTable[dbid] = tempobject call( getResourceFromName( "item-system" ), "clearItems", tempobject ) return 0 end end return 3 end function moveSafe ( thePlayer, commandName ) local x,y,z = getElementPosition( thePlayer ) local rotz = getPedRotation( thePlayer ) local dbid = getElementDimension( thePlayer ) local interior = getElementInterior( thePlayer ) if (dbid < 19000 and (exports.global:hasItem( thePlayer, 5, dbid ) or exports.global:hasItem( thePlayer, 4, dbid))) or (dbid >= 20000 and exports.global:hasItem(thePlayer, 3, dbid - 20000)) then z = z - 0.5 rotz = rotz + 180 if dbid >= 20000 and exports['vehicle-system']:getSafe(dbid-20000) then local safe = exports['vehicle-system']:getSafe(dbid-20000) exports.mysql:query_free("UPDATE vehicles SET safepositionX='" .. x .. "', safepositionY='" .. y .. "', safepositionZ='" .. z .. "', safepositionRZ='" .. rotz .. "' WHERE id='" .. (dbid-20000) .. "'") setElementPosition(safe, x, y, z) setObjectRotation(safe, 0, 0, rotz) elseif dbid > 0 and safeTable[dbid] then local safe = safeTable[dbid] exports.mysql:query_free("UPDATE interiors SET safepositionX='" .. x .. "', safepositionY='" .. y .. "', safepositionZ='" .. z .. "', safepositionRZ='" .. rotz .. "' WHERE id='" .. dbid .. "'") -- Update the name in the sql. setElementPosition(safe, x, y, z) setObjectRotation(safe, 0, 0, rotz) else outputChatBox("You need a safe to move!", thePlayer, 255, 0, 0) end else outputChatBox("You need the keys of this interior to move the Safe.", thePlayer, 255, 0, 0) end end addCommandHandler("movesafe", moveSafe) local function hasKey( source, key ) if exports.global:hasItem(source, 4, key) or exports.global:hasItem(source, 5,key) then return true, false else if getElementData(source, "adminduty") == 1 then return true, true else return false, false end end return false, false end function lockUnlockHouseEvent(player, checkdistance) if (player) then source = player end local itemValue = nil local found = nil local foundpoint = nil local minDistance = 5 local interiorName = "" local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local canEnter, byAdmin = nil local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then local interiorID = getElementData(interior, "dbid") canEnter, byAdmin = hasKey(source, interiorID) if canEnter then -- house found found = interior foundpoint = point itemValue = interiorID minDistance = distance interiorName = getElementData(interior, "name") end end end end end -- For elevators already local possibleElevators = getElementsByType("elevator") for _, elevator in ipairs(possibleElevators) do local elevatorEntrance = getElementData(elevator, "entrance") local elevatorExit = getElementData(elevator, "exit") for _, point in ipairs( { elevatorEntrance, elevatorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) if (distance < minDistance) then if hasKey(source, elevatorEntrance[INTERIOR_DIM]) and elevatorEntrance[INTERIOR_DIM] ~= 0 then found = elevator foundpoint = point itemValue = elevatorEntrance[INTERIOR_DIM] minDistance = distance elseif hasKey(source, elevatorExit[INTERIOR_DIM]) and elevatorExit[INTERIOR_DIM] ~= 0 then found = elevator foundpoint = point itemValue = elevatorExit[INTERIOR_DIM] minDistance = distance end end end end end if (checkdistance) then return found, minDistance end if found and itemValue then local dbid, entrance, exit, interiorType, interiorElement = findProperty( source, itemValue ) local interiorStatus = getElementData(interiorElement, "status") local locked = interiorStatus[INTERIOR_LOCKED] and 1 or 0 locked = 1 - locked -- Invert status local newRealLockedValue = false mysql:query_free("UPDATE interiors SET locked='" .. mysql:escape_string(locked) .. "' WHERE id='" .. mysql:escape_string(itemValue) .. "' LIMIT 1") if locked == 0 then doorUnlockSound(interiorElement) if byAdmin then if getElementData(source, "hiddenadmin") == 0 then local adminTitle = exports.global:getPlayerAdminTitle(source) local adminUsername = getElementData(source, "account:username") exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(source):gsub("_", " ").. " ("..adminUsername..") has unlocked Interior ID #"..itemValue.." without key.") exports.global:sendLocalText(source, " * The door should be now open *", 255, 51, 102, 30, {}, true) exports["interior-manager"]:addInteriorLogs(itemValue, "unlock without key", source) end else exports.global:sendLocalMeAction(source, "puts the key in the door to unlock it.") end exports.logs:dbLog(source, 31, { "in"..tostring(itemValue) }, "UNLOCK INTERIOR") else --:~ doorLockSound(interiorElement) newRealLockedValue = true if byAdmin then if getElementData(source, "hiddenadmin") == 0 then local adminTitle = exports.global:getPlayerAdminTitle(source) local adminUsername = getElementData(source, "account:username") exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(source):gsub("_", " ").. " ("..adminUsername..") has locked Interior ID #"..itemValue.." without key.") exports.global:sendLocalText(source, " * The door should be now locked *", 255, 51, 102, 30, {}, true) exports["interior-manager"]:addInteriorLogs(itemValue, "lock without key", source) end else exports.global:sendLocalMeAction(source, "puts the key in the door to lock it.") end exports.logs:dbLog(source, 31, { "in"..tostring(itemValue) }, "LOCK INTERIOR") end interiorStatus[INTERIOR_LOCKED] = newRealLockedValue exports['anticheat-system']:changeProtectedElementDataEx(interiorElement, "status", interiorStatus, true) else cancelEvent( ) end end addEvent( "lockUnlockHouse",false ) addEventHandler( "lockUnlockHouse", getRootElement(), lockUnlockHouseEvent) function doorUnlockSound(house) if (house) then if (getElementType(house) == "interior") then local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") for index, nearbyPlayer in ipairs(getElementsByType("player")) do if isElement(nearbyPlayer) then if ((getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorEntrance[INTERIOR_DIM]) or ((getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorExit[INTERIOR_DIM]) then local logged = getElementData(nearbyPlayer, "loggedin") if logged == 1 then triggerClientEvent(nearbyPlayer, "doorUnlockSound", source) end end end end else -- It would be 0 local found = nil local minDistance = 20 local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then found = interior minDistance = distance end end end end end if found then triggerEvent("doorUnlockSound", source, found) end end end function doorLockSound(house) if (house) then if (getElementType(house) == "interior") then local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") for index, nearbyPlayer in ipairs(getElementsByType("player")) do if isElement(nearbyPlayer) then if ((getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorEntrance[INTERIOR_DIM]) or ((getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorExit[INTERIOR_DIM]) then local logged = getElementData(nearbyPlayer, "loggedin") if logged == 1 then triggerClientEvent(nearbyPlayer, "doorLockSound", source) end end end end else -- It would be 0 local found = nil local minDistance = 20 local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then found = interior minDistance = distance end end end end end if found then triggerEvent("doorLockSound", source, found) end end end function doorGoThru(house) if (house) then if (getElementType(house) == "interior") then local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") for index, nearbyPlayer in ipairs(getElementsByType("player")) do if isElement(nearbyPlayer) then if ((getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorEntrance[INTERIOR_DIM]) or ((getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorExit[INTERIOR_DIM]) then local logged = getElementData(nearbyPlayer, "loggedin") if logged == 1 then triggerClientEvent(nearbyPlayer, "doorGoThru", source) end end end end else -- It would be 0 local found = nil local minDistance = 20 local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then found = interior minDistance = distance end end end end end if found then triggerEvent("doorGoThru", source, found) end end end addEvent( "lockUnlockHouseID",true ) addEventHandler( "lockUnlockHouseID", getRootElement(), function( id ) local hasKey1, byAdmin = hasKey(source, id) if id and tonumber(id) and hasKey1 then local result = mysql:query_fetch_assoc( "SELECT 1-locked as 'val' FROM interiors WHERE id = " .. id) local locked = 0 if result then locked = tonumber( result["val"] ) end local newRealLockedValue = false mysql:query_free("UPDATE interiors SET locked='" .. locked .. "' WHERE id='" .. id .. "' LIMIT 1") if locked == 0 then if byAdmin then if getElementData(source, "hiddenadmin") == 0 then local adminTitle = exports.global:getPlayerAdminTitle(source) local adminUsername = getElementData(source, "account:username") exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(source):gsub("_", " ").. " ("..adminUsername..") has unlocked Interior ID #"..id.." without key.") exports.global:sendLocalText(source, " * The door should be now open *", 255, 51, 102, 30, {}, true) exports["interior-manager"]:addInteriorLogs(id, "unlock without key", source) end else exports.global:sendLocalMeAction(source, "puts the key in the door to unlock it.") end exports.logs:dbLog(source, 31, { "in"..tostring(id) }, "UNLOCK INTERIOR") else newRealLockedValue = true if byAdmin then if getElementData(source, "hiddenadmin") == 0 then local adminTitle = exports.global:getPlayerAdminTitle(source) local adminUsername = getElementData(source, "account:username") exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(source):gsub("_", " ").. " ("..adminUsername..") has locked Interior ID #"..id.." without key.") exports.global:sendLocalText(source, " * The door should be now closed *", 255, 51, 102, 30, {}, true) exports["interior-manager"]:addInteriorLogs(id, "lock without key", source) end else exports.global:sendLocalMeAction(source, "puts the key in the door to lock it.") end exports.logs:dbLog(source, 31, { "in"..tostring(id) }, "LOCK INTERIOR") end local dbid, entrance, exit, interiorType, interiorElement = findProperty( source, id ) if interiorElement then local interiorStatus = getElementData(interiorElement, "status") interiorStatus[INTERIOR_LOCKED] = newRealLockedValue exports['anticheat-system']:changeProtectedElementDataEx(interiorElement, "status", interiorStatus, true) end else cancelEvent( ) end end ) function findParent( element, dimension ) local dbid, entrance, exit, type, interiorElement = findProperty( element, dimension ) return interiorElement end addEventHandler("onPlayerInteriorChange", getRootElement( ), function( a, b, toDimension, toInterior) if toDimension then setElementDimension(source, toDimension) end if toInterior then setElementInterior(source, toInterior) end local vehicle = getPedOccupiedVehicle( source ) if not vehicle then --setPedGravity(source, 0) end triggerEvent("texture-system:loadCustomTextures", source) end ) function playerKnocking(house) if (house) then if isElement(house) and (getElementType(house) == "interior") then local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") for index, nearbyPlayer in ipairs(getElementsByType("player")) do if isElement(nearbyPlayer) then if ((getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorEntrance[INTERIOR_DIM]) or ((getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorExit[INTERIOR_DIM]) then local logged = getElementData(nearbyPlayer, "loggedin") if logged == 1 then triggerClientEvent(nearbyPlayer, "playerKnock", source) end end end end else -- It would be 0 local found = nil local minDistance = 20 local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then found = interior minDistance = distance end end end end end if found then triggerEvent("onKnocking", source, found) end end end addEvent("onKnocking", true) addEventHandler("onKnocking", getRootElement(), playerKnocking) function client_requestHUDinfo() -- Client = client -- Source = interior element if not isElement(source) or (getElementType(source) ~= "interior" and getElementType(source) ~= "elevator") then return end exports['anticheat-system']:changeProtectedElementDataEx( client, "interiormarker", true, false, false ) local interiorID, interiorName, interiorStatus, interiorEntrance, interiorExit = nil if getElementType(source) == "elevator" then local playerDimension = getElementDimension(client) local elevatorEntranceDimension = getElementData(source, "entrance")[INTERIOR_DIM] local elevatorExitDimension = getElementData(source, "exit")[INTERIOR_DIM] if playerDimension ~= elevatorEntranceDimension and elevatorEntranceDimension ~= 0 then local dbid, entrance, exit, type, interiorElement = findProperty( client, elevatorEntranceDimension ) if dbid and interiorElement then interiorID = getElementData(interiorElement, "dbid") interiorName = getElementData(interiorElement,"name") interiorStatus = getElementData(interiorElement, "status") interiorEntrance = getElementData(interiorElement, "entrance") interiorExit = getElementData(interiorElement, "exit") end elseif elevatorExitDimension ~= 0 then local dbid, entrance, exit, type, interiorElement = findProperty( client, elevatorExitDimension ) if dbid and interiorElement then interiorID = getElementData(interiorElement, "dbid") interiorName = getElementData(interiorElement,"name") interiorStatus = getElementData(interiorElement, "status") interiorEntrance = getElementData(interiorElement, "entrance") interiorExit = getElementData(interiorElement, "exit") end end if not dbid then interiorID = -1 interiorName = "None" interiorStatus = { } interiorEntrance = { } interiorStatus[INTERIOR_TYPE] = 2 interiorStatus[INTERIOR_COST] = 0 interiorStatus[INTERIOR_OWNER] = -1 interiorEntrance[INTERIOR_FEE] = 0 end else interiorName = getElementData(source,"name") interiorStatus = getElementData(source, "status") interiorEntrance = getElementData(source, "entrance") interiorExit = getElementData(source, "exit") end local interiorOwnerName = exports['cache']:getCharacterName(interiorStatus[INTERIOR_OWNER]) or "None" local interiorType = interiorStatus[INTERIOR_TYPE] or 2 local interiorCost = interiorStatus[INTERIOR_COST] or 0 local interiorBizNote = getElementData(source, "business:note") or false triggerClientEvent(client, "displayInteriorName", source, interiorName or "Elevator", interiorOwnerName, interiorType or 2, interiorCost or 0, interiorID or -1, interiorBizNote) end addEvent("interior:requestHUD", true) addEventHandler("interior:requestHUD", getRootElement(), client_requestHUDinfo) addEvent("int:updatemarker", true) addEventHandler("int:updatemarker", getRootElement(), function( newState ) exports['anticheat-system']:changeProtectedElementDataEx(client, "interiormarker", newState, false, true) -- No sync at all: function is only called from client thusfar has the actual state itself end ) --INTERIOR LIGHT BY MAXIME --[[function toggleInteriorLights(thePlayer, commandName) local playerInterior = getElementInterior(thePlayer) if (playerInterior==0) then outputChatBox("There is no light out here.", thePlayer, 255, 0, 0) else local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do if getElementData(interior, "dbid") == playerInterior then if getElementData(interior, "isLightOn") then setElementDataEx(interior, "isLightOn", false, true ) updateLight(false, playerInterior) exports.global:sendLocalText(thePlayer, "*"..getPlayerName(thePlayer):gsub("_", " ").." turns off the lights.", 255, 51, 102, 30, {}, true) local mQuery1 = mysql:query_free("UPDATE `interiors` SET `isLightOn` = '0' WHERE `id` = '"..tostring(playerInterior).."'") if not mQuery1 then outputDebugString("[SQL] Failed to update interior light status") end break else setElementDataEx(interior, "isLightOn", true, true ) updateLight(true, playerInterior) exports.global:sendLocalText(thePlayer, "*"..getPlayerName(thePlayer):gsub("_", " ").." turns on the lights.", 255, 51, 102, 30, {}, true) local mQuery1 = mysql:query_free("UPDATE `interiors` SET `isLightOn` = '1' WHERE `id` = '"..tostring(playerInterior).."'") if not mQuery1 then outputDebugString("[SQL] Failed to update interior light status") end break end end end end end addCommandHandler("toglight", toggleInteriorLights) addCommandHandler("togglelight", toggleInteriorLights) function updateLight(status, playerInterior) local possiblePlayers = getElementsByType("player") for _, player in ipairs(possiblePlayers) do if getElementInterior(player) == playerInterior then triggerClientEvent ( player, "updateLightStatus", player, status ) end end end addEvent("setInteriorLight", true) addEventHandler("setInteriorLight", getRootElement(), updateLight) ]] and this is interior system.lua client based. gInteriorName, gOwnerName, gBuyMessage, gBizMessage = nil timer = nil intNameFont = guiCreateFont( "intNameFont.ttf", 30 ) --AngryBird BizNoteFont = guiCreateFont( "BizNote.ttf", 21 ) -- Message on enter function showIntName(name, ownerName, inttype, cost, ID, bizMsg) bizMessage = bizMsg if (isElement(gInteriorName) and guiGetVisible(gInteriorName)) then if isTimer(timer) then killTimer(timer) timer = nil end destroyElement(gInteriorName) gInteriorName = nil if isElement(gOwnerName) then destroyElement(gOwnerName) gOwnerName = nil end if (gBuyMessage) then destroyElement(gBuyMessage) gBuyMessage = nil end if (gBizMessage) then destroyElement(gBizMessage) gBizMessage = nil end end if name == "None" then return elseif name then if (inttype==3) then -- Interior name and Owner for rented gInteriorName = guiCreateLabel(0.0, 0.84, 1.0, 0.3, tostring(name), true) guiSetFont(gInteriorName,intNameFont) guiLabelSetHorizontalAlign(gInteriorName, "center", true) --guiSetAlpha(gInteriorName, 0.0) if (exports.global:isPlayerAdmin(getLocalPlayer()) and getElementData(getLocalPlayer(), "adminduty") == 1) or exports.global:hasItem(getLocalPlayer(), 4, ID) then gOwnerName = guiCreateLabel(0.0, 0.90, 1.0, 0.3, "Rented by: " .. tostring(ownerName), true) guiSetFont(gOwnerName, "default") guiLabelSetHorizontalAlign(gOwnerName, "center", true) --guiSetAlpha(gOwnerName, 0.0) end else -- Interior name and Owner for the rest --outputDebugString((name or "nil").." - "..(tostring(bizMsg) or "nil")) if bizMessage then gInteriorName = guiCreateLabel(0.0, 0.80, 1.0, 0.3, tostring(name), true) gBizMessage = guiCreateLabel(0.0, 0.864, 1.0, 0.3, tostring(bizMessage), true) guiLabelSetHorizontalAlign(gBizMessage, "center", true) --guiSetAlpha(gBizMessage, 0.0) guiSetFont(gBizMessage, BizNoteFont) else gInteriorName = guiCreateLabel(0.0, 0.84, 1.0, 0.3, tostring(name), true) end guiSetFont(gInteriorName, intNameFont) guiLabelSetHorizontalAlign(gInteriorName, "center", true) --guiSetAlpha(gInteriorName, 0.0) if (exports.global:isPlayerAdmin(getLocalPlayer()) and getElementData(getLocalPlayer(), "adminduty") == 1) or exports.global:hasItem(getLocalPlayer(), 4, ID) or exports.global:hasItem(getLocalPlayer(), 5, ID) then gOwnerName = guiCreateLabel(0.0, 0.90, 1.0, 0.3, "Owner: " .. tostring(ownerName), true) guiSetFont(gOwnerName, "default") guiLabelSetHorizontalAlign(gOwnerName, "center", true) --guiSetAlpha(gOwnerName, 0.0) end end if (ownerName=="None") and (inttype==3) then -- Unowned type 3 (rentable) gBuyMessage = guiCreateLabel(0.0, 0.915, 1.0, 0.3, "Press F to rent for $" .. tostring(exports.global:formatMoney(cost)) .. ".", true) guiSetFont(gBuyMessage, "default") guiLabelSetHorizontalAlign(gBuyMessage, "center", true) --guiSetAlpha(gBuyMessage, 0.0) elseif (ownerName=="None") and (inttype<2) then -- Unowned any other type gBuyMessage = guiCreateLabel(0.0, 0.915, 1.0, 0.3, "Press F to buy for $" .. tostring(exports.global:formatMoney(cost)) .. ".", true) guiSetFont(gBuyMessage, "default") guiLabelSetHorizontalAlign(gBuyMessage, "center", true) --guiSetAlpha(gBuyMessage, 0.0) else local msg = "Press F to enter." --[[if fee and fee > 0 then msg = "Entrance Fee: $" .. exports.global:formatMoney(fee) if exports.global:hasMoney( getLocalPlayer(), fee ) then msg = msg .. "\nPress F to enter." end end]] gBuyMessage = guiCreateLabel(0.0, 0.915, 1.0, 0.3, msg, true) guiSetFont(gBuyMessage, "default") guiLabelSetHorizontalAlign(gBuyMessage, "center", true) --guiSetAlpha(gBuyMessage, 0.0) end setTimer(function() destroyElement(gInteriorName) gInteriorName = nil if isElement(gOwnerName) then destroyElement(gOwnerName) gOwnerName = nil end if (gBuyMessage) then destroyElement(gBuyMessage) gBuyMessage = nil end if (gBizMessage) then destroyElement(gBizMessage) gBizMessage = nil end end, 3000, 1) --timer = setTimer(fadeMessage, 50, 20, true) end end function fadeMessage(fadein) local alpha = guiGetAlpha(gInteriorName) if (fadein) and (alpha) then local newalpha = alpha + 0.05 guiSetAlpha(gInteriorName, newalpha) if isElement(gOwnerName) then guiSetAlpha(gOwnerName, newalpha) end if (gBuyMessage) then guiSetAlpha(gBuyMessage, newalpha) end if gBizMessage then guiSetAlpha(gBizMessage, newalpha) end if(newalpha>=1.0) then timer = setTimer(hideIntName, 5000, 1) end elseif (alpha) then local newalpha = alpha - 0.05 guiSetAlpha(gInteriorName, newalpha) if isElement(gOwnerName) then guiSetAlpha(gOwnerName, newalpha) end if (gBuyMessage) then guiSetAlpha(gBuyMessage, newalpha) end if (gBizMessage) then guiSetAlpha(gBizMessage, newalpha) end if(newalpha<=0.0) then destroyElement(gInteriorName) gInteriorName = nil if isElement(gOwnerName) then destroyElement(gOwnerName) gOwnerName = nil end if (gBuyMessage) then destroyElement(gBuyMessage) gBuyMessage = nil end if (gBizMessage) then destroyElement(gBizMessage) gBizMessage = nil end end end end function hideIntName() setTimer(fadeMessage, 50, 20, false) end addEvent("displayInteriorName", true ) addEventHandler("displayInteriorName", getRootElement(), showIntName) -- Creation of clientside blips function createBlipsFromTable(interiors) -- remove existing house blips for key, value in ipairs(getElementsByType("blip")) do local blipicon = getBlipIcon(value) if (blipicon == 31 or blipicon == 32) then destroyElement(value) end end -- spawn the new ones for key, value in ipairs(interiors) do createBlipAtXY(interiors[key][1], interiors[key][2], interiors[key][3]) end end addEvent("createBlipsFromTable", true) addEventHandler("createBlipsFromTable", getRootElement(), createBlipsFromTable) function createBlipAtXY(inttype, x, y) if inttype == 3 then inttype = 0 end createBlip(x, y, 10, 31+inttype, 2, 255, 0, 0, 255, 0, 300) end addEvent("createBlipAtXY", true) addEventHandler("createBlipAtXY", getRootElement(), createBlipAtXY) function removeBlipAtXY(inttype, x, y) if inttype == 3 or type(inttype) ~= 'number' then inttype = 0 end for key, value in ipairs(getElementsByType("blip")) do local bx, by, bz = getElementPosition(value) local icon = getBlipIcon(value) if (icon==31+inttype and bx==x and by==y) then destroyElement(value) break end end end addEvent("removeBlipAtXY", true) addEventHandler("removeBlipAtXY", getRootElement(), removeBlipAtXY) ------ local wBizNote, wRightClick, ax, ay = nil local house = nil local houseID = nil local sx, sy = guiGetScreenSize( ) function showHouseMenu( ) guiSetInputEnabled(true) showCursor(true) ax = math.max( math.min( sx - 160, ax - 75 ), 10 ) ay = math.max( math.min( sx - 210, ay - 100 ), 10 ) wRightClick = guiCreateWindow(ax, ay, 150, 200, (getElementData(house, "name") or ("Interior ID #"..tostring( houseID ))), false) guiWindowSetSizable(wRightClick, false) bLock = guiCreateButton(0.05, 0.13, 0.9, 0.1, "Lock/Unlock", true, wRightClick) addEventHandler("onClientGUIClick", bLock, lockUnlockHouse, false) bKnock = guiCreateButton(0.05, 0.27, 0.9, 0.1, "Knock on Door", true, wRightClick) addEventHandler("onClientGUIClick", bKnock, knockHouse, false) if hasKey(houseID) then bBizNote = guiCreateButton(0.05, 0.41, 0.9, 0.1, "Edit Greeting Msg", true, wRightClick) addEventHandler("onClientGUIClick", bBizNote, function() local width, height = 506, 103 local sx, sy = guiGetScreenSize() local posX = (sx/2)-(width/2) local posY = (sy/2)-(height/2) wBizNote = guiCreateWindow(posX,posY,width,height,"Edit Business Greeting Message - "..(getElementData(house, "name") or ("Interior ID #"..tostring( houseID ))),false) local eBizNote = guiCreateEdit(9,22,488,40,"",false,wBizNote) local bRemove = guiCreateButton(9,68,163,28,"Remove",false,wBizNote) local bSave = guiCreateButton(172,68,163,28,"Save",false,wBizNote) local bCancel = guiCreateButton(335,68,163,28,"Cancel",false,wBizNote) addEventHandler("onClientGUIClick", bRemove, function() if triggerServerEvent("businessSystem:setBizNote", getLocalPlayer(), getLocalPlayer(), houseID) then hideHouseMenu() end end, false) addEventHandler("onClientGUIClick", bSave, function() if triggerServerEvent("businessSystem:setBizNote", getLocalPlayer(), getLocalPlayer(), houseID, guiGetText(eBizNote)) then hideHouseMenu() end end, false) addEventHandler("onClientGUIClick", bCancel, function() if wBizNote then destroyElement(wBizNote) wBizNote = nil end end, false) end, false) bCloseMenu = guiCreateButton(0.05, 0.55, 0.9, 0.1, "Close Menu", true, wRightClick) else bCloseMenu = guiCreateButton(0.05, 0.41, 0.9, 0.1, "Close Menu", true, wRightClick) end addEventHandler("onClientGUIClick", bCloseMenu, hideHouseMenu, false) end local lastKnocked = 0 function knockHouse() local tick = getTickCount( ) if tick - lastKnocked > 5000 then triggerServerEvent("onKnocking", getLocalPlayer(), house) hideHouseMenu() lastKnocked = tick else outputChatBox("Please wait a bit before knocking again.", 255, 0, 0) end end function lockUnlockHouse( ) local tick = getTickCount( ) if tick - lastKnocked > 2000 then local px, py, pz = getElementPosition(getLocalPlayer()) local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") local x, y, z = getElementPosition(house) if getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], px, py, pz) < 5 then triggerServerEvent( "lockUnlockHouseID", getLocalPlayer( ), houseID ) elseif getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], px, py, pz) < 5 then triggerServerEvent( "lockUnlockHouseID", getLocalPlayer( ), houseID ) end hideHouseMenu() end end function hideHouseMenu( ) if wRightClick then destroyElement( wRightClick ) wRightClick = nil showCursor( false ) end if wBizNote then destroyElement(wBizNote) wBizNote = nil end house = nil houseID = nil guiSetInputEnabled(false) showCursor(false) end -- local function hasKey( key ) -- return exports.global:hasItem(getLocalPlayer(), 4, key) or exports.global:hasItem(getLocalPlayer(), 5,key) -- end function hasKey( key ) if exports.global:hasItem(getLocalPlayer(), 4, key) or exports.global:hasItem(getLocalPlayer(), 5,key) then return true, false else if getElementData(getLocalPlayer(), "adminduty") == 1 then return true, true else return false, false end end return false, false end function clickHouse(button, state, absX, absY, wx, wy, wz, e) if (button == "right") and (state=="down") and not e then if getElementData(getLocalPlayer(), "exclusiveGUI") then return end local element, id = nil, nil local px, py, pz = getElementPosition(getLocalPlayer()) local x, y, z = nil local interiorres = getResourceRootElement(getResourceFromName("interior-system")) local elevatorres = getResourceRootElement(getResourceFromName("elevator-system")) for key, value in ipairs(getElementsByType("pickup")) do if isElementStreamedIn(value) then x, y, z = getElementPosition(value) local minx, miny, minz, maxx, maxy, maxz local offset = 4 minx = x - offset miny = y - offset minz = z - offset maxx = x + offset maxy = y + offset maxz = z + offset if (wx >= minx and wx <=maxx) and (wy >= miny and wy <=maxy) and (wz >= minz and wz <=maxz) then local dbid = getElementData(getElementParent( value ), "dbid") if getElementType(getElementParent( value )) == "interior" then -- house found element = getElementParent( value ) id = dbid break elseif getElementType(getElementParent( value ) ) == "elevator" then -- it's an elevator if getElementData(value, "dim") and getElementData(value, "dim") ~= 0 then element = getElementParent( value ) id = getElementData(value, "dim") break elseif getElementData( getElementData( value, "other" ), "dim") and getElementData( getElementData( value, "other" ), "dim") ~= 0 then element = value id = getElementData( getElementData( value, "other" ), "dim") break end end end end end if element then if getDistanceBetweenPoints3D(x, y, z, px, py, pz) < 5 then ax, ay = getScreenFromWorldPosition(x, y, z, 0, false) if ax then hideHouseMenu() house = element houseID = id showHouseMenu() end else outputChatBox("You are too far away from this house.", 255, 0, 0) end else hideHouseMenu() end end end addEventHandler("onClientClick", getRootElement(), clickHouse, true) addEvent("playerKnock", true) addEventHandler("playerKnock", root, function() outputChatBox(" * Knocks can be heard coming from the door. * ((" .. getPlayerName(source):gsub("_"," ") .. "))", 255, 51, 102) playSound("knocking.mp3") end ) addEvent("doorUnlockSound", true) addEventHandler("doorUnlockSound", root, function() --outputChatBox(" * Knocks can be heard coming from the door. * ((" .. getPlayerName(source):gsub("_"," ") .. "))", 255, 51, 102) playSound("doorUnlockSound.mp3") end ) addEvent("doorLockSound", true) addEventHandler("doorLockSound", root, function() --outputChatBox(" * Knocks can be heard coming from the door. * ((" .. getPlayerName(source):gsub("_"," ") .. "))", 255, 51, 102) playSound("doorLockSound.mp3") end ) addEvent("doorGoThru", true) addEventHandler("doorGoThru", root, function() --outputChatBox(" * Knocks can be heard coming from the door. * ((" .. getPlayerName(source):gsub("_"," ") .. "))", 255, 51, 102) playSound("doorGoThru.mp3") end ) local cache = { } function findProperty(thePlayer, dimension) local dbid = dimension or getElementDimension( thePlayer ) if dbid > 0 then if cache[ dbid ] then return unpack( cache[ dbid ] ) end -- find the entrance and exit local entrance, exit = nil, nil for key, value in pairs(getElementsByType( "pickup", getResourceRootElement() )) do if getElementData(value, "dbid") == dbid then entrance = value break end end if entrance then cache[ dbid ] = { dbid, entrance } return dbid, entrance end end cache[ dbid ] = { 0 } return 0 end function findParent( element, dimension ) local dbid, entrance = findProperty( element, dimension ) return entrance end -- local inttimer = nil addEvent( "setPlayerInsideInterior", true ) addEventHandler( "setPlayerInsideInterior", getRootElement( ), function( targetLocation, targetInterior) if inttimer then return end if targetLocation[INTERIOR_DIM] ~= 0 then setGravity(0) end setElementFrozen(getLocalPlayer(), true) setElementPosition(getLocalPlayer(), targetLocation[INTERIOR_X], targetLocation[INTERIOR_Y], targetLocation[INTERIOR_Z], true) setElementInterior(getLocalPlayer(), targetLocation[INTERIOR_INT]) setCameraInterior(targetLocation[INTERIOR_INT]) setElementDimension(getLocalPlayer(), targetLocation[INTERIOR_DIM]) if targetLocation[INTERIOR_ANGLE] then setPedRotation(getLocalPlayer(), targetLocation[INTERIOR_ANGLE]) end triggerServerEvent("onPlayerInteriorChange", getLocalPlayer(), 0, 0, targetLocation[INTERIOR_DIM], targetLocation[INTERIOR_INT]) inttimer = setTimer(onPlayerPutInInteriorSecond, 1000, 1, targetLocation[INTERIOR_DIM], targetLocation[INTERIOR_INT]) engineSetAsynchronousLoading ( false, true ) -- if tonumber(targetLocation[INTERIOR_DIM]) == 0 then -- updateLightStatus(1) -- else --:~ -- outputDebugString(tostring(getElementData(targetInterior, "isLightOn"))) -- updateLightStatus(getElementData(targetInterior, "isLightOn")) -- outputChatBox("'/toglight' to switch on/off the lights in this interior") -- end local adminnote = tostring(getElementData(targetInterior, "adminnote")) if string.sub(tostring(adminnote),1,8) ~= "userdata" and adminnote ~= "\n" and getElementData(getLocalPlayer(), "adminduty") == 1 then outputChatBox("[INT MONITOR]: "..adminnote:gsub("\n", " ").."[..]", 255,0,0) outputChatBox("'/checkint "..getElementData(targetInterior, "dbid").." 'for details.",255,255,0) end end ) function onPlayerPutInInteriorSecond(dimension, interior) setCameraInterior(interior) local safeToSpawn = true if(getResourceFromName("object-system"))then safeToSpawn = exports['object-system']:isSafeToSpawn() end if (safeToSpawn) then inttimer = nil if isElement(getLocalPlayer()) then setTimer(onPlayerPutInInteriorThird, 1000, 1) end else setTimer(onPlayerPutInInteriorSecond, 1000, 1, dimension, interior) end end function onPlayerPutInInteriorThird() setGravity(0.008) setElementFrozen(getLocalPlayer(), false) engineSetAsynchronousLoading ( true, false ) end function cPKnock() if (getElementDimension(getLocalPlayer()) > 20000) then triggerServerEvent("onVehicleKnocking", getLocalPlayer()) else triggerServerEvent("onKnocking", getLocalPlayer(), 0) end end addCommandHandler("knock", cPKnock) local starttime = false local function updateIconAlpha( ) local time = getTickCount( ) - starttime -- if time > 20000 then -- removeIcon( ) -- else time = time % 1000 local alpha = 0 if time < 500 then alpha = time / 500 else alpha = 1 - ( time - 500 ) / 500 end guiSetAlpha(help_icon, alpha) guiSetAlpha(icon_label_shadow, alpha) guiSetAlpha(icon_label, alpha) --end end function showLoadingProgress(stats_numberOfInts, delayTime) if help_icon then removeIcon() end local title = stats_numberOfInts.." interiors(ETA: "..string.sub(tostring((tonumber(delayTime)-5000)/(60*1000)), 1, 3).." minutes) are being loaded. Don't panic if your house hasn't appeared yet. " local screenwidth, screenheight = guiGetScreenSize() help_icon = guiCreateStaticImage(screenwidth-25,6,20,20,"icon.png",false) icon_label_shadow = guiCreateLabel(screenwidth-829,11,800,20,title,false) guiSetFont(icon_label_shadow,"default-bold-small") guiLabelSetColor(icon_label_shadow,0,0,0) guiLabelSetHorizontalAlign(icon_label_shadow,"right",true) icon_label = guiCreateLabel(screenwidth-830,10,800,20,title,false) guiSetFont(icon_label,"default-bold-small") guiLabelSetHorizontalAlign(icon_label,"right",true) starttime = getTickCount( ) updateIconAlpha( ) addEventHandler( "onClientRender", getRootElement( ), updateIconAlpha ) setTimer(function () if help_icon then removeIcon() end end, delayTime+10000 , 1) end addEvent("interior:showLoadingProgress",true) addEventHandler("interior:showLoadingProgress",getRootElement(),showLoadingProgress) --addCommandHandler("fu",showLoadingProgress) function removeIcon() removeEventHandler( "onClientRender", getRootElement( ), updateIconAlpha ) destroyElement(icon_label_shadow) destroyElement(icon_label) destroyElement(help_icon) icon_label_shadow, icon_label, help_icon = nil end
  15. Hello.... i need help. i starting scripting and i need support whit this script. function giveWeaponsOnPlayerSpawn (TheSpawnpoint, theTeam) giveWeapon (source, 26, 20) -- sawed-off and 20 ammo end addEventHandler ("onPlayerSpawn", getRootElement (), giveWeaponsOnSpawn) META: <meta> <script src="script.lua" type="server"/> <meta> ¿wich is the problem here? thanks
  16. Vortex Hosting FREE Game Servers Hosting | FREE Web Hosting | FREE Shared Hosting About: Vortex Hosting is a company that provides free game server hosting for posts in the Forum. ________________________________________________________________ NO Lag (Low Ping Accuracy) 5GB Disk Space 8GB RAM Server 10-500 slots on Major Games Scripts Help Support Fast Download Backups Online 24/7 FTP Access Comfortable Game Panel Active Admin/moderator + community Over 90+ games available to be hosted ___________________________________________________________ CONTACT: Email- [email protected] Phone - +91 8794223760 ___________________________________________________________ VISIT US: www.vortexhost.me CLICK HERE
  17. Hi, i just uploaded a little gameplay from a playerunknown's battleground server, check it and let your like and suscribe, check my other videos too, is in spanish... https://www.youtube.com/watch?v=aQBy1ilwGZI&t=0s
  18. Background Hello everybody, I'm here to present you my brand new and updated race server but first some information about how I got to make it. It all started around august 2015 when I read a tutorial on these forums on how to open my own server as back then I needed it to train some maps alone and restart them as many times as I wanted. But in time I got interested in how all those other servers I play on are actually made and little by little I started learning LUA. At first I just used ready scripts from the community, a bit later I started to edit small parts of them and soon after I started to recreate community resources, meaning that I use the base idea/code but adapt it for my needs. And not long after I made my first standalone script. Since then I've learned a lot about how MTA works and actually that was what got me interested in programming and at the moment I'm first year in university, studying informatics and working on a few MTA servers A Glimpse Of What's Included If you wish to have a look at some of the features on the server, screenshots are available at the following link (not all are included in the screenshots): click me Server Information I won't give an IP here because there's no telling when it might change since I'm on a free hosting service (which has premium quality by the way)(https://www.limitlessrpg.com). You can either search for the server by it's name (Classic Racing) or you can see the current IP on it's forums at http://www.classicracing.tk. Other than that below you will see some more information about the server if you want to know more about it: Server Location: France Server Version: 1.5.4 First Download: Around 50 MB Maps: There are around 2000 racing maps each of which was reviewed and had it's details edited if needed. My main goal is to offer that old classic feeling of race which sadly most other servers have just forgotten and they started accepting any kind of maps in their race arenas/rooms, even DM maps or ones which are kindly put - horrible to play in any gamemode. If a map on the server is bad, you can report it to be deleted on the forums and it actually will be deleted. I hope you give the server a go when you have some free time. There are a lot of features (some quite unique and not seen in other servers) not included in the screenshots above. I have used open-source servers' resources as well as a lot of community ones but everything that was not made by me was edited or recreated mainly by me and a few of my MTA friends so that there are zero bugs or incompatibility between scripts. See you on the roads of San Andreas
  19. Hello! due to canceling my Vice city project me and my team started working on something new. Since Watch dogs 2 came out we really wanted to make something similiar. And here it is... Behold - Project San Francisco This project will have its own map based on Real San Francisco (Obviously) and will have a bunch of stuff inspired by watch dogs games and rpg's/roleplay's Since there's not that much progress yet ill show a few stuff that were done (And are in Work in progress state) Let me start with some vehicles and guns , later ill show some few models that we are still working on 1.Goblin (Including radar in the picture) 2.SFPD Talos (Including radar in the picture) 3.Golden Gate (WIP) Team: Main Dev's: ThatsMe Fusion*
  20. Hi all, I request a simple thing, because I really want to see this exist though I dont know how to make it myself. I request that u make a little program or something like that that I can just go in game then press a button or alt tab out and activate it and it will move my character randomly ever few seconds, so that let's say you don't get kicked or something like that. Please if u could do this you would make my day really. Hope to see some, your's truly, Lopexsw.
×
×
  • Create New...