-
Posts
367 -
Joined
-
Last visited
Everything posted by Ab-47
-
I know this maybe a funny question, but did you click the refresh button to load servers?
-
At-least post your code along with your meta. So we can see if you've gone wrong or not there.
-
Then Xeon's code is wrong if you want to prevent admins from spawning vehicles. When they're spawned directly into a vehicle the event "onVehicleEnter" will not be called. Banex's code looks great and more neater, instead of "blowVehicle" use "destroyElement" and there's the solution.
-
local allowed = {[411] = true,[522] = true, [470] = true} addEventHandler("onVehicleEnter", root, function(thePlayer) local veh = getPedOccupiedVehicle(thePlayer) if not allowed[getElementModel(veh)] then destroyElement(veh) end end)
-
Sorry, I didn't understand your problem :3 and missed the point. But glad your situation is resolved.
-
Yeah like "getRealTime()", start the timer, and when the resource stops, set the account data for the time it was stopped. Then when the resource starts again it could "getRealTime()" and add account data for the time it started again and calculate the difference between the stopped and started time. Would need a bit of math, but I'm sure it's possible.
-
Yes, continue using bindKey and your code. But instead of calling "doSomething()" use this: triggerEvent(source, "doSomething") Then to the function you're calling add it's events: function doSomething() --your code end addEvent("doSomething", true) addEventHandler("doSomething", root, doSomething)
-
And restarting the script 1 minute before 24 hours will give the player another 24 hours. It's better you use an SQL database. Link
-
Calling a function like that is only server sided. Try using triggerEvent for client sided functions. Example: function testFunc() triggerEvent(source, "example.trigger") end addEventHandler("onClientResourceStart", root, testFunc) function trigger() outputDebugString("called") end addEvent("example.trigger", true) addEventHandler("example.trigger", root, trigger)
-
function bindLockOnSpawn ( theSpawnpoint ) -- w bindKey ( source, "l", "down", lockcar ) end addEventHandler ( "onResourceStart", getRootElement(), bindLockOnSpawn ) Try this.
-
Are you using a router connected to your modem? And what's your modem type. Generally, players get packet data loss due to using a router connected to a modem which causes data loss at random intervals like as you stated, you get disconnected after 10 mins. Try connect directly to your modem, if you use a router. Or try connecting an ethernet cable directly to your computer/laptop.
-
First bump - 6 years Second bump - 5 years.. Is your third bump gonna be in 2019?
-
Try stopping all resources and check to see if the problem persists. If it doesn't, one of your resources (probably a resource that includes a map file) may be the problem. If it still happens, then just let us know.
-
Are you sure the noise is coming from MTA? Because if the software isn't running there shouldn't be any noise coming from it. Try quit MTA again, then open the task manager, switch tabs to 'processes', check if any source is running under MTA, end the process and see if the noise is still there. On the other hand, click your sound icon on the task bar, click 'mixer' to open the sound mixer, and verify what is making the sound if it shows. Goodluck.
-
As much as I understood from what you just said, conclusion, wait 5 days.
-
If you're able to run MTA though not play it, you can always try going to settings and checking the 'Windowed' box, allowing you to play in Windowed.
-
Create a col-shape, get objects under the vehicles class and remove the vehicles if they're within the col-shape. Simple, I guess.
-
afaik impossible.. What about placing objects slightly above the water, like a gate object, set alpha to 0. Only worry about this is players falling through water if their FPS is too low and taking to much download space.
-
Or do you mean safezones? Like a player gets killed randomly anywhere on the map and spawns within a colshape?
-
I got This when i try to run this script , can you fix it?? So sorry mate, forgot to close the 'if' statement with an 'end'. But your problem is solved now
-
sorry sir , the password "open / close" it just as an example, what I mean here is how to get the gate closed and opened with one same password, as an example, I want to open the gate to move with one command, / gatepassword and I want to close with the command / gatepassword as well Okay.. local gateOpen = false function createTheGate1 () myGate1 = createObject ( 987, 2500.7998046875, -1520.400390625, 22.700000762939, 270, 90, 90 ) myGate2 = createObject ( 987, 2500.7998046875, -1525.400390625, 22.700000762939, 270, 90, 90 ) myGate3 = createObject ( 987, 2500.7998046875, -1531.2001953125, 22.700000762939, 270, 90, 90 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate1 ) function openMyGate1 () if (gateOpen == false) then moveObject ( myGate1, 1500, 2500.7998046875, -1520.400390625, 19.5, 0, 0, 0 ) moveObject ( myGate2, 1500, 2500.7998046875, -1525.400390625, 17.700000762939, 0, 0, 0 ) moveObject ( myGate3, 1500, 2500.7998046875, -1531.2001953125, 16, 0, 0, 0 ) gateOpen = true else moveObject ( myGate1, 1500, 2500.7998046875, -1520.400390625, 22.700000762939, 0, 0, 0 ) moveObject ( myGate2, 1500, 2500.7998046875, -1525.400390625, 22.700000762939, 0, 0, 0 ) moveObject ( myGate3, 1500, 2500.7998046875, -1531.2001953125, 22.700000762939, 0, 0, 0 ) gateOpen = false end addCommandHandler("yourcommand",openMyGate1) That?
-
Well, if your gate isn't opening I guess you're unaware that you've included an irrelevant character in your command handler; addCommandHandler("'open",openMyGate1) change that with; addCommandHandler("open",openMyGate1) Though, password is basically a code, a code that other people aren't aware of. 'open' and 'close' are common words people use to commit that command, but you can also change these words to something other people aren't aware of. There's your password solution, change your command handler command to whatever your password is, i.e; [/lua]addCommandHandler("123456",openMyGate1)[/lua] The code shall open using the command /123456 or if you want a more unique system like an edit box and accept button, try GUI elements, functions etc.
-
In the same file or a different one?