Jump to content

Angelo.

Members
  • Posts

    18
  • Joined

  • Last visited

About Angelo.

  • Birthday 09/03/1995

Details

  • Gang
    SAES

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Angelo.'s Achievements

Square

Square (6/54)

0

Reputation

  1. Does anyone know if it's possible to disable adding function parameters on auto-complete? Maybe only put mandatory arguments and not put optional ones? for example I type "outp" then press Tab and have "outputChatBox(string message)" if it's client or have "outputChatBox(string message, player target)" if server side.
  2. Your snipper does not contain any issues relating to the error you mentioned. If you prefer not to post a bigger snippet, do check all your functions, condition statements and loops and make sure each has a closing 'end'.
  3. Yhea I changed car to maverick at the last second before posting and forgot to change the other ones, but that's not the problem. Will check that link and get back on you.
  4. Hello, I've been looking into setVehicleHandling() and what I'm trying to do is increase maverick speed but for some reason it won't change. This is what I do: funtion handlingTest() local me = getPlayerFromName("Angelo") local maverick = getPedOccupiedVehicle(me) setVehicleHandling(car, "maxVelocity", 500) setVehicleHandling(car, "engineAcceleration", 50) end addCommandHandler("yolo", handlingTest) Before you ask the obviousl, this is just a test function and not an actual script, I run the command while being fully inside the maverick. It just wouldn't go over the speed of approx 140 kph The command seems to have no effect.
  5. Angelo.

    help

    You could also create a local variable for example 'cooldown' and set it to false. When someone uses the command set cooldown to true then set a timer to reset the cooldown to false after X seconds as well as close the barrier. local cooldown = false function tollHandler() if cooldown then return end openBarrier() -- this is the function that will open the barrier cooldown = true setTimer( function() closeBarrier() -- this is the function that will close the barrier cooldown = false end, 5000, 1) -- 5 seconds cooldown end addCommandHandler("paytoll", tollHandtler) function openBarrier() -- code here end function closeBarrier() -- code here end
  6. have you modified the freeroam resource?
  7. Please read the following topic on how to properly ask for help
  8. Thanks for all the help, this topic can be locked (not sure if that's what happens) as it's now solved.
  9. Cool, I wasn't sure it was possible. So I'll just create the file server side and not include it in the meta so clients won't download it.
  10. is it possible to have the file created on the server only? If yes, that's what exactly I'm looking for.
  11. So this is your client side function, since you didn't put the code in it, I will suppose it outputs the 'text' you pass as argument. addEvent("test12334", true) function trailerCreated(text) outputChatBox("Hello World!") end addEventHandler("test12334", getLocalPlayer(), trailerCreated) Now to call call this from a server side script, you need to use triggerClientEvent like this: triggerClientEvent(getRootElement(), "test12334", client, text) This will trigger the event for all the players on the server, result: the "Hello World!" message will be outputed for all players. If you want to specify an element to trigger the event for, simply change the first argument to the element you want. For example, I want to trigger the event for ONE player only, this player is called "Angelo", this is what I will do: local pElem = getPlayerFromName("Angelo") -- you can also do this inline inside the triggerClientEvent, but I prefer it like this triggerClientEvent(me, "test12334", client, text) -- me : target, trigger the event for this element, optional, default is getRootElement() which is all players -- "test12334" : your client event name -- client : it's the source of the event, where it came from -- text : your argument from trailerCreated function
  12. Hello, I'll get straight to it. I'm trying to restrict access to an XML file which I'm planning to create. This file will contain more or less sensitive information which I don't want clients to access. Usually, when a file is created by a resource, clients can find it in the downloaded resources folder. In my case I don't want that to be possible. I thought about deleting the file after using it, but the file will be edited via a GUI which I coded by people with proper access. Is it possible to have the file created and hidden from clients? not sure if it works similar to server scripts which are not downloaded by clients. Or maybe create the file but only for specific clients?
  13. Never mind, after running some tests, I just realized how stupid my mistake was. Apparently I assigned the commands ( line 22 to line 27 ) as local, so the second block "elseif"(line 20) doesn't recognize the commands, so it doesn't gets unbinded. Silly me.
  14. https://wiki.multitheftauto.com/wiki/UnbindKey problem still up.
  15. Good day gents, So, I got this piece of code Client side: function bindKeyFunc(state) if(state == "bind")then local activeListString = "Page"..tostring(activeList) local ID1, NAME1, CONTENT1, COMMAND1 = dataRetrieve( activeListString, "Bind1") local ID2, NAME2, CONTENT2, COMMAND2 = dataRetrieve( activeListString, "Bind2") local ID3, NAME3, CONTENT3, COMMAND3 = dataRetrieve( activeListString, "Bind3") local ID4, NAME4, CONTENT4, COMMAND4 = dataRetrieve( activeListString, "Bind4") local ID5, NAME5, CONTENT5, COMMAND5 = dataRetrieve( activeListString, "Bind5") local ID6, NAME6, CONTENT6, COMMAND6 = dataRetrieve( activeListString, "Bind6") bindKey ( "1", "down", COMMAND1, CONTENT1 ) bindKey ( "2", "down", COMMAND2, CONTENT2 ) bindKey ( "3", "down", COMMAND3, CONTENT3 ) bindKey ( "4", "down", COMMAND4, CONTENT4 ) bindKey ( "5", "down", COMMAND5, CONTENT5 ) bindKey ( "6", "down", COMMAND6, CONTENT6 ) outputChatBox("All keys bounded!") elseif(state == "unbind")then res1 = unbindKey ( "1", "down", COMMAND1 ) res2 = unbindKey ( "2", "down", COMMAND2) res3 = unbindKey ( "3", "down", COMMAND3) res4 = unbindKey ( "4", "down", COMMAND4) res5 = unbindKey ( "5", "down", COMMAND5) res6 = unbindKey ( "6", "down", COMMAND6) -- outputs are for testing outputChatBox(tostring(res1)) outputChatBox(tostring(res2)) outputChatBox(tostring(res3)) outputChatBox(tostring(res4)) outputChatBox(tostring(res5)) outputChatBox(tostring(res6)) end end So the thing is, i'm using this function somewhere else with either "bind" or "unbind" as arguments ( string type arguments). There is no problem with the binding part, that works perfectly, but there is an issue with the unbindKey part because it returns false and the keys doesn't get unbinded. in case you're wondering, dataRetrieve() is a function made on the same script, and it works perfectly. No debug warnings/errors show. I'd like to know if anyone have experienced the same issue and how to fix it, thanks in advance
×
×
  • Create New...