WASSIm.

Members
  • Content Count

    1,431
  • Joined

  • Last visited

  • Days Won

    1

WASSIm. last won the day on October 21

WASSIm. had the most liked content!

Community Reputation

10 Decent

2 Followers

About WASSIm.

  • Rank
    Loc
  • Birthday 11/09/1996

Details

  • Gang
    Zombie Attack
  • Location
    Tunisia
  • Occupation
    Founder Zombie Attack Server

Recent Profile Visitors

1,463 profile views
  1. Hi guys i want show how to cover map (file with .map) to Lua script, but not finished yet, Its cover this elements: Object Vehicle Ped Marker Pickup Blip RemoveWorldObject 1) Use this code: addCommandHandler("covermap", function (thePlayer, _, map) if not (map) then return end local file = xmlLoadFile(map..".map") if (file) then local newMapFile = fileCreate(map..".Lua") if (newMapFile) then local mapTable = {} local mapText = "" local functionName = false for i,element in ipairs(xmlNodeGetChildren(file)) do local elementType = xmlNodeGetName(element) if not (mapTable[elementType]) then mapTable[elementType] = {} end table.insert(mapTable[elementType], xmlNodeGetAttributes(element)) end for type, dataList in pairs(mapTable) do mapText = mapText.."----- "..type..": # "..(#dataList).."\r\n" if (type == "object") then for _, data in ipairs(dataList) do mapText = mapText.."createObject".."("..(data.model or "nil")..", "..(data.posX or "nil")..", "..(data.posY or "nil")..", "..(data.posZ or "nil")..", "..(data.rotX or 0)..", "..(data.rotY or 0)..", "..(data.rotZ or 0)..")\r\n" end elseif (type == "vehicle") then for _, data in ipairs(dataList) do mapText = mapText.."createVehicle".."("..(data.model or "nil")..", "..(data.posX or "nil")..", "..(data.posY or "nil")..", "..(data.posZ or "nil")..", "..(data.rotX or 0)..", "..(data.rotY or 0)..", "..(data.rotZ or 0)..")\r\n" end elseif (type == "ped") then for _, data in ipairs(dataList) do mapText = mapText.."createPed".."("..(data.model or "nil")..", "..(data.posX or "nil")..", "..(data.posY or "nil")..", "..(data.posZ or "nil")..", "..(data.rotZ or 0)..")\r\n" end elseif (type == "marker") then local data.color = table.concat({getColorFromString(data.color or "#ff0000")}, ", ") for _, data in ipairs(dataList) do mapText = mapText.."createMarker".."("..(data.posX or "nil")..", "..(data.posY or "nil")..", "..(data.posZ or "nil")..", "..(data.type or "checkpoint")..", "..(data.size or "4")..", "..(data.color or "nil")..")\r\n" end elseif (type == "pickup") then for _, data in ipairs(dataList) do mapText = mapText.."createPickup".."("..(data.posX or "nil")..", "..(data.posY or "nil")..", "..(data.posZ or "nil")..", "..(data.type or "nil")..", "..(data.amount or "nil")..", "..(data.respawn or "30000")..")\r\n" end elseif (type == "blip") then local r, g, b, a = table.concat({getColorFromString(data.color or "#ff0000")}, ", ") for _, data in ipairs(dataList) do mapText = mapText.."createBlip".."("..(data.posX or "nil")..", "..(data.posY or "nil")..", "..(data.posZ or "nil")..", "..(data.icon or "0")..", 2, "..(r or "255")..", "..(g or "255")..", "..(b or "255")..", "..(a or "255")..", "..(data.ordering or "0")..")\r\n" end elseif (type == "removeWorldObject") then for _, data in ipairs(dataList) do mapText = mapText.."removeWorldObject".."("..(data.radius or "nil")..", "..(data.interior or "nil")..", "..(data.model or "nil")..", "..(data.lodModel or "nil")..", "..(data.posX or 0)..", "..(data.posY or 0)..", "..(data.posZ or 0)..")\r\n" end end end fileWrite(newMapFile, tostring(mapText)) fileFlush(newMapFile) fileClose(newMapFile) outputDebugString("Successfully "..map..".map covered to "..map..".Lua") else outputDebugString("Fail to create new map file") end xmlUnloadFile(file) else outputDebugString("Fail to load map file") end end) 2) For use removeWorldObject add this function function removeWorldObject(radius, interior, model, lodModel, posX, posY, posZ) table.insert(objectsRemoved, {radius, interior, model, lodModel, posX, posY, posZ}) removeWorldModel(model, radius, posX, posY, posZ, interior) removeWorldModel(lodModel, radius, posX, posY, posZ, interior) end 3) For restore all objects was removed when stop resource add this code: addEventHandler("onResourceStop", resourceRoot, function( ) for _, data in ipairs(objectsRemoved) do local radius, interior, model, lodModel, posX, posY, posZ = unpack(data) restoreWorldModel(model, radius, posX, posY, posZ, interior) restoreWorldModel(lodModel, radius, posX, posY, posZ, interior) end end) 4) Remember add this table: local objectsRemoved = {} 5) Use command 'covermap filename' example: /covermap base51 I have hope this TUT helpful and sorry for bad english
  2. Hi guys i have question, Why some resource show me on debug without resource name
  3. I Updated server and works thanks guys
  4. Hi Guys, I have problem with starting resources, Its keep show me this message Not starting resource ZA-system as this server version is too low (1.5.7 required)
  5. WASSIm.

    Json Script

    use callRemote & fromJSON
  6. Hi, Can any admin change board name of Algerian & Tunisian to Maghrebi Arabic or Darija / الدارجة for information what i mean please read here: https://en.wikipedia.org/wiki/Maghrebi_Arabic
  7. wrong board you need to post here: https://forum.mtasa.com/forum/83-client/
  8. Explain us what are u working for so we can help u about it
  9. I use the the second code
  10. Hi #,xiRocKyz sorry but your code complicated and is wrong its shows everything wrong on list anyway i fixed it and thank for your help
  11. Hi guys i am back for long time, i working for top 20 players like top player have high level and much money i hope help me for this errors 1) Its show all players not only 20 2) Its make server laggy so much when start resource or on select type of list 3) Got ERROR: Aborting infinite running script ZA-info when start resource 4) Some time got table nil Server side local statsList = { {"level", "Level", "lvl"}, {"money", "Money", "$"}, {"playTime", "Play Time"}, {"kills", "Kills"}, {"deaths", "Deaths"}, {"zombieKills", "Zombie Kills"}, {"bossKills", "Boss Kills"} } addEventHandler("onResourceStart", resourceRoot, function() for i, list in ipairs(statsList) do local key = list[1] local accounts = getAccounts() local playerList = {} for i, account in ipairs(accounts) do local data = exports["ZA-account"]:getAccountData(account, key) local name = exports["ZA-account"]:getAccountData(account, "nick") if (data and tonumber(data)) then table.insert(playerList, {name, tonumber(data)}) --outputDebugString("Name: "..name.. " / "..key..": "..data or "N/A") end end table.sort(playerList, function(a, b) return a[2] > b[2] end) for i=20, #playerList do table.remove(playerList, i) end statsList[i][4] = playerList end end) addEvent("onPlayerOpenTopPanel", true) addEventHandler("onPlayerOpenTopPanel", root, function( ) triggerClientEvent(source, "onClientPlayerOpenTopPanel", source, statsList) end) Thanks for help! NB: I edited this topic
  12. You can use XML function its more easy: https://wiki.multitheftauto.com/wiki/XML
  13. WASSIm.

    speedometer

    1) Your function is wrong 2) You need to use DX functions