-
Posts
266 -
Joined
-
Last visited
Everything posted by Ryancit2
-
Put this: local radioChannels = { ["name"] = "www.example.com/listen.pls", ["name2"] = "www.example.com/listen.pls", ["name3"] = "www.example.com/listen.pls", ["name4"] = "www.example.com/listen.pls", ["name5"] = "www.example.com/listen.pls" } function startRadio(cmd, name) local channel = radioChannels[name] if (not channel) then outputChatBox("No channel found with name: "..name, 200, 0, 0) return end startChannel = playSound(channel) end addCommandHandler("playradio", startRadio) function stopRadio() if (not startChannel) then outputChatBox("No radio channel is currently on, start by /playradio ", 200, 0, 0) return end stopSound(startChannel) end addCommandHandler("stopradio", stopRadio)
-
It can not work, thats because MTA have MP3 streaming script, not Youtube.
-
Actually K and V can be any variable: for cat , dog in pairs (getElementsByType("vehicle")) do for mta , gta in pairs (getElementsByType("vehicle")) do for jingzhi , example in pairs (getElementsByType("vehicle")) do But people use single words, mostly K and V for keys and values, actually we are assigning a name to key part and values part from a table like we usually do: local k = key local v = value ... etc
-
Its so easy, JR10 meant like this: use this resource https://community.multitheftauto.com/index.php?p= ... ls&id=4448 And add export this to your script by: function outputAdminMessage(cmd, ...) local text = table.concat({...}, " ") exports["guimessages"]:outputServer(text, 200, 0, 0) -- Replace "guimessages" with folder name in which you placed the downloaded resource. end
-
Add this before or after Line#25: if (isPedInVehicle(hitElement)) then return end
-
Here is serverside command for chatbox output (/ann text): function shoutAdmin(plr, cmd, ...) local msg = table.concat({...}, " ") outputChatBox("Admin "..getPlayerName(plr)..": "..msg, root, 200, 0, 0) end addCommandHandler("ann", shoutAdmin) And here is the clientside command (/dann text) for custom shout: local sx, sy = guiGetScreenSize() local isShowing = false function showMessage() dxDrawText(text, sx/2, sy/2, sx, sy, tocolor(255, 255, 255, 255), 2, "sans") isShowing = true end function renderText(cmd, ...) if (not isShowing) then text = table.concat({...}," ") addEventHandler("onClientRender", root, showMessage) else removeEventHandler("onClientRender", root, showMessage) isShowing = false end end addCommandHandler("dann", renderText)
-
You mean people should post youtube URL and then script should automatically convert the URL to MP3? Thats a bit complicated, though it can be done within MTA SA by using callRemote on your website page which will fetch an audio from some converter site by using PHP functions and then will send back audio converted URL to MTA client back.
-
Fixed @BlueTheFurry's code: local cars = { {411}, {410}, {412} } carmarker = createMarker( x,y,z, "cylinder", 2, 255, 255, 255, 210, root ) function carmarkerhit(hitElement) if (isElement(hitElement) and getElementType(hitElement) == "player") then randomcar = math.random(#cars) carid = cars[randomcar][1] car = createVehicle(carid, x,y,z) warpPedintoVehicle(hitElement) setTimer(function() destroyElement(car) end, 120000, 1) end end addEventHandler("onMarkerHit", carmarker, carmarkerhit)
-
Well you can try to convert youtube URL to MP3 by some converter site then get the "Download" button URL of the converted file which will end with ".mp3" and put it in that script. If that doesn't works, you'll have to manually find the song on some MP3 site.
-
There you are: local vehTable = getElementsByType("vehicle") setTimer(function() for k, v in ipairs(vehTable) do if getElementSpeed(v, 1) > 120 then outputChatBox(getVehicleName(v).." is now at speed greater than 120 KM/H!") end end end, 3000, 0) However you need to grab one "Useful function" from wiki which is: function getElementSpeed(theElement, unit) assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")") assert(getElementType(theElement) == "player" or getElementType(theElement) == "ped" or getElementType(theElement) == "object" or getElementType(theElement) == "vehicle", "Invalid element type @ getElementSpeed (player/ped/object/vehicle expected, got " .. getElementType(theElement) .. ")") assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)") unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit)) local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456) return (Vector3(getElementVelocity(theElement)) * mult).length end Add both those codes in your script's client side and start it, the function in first code will check speed of every vehicle in server every 3 seconds and will output a message to player alogwith vehicle name (I made it so that you can get to know the table better )
-
There you go: local spawnX, spawnY, spawnZ = 2494.6000976563, -1692.5, 25.39999961853 local skin = 287 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ, 90, skin) fadeCamera(source, true) setCameraTarget(source, source) end addEventHandler("onPlayerJoin", root, joinHandler) function deadHandler() fadeCamera(source, true) setCameraTarget(source, source) setTimer(spawnPlayer, 2000, 1, source, spawnX, spawnY, spawnZ, 90, skin) end addEventHandler("onPlayerWasted", root, deadHandler) To set skin with spawnPlayer function, you gotta pass another optional argument "Set Rotation" which comes before setting skin, then you can set the model ID which will be applied after spawning.
-
You can mod the previous ones and edit their texture and col to whatever you want it to be. For further details check: engineImportTXD Click on that^ and read relative pages from wiki given at bottom.
-
Put "True" at end of GUIEditor line like this: GUIEditor.window[1] = guiCreateWindow(839, 0, 527, 763, "Spawn Selection", true) This means that now "Relative" is changed to "True" which means that GUI pos should lie between 0 and 1, otherwise it is "False" which makes GUI pos depends on client's screen size. Check detailed explanation from Wiki: relative: This is whether sizes and positioning are relative. If this is true, then all x,y,width,height floats must be between 0 and 1, representing sizes/positions as a fraction of the screen size. If false, then the size and co-ordinates are based on client's resolution, accessible using guiGetScreenSize.
-
Oh, thats still far from F11
-
A guy is facing a bug on such trivial thing as "MARKER SIZE" how would he even understand what "DEBUG WITH CHATBOX" is? Also, problem is solved so excuse me @Paradox.
-
Debug body wont show up any message because script didn't had any 'bug'. Yea thats what i gave you at very first reply on mine here, but then again you mis-explained it or i misunderstood it, anyways, here is what you want: local marker = createMarker(1514.20679,-1657.22742,12.5,"cylinder",1.2,255,255,255) function MarkerHit(plr) if getElementType(plr) == "player" then if (isPedInVehicle(plr)) then return end local x, y, z = getElementPosition(plr) local veh = createVehicle(509, x, y, z) warpPedIntoVehicle(plr, veh) end end addEventHandler("onMarkerHit", marker, MarkerHit) \ This wont spawn vehicle if you are already in a vehicle.
-
Have you tried changing teamLV from 'team data' to team name string? Maybe that slothbot checks team "Name" but not team "Data"? To do so, either change line#1 with this: teamLV = "Las Venturas Mafia" or change line#3 with this: bots1 = exports.slothbot:spawnBot (2494.6000976563, 1587, 10.7, 0, 108, 0, 0, "Las Venturas Team", 31,
-
The original problem is, when I'm on foot, it won't put me on a bike, it only will if I'm in a vehicle Change Line#5 with this: if (not isPedInVehicle(plr)) then return end
-
When you are "NOT"* on foot? edit line#5 with this: if (isPedInVehicle(plr)) or (not isPedOnGround(plr)) or (doesPedHaveJetPack(plr)) then return end
-
You mean you want player to shoot colt like Deagle? Thats not possible i guess, in singleplayer, those were animations used in missions, etc. In here, there is only one animation to use colt, i'm not sure if that animation is editable or not. In singleplayer, our CJ also aimed Colt with one hand (just like MTA SA).
-
Its not about the delay, neither is related to client/server side, check this: local marker = createMarker(1514.20679,-1657.22742,12.5,"cylinder",1.2,255,255,255) function MarkerHit(plr) if getElementType(plr) == "player" then if (isPedInVehicle(plr)) then return end local x, y, z = getElementPosition(plr) local veh = createVehicle(509, x, y, z) warpPedIntoVehicle(plr, veh) end end addEventHandler("onMarkerHit", marker, MarkerHit) Marker size was 1, which made marker's actual size start from slightly lower than ground level by which it didn't detected hitElement. I changed the size to 1.2 + added exception if Player is already in vehicle, function wont proceed.
-
Owh aight, far from me.
-
1)Your In game name: SK#Ryan 2)MTA name: Ryancit2 3)Can you script? and like to help MTA fellows? Yes and Yes. 4) you are mapper? and like to help MTA fellows? Yes n' yes. 5)MTA forums profile link. https://forum.multitheftauto.com/memberlist.php? ... le&u=75528