Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    41

Everything posted by myonlake

  1. Save the current timestamp and check the timestamp in database and compare it with the current time and date and it should work.
  2. myonlake

    Lock this

    I think your post was unnecessary since I fixed it in my last post.
  3. myonlake

    Lock this

    Well perhaps you could change the code by yourself? We are not making scripts for you. local pilotMark = createMarker(1711.1593017578, 1615.5653076172, 9, "cylinder", 2, 255, 255, 0, 255) local pilotBlip = createBlipAttachedTo(pilotMark, 56) local pilotped = createPed(61, 1711.1593017578, 1615.5653076172, 10, 252.005493) local teamPilot = createTeam("Pilot", 255, 255, 0) local pilotVehMark = createMarker(1719.3674316406, 1612.0157470703, 8.5, "cylinder", 1.75, 255, 255, 0, 255) setElementFrozen(pilotped, true) addEventHandler("onMarkerHit", root, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then if isPedInVehicle(hitElement) then return end if not getElementData(hitElement, "pilot.on-duty") then if source == pilotMark then setElementModel(hitElement, 61) setPlayerTeam(hitElement, teamPilot) setElementData(hitElement, "pilot.on-duty", true, true) elseif source == pilotVehMark then if getTeamName(getPlayerTeam(hitElement)) == "Pilot" then local x, y, z = getElementPosition(hitElement) local pilotVeh = createVehicle(583, x - 3, y + 2, z + 0.5) warpPedIntoVehicle(hitElement, pilotVeh) outputChatBox("Vehicle spawned.", hitElement, 0, 153, 0, false) setElementData(hitElement, "pilot.on-duty", true, true) end end end end end ) addEventHandler("onPlayerJoin", root, function() for _, player in ipairs(getElementsByType("player")) do setElementVisibleTo(pilotMark, player, false) end for _, player in ipairs(getPlayersInTeam(teamPilot)) do setElementVisibleTo(pilotMark, player, true) end end )
  4. We are not here to give away codes. Please check out those functions from the Wiki.
  5. isObjectInACLGroup getElementData setElementData
  6. Yeah well this is not Java or PHP.
  7. I think the fact that you give a link to an automatic generator doesn't teach him anything - only that he gets what he wants without putting any effort to it. First of all, texture replacements are client-side and work as a normal resource. You need two files for normal purposes (TXD, DFF). You need to load these files via the meta.xml file and via the client-side .lua file. I made you a simple example of how it can be done. I do not suggest generators because it takes more time than doing this manually. If you want to improve your lua skills in MTA, then you should just script everything by yourself and not use anyone else's scripts - just saying. Replacing the skin ID 9 skin_txd = engineLoadTXD("models/9.txd") engineImportTXD(skin_txd, 9) skin_dff = engineLoadDFF("models/9.dff", 0) engineReplaceModel(skin_dff, 9) Replacing the vehicle ID 411 (Infernus) vehicle_txd = engineLoadTXD("models/Infernus.txd") engineImportTXD(vehicle_txd, 411) vehicle_dff = engineLoadDFF("models/Infernus.dff", 411) engineReplaceModel(vehicle_dff, 411) If you want to replace something else than vehicles, then your engineLoadDFF's second argument must be a zero. Otherwise you must enter the vehicle ID. <meta> <info name="Replacement of textures" type="script" /> <script src="c_replace.lua" type="client" /> <file src="models/9.txd" /> <file src="models/9.dff" /> <file src="models/Infernus.txd" /> <file src="models/Infernus.dff" /> </meta>
  8. For those who have this issue, here's an example, which shouldn't be too hard to produce yourself. bool setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, bool loop=true, bool updatePosition=true, bool interruptable=true, bool freezeLastFrame = true] ) setPedAnimation(player, "block", "animation", -1, true, false, false, true)
  9. myonlake

    Lock this

    Are you serious...? local pilotMark = createMarker(1711.1593017578, 1615.5653076172, 9, "cylinder", 2, 255, 255, 0, 255) local pilotBlip = createBlipAttachedTo(pilotMark, 56) local pilotped = createPed(61, 1711.1593017578, 1615.5653076172, 10, 252.005493) local teamPilot = createTeam("Pilot", 255, 255, 0) local pilotVehMark = createMarker(1719.3674316406, 1612.0157470703, 8.5, "cylinder", 1.75, 255, 255, 0, 255) setElementFrozen(pilotped, true) addEventHandler("onMarkerHit", root, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then if source == pilotMark then if isPedInVehicle(hitElement) then return end setElementModel(hitElement, 61) setPlayerTeam(hitElement, teamPilot) elseif source == pilotVehMark then if getTeamName(getPlayerTeam(hitElement)) == "Pilot" then local x, y, z = getElementPosition(hitElement) local pilotVeh = createVehicle(583, x - 3, y + 2, z + 0.5) if isPedInVehicle(hitElement) then removePedFromVehicle(hitElement) end warpPedIntoVehicle(hitElement, pilotVeh) outputChatBox("Vehicle spawned.", hitElement, 0, 153, 0, false) end end end end ) addEventHandler("onPlayerJoin", root, function() for _, player in ipairs(getElementsByType("player")) do setElementVisibleTo(pilotMark, player, false) end for _, player in ipairs(getPlayersInTeam(teamPilot)) do setElementVisibleTo(pilotMark, player, true) end end )
  10. Right, didn't pay attention to that.
  11. https://wiki.multitheftauto.com/wiki/Meta.xml
  12. myonlake

    Tuning of MTA (Cars)

    Texture modifications work perfectly with MTA. I have never heard of your issue and I didn't find anything via Google neither.
  13. myonlake

    Lock this

    local pilotMark = createMarker(1711.1593017578, 1615.5653076172, 9, "cylinder", 2, 255, 255, 0, 255) local pilotBlip = createBlipAttachedTo(pilotMark, 56) local pilotped = createPed(61, 1711.1593017578, 1615.5653076172, 10, 252.005493) local teamPilot = createTeam("Pilot", 255, 255, 0) local pilotVehMark = createMarker(1719.3674316406, 1612.0157470703, 8.5, "cylinder", 1.75, 255, 255, 0, 255) setElementFrozen(pilotped, true) addEventHandler("onMarkerHit", root, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then if source == pilotMark then if isPedInVehicle(hitElement) then return end setElementModel(hitElement, 61) setPlayerTeam(hitElement, teamPilot) elseif source == pilotVehMark then if getTeamName(getPlayerTeam(hitElement)) == "Pilot" then local x, y, z = getElementPosition(hitElement) local pilotVeh = createVehicle(583, x - 3, y + 2, z + 0.5) if isPedInVehicle(hitElement) then removePedFromVehicle(hitElement) end warpPedIntoVehicle(hitElement, pilotVeh) outputChatBox("Vehicle spawned.", hitElement, 0, 153, 0, false) end end end end )
  14. Compilation doesn't mean it's encrypted. Compilation means it turns the code to the computer language such as 0 and 1.
  15. The event which you have server-side doesn't return anything. This should work. Client-side function g_commands() if not isElement(hWnd_Commands) then hWnd_Commands = guiCreateWindow(0.2, 0.2, 0.6, 0.6, "Admin LVL.5 Commands || By Enjoy || Version 1.0", true) hGrid_Admin = guiCreateGridList(0.1, 0.1, 0.8, 0.6, true, hWnd_Commands) showCursor(true) else destroyElement(hWnd_Commands) showCursor(false) end ) function visibleToAdmin5() triggerServerEvent("aclAdmin5", localPlayer) end addCommandHandler("mycmds", visibleToAdmin5) addEventHandler("onPlayerLogin", root, visibleToAdmin5) addEvent("onPermissionGranted", true) addEventHandler("onPermissionGranted", root, function() g_commands() end ) Server-side addEvent("aclAdmin5", true) addEventHandler("aclAdmin5", root, function() if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup ("Admin5")) then triggerClientEvent("onPermissionGranted", source) end end ) Edit: Just realized this is my 666th post, lmao.
  16. Probably because you aren't doing anything when it checks that.
  17. myonlake

    SQL Question

    You need to make sure you have the correct modules in right places and the MySQL settings in your server are correct. Any errors in the console or debug? What script are you trying to run?
  18. local txd = engineLoadTXD("data/Ajax.txd") engineImportTXD(txd, 16) local dff = engineLoadDFF("data/Ajax.dff", 0) engineReplaceModel(dff, 16)
  19. In other words: https://wiki.multitheftauto.com/wiki/Scr ... troduction.
  20. local originalX = -783.20001220703 local originalY = 2597.1999511719 local originalZ = 104.09999847412 addEventHandler("onResourceStart", resourceRoot, function() myGate = createObject(18483, originalX, originalY, originalZ, 0, 0, 83.984985351563) end ) addCommandHandler("opengate", function () moveObject(myGate, 500, -781.20001220703, 2624.8000488281, 104.09999847412, 0, 0, 0) myEffect = createObject(2780, -783.90002441406, 2660.5, 104.09999847412, 0, 0, 0) setTimer(destroyElement, 3000, 1, myEffect) end ) addCommandHandler("closegate", function() moveObject(myGate, 500, originalX, originalY, originalZ, 0, 0, 0) end )
  21. In other words, just check out the scripting introduction here: https://wiki.multitheftauto.com/wiki/Scr ... troduction. And tutorials here: viewforum.php?f=148.
  22. [2012-10-15 18:14:50] MODULE: Unable to find modules/conection.lua! [2012-10-15 18:14:50] MODULE: Unable to find modules/s_mysql.lua! [2012-10-15 18:14:50] MODULE: Unable to find modules/mta_mysql! Those are not modules. [2012-10-15 18:14:50] ERROR: Couldn't find resource conection. Check it exists. [2012-10-15 18:14:50] ERROR: Couldn't find resource s_mysql. Check it exists. Those are not resources. [2012-10-15 18:14:51] ERROR: Couldn't find resource apps-system. Check it exists. [2012-10-15 18:14:51] ERROR: Couldn't find resource apps-system. Check it exists. You are trying to start the same resource twice which is unnecessary. [2012-10-15 18:14:51] ERROR: Couldn't find resource bank-system. Check it exists. [2012-10-15 18:14:51] ERROR: Couldn't find resource event-system. Check it exists. [2012-10-15 18:14:51] ERROR: Couldn't find resource fiddycal. Check it exists. [2012-10-15 18:14:51] ERROR: Couldn't find resource fuel-system. Check it exists. [2012-10-15 18:14:52] ERROR: Couldn't find resource ammun. Check it exists. [2012-10-15 18:14:53] ERROR: Couldn't find resource loading. Check it exists. [2012-10-15 18:14:53] ERROR: Couldn't find resource maps. Check it exists. Those resources do not exist. You also have a lot of errors that can be fixed. Secondly, you do not have a valid MySQL server set up.
  23. Or then just do this. addCommandHandler("effectoff", function(player, cmd) setTimer(destroyElement, 3000, 0, myeffect) end ) Doesn't really matter how.
×
×
  • Create New...