Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 20/11/21 in all areas

  1. mta-add-models is a library/framework resource that I made: Its purpose is allowing you to add new peds(skins)/objects/vehicles to your server. All the new added models will be automatically synced with all players. Supports encrypted mod files using the NandoCrypt system. As of v2.0.0, files with attribute download="false" in meta.xml are supported, and newmodels will handle downloading them! The way to achieve this is by following the tutorial included in the project's documentation (see GitHub link below) The resource comes with test commands for you to experiment with the mods provided and see what's going on under the hood. You're meant to make your own implementations to use newmodels in your server's complex systems. GitHub Repo (Download): https://github.com/Fernando-A-Rocha/mta-add-models#readme (Documentation here) (NEW) Custom Map Editor Community Page (Alternative Download): https://community.multitheftauto.com/index.php?p=resources&s=details&id=18598 For support/questions please access my main thread: https://forum.multitheftauto.com/topic/139644-rel-nandos-resources/ I hope you enjoy!
    1 point
  2. addCommandHandler ( "s", function(source, cmd, ...) local message = table.concat({ ... }, " ") local x, y, z = getElementPosition(source) local radius = createColSphere(x, y, z, 100) local nearplayers = getElementsWithinColShape(radius, "player") destroyElement(radius) for _, player in ipairs(nearplayers) do if getElementDimension(player) == getElementDimension(source) then local chatter = pregReplace( getPlayerName(source), '_', ' ' ) or '#cf7ee6[FroMTA - Admin] #db5151'..getPlayerName(source) local MESSAGE = string.upper(message) outputChatBox(chatter..' ordítja: '..MESSAGE, player, 255, 255, 255, true) end end end) This is my new code; I only changed ... to message in string upper. This code works just as I expect it, thanks for the help!
    1 point
  3. You have the option to donate to me. Visit https://osdn.net/projects/magic-txd/ and click on the blue Donation button. I would appreciate it a lot!
    1 point
  4. Yeah haha... sry , i put all the code in case there is any doubt when someone wants to answer. i think the specific part i want to modify is this addEvent("SpawnMyVehicle", true) addEventHandler("SpawnMyVehicle", root, function(id) if not playerVehicles[source] then playerVehicles[source] = {} end if #playerVehicles[source] >= 1 then exports.Script_Textos:createNewDxMessage("Solo Puedes Spawnear Un Vehiculos a La Vez", source, 255, 85, 0, true) return end local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then if getVehicleByID(id) then exports.Script_Textos:createNewDxMessage("Su Vehiculo Ha Sido Spawneado", source, 255, 85, 0, true) else local color = split(data[1]["Colors"], ',') r1 = color[1] or 255 g1 = color[2] or 255 b1 = color[3] or 255 r2 = color[4] or 255 g2 = color[5] or 255 b2 = color[6] or 255 vehicle = createVehicle(data[1]["Model"], data[1]["X"], data[1]["Y"], data[1]["Z"], 0, 0, data[1]["RotZ"]) setElementData(vehicle, "ID", id) table.insert(playerVehicles[source],vehicle) local fuelnu = data[1]["fuel"] or 100 local tune = fromJSON(data[1]["handling"]) -- outputChatBox(data[1]["handling"],source,255,0,0) --outputChatBox(tostring(tune),source,255,0,255) setElementData(vehicle, "vehicleFuel", fuelnu) local upd = split(tostring(data[1]["Upgrades"]), ',') for i, upgrade in ipairs(upd) do addVehicleUpgrade(vehicle, upgrade) end local Paintjob = data[1]["Paintjob"] or 3 setVehiclePaintjob(vehicle, Paintjob) setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) if data[1]["HP"] <= 255.5 then data[1]["HP"] = 255 end setElementHealth(vehicle, data[1]["HP"]) setElementData(vehicle, "Owner", source) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) -- setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 50, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) exports.Script_Textos:createNewDxMessage("Tu Vehiculo Ha Sido Spawneado", source, 255, 85, 0, true) cur = getElementData(source,"spawnedcars") or {} table.insert(cur,getVehicleNameFromModel(data[1]["Model"])) setElementData(source,"spawnedcars",cur) end else exports.Script_Textos:createNewDxMessage("Ocurrio Un Error", source, 255, 85, 0, true) end end) I just want the vehicle spawns in the same position as the player Thanks for the recommendation :))
    1 point
  5. It might help figure out the problem if you download and run MTADiag from here: https://mirror.multitheftauto.com/mtasa/utils/MTADiag.exe Follow the instructions provided there and once you are done, you will get a pastebin link which you should post it here.
    1 point
  6. Si sigues en la búsqueda, contáctame al privado.
    1 point
×
×
  • Create New...