-
Posts
373 -
Joined
-
Last visited
-
Days Won
12
Everything posted by Hydra
-
Hi, I started this project recently and decided to make it public on the forum. As it says in the title this project will try to be as similar as possible to the game mode in the game need for speed most wanted 2012. I'm working on it alone with some help from a few people on the modelling, visual and scripting side. Below I will show you some pictures/videos: Server Trailer: Camera Showcase: Repair Zones: New Lighting: [N12] Soundtrack Showcase [N12] Loading Screen Discord Server: https://discord.gg/hZ6Hka5v9x (You will see more on the discord server)
-
function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end Try this one
-
Happy holidays to all the players! And good luck with this project going forward
-
1. We create an application in https://discord.com/developers/applications 2. We copy the application id: 3. Now we are making the script (start with creating a .lua file) --// discord_c.lua local app_id = "your_app_key_here" function ConnectRPC() setDiscordApplicationID(app_id) if isDiscordRichPresenceConnected() then local name = getPlayerName(localPlayer) iprint("RPC: Discord RPC is now connected") setDiscordRichPresenceAsset("your_app_logo_string", "Yey, this is my app logo") setDiscordRichPresenceButton(1, "Join Discord", "url_here") setDiscordRichPresenceButton(2, "Connect Server", "url_here") --// NOTE: you can show only 2 buttons setDiscordRichPresenceState("Playing") setDiscordRichPresenceDetails("Playing as: "..name) else iprint("RPC: Discord RPC failed to connect") end end addEventHandler("onClientResourceStart", resourceRoot, ConnectRPC) --// Now, we reset the rpc details so the status will not be bugged addEventHandler("onClientResourceStop", resourceRoot, function() resetDiscordRichPresenceData() end) 4. So, we have our discord_c.lua file and now we need to create the meta.xml <meta> <info author="YourName" description="YourResourceDescription" type="YourScriptType", version="1.0" /> <script src="discord_c.lua" type="client" cache="false" /> </meta> 5. In the console you can now type refresh and after start theResourceName
-
local app_id = "my_app_id" addEventHandler("onClientResourceStart", resourceRoot, function() local name = getPlayerName(localPlayer) setDiscordApplicationID(app_id) if isDiscordRichPresenceConnected() then setDiscordRichPresenceAsset("your_app_logo_name", "This is my logo!") setDiscordRichPresenceSmallAsset("your_second_app_logo_name", "This is my second logo!") setDiscordRichPresenceState("In-game") setDiscordRichPresenceDetails("currently as "..name) end end) addEventHandler("onClientResourceStop", resourceRoot, function() resetDiscordRichPresenceData() end)
-
Hello, I am selling my chatbox resource from a project I was working on Preview: Description: Supports client/server side commands Outputs default messages (player muted, player banned, etc..) Press T to talk with all players Press Y to talk with your team Smooth fade in when a message is typed Supports admin tags Contact & Info: Price: 15-20 euro, only paypal Contact: Gabriel45#6859 (Dirscord)
-
Could you leave some more explicit informations to understand your problem? All I understood is that you can't find the vehicle_save resource. You can download it from here: https://community.multitheftauto.com/index.php?p=resources&s=details&id=10877
-
Have you granted yourself admin access at least? To use commands like /start, /restart, /stop etc.. you must be an adminr or use the console for starting the resources. Also, if your resource contains commands that are used by the admins like the ones above, you will have to add <object name="resource.Derby"></object> in Admin ACL group
-
You can use something more simplier --// Example local borderSize = 1 dxDrawBorderedText(borderSize, etc..) function dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) for oX = (outline * -1), outline do for oY = (outline * -1), outline do dxDrawText (text, left + oX, top + oY, right + oX, bottom + oY, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end end dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY) end
-
Show your code, so people can help you. Only with an explanation, we have no way of knowing where the exact problem is. Also HTML colors must contain 6 characters like #FFBB00
-
https://streamable.com/wj20up
-
No problem, your welcome
-
Connecting the Asi plugin and scripts to the MTA
Hydra replied to Lance_Delmago's topic in Scripting
You can't use .ASI scripts on MTA, what's so hard to understand? -
Adding new cars to Mta 1.6 via Client source code
Hydra replied to Lance_Delmago's topic in Scripting
You could use this resource to add more models for your server https://github.com/Fernando-A-Rocha/mta-add-models Make sure you read the guide and follow the steps -
You are not doing it correctly, it should be: function GripTyre() engineSetSurfaceProperties(9, "tyregrip", 255) engineSetSurfaceProperties(10, "tyregrip", 255) engineSetSurfaceProperties(11, "tyregrip", 255) engineSetSurfaceProperties(12, "tyregrip", 255) engineSetSurfaceProperties(13, "tyregrip", 255) engineSetSurfaceProperties(14, "tyregrip", 255) engineSetSurfaceProperties(15, "tyregrip", 255) engineSetSurfaceProperties(16, "tyregrip", 255) engineSetSurfaceProperties(17, "tyregrip", 255) engineSetSurfaceProperties(20, "tyregrip", 255) engineSetSurfaceProperties(80, "tyregrip", 255) engineSetSurfaceProperties(81, "tyregrip", 255) engineSetSurfaceProperties(82, "tyregrip", 255) engineSetSurfaceProperties(115, "tyregrip", 255) engineSetSurfaceProperties(116, "tyregrip", 255) engineSetSurfaceProperties(117, "tyregrip", 255) engineSetSurfaceProperties(118, "tyregrip", 255) engineSetSurfaceProperties(119, "tyregrip", 255) engineSetSurfaceProperties(120, "tyregrip", 255) engineSetSurfaceProperties(121, "tyregrip", 255) engineSetSurfaceProperties(122, "tyregrip", 255) engineSetSurfaceProperties(125, "tyregrip", 255) engineSetSurfaceProperties(146, "tyregrip", 255) engineSetSurfaceProperties(147, "tyregrip", 255) engineSetSurfaceProperties(148, "tyregrip", 255) engineSetSurfaceProperties(149, "tyregrip", 255) engineSetSurfaceProperties(150, "tyregrip", 255) engineSetSurfaceProperties(151, "tyregrip", 255) engineSetSurfaceProperties(152, "tyregrip", 255) engineSetSurfaceProperties(153, "tyregrip", 255) engineSetSurfaceProperties(160, "tyregrip", 255) iprint("Tyre grip started") end addCommandHandler( "grip", GripTyre)
-
Connecting the Asi plugin and scripts to the MTA
Hydra replied to Lance_Delmago's topic in Scripting
You can search for resources on this forum or its community: https://community.multitheftauto.com https://forum.multitheftauto.com/forum/87-resources/ Or you can learn scripting and create your own first person mode For car mods you can download them from: https://www.gtainside.com/en/news.php https://www.gtaall.com Make a folder and create meta.xml & client.lua files In meta.xml you will need to put: <meta> <script src="client.lua" type="client" /> --// Now the mods <file src="themodname.dff" /> <file src="themodname.txd" /> </meta> In client.lua you will need to put: local dff = engineLoadDFF("themodname.dff") engineReplaceModel(dff, theIDForVehicle) local txd = engineLoadTXD("themodname.txd") engineImportTXD(txd, theIDForVehicle) --// Example replacing infernus local dff = engineLoadDFF("infernus.dff") engineReplaceModel(dff, 411) local txd = engineLoadTXD("infernus.txd") engineImportTXD(txd, 411) You can see all vehicles ID's on these websites: https://wiki.multitheftauto.com/wiki/Vehicle_IDs http://weedarr.wikidot.com/veh I hope you understood what I explained to you and if you still have problems enter the official discord server to get more detailed help Official MTA Discord: https://discord.gg/mtasa -
Connecting the Asi plugin and scripts to the MTA
Hydra replied to Lance_Delmago's topic in Scripting
You can't use .ASI scripts on MTA. If they were allowed, there would be chaos on the servers, some let you create cars, npc's, you can cheat by setting health, armor, money etc.. with these files -
You have a variable called g_peso, but it doesn't exist in your script. Also instead of dxDrawRectangle(x-4, y-4 -sroll,52, 53, i == selected and dxDrawImage(x-4, y-4 -sroll,52, 53, "assets/img/slot-effect.png") or scrollColor) Change in: dxDrawRectangle(x-4, y-4 -sroll,52, 53, tocolor(255, 255, 255, 255), false) dxDrawImage(x-4, y-4 -sroll,52, 53, "assets/img/slot-effect.png", 0, 0, 0, scrollColor, false) Furthermore, I can't help you with your script. From what I can see, it's not something you did and it's from a gamemode on the net, maybe I'm wrong but this is how I see it
-
Leave the full code because with only what you gave I can't test it.
-
Even if it's inside a render you are using it wrong. You have dxDrawRectangle(x-4, y-4 -sroll,52, 53, i == selected and dxDrawImage(x-4, y-4 -sroll,52, 53,"assets/img/slot-effect.png") or scrollColor). Calling dxDrawImage inside dxDrawRectangle it is not possible according to my experience and that is why you have errors in your code. But wait for more answers maybe there are people that disagree with me. My advice is to use them separate, I hope you understood what I was talking
-
Almost nothing you posted can be understood. The correct way to use dxDrawRectangle and dxDrawImage is: dxDrawRectangle(posX, posY, width, height, color, postGUI) dxDrawImage(posX, posY, width, height, imagePath, rotationX, rotationY, rotationZ, color, postGUI)
-
Cu aceasta functie vei putea detecta daca un jucator/npc foloseste o animatie sau nu Exemplu: bindKey("i", "down", function() if isPedDoingAnim(localPlayer) then outputChatBox("Folosesti o animatie", 255, 255, 255, true) else outputChatBox("Nu folosesti o animatie", 255, 255, 255, true) end end) function isPedDoingAnim(theElement) if isElement(theElement) and getElementType(theElement) == "ped" or getElementType(theElement) == "player" then local block, anim = getPedAnimation(theElement) if block ~= nil and anim ~= nil then return true else return false end end end
-
By saying: Do you mean how to disable that button? If yes then you could use --// Client addEvent("ButtonState", true) addEventHandler("ButtonState", root, function(state) if state == true then guiSetEnabled(spawnButton, true) elseif state == false then guiSetEnabled(spawnButton, false) end end) --// Server addCommandHandler("button", function(player, cmd, newstate) if not newstate then return end triggerClientEvent(player, "ButtonState", player, newstate) end)