Jump to content

SjoerdPSV

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by SjoerdPSV

  1. Start 'startup'. That resource will start any resource you need. I am currently working on the ACL on my private server, we didn't had access to the ACL file. It will start all resources in order ? automatically ? Yes it does. You should change your mysql details in database.slua. (Which could be found in some resources.) If you add the correct details it will set-up the database by itself, since it contains queries to add them automically.
  2. Start 'startup'. That resource will start any resource you need. I am currently working on the ACL on my private server, we didn't had access to the ACL file.
  3. The script is unfished, but it's located in Flint County, the car cinema. Or if it's the other version (there were 2) it's located in the Verona Mall.
  4. Apparantly I forgot to install one of those libraries, it's fixed now! Thanks for your help Mr_Moose, appreciated!
  5. Did that, but it still outputs the same error. root@vps218448:/home/mta/server# chmod u+x core.so net.so xmll.so root@vps218448:/home/mta/server# ./mta-server -bash: ./mta-server: No such file or directory
  6. Hello, I wanted to set up my private server on debian 7 today, did it loads of time before but this error doesn't disappear: I chmodded the file (as you can see in the picture) installed everything that's necessary, so I don't know what's wrong. Anyone who's able to help me? Thanks.
  7. Add LilDolla to the developers list, he did a lot of great things for GTI and deserves to be on that list. No matter what he did, you're not the one who decides who should and who shouldn't be on that list. No I am not being mad with you, but I don't want him to be excluded from this.
  8. function disableLogin(command) if (command == "login") then cancelEvent() end end addEventHandler("onPlayerCommand", root, disableLogin) There you go
  9. Hello, Could anyone help me, I want to round some numbers in my script to 1 decimal, but I don't know which Lua function I should use for that. For example, 1.36455 will be rounded to 1.4 etc.
  10. OWLGaming is a good server for RP imo.
  11. Hello, I wanted to install MTA on my VPS. I want to use it for my own server, as a 'second' screen. Sometimes I need to test something with 2 persons, but I can't since I only have 1 PC. I've installed GTA and MTA on it, but when I try to start MTA, I get the following error: http://puu.sh/gIePy/33f063672d.png I tried to install it manually, but I didn't succed in it, does anyone have a solution for this?
  12. LOL, it was because of that capital. Thanks for your help
  13. use triggerClientEvent (https://wiki.multitheftauto.com/wiki/triggerClientEvent) in the server side function which handles it.
  14. Hello I was scripting a GUI and for the button handling I made this function: function buttonHandling() outputDebugString("test1") local input = guiGetText(GUIEditor.edit[1]) if (source == GUIEditor.button[1]) then guiSetText(GUIEditor.edit[1], input.."1") outputDebugString("test2") elseif (source == GUIeditor.button[9]) then guiSetText(GUIEditor.edit[1], input.."2") elseif (source == GUIeditor.button[8]) then guiSetText(GUIEditor.edit[1], input.."3") elseif (source == GUIeditor.button[8]) then guiSetText(GUIEditor.edit[1], input.."4") elseif (source == GUIeditor.button[7]) then guiSetText(GUIEditor.edit[1], input.."5") elseif (source == GUIeditor.button[6]) then guiSetText(GUIEditor.edit[1], input.."6") elseif (source == GUIeditor.button[5]) then guiSetText(GUIEditor.edit[1], input.."7") elseif (source == GUIeditor.button[4]) then guiSetText(GUIEditor.edit[1], input.."8") elseif (source == GUIeditor.button[3]) then guiSetText(GUIEditor.edit[1], input.."9") elseif (source == GUIeditor.button[2]) then guiSetText(GUIEditor.edit[1], input.."0") end end addEventHandler("OnClientGUIClick", root, buttonHandling) But it doesn't work, the outputDebugString are not popping up in my /debugscript. I can't find out what's wrong with this and I'm 100% sure that all GUIelements are the right ones (the ones after source ==) Is it becuase I set it on read only? Or shouldn't that be a problem?
  15. Anyone knows how to install this on Windows 8.1? Always get the error that I don't have MTA installed.
  16. Hello, I wanted to trigger the onPlayerLogin event, but I want it so that only the player who logs in will trigger the event. I tried to put source as the 2nd argument but that gives an error. Anyone knows what's wrong? function startUp() dbQuery(startUp2, speakerdb, "SELECT * FROM songs") dbQuery(startUp3, speakerdb, "SELECT * FROM radios") dbQuery(startUp4, speakerdb, "SELECT * FROM speakers") end addEventHandler("onResourceStart", resourceRoot, startUp) addEventHandler("onPlayerLogin", source, startUp) Thanks in advantage, Sjoerd
  17. Hello, Is it possible to play music in a colshape? And if it's possible, which functions/events should I use for it? Thanks in advance, SjoerdPSV
  18. Hello, I want to make a gate for a specific group, I'm using this group-system: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8036 So I created this script, I don't have any errors in /debugscript but there still happens nothing. gate1 = createObject ( 2990, 1621.39941, -1862, 16.5, 0,0,0 ) gatecol = createColCircle ( 1621.1999511719,-1860.5,12.5, 10 ) function opengates(thePlayer) if ( exports["groups-system"]:getAccountGang ( getPlayerAccount ( thePlayer ) ) == "ArmedForces" ) then moveObject (gate1, 650, 1621.40002, -1862, 7.3 ) end end addEventHandler( "onColShapeHit", gatecol, opengates ) function closegates(thePlayer) if ( exports["groups-system"]:getAccountGang ( getPlayerAccount ( thePlayer ) ) == "ArmedForces" ) then moveObject (gate1, 650, 1621.39941, -1862, 16.5 ) end end addEventHandler( "onColShapeLeave", gatecol, closegates ) Anyone knows what's wrong?
  19. Ik zal hem even voor je maken en straks mailen.
  20. I did and changed it and the script looks like this now: local fuelMarker = createMarker ( -2024.2071533203, 156.86796569824, 28.8359375, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( 2114.6799316406, 920.03802490234, 9.8203125, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( 2639.9396972656, 1106.4301757813, 9.376944541931, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( 2147.025390625, 2747.4851074219, 9.392276763916, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( 2202.6599121094, 2474.2084960938, 9.389625549316, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( 1595.8334960938, 2199.1372070313, 9.392153739929, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( 292.55081176758, 2541.2055664063, 15.820880889893, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( 611.92376708984, 1694.8377685547, 5.9921875, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( -1328.3668212891, 2677.4641113281, 49.0625, "cylinder", 4.5, 255, 255, 255, 91 ) local fuelMarker = createMarker ( 1944.73230, -1771.29858, 12.39060, "cylinder", 4.5, 255, 255, 255, 91 ) addEvent("onGasRefill",true) function setUp(startedResource) if(startedResource == getThisResource()) then local sWidth,sHeight = guiGetScreenSize ( ) oX,oY,oZ = getElementPosition(getLocalPlayer()) fBar = guiCreateProgressBar(sWidth*0.796, sHeight*0.853, 200, 19, false) fLabel = guiCreateLabel(68, 2, 40, 30, "", false, fBar) setTimer(fuelDepleting,50,0) distance = 0 distanceOld = 0 end end addEventHandler("onClientResourceStart",getRootElement(),setUp) function drawFuelBar() fBar = guiCreateProgressBar(sWidth*0.796, sHeight*0.853, 200, 19, false) guiSetVisible(fBar,false) end addEventHandler("onClientPlayerJoin",getRootElement(),drawFuelBar) function monitoring() if(isPlayerInVehicle(getLocalPlayer())) then vehicle = getPlayerOccupiedVehicle(getLocalPlayer()) x,y,z = getElementPosition(getLocalPlayer()) distance = distance + getDistanceBetweenPoints3D(x,y,z,oX,oY,oZ) oX = x oY = y oZ = z end end addEventHandler("onClientRender",getRootElement(),monitoring) function fuelDepleting() if(isPlayerInVehicle(getLocalPlayer())) then vehicle = getPlayerOccupiedVehicle(getLocalPlayer()) guiSetVisible(fBar,true) if(getElementData(vehicle,"fuel") == false) then fuel = math.random(85,100) setElementData(vehicle,"fuel",tonumber(fuel)) end currentFuel = tonumber(getElementData(vehicle,"fuel")) if(currentFuel > 0) then setElementData(vehicle,"fuel",tostring(currentFuel - math.floor(distance - distanceOld)/200)) currentFuel = tonumber(getElementData(vehicle,"fuel")) guiProgressBarSetProgress(fBar,currentFuel) guiSetText(fLabel,"" .. math.floor(currentFuel) .. "%") guiSetFont(fLabel, "default-bold-small") guiLabelSetColor(fLabel, 255, 0, 0) distanceOld = distance else toggleControl("accelerate",false) toggleControl("brake_reverse",false) guiSetText(fLabel,"0%") guiSetFont(fLabel, "default-bold-small") guiLabelSetColor(fLabel, 255, 0, 0) end else guiSetText(fLabel,"") guiProgressBarSetProgress(fBar,0) guiSetVisible(fBar,false) end end function setFuel(player,seat,jacked) if(getElementData(vehicle,"fuel") == false) then fuel = math.random(70,100) setElementData(source,"fuel",tonumber(fuel)) end end addEventHandler("onClientVehicleEnter",getRootElement(),setFuel) function setFuelOnRespawn() local fuel = math.random(70,100) setElementData(source,"fuel",tonumber(fuel)) end addEventHandler("onClientVehicleRespawn",getRootElement(),setFuelOnRespawn) function enableDriving(player,seat) toggleControl("accelerate",true) toggleControl("brake_reverse",true) end addEventHandler("onClientVehicleExit",getRootElement(),enableDriving) function refillGas() if(isPlayerInVehicle(getLocalPlayer()) and isPlayer) then local vehicle = getPlayerOccupiedVehicle(getLocalPlayer()) setElementData(vehicle,"fuel","99") outputChatBox("Refilled") toggleControl("accelerate",true) toggleControl("brake_reverse",true) exports["TopBarChat"]:sendClientMessage("Your vehicle is refilled!",255,0,0, true, -- s8) --> end end addCommandHandler("refill",refillGas) function setTimerRefillGas(enabled) if(isPlayerInVehicle(getLocalPlayer())) then if(enabled == true) then refillTimer = setTimer(timerRefillGas,100,0) else if isTimer(refillTimer) then killTimer(refillTimer) end end else outputChatBox("You have to be in vehicle to refill!") end end addEventHandler("onGasRefill",getRootElement(),setTimerRefillGas) function timerRefillGas() if(isPlayerInVehicle(getLocalPlayer())) then local player = getLocalPlayer() local vehicle = getPlayerOccupiedVehicle(player) local fuel = getElementData(vehicle,"fuel") if(tonumber(fuel) < 99) then setElementData(vehicle,"fuel",tostring(fuel + 1)) distanceOld = distance end end end function Warning() if(isPlayerInVehicle(getLocalPlayer())) then if(tonumber(fuel) < 5) then exports["TopBarChat"]:sendClientMessage("You're almost out of fuel!",255,0,0, true, -- s8) --> end end end function onEnterRefillArea(thePlayer,amount,player,sDimension) triggerEvent("onGasRefill",getRootElement(),true) takePlayerMoney(500) exports["TopBarChat"]:sendClientMessage("Your vehicle has been refilled for $500!",12,163,19,true,8) end addEventHandler ( "onClientMarkerHit", fuelMarker, onEnterRefillArea ) function onExitRefillArea(player,sDimension) triggerEvent("onGasRefill",getRootElement(),false) end addEventHandler ( "onClientMarkerLeave", fuelMarker, onExitRefillArea ) but it's still not on the right location.
  21. Hello, I'm using a GUIprogressBar, but for me it's at the right location. (SS1) But for others it's on an other place (SS2). Does anyone have a solution for this? SS1: (Progressbar on the right bottom) SS2: (Progressbar in the middle)
  22. Hello, I'm using a fuel system script, but there's a bug which I can't get fixed. It should stop refilling my car when I leave the marker but it doesn't work. This is the server side, if I leave the marker, it should stop refilling my car but it doesn't work. function onEnterRefillArea(thePlayer,amount,player,sDimension) triggerClientEvent("onGasRefill",getRootElement(),true) takePlayerMoney(thePlayer,500) exports["TopBarChat"]:sendClientMessage("Your vehicle has been refilled for $500!",thePlayer,12,163,19,true,8) end addEventHandler("onMarkerHit",getRootElement(),onEnterRefillArea) function onExitRefillArea(player,sDimension) triggerClientEvent("onGasRefill",getRootElement(),false) end addEventHandler("onMarkerLeave",getRootElement(),onExitRefillArea)
  23. Thanks for the quick response, I forgot that. Thanks for the help.
  24. Hello, I wanted to add a custom blip for my fuel system, so I made a new file, called blips.lua. Here's the code: addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function() exports["customblips"]:createCustomBlip ( -2024.2071533203, 156.86796569824, 10, 10, "icon.png", 500 ) end ) addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function() exports["customblips"]:createCustomBlip ( 2114.6799316406, 920.03802490234, 10, 10, "icon.png", 500 ) end ) addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function() exports["customblips"]:createCustomBlip ( 2639.9396972656, 1106.4301757813, 10, 10, "icon.png", 500 ) end ) addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function() exports["customblips"]:createCustomBlip ( 2147.025390625, 2747.4851074219, 10, 10, "icon.png", 500 ) end ) But in-game the blips doesn't show up. I added the script, the icon in the meta file.
×
×
  • Create New...