Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. addEventHandler("onPlayerWasted", root, function(ammo,attacker,attackerweapon)
  2. Are you sure you have started the resource? (Admin Panel >Resources or /start command)
  3. exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) local sScore = getElementData(source, "Score") or 0 local aScore = getElementData(attacker, "Score") or 0 setElementData(source, "Score", sScore-1) setElementData(attacker, "Score", aScore+1) end)
  4. https://wiki.multitheftauto.com/wiki/Meta.xml
  5. top right corner » set project to "New Issues"
  6. https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL
  7. Use https://wiki.multitheftauto.com/wiki/getTimestamp useful function to convert calendar date to timestamp and then compare to getRealTime().timestamp
  8. Addlibs

    check

    Just do a check whether they were given the achievement before, if not - give it
  9. Admin Panel by default blocks command.setnick (Admin Panel > Set Nick) from 'Default' ACL.
  10. That's exactly how the event functions when when attached to root (or getElementRoot()) The player that logs in triggers the event, as the event's source.
  11. Impossible with current MTA/GTA weapon system You could do a custom weapon system, where ped-held weapons are elements, onto which you can apply a shader that would change the texture into a specific camo.
  12. Addlibs

    SQLITE

    SQLmarker = executeSQLQuery("SELECT rowid, * FROM spawncar") --Select the rowid, and all other columns for i,v in ipairs(SQLmarker) do v["rowid"] v.rowid -- Both work, choose any. end
  13. addEventHandler("onPlayerLogin", source, startUp) source isn't defined. You need do do addEventHandler("onPlayerLogin", root, function() startUp(source) --Call 'startUp' function sending the source of the 'onPlayerLogin' event end) function startUp( player ) -- 'player' is the player element that just logged in -- Your stuff end
  14. Addlibs

    dxGui Help

    function dxCreateLabel(367,27,153,15,"Made By [Gta-Ar]#Ivan7",tocolor(255,0,0,255),default-bold,1,"right","top",blue) end Looks interesting... How you want that to work? You're using strings to store variables in them (those which get sent when the function is called)? Shouldn't this just be dxCreateLabel(367,27,153,15,"Made By [Gta-Ar]#Ivan7",tocolor(255,0,0,255),default-bold,1,"right","top",blue)
  15. Aren't you just trying to take out the value from the table? No point of getElementData. I'm pretty sure this'll work: table.insert(content,{ " - " ..(carname[getElementModel(source)] or getVehicleNameFromModel(getElementModel(source)))}) But what exactly are you trying to do by putting the custom name into a table?
  16. If this ID script works by setting element data 'id' to the actual player ID, add this function at the top of the file: function getPlayerFromID(id) for k,v in ipairs(getElementsByType("player")) do if getElementData(v, "id") == id then return v end end return false end Returns player element if found by ID, or false otherwise
  17. outputChatBox("(( This " .. tostring(carname[getElementModel(source)][1]) .. " belongs to " .. ownerName .. ". ))", thePlayer, 255, 195, 14) --use first value of the tabble carname[model] ( carname[model][1] ) OR: local carname = { } carname[506] = "Austin Martin Z12 Zagato MD10" carname[560] = "1993 Subaru Impreza" --notice I moved the strings out of the tables { } with
  18. addCommandHandler("level", function(cmdSrc, cmd, player, level) local pla = getPlayerFromName(player) if player and pla then if level and tonumber(level) then setElementData(pla, "level", tonumber(level)) outputChatBox("Set "..getPlayerName(pla).."'s level to "..tonumber(level), cmdSrc, 0, 255, 0) else outputChatBox("Error: Invalid level specified.", cmdSrc, 255, 0, 0) end else outputChatBox("Error: Player '"..player.."' not found.", cmdSrc, 255, 0, 0) end end)
  19. bantime = getRealTime(getBanTime(theBan)) local day = bantime.day local month = bantime.month+1 local year = bantime.year+1900 local hour = bantime.hour local minute = bantime.minute local second = bantime.second dateformatted = string.format(%.2d/%.2d/%.4d %.2d:%.2d:%.2d, day, month, year, hour, minute, second) Gives a formatted date like this: 01/01/0001 00:00:00
  20. I don't think it is possible to find out who changed the map unless you do some extra scripting to make a custom event being called when someone starts a resource / changes the map.
  21. yep... Try: outputChatBox("(( This " .. tostring(carname[getElementModel(source)]) .. " belongs to " .. ownerName .. ". ))", thePlayer, 255, 195, 14)
  22. Ped bone position retrieving seems to be fixed when on a slope or in water.
×
×
  • Create New...