• Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About DriFtyZ

  • Rank

Recent Profile Visitors

546 profile views
  1. Hello, i am trying to create a vehicle loader script that loads all the vehicle models from a Lua table instead of adding them manually one by one but i am getting "error unexpected symbol near .." Now i know my syntax is wrong in line 18 and 20 where i try to create a variable based from the name index on the Lua table but i don't know how to accomplish it. Any help would be appreciated. Thanks local vehiclesFileNames = { AE86 = 589, ToyotaSupra = 559, ToyotaAltezza = 402, Datsun240Z = 475, Nissan180SX = 602, SilviaS13 = 401, SilviaS14 = 576, SilviaS15 = 474, Skyline2000 = 535, SkylineR32 = 555, SkylineR34 = 562, SkylineGTR = 558, } function loadVehicleFiles() for name, id in ipairs(vehiclesFileNames) do local name..txd = engineLoadTXD ( "Cars/"..name.."/"..name..".txd") engineImportTXD ( name..txd, id ) local name..dff = engineLoadDFF ( "Cars/"..name.."/"..name..".dff") engineReplaceModel ( name..dff, id ) outputDebugString("name = "..name.." | id = "..id..".") end end addEventHandler("onClientResourceStart", resourceRoot, loadVehicleFiles())
  2. Fair enough you answered almost all my questions, but there is one more. if you player:setHealth(50) that "player" needs to be defined right? So if the player is defined somehow either from source or from a variable like local driftyz = getLocalPlayer() can i use driftyz:setHealth(50)? Thanks in advance
  3. okay makes sense it is faster to write, but for people like me who don't know the OOP functions will have to learn them, because i remember it took me months to learn most of the procedural mta functions. Guess it is more advanced even tho it sounds more simple
  4. Hello MTA SA Community i started this thread so someone who knows how the OOP works can explain it to me aswell because i have some questions and couldn't understand some of the wiki. I've seen some people using OOP in their resources instead of calling exported functions if i saw correctly. Can i use OOP to replace some exported functions? for example if i have to call a notification resource to show notifications can i use OOP to call that function who will post notifications on the player screen? And second what is the main point to use OOP at all?
  5. The brackets wasn't a problem i tried it without them before, anyways ill try the "call" way and let you know
  6. <exports function="showErrorCode" type="server" /> It might looks messed because im from my phone
  7. Exact what the title says, i can't figure it out what is wrong with a simple exports code im testing, thanks! error: Failed to call '[DWN]Core:showErrorCode'[string "?"] code to call the function: exports["[DWN]Core"]:showErrorCode(player, "02") code of the exported function: function showErrorCode (player, int) if player then if int == "02" then -- Some random code to excecute here outputChatBox("It Works!") end end end
  8. DriFtyZ

    [BUG]About GUIs

    Correct but as i said i haven't explained what i wanted correctly which i fixed it later and that link wasn't what i was looking for.
  9. DriFtyZ

    [BUG]About GUIs

    I'm sorry my mistake i should have put [QUESTION] tag and i didn't explained well what i wanted tough i fixed it, this guy also didn't behave gentle instead of he threw a common link onto my face telling me to quit calling stuff like this bugs like i'm doing it every day
  10. DriFtyZ

    [BUG]About GUIs

    Quit being an smartass
  11. Yes, Its an another one annoying question from me, i have a vehicle menu where the player selects which vehicle he wants to spawn/hide unlock etc... the menu finds the player's owned vehicles through a dbQuery and separates them into rows inside the gridlist when i select a vehicle it spawns it based on the plate text, but when i close and open the menu again it just's deselects the selected row... In few words i want to make the gui selects the row itself if the vehicle is spawned when the player opens the menu how can this be possible, thanks! EDIT: Pic is a bit aged don't mind if the other buttons i said are not included in
  12. thank you, i was so dumb that just tried to use only a useful function without copying the code below
  13. Hello people, i noticed on the wiki there are some function called Useful functions, how can i use them? what are they exactly?
  14. Hello there, i want to export some database functions instead of using db connect on all resources, how can i make it?