Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. Can you tell me what arguments did you use when calling the function server-side?
  2. Well, I don't know what might be the reason for this error in this case. However, I can offer a (temporary) workaround (this reduces or disables security of the admin panel, though): In /mods/deathmatch/settings.xml, add (or replace previous) name="*admin.securitylevel" value="1">> or name="*admin.securitylevel" value="0">> admin.securitylevel defaults to 2, having all checks (including the one preventing your admin panel from functioning). Having security level of 1 would mean only some checks, and 0 would mean no checks. You may also change it in …/admin/meta.xml if you prefer (but according to my understanding, it will be overridden by the value in settings.xml, so remove it from there to use the default one, which is the one set in meta.xml).
  3. The error message is self-explanatory. You're attempting to use the admin panel even though you do not have permission for that (according to the admin panel script). Are you using the default MTA account system? Or have you edited the admin panel at all?
  4. Ermm, I didn't suggest you to change "player" to "nil". I said that you've inputted "nil" where you were meant to input a player element.
  5. You should at least try. We're not here to take requests but to either help with wrongly coded scripts, or help get onto the right track with regards to concept scripts.
  6. You didn't specify the player element for the server side call, thus it skipped the sendTo argument (since it is optional, it is evaluated only if it is a userdata, otherwise it assumes the argument doesn't exist and considers argument 1 as argument 2, 2 as 3, 3 as 4 and so on), leaving the slightly confusing message that it got a string instead of a player element. -- To illustrate, this is being called: triggerClientEvent(nil, "business.dxOutputMessage", nil, "message", 255, 255, 255) -- which is the same as triggerClientEvent("business.dxOutputMessage", nil, "message", 255, 255, 255) -- but the arguments are misplaced. If the first argument was a player element, instead of a nil, the former example would work, otherwise it must be structured like the latter.
  7. You could use element data to store the fact there's a trailer attached and use that data to reattach the trailer when streaming in to either the towtruck or the trailer, and perhaps every 5 seconds (of course as long as either one of them is streamed in) (checking if it has disconnected through desync) maybe?
  8. You can use the standard 'headshot' resource within MTA. Otherwise, use killPed in conjunction with onPlayerDamage on the specific body-part ID (that is, 9, for the head).
  9. You can check whether a value is already within the table using this function function in_table(haystack, needle) for k, v in pairs(haystack) do -- if your table has standard auto-generated keys, you can change 'pairs' to 'pairs' (it might be less CPU intensive that way, but I'm not sure) if v == needle then return true, k -- returns true along with the key at which the value is first found end end return false -- not found, returns false end
  10. I don't see why this code doesn't work for you. Are you sure you saved the file and restarted the resource etc? Also, beware—you're calling isLoggedIn every time a resource starts. You should use resourceRoot (a predefined variable) instead of getRootElement(), otherwise the panel will appear everytime a new resource is started and someone isn't logged in.
  11. Check it serverside and trigger RPC (via server-to-client event) to show GUI.
  12. Admin panel is quite complicated but it doesn't do anything more complex (in that respect) than syncing clientside table with serverside ACL and then looping the table, checking whether such groups in particular apply to the context (the player you're checking against) and concatenation the names of such groups into one string.
  13. I find it more helpful to think of 'piraterpg.money' as a variable and playerMoney as its definition
  14. Think of the account data key as a variable or a Lua table key
  15. — viewtopic.php?p=858390#p858390
  16. Addlibs

    Nill

    p is undefined in getElementData
  17. Make a position check on regular (e.g. every 50ms on timer) or irregular (but frequent) (e.g. onClientRender - but that may be too much for some CPUs) intervals. You can't always rely on having something run by one and only one function.
  18. https://forum.multitheftauto.com/viewforum.php?f=177
  19. Please use [lua] tags so that it's easier to see the code.
  20. You're not alone. I find it hard to understand matrices as well… There might be some useful information on Wikipedia though. http://en.wikipedia.org/wiki/Matrix_(mathematics)
  21. You can't add a number to a vector. However, you can add a Vector to a Vector.If we assume adding 4 means adding a 3-Dimensional Vector with all values set to 4, then you'll simply increment the vector by 4 in all absolute (not relative to the context) directions (resulting in a position 6.92820323028 units to the north-east, slightly upwards)
  22. local text2 = tonumber(guiGetText(GUIEditor.edit[1]))
×
×
  • Create New...