Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. Are you sure you've saved and restarted the script?
  2. --Initialize: executeSQLQuery("CREATE TABLE IF NOT EXIST names_database (serial TEXT, nick TEXT)") function getOtherNicknames(serial) return executeSQLQuery("SELECT * FROM names_database WHERE serial = ?", serial) --collect data of old nicknames end function recordNewName(serial, name) local oldnames = getOtherNicknames(serial) if oldnames then --if data retrieved, then if #oldnames > 5 then --check if number of records for serial exceeds 5, executeSQLQuery("DELETE FROM names_database WHERE rowid = ?", oldnames[1]['rowid']) --and delete oldest row if that's the case end end executeSQLQuery("INSERT INTO names_database (serial, nick) VALUES(?, ?)", serial, name) --record new nickname end addEventHandler("onPlayerJoin", root, function() local currentName = getPlayerName(source) local serial = getPlayerSerial(source) -- *ACL admin rights required* local aka = getOtherNames(serial) --collect other names before recording current one, to avoid duplicates on message output local othernames = {} --create a temporary table for k, v in ipairs(aka) do table.insert(othernames, v['nick']) --add the name to a separate table end recordNewName(serial, currentName) outputChatBox(currentName .. " #008800is also known as #D4A017" .. table.concat(othernames, ", "), root, 255, 0, 0, true) end ) addEventHandler("onPlayerChangeNick", root, function(old, new) local serial = getPlayerSerial(source) -- *ACL admin rights required* recordNewName(serial, new) end ) ^^ Untested ^^ Also, the order might not be the same as you wanted, therefore, it's better if you insert the code into joinquit resource (without duplicating event handlers eg. just put everything from onPlayerJoin into the first lines of onPlayerJoin in joinquit resource)
  3. addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(killer)),aclGetGroup("Vip")) then givePlayerMoney(killer, 100 ) else givePlayerMoney(killer, 50 ) end end ) Was that really so hard?
  4. Colshape > Related scripting functions ( getElementData(theZombie, "zombie") == true ) killPed all of the GUI functions: https://wiki.multitheftauto.com/wiki/Cl ... _functions
  5. Line 4, 2nd parameter of isObjectInACLGroup. There's a difference between aclGet and aclGetGroup. 2nd parameter requires an ACL group, not an ACL data. Just change aclGet into aclGetGroup.
  6. local whitelist = { ['SERIAL HERE'] = true, } addEventHandler("onPlayerConnect", root, function(nick, ip, _, serial, if not whitelist[serial] then --if not on the whitelist table, cancelEvent(true, "This is a whitelisted server.") --refuse connection with message "This is a whitelisted server" end end ) Server sided.
  7. WARNING: [DayZ]\DayZ\vehicle_spawns.lua:625: Bad argument @ 'createVehicle' [Expected vector3 at argument 2, got nil] I guess there's some problem with the createVehicle syntax in the code and MTA guesses you've attempted to input a vector3.
  8. Addlibs

    Second Rhino

    Afaik, Rhinos do take damage from fire and/or explosions. I've managed to destroy a Rhino with another Rhino, however, it's more probably that the fire after the explosion causes the damage.
  9. Account name or account entity (such as those acquired by getAccount)?
  10. Is line 175 on line 22 in the code snippet you've sent, or is it another dbConnect statement?
  11. I guess it's because the client is not aware of all resources; only those which are running, have an instance, have their resourceRoot element are visible to the client.
  12. absolutely nothing changed in the debug message?
  13. Addlibs

    Vehicle weapon

    setElementPosition, attachElements, etc. You need to write up your own function that would handle mounting the weapon.
  14. line 22, change 'test_db' to 'connection'
  15. I guess you'd most likley have to do some server-client events (preferably latent events, so the server wouldn't lag)
  16. Addlibs

    Vehicle weapon

    To fire it, use either fireWeapon(weapon) (single fire) or setWeaponState(weapon, "firing") (continouos firing)
  17. Try adding ;unix_socket=/var/run/mysqld/mysqld.sock (including the ; at the front) to the end of the 2nd parameter string (host) eg: test_db = dbConnect( "mysql", "dbname=frank;host=1.2.3.4;unix_socket=/var/run/mysqld/mysqld.sock", "username", "password", "share=1" )
  18. I believe it is also possible (but quite hard) to read what was sent to cache through memory dumps.
  19. Just setPedAnimation straight after calling guiSetVisible. Quite simple. To import a TXD, use engineImportTXD and engineLoadTXD
  20. How about setting an uninterruptible animation onto the player? I guess that would work, but can't really test it myself at the moment.
  21. 1 unit = 1 metre, ≈1.09361 yards The returned values are expressed in GTA units per 1/50th of a second[1]. A GTA Unit is equal to one metre[2]. Source: https://wiki.multitheftauto.com/wiki/Ge ... ty#Returns
  22. The error message states you push a string instead of an element for the 2nd parameter (the player who shall receive the chatbox message). However, it's impossible that 'client' or 'source' contain a string, or anything else other than an element value. My guess is that you haven't corrected the code still, maybe you saved it in the wrong place?
  23. I'm afraid you cannot detect whether a cursor moved over a world object, only elements, unless you want to continuously proceedLineOfSight and detect changes in model number or whatever. Some functions which might be helpful: getCursorPosition getWorldFromScreenPosition proceedLineOfSight
  24. Addlibs

    Door Types

    Only possible with components.
  25. hide_hideGUI = hide.hideGUI --You've set hide_hideGUI equal to hide.hideGUI (nil). Since hide.hideGUI is not defined yet, it's equal to nil; thus hide_hideGUI is also equal to nil. function hideGUI(regged) --Function name is no longer 'hide.hideGUI' (not in the 'hide' table) - No point of trying the suggestions if you chose to make the function outside the table. All above suggestions are ways to use exports on functions which are within tables. exports.CORchar:hide_hideGUI() --Trying to call a function that isn't defined. Only hideGUI is defined, not hide.hideGUI. Moreover, neither hide.hideGUI, hide_hideGUI or hideGUI were defined server side.
×
×
  • Create New...