-
Posts
426 -
Joined
-
Last visited
Everything posted by Mossy
-
A: Black. Q: Where would you want to live?
-
For now try http://www.game-state.eu/
-
http://sphotos-a.xx.fbcdn.net/hphotos-a ... 2378_n.jpg
-
Yea just use those functions and check these out: https://wiki.multitheftauto.com/wiki/Filepath https://wiki.multitheftauto.com/wiki/PlaySound
-
https://community.multitheftauto.com/ind ... ls&id=5762 Car mod DONE
-
No prob and keep up the good work!
-
Make sure you START the resource either from the console or Admin Panel. If you did already, then use [/debugscript 3] to see what's causing the error. Or look through the script for typos and what not.
-
I'm Sorry, i Haven't a MTA Server, Maybe Some one will test it? I'll do it. Edit: Here are some pics: Bugs: -Resets to kph when map switches -It's supposed to be mph, not mps
-
try local toggleradar = createRadarArea ( -2183.5678710938, 705.67950439453, 40, -40, 0, 255, 0, 175 ) -- REPLACE these numbers if needed. local localplayer = getLocalPlayer if onoff="1" then setPlayerHudComponent(root, "radar", true, localplayer) outputChatBox("Radar was turned on.") else if onoff="0" then setPlayerHudComponent(root, "radar", false, localplayer) outputChatBox("Radar was turned off.") else outputChatBox("Syntax: /setradar [1=on], [0=off]" end addCommandHandler("setradar", toggleradar) If localplayer doesn't work replace it with thePlayer and remove local localplayer = getLocalPlayer
-
Works great. Thanks!
-
Code please? :>
-
A: Rainbow obviously. Q: Subway or Quiznos?
-
Yes. By the way, Line 4 got an error. Function arguments expected near '==' And how can I make it so that only I can do the command?
-
I'm making a script that will start a random map with the command "/random". What I'm asking is how can I set a function to generate a random map? I couldn't find a function on the wiki to do this, yet I used a resource that did this. Please help
-
http://sphotos-a.xx.fbcdn.net/hphotos-a ... 7615_n.jpg
-
If you can't find any try making one. https://wiki.multitheftauto.com/wiki/LogIn https://wiki.multitheftauto.com/wiki/GUI_widgets
-
https://wiki.multitheftauto.com/wiki/GetPlayerSerial https://wiki.multitheftauto.com/wiki/LogIn Try combining the 2.
-
Worked, thanks! And if you mind, can you do the same thing for one more script that has the same problem? local SCREEN_WIDTH, SCREEN_HEIGHT = guiGetScreenSize() local name, author, lastTimePlayed, spawnPointCount, playedCount, modename local startTick local enabled = false local month = {"January","February","March","April","May","June","July","August","September","October","November","December"} function timestampToDate(stamp) local time = getRealTime(stamp) return string.format("%d %s %02d:%02d",time.monthday,month[time.month+1],time.hour,time.minute) end function handleMapInfo(mapInfo) name = mapInfo.name or "Unknown" author = mapInfo.author or "N/A" playedCount = tostring(mapInfo.playedCount or "N/A") outputChatBox("#FFFFFF[iNFO] #00FF00Map Name: #FFFFFF"..name,255,255,255,true) outputChatBox("#FFFFFF[iNFO] #00FF00Map Author: #FFFFFF"..author,255,255,255,true) startTick = getTickCount() if not enabled then addEventHandler("onClientRender",getRootElement(),handleOnRender) enabled = true end end addEvent("onClientMapStarting",true) addEventHandler("onClientMapStarting",getRootElement(),handleMapInfo) local g_Root = getRootElement() local g_ResRoot = getResourceRootElement(getThisResource()) local screenWidth, screenHeight = guiGetScreenSize() -- Get the screen resolution local c_Font = "pricedown" local c_FontScale =0.90 local yo local mapName addEvent("onSendMapName", true) addEventHandler("onSendMapName", g_ResRoot, function(name) mapName = name end ) addEventHandler("onClientResourceStart", g_ResRoot, function() yo = dxGetFontHeight(c_FontScale, c_Font) triggerServerEvent("onRequestMapName", g_ResRoot) end ) addEventHandler("onClientRender", g_Root, function() if mapName then dxDrawText("Current Map: '" .. mapName .."'", 5, screenHeight-yo-2, screenWidth, screenHeight, tocolor(0, 255, 0, 255), c_FontScale, c_Font) end end ) Line 26.
-
spfont = dxCreateFont("fonts/font.ttf", 21) function speed ( ) addEventHandler ( "onClientRender", root, getspeed ) end addEventHandler ("onClientVehicleEnter", root, speed) function wylacz ( ) removeEventHandler ( "onClientRender", root, getspeed ) end addEventHandler("onClientVehicleExit", root, wylacz) function getspeed ( ) if isPedInVehicle (localPlayer) == false then return end sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) mphs = math.floor((((sx^2 + sy^2 + sz^2)^(0.5))*180)/1.6) health = getElementHealth (getPedOccupiedVehicle(localPlayer)) name = getVehicleName (getPedOccupiedVehicle(localPlayer)) currenthealth = math.floor(health/10) screenWidth, screenHeight = guiGetScreenSize() windowWidth, windowHeight = 300,170 left = screenWidth/1.15 - windowWidth/9.8 top = screenHeight/1.15 - windowHeight/20 dxDrawText ( " "..tostring(name).." ", left , top -93, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) dxDrawText ( " "..tostring(name).." ", left -2, top -95, screenWidth, screenHeight -2, tocolor ( 0, 255, 0, 255 ), 1, spfont ) dxDrawText ( " "..tostring(currenthealth).."%", left , top -63, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) dxDrawText ( " "..tostring(currenthealth).."#00FF00%", left -2, top -65, screenWidth, screenHeight -2, tocolor ( 255, 12, 0, 255 ), 1, spfont, "left", "top", false, false, false, true ) dxDrawText ( " ___________________", left -2, top -62, screenWidth, screenHeight -2, tocolor ( 255, 0, 0, 255 ), 1, spfont ) dxDrawText ( " ___________________", left -2, top -60, screenWidth, screenHeight -2, tocolor ( 0, 0, 0, 255 ), 1, spfont ) dxDrawText ( " "..tostring(mphs).."mph", left , top +2, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) dxDrawText ( " "..tostring(mphs).."#00FF00mph", left -2, top, screenWidth, screenHeight -2, tocolor ( 0, 255, 255, 255 ), 1, spfont, "left", "top", false, false, false, true ) dxDrawText ( " "..tostring(kmhs).."km/h", left , top -23, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) dxDrawText ( " "..tostring(kmhs).."#00FF00km/h", left -2, top -25, screenWidth, screenHeight -2, tocolor ( 0, 255, 255, 255 ), 1, spfont, "left", "top", false, false, false, true ) end Message I get: bspeedometer\speedo.lua:5: addEventHandler" 'onClientRender' with this function is already handled
-
try addEventHandler ( "onClientRender", root, getElementData ) function getElementData ( ) if isPedJoin (localPlayer) == false then return end kills = getElementKills (getPedJoin(localPlayer)) deaths = getElementDeaths (getPedJoin(localPlayer)) screenWidth, screenHeight = guiGetScreenSize() windowWidth, windowHeight = 300,170 left = screenWidth/1.15 - windowWidth/9.8 top = screenHeight/1.15 - windowHeight/20 dxDrawText ( "Kills: "..tostring(speed).."Kills", left, top, screenWidth, screenHeight, tocolor ( 200, 200, 200, 255 ), 1.5, "arial" ) dxDrawText ( "Deaths: "..tostring(currenthealth).."Deaths", left, top -25, screenWidth, screenHeight, tocolor ( 200, 200, 200, 255 ), 1.5, "arial" ) end
-
Ah I see. Keep up the good work :>
