Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. blips = {} function Blip () for id, player in ipairs(getElementsByType("player")) do local r, g, b = getTeamColor(getPlayerTeam(player)) if blips[player] then setBlipColor (blips[player],r, g, b,255) else blips[player] = createBlipAttachedTo(PLAYERS, 0, 2, r, g, b) end end end setTimer(Blip, 5000, 0) function quit () destroyElement(blips[source]) end addEventHandler("onPlayerQuit", getRootElement(), quit) function dead (totalammo, killer, killerweapon) destroyElement(blips[source]) end addEventHandler("onPlayerWasted", getRootElement(), dead) You were creating a new blip every 5 secounds. Causing alot of lag.
  2. This will cycle through pictures you define in the path= table Example path = {"me.png","car.png","Oldmandowntheroad.png"}
  3. https://wiki.multitheftauto.com/wiki/GuiCreateButton https://wiki.multitheftauto.com/wiki/Gu ... taticImage Match up X,Y, Width, Height. local x,y , width, height = 0,0,0,0 -- CHANGE function button () local button = guiCreateButton ( x,y , width, height,"", false, menu) guiSetAlpha (button ,0) addEventHandler ( "onClientGUIClick", button , setImage, false ) end path = {"Path1","Path2","Path3"} function setImage () destroyElement(static) if patha > (#path-1) then patha = 0 else patha = patha+1 end static = guiCreateStaticImage (x,y , width, height,path[patha], false,menu) end Questions?
  4. Is the domain name itself linked correctly to the IP? Also some times the domain name has the ports in it. So that may mess it up.
  5. Please use [lua ] [/lua ] to make it more readable. Any way, you're missing an end in the register some where. Please try /debugscript 3, and see if any errors are outputted into the debug console.
  6. getElementZoneName uses an element getZoneName just uses cords, Just forgot about the getElementZoneName thing
  7. That would probably require client side integration, including with that would be a timer, that is infinite, every 5 secounds. That is where I end support here.
  8. This is just due to how it's set up, gives the illusion that it is 3D but in reality it's just a flat picture. From what it seams, the picture is just slanted a bit if that makes any sense.
  9. Type /debugscript 3 and look at bottom of screen for errors.
  10. Could have specified that in the original post maybe. addEventHandler("onPlayerTarget",root,function(target) if(getElementType(target)=="player")then if(getTeamName(getPlayerTeam(target))=="Police")then local x,y,z = getElementPosition(source) if getZoneName ( x, y, z, true ) == "Los Santos" or getZoneName ( x, y, z, true ) == "San Fierro" then local slot = getPedWeaponSlot (source) if slot ~= 1 and slot ~= 0 then setPlayerWantedLevel(source,getPlayerWantedLevel(source)+1) end end end end end) Any ways if you need anything else -- https://wiki.multitheftauto.com/wiki/Sc ... troduction Try searching up the functions and what not before you ask here, that's a very simple code to do. /debugscript 3 to find errors.
  11. addEventHandler("onPlayerTarget",root,function(target) if(getElementType(target)=="player")then if(getTeamName(getPlayerTeam(target))=="Police")then setPlayerWantedLevel(source,getPlayerWantedLevel(source)+1) end end end)
  12. Ah yes, always make that mistake, for some reason notepad ++ automaticly changes that to a single ) instead of both.
  13. KariiiM, I put that assuming he would know how to do it. Any ways function join () for i,player in pairs(getElementsByType("player") do if getElementData(player,"Test") == true then -- "Test" -> Set your element data here outputChatBox("TEST",player) -- > Set your text Here end end end addEventHandler ( "onPlayerJoin", getRootElement(), join )
  14. if getElementData(player,"Test") == true then -- "Test" -> Set your element data here outputChatBox("TEST",player) -- > Set your text Here end
  15. if getElementData(player,"Test") == true then -- "Test" -> Set your element data here outputChatBox("TEST") -- > Set your text Here end
  16. The weapon that is carried in the hand is not represented as a physical object. Meaning you'd have to create a custom weapon and apply a shader over that.
  17. yes but stefutz as soon as lots of cars start using setElementData you will notice a performance drop.
  18. To show them = function showPage(thePage) if thePage == "homepage" then CloseThePersonStats() OpenTheHomePage() elseif thePage == "personalStats" then CloseTheHomePage() OpenThePersonStats() end end Personal stats - local sX, sY = guiGetScreenSize() local dxfont_0 = dxCreateFont("font/font.ttf", 16) local dxfont_1 = dxCreateFont("font/font.ttf", 12) function OpenThePersonStats() if not personOpen then personOpen = true addEventHandler("onClientRender", getRootElement(), openPersonalStats) end end function CloseThePersonStats() personOpen = false removeEventHandler("onClientRender", getRootElement(), openPersonalStats) end function openPersonalStats() dxDrawRectangle((560/1366)*sX, (315/768)*sY, (375/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 200), false) dxDrawText ("Personal stats:", (565/1366)*sX, (320/768)*sY, x, y, tocolor ( 255, 255, 255, 200 ), (0.7/1366)*sX, dxfont_0) end Home page - local sX, sY = guiGetScreenSize() local dxfont_0 = dxCreateFont("font/font.ttf", 16) local dxfont_1 = dxCreateFont("font/font.ttf", 12) HomeOpen = false function OpenTheHomePage() --- OPEN IT if not HomeOpen then HomeOpen = true addEventHandler("onClientRender", getRootElement(), openHomepage) end end function CloseTheHomePage() --- CLOSE IT HomeOpen = false removeEventHandler("onClientRender", getRootElement(), openHomepage) end function openHomepage() -- 200 = interpolateBetween( 255, 0, 0, 0, 0, 0, 1500, "Linear" ) dxDrawImage( (880/1366)*sX, (160/768)*sY, (25/1366)*sX, (25/768)*sY, "img/home.png", 0, 0, 0, tocolor(255, 255, 255, 255) ) dxDrawText ("Home", (915/1366)*sX, (158/768)*sY, x, y, tocolor ( 255, 102, 0, 255 ), 1, dxfont_0) dxDrawImage( (560/1366)*sX, (235/768)*sY, (375/1366)*sX, (115/768)*sY, "img/header.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawEmptyRec((560/1366)*sX, (235/768)*sY, (375/1366)*sX, (115/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawRectangle((560/1366)*sX, (315/768)*sY, (375/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 200), false) dxDrawText ("NEWS: Read our latest news in our website [url=http://www.shc-clan.com!]http://www.shc-clan.com![/url], (565/1366)*sX, (320/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0)) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- dxDrawEmptyRec((560/1366)*sX, (375/768)*sY, (165/1366)*sX, (175/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawText ("Latest clanwars", (595/1366)*sX, (380/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 14 - 6 xS//", (595/1366)*sX, (400/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 15 - 5 eo3//", (595/1366)*sX, (420/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 13 - 7 iR|", (595/1366)*sX, (440/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 9 - 11 xN#", (595/1366)*sX, (460/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 16 - 4 [GoD]", (595/1366)*sX, (480/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 10 - 11 |6s", (595/1366)*sX, (500/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("Visit our website for more", (570/1366)*sX, (530/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- if isMouseInPosition ((740/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY) then dxDrawRectangle((740/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY, tocolor(150, 150, 150, 75)) end dxDrawEmptyRec((740/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawImage( (760/1366)*sX, (415/768)*sY, (50/1366)*sX, (50/768)*sY, "img/notebook.png", 0, 0, 0, tocolor(255, 255, 255, 255)) if isMouseInPosition ((845/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY) then dxDrawRectangle((845/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY, tocolor(150, 150, 150, 75)) end dxDrawEmptyRec((845/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawImage( (865/1366)*sX, (415/768)*sY, (50/1366)*sX, (50/768)*sY, "img/team.png", 0, 0, 0, tocolor(255, 255, 255, 255) ) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- dxDrawEmptyRec((740/1366)*sX, (495/768)*sY, (195/1366)*sX, (55/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawText ("[url=http://www.shc-clan.com]http://www.shc-clan.com[/url]", (763/1366)*sX, (510/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (1/1366)*sX, dxfont_0) end function dxDrawEmptyRec(startX, startY, endX, endY, color, width, postGUI) dxDrawLine ( startX, startY, startX+endX, startY, color, width, postGUI ) dxDrawLine ( startX, startY, startX, startY+endY, color, width, postGUI ) dxDrawLine ( startX, startY+endY, startX+endX, startY+endY, color, width, postGUI ) dxDrawLine ( startX+endX, startY, startX+endX, startY+endY, color, width, postGUI ) end
  19. Check this - https://community.multitheftauto.com/in ... ils&id=344
  20. #1 You need to add an onClientRender in the first place to the DXs #2 openPage is not defined
×
×
  • Create New...