-
Posts
6,089 -
Joined
-
Last visited
-
Days Won
216
Everything posted by IIYAMA
-
If you are talking about a dx chat, then yes.
-
Your condition: https://wiki.multitheftauto.com/wiki/GetKeyState
-
You can take over the controls of the driver. But the driver remains to be the syncer of the vehicle. Which means that the delay of the action depends on the driver and co-driver their internet speed. https://wiki.multitheftauto.com/wiki/SetControlState https://wiki.multitheftauto.com/wiki/BindKey (serverside)
-
map = { size = 1024 } function reCalculateToMap (posX, posY) return posX / map["size"] * 6000 - 3000, posY / map["size"] * -6000 + 3000 end local x, y = reCalculateToMap (500, 800) print(x, y) function reCalculateFromMap (mapX, mapY) return (mapX + 3000) * map["size"] / 6000, (mapY - 3000) * map["size"] / -6000 end local x2, y2 = reCalculateFromMap (x, y) print(x2, y2) This is just old school math. Example: Click X position in image is: 240px Image size is: 1024px Map size is: 6000 X 240 / 1024 = 0.234375 --[[ 0.234375 * 100 = 23.4 240 is 23.4% from 1024 ]] 0.234375 * 6000 = 1406.25 --[[ Append to other value ETC. ]]
-
local mapX = clickX / map["size"] * 6000 - 3000 local mapY = clickY / map["size"] * -6000 + 3000 Try this. Afaik the left + bottom is -3000, -3000. The right + top is 3000, 3000. And the center is 0, 0.
-
if aX > (x / 2 - map["size"] / 2) and aX < (x / 2 + map["size"] / 2) and aY > (y / 2 - map["size"] / 2) and aY < (y / 2 + map["size"] / 2) then end local clickX = aX - (x / 2 - map["size"] / 2) local clickY = aY - (y / 2 - map["size"] / 2) local mapX = clickX / map["size"] * 6000 local mapY = clickY / map["size"] * 6000 Everything is untested.
-
https://wiki.multitheftauto.com/wiki/OnClientClick string button, string state, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ, element clickedWorld float worldX, float worldY, float worldZ, element clickedWorld https://wiki.multitheftauto.com/wiki/GetScreenFromWorldPosition float float getScreenFromWorldPosition ( float x, float y, float z, [ float edgeTolerance=0, bool relative=true ] )
-
local serial = getPlayerSerial( source ) local accounts = getAccountsBySerial( serial ) if accounts and #accounts > 1 then outputChatBox("You have an account and your data will now be transferred to the new one.", source, 50, 255, 200) local dataSafe = {} --Empty table to save data for i=1, #accounts do local account = accounts[i] local allAccountData = getAllAccountData( account ) local accountName = getAccountName(account) for key, value in pairs ( allAccountData ) do dataSafe[#dataSafe + 1] = {accountName, key, value} end end for i=1, #dataSafe do --Outside my for to cycle through accounts is where I will merge data, for now it prints the table local name, k, v = dataSafe[i][1],dataSafe[i][2],dataSafe[i][3] --So it does index them, BUT, it indexes as nil... outputChatBox(tostring(name)..""..tostring(k)..""..tostring(v), source) --As you can see when it prints end end There is also this function: (if you are interested in moving/replace data. Never used it, so I do not know how it will merge) https://wiki.multitheftauto.com/wiki/CopyAccountData
-
Might help, might not. https://wiki.multitheftauto.com/wiki/SetHelicopterRotorSpeed https://wiki.multitheftauto.com/wiki/SetAircraftMaxVelocity https://wiki.multitheftauto.com/wiki/SetElementVelocity
-
Lol, seems like you had too many rage-quit's. Well, you can use the /disconnect command to access it.
-
Order matters: (the computer reads from top to bottom) triggerServerEvent("PonerCortina", resourceRoot, paintjobID, color) --This does not work local color = "nada" local color = "nada" triggerServerEvent("PonerCortina", resourceRoot, paintjobID, color) You still didn't fix this: - local vehicle = getPedOccupiedVehicle( source ) local vehicle = getPedOccupiedVehicle( client ) It is client, not source. If it doesn't work, then manually debug it...(tutorial) Because I do not know where I have to look for issues.
-
local color = "red" triggerServerEvent("PonerCortina", resourceRoot, paintjobID, color) function Cortina1(paintjobID, color) local player = client -- ... triggerClientEvent (root, "setShader", resourceRoot, paintjobID, color) end addEvent("PonerCortina", true) addEventHandler("PonerCortina", resourceRoot, Cortina1) ? function addPaintjob2(paintjobID, color) outputChatBox("the color is:" .. color) if color == "red" then -- set the red shader elseif color == "blue" then -- set the blue shader ETC. end end addEvent( "setShader", true ) addEventHandler( "setShader", resourceRoot, addPaintjob2 ) I just send the string "red" from clientside to serverside. And from serverside back to clientside for all players. If the string is "red" then set your red shader. Same goes for the color blue. (But you can't pass textures)
-
If you do not know lua, then this is not what you should be learning. Start with lua. And just to be clear, we are not here to donating code to charity Alonemta... so stop begging, it is really a shameful and abusive matter.
-
Your code?
-
@HairyMeets function keyDetection (key, keyState) iprint("key:", key, ", keystate:", keyState) end bindKey ( "arrow_u", "down", keyDetection ) bindKey ( "arrow_d", "down", keyDetection ) Untested, but should activate a single function with the keys arrow UP and DOWN. (clientside)
-
Code is already there in example, blind chicken...
- 5 replies
-
- 2
-
-
- blokker_1999
- ccw
- (and 12 more)
-
See example of this page: https://wiki.multitheftauto.com/wiki/SetPedCanBeKnockedOffBike
- 5 replies
-
- blokker_1999
- ccw
- (and 12 more)
-
That is because you are not doing anything related to passing colours. Neither it is clear to me where those colours are.
-
Try to use an online tool to reconvert the font to True Type. It is probably containing some extra font information which MTA doesn't like.
-
local vehicle = getPedOccupiedVehicle( source ) local vehicle = getPedOccupiedVehicle( client )
-
Use client instead of source. (Line 5) Source is in this case the resourceRoot and not a player. And NO screaming TO ME! Or you get it 10x back.
-
Element data - Uses less data - Slow - Target players can't be specified. - Latent variant not available. Trigger event. - Uses much more data - Much faster - Target players can be specified.(data reduction) - Latent variant available. (Not blocking the network) To be honest, I prefer to use the latent trigger, even though it might be very annoying for players with slow internet. But it works for me best, because the players will not teleport so much.
-
Where does the code stops working?
-
Please give me some context about how it overlaps, it makes it easier for me to find the problem. self.endPos = self.startPos+self.maxItems Also this should be limited to the total items in the gridlist for performance reasons. (Unless you do add a grid) Debug the yOff variable for every item, just to be sure that the problem is here.(and show result)
-
triggerServerEvent("PonerCortina", resourceRoot, paintjobID) function Cortina1(paintjobID) local player = client -- ... triggerClientEvent (root, "setShader", resourceRoot, paintjobID) end addEvent("PonerCortina", true) addEventHandler("PonerCortina", resourceRoot, Cortina1) function addPaintjob2(paintjobID) end addEvent( "setShader", true ) addEventHandler( "setShader", resourceRoot, addPaintjob2 )
