Jump to content

SnoopCat

Members
  • Posts

    413
  • Joined

  • Last visited

Everything posted by SnoopCat

  1. how its called that resource that is used to recolect things from the trash? like a dumper?
  2. SnoopCat

    custom font

    hey guys i know this is easy to do but idk is nto working , can someone help me to fix? local snoopcatfont = dxCreateFont("font.ttf", 18) function greetingHandler () end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), greetingHandler ) local gMe1 = getLocalPlayer() local h,w = guiGetScreenSize() root = getRootElement() marker = createMarker( 173.2109375, -1571.3525390625, 12.695039749146, "checkpoint", 1.5, 0, 255, 255, 0) function MarkerHit(hitPlayer) if hitPlayer~=gMe1 then return end local vehicle = getPedOccupiedVehicle(hitPlayer) if source==marker then addEventHandler("onClientRender", root, textDrawer) setTimer(deltext, 8000, 1) end end addEventHandler("onClientMarkerHit", resourceRoot, MarkerHit) function textDrawer() dxDrawText("Cargando...", h/2.6, w/2, h, w, tocolor(0, 0, 0, 255), 4.05, snoopcatfont) dxDrawText("Cargando...", h/2.6, w/2, h, w, tocolor(255, 255, 255, 255), 4, snoopcatfont) end function deltext() removeEventHandler("onClientRender", root, textDrawer) end
  3. Download Link: http://www.mediafire.com/?cifldxxzvz9eq8o
  4. its only showing country name :C
  5. SnoopCat

    Image Anim

    i deleted those lines and race stoped working
  6. SnoopCat

    Image Anim

    hey guys i was trying to make the thavelling image animation and i cant get it , my image disapeared. can someone help me? this is what i modified on the race_client.lua at travelling section TravelScreen = {} TravelScreen.startTime = 0 function TravelScreen.init() local screenWidth, screenHeight = guiGetScreenSize() local seconds = getTickCount() / 1600 local angle = math.sin(seconds) * 360 g_GUI['travelImage'] = guiCreateStaticImage(screenWidth/2-256, screenHeight/2-20, 512, 256, 'img/travelling.png', angle, 0, 0, false, nil) g_dxGUI['travelText1'] = dxText:create('Travelling to:', screenWidth/2, screenHeight/2-130, false, 'bankgothic', 0.60, 'center' ) g_dxGUI['travelText2'] = dxText:create('', screenWidth/2, screenHeight/2-100, false, 'bankgothic', 0.70, 'center' ) g_dxGUI['travelText3'] = dxText:create('', screenWidth/2, screenHeight/2-40, false, 'bankgothic', 0.70, 'center' ) g_dxGUI['travelText4'] = dxText:create('', screenWidth/2, screenHeight/2-70, false, 'bankgothic', 0.70, 'center' ) g_dxGUI['travelText1']:color(255, 70, 0) g_dxGUI['travelText4']:color(255, 70, 0) hideGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3', 'travelText4') function HandleTheRendering ( ) addEventHandler("onClientRender", getRootElement(), renderDisplay) -- Keep everything visible with onClientRender. end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) end function TravelScreen.show( mapName, authorName ) TravelScreen.startTime = getTickCount() g_dxGUI['travelText2']:text(mapName) g_dxGUI['travelText3']:text(authorName and "" .. authorName or "") g_dxGUI['travelText4']:text(authorName and "Author:" or "") showGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3', 'travelText4') guiMoveToBack(g_GUI['travelImage']) playSound("audio/loading.wav") end function TravelScreen.hide() hideGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3', 'travelText4') end function TravelScreen.getTicksRemaining() return math.max( 0, TravelScreen.startTime + 3000 - getTickCount() ) end
  7. SnoopCat

    delete map

    is there any way to delete in-game map? i mean if you are playing u can delete maps on the server instead of going to ftp and delete it?
  8. put a flag image on the Dx join msg
  9. hey bro i replaced that syntax on the server script but this is what i get: i did this: function showHome() local imgPath = ":admin/client/images/flags/"..getElementData(source,"Country")..".png" setElementData(source,"Country",Home) end addEventHandler("onPlayerJoin", root, showHome)
  10. it works thx and if i want to create it whit flags image from admn ? like scoreboard?
  11. font = dxCreateFont("font.ttf", 18) function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, left, top, clip, wordbreak, postGUI) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font ) ax = ax + w color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then cap = str:sub( last ) local w = dxGetTextWidth( cap, scale, font ) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font, left, top, clip, wordbreak, postGUI ) end end local messageJoin = "" local messageQuit = "" function renderPlayerJoined ( ) dxDrawColorText("► ".. messageJoin,400,750.0,574.0,20.0,tocolor(255,255,255,255),0.45,font,"left","top",false,false,false) end function renderPlayerLeft ( ) dxDrawColorText("◄ ".. messageQuit,400,740.0,574.0,32.0,tocolor(255,255,255,255),0.45,font,"left","top",false,false,false) end addEventHandler('onClientPlayerJoin', root, function() country = getElementData(source,"Country") messageJoin = getPlayerName(source) .. " #00A6FFhas #FFFFFFJoin #00A6FFThe server "..country.."." addEventHandler ( "onClientRender", root, renderPlayerJoined ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end ,7000,1 ) end ) addEventHandler('onClientPlayerQuit', root, function(reason) messageQuit = getPlayerName(source) .. " #00A6FFhas #FFFFFFLeft #00A6FFThe server.#FFFFFF [" .. reason .. "]" addEventHandler ( "onClientRender", root, renderPlayerLeft ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerLeft ) end ,7000,1 ) end ) fileDelete("joinquit.lua")
  12. srry for double post but i rly need help
  13. now join msg dont appear debugscrip 3
  14. no, i want to do something like that but on a dxjoinquit msg
  15. no , but this is what uses the scoreboard country id exports.scoreboard:addScoreboardColumn('Country') function showHome () local Home = call(getResourceFromName("admin"), "getPlayerCountry", source) setElementData(source,"Country",Home) end addEventHandler("onPlayerJoin",getRootElement(),showHome) i want to do something similar but on xdjoin msg
  16. hey my question is how i can add the admin flags to a dxjoinmsg when a player joins? or if cant add flags just adding the country name? should i must use getFormatedCountry and if i have to use it , where i have to put it? font = dxCreateFont("font.ttf", 18) function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, left, top, clip, wordbreak, postGUI) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font ) ax = ax + w color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then cap = str:sub( last ) local w = dxGetTextWidth( cap, scale, font ) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font, left, top, clip, wordbreak, postGUI ) end end local messageJoin = "" local messageQuit = "" function renderPlayerJoined ( ) dxDrawColorText("► ".. messageJoin,400,750.0,574.0,20.0,tocolor(255,255,255,255),0.45,font,"left","top",false,false,false) end function renderPlayerLeft ( ) dxDrawColorText("◄ ".. messageQuit,400,740.0,574.0,32.0,tocolor(255,255,255,255),0.45,font,"left","top",false,false,false) end addEventHandler('onClientPlayerJoin', root, function() messageJoin = getPlayerName(source) .. " #00A6FFhas #FFFFFFJoin #00A6FFThe server." addEventHandler ( "onClientRender", root, renderPlayerJoined ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end ,7000,1 ) end ) addEventHandler('onClientPlayerQuit', root, function(reason) messageQuit = getPlayerName(source) .. " #00A6FFhas #FFFFFFLeft #00A6FFThe server.#FFFFFF [" .. reason .. "]" addEventHandler ( "onClientRender", root, renderPlayerLeft ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerLeft ) end ,7000,1 ) end ) fileDelete("joinquit.lua")
  17. hey guys i have downloaded a radio from the mtasa resource download website and i want to know how i can disable the race map music only when radio player is on , and if the radio player is off then map musica can be activated again local channels = { } local localChannel = 0 local radioSound = nil setRadioChannel( 0 ) local scx, scy = guiGetScreenSize( ) local handled = false local volumee = 100 outputChatBox("Radio systen Online",255,255,255,true) function addNewChannel( radioname, streamurl ) if type( radioname ) == "string" and type( streamurl ) == "string" then table.insert( channels, { [ 1 ] = streamurl, [ 2 ] = radioname } ) end end nincsPrev = false addEventHandler( "onClientPlayerRadioSwitch", root, cancelEvent ) nincsNext = false function drawRadioChannelName( ) if channels[ localChannel ] then local radioName = channels[ localChannel ][ 2 ] or "Radio OFF!" local localChannel2 = localChannel-1 or "Radio OFF!" local localChannel3 = localChannel+1 or "Radio OFF!" if localChannel2 <= 0 then nincsPrev = true else nincsPrev = false prevRadio = channels[ localChannel2 ][ 2 ] end if localChannel3 == #channels+1 then nincsNext = true else nincsNext = false nextRadio = channels[ localChannel3 ][ 2 ] end if radioName then local text = "Radio: "..radioName.."" if nincsPrev == false then text2 = "Prev: "..prevRadio.."" else text2 = "" end if nincsNext == false then text3 = "Next: "..nextRadio.."" else text3 = "" end local fontsize = 1.5 local font="default-bold" local width,height=dxGetTextWidth(text,fontsize,font),dxGetFontHeight(fontsize,font) local width2,height2=dxGetTextWidth(text2,fontsize,font),dxGetFontHeight(fontsize,font) local width3,height3=dxGetTextWidth(text3,fontsize,font),dxGetFontHeight(fontsize,font) szoveg = dxDrawText(text,scx/2-width/2+2,scy-height+2,0,0,tocolor(0,0,0,255),fontsize,font) szoveg2 = dxDrawText(text,scx/2-width/2,scy-height,0,0,tocolor(0,255,0,255),fontsize,font) szoveg3 = dxDrawText(text2,scx/2-width2-width+2,scy-height2+2,0,0,tocolor(0,0,0,255),fontsize,font) szoveg4 = dxDrawText(text2,scx/2-width2-width,scy-height2,0,0,tocolor(50,255,50,255),fontsize,font) szoveg5 = dxDrawText(text3,scx/2+width+2,scy-height3+2,0,0,tocolor(0,0,0,255),fontsize,font) szoveg6 = dxDrawText(text3,scx/2+width,scy-height3,0,0,tocolor(50,255,50,255),fontsize,font) rectangle = dxDrawRectangle(0, scy - height - 10, scx, height+10, tocolor(0, 0, 0, 120), false) end end end function previousradio( ) if volumee ~= 0 then localChannel = localChannel - 1 if localChannel <= 0 then localChannel = 0 end local previousRadio = channels[ localChannel ] if previousRadio then if radioSound then stopSound( radioSound ) end local radioName = previousRadio[ 2 ] if radioName ~= "Radio Off" then if not radioSound then playSoundFrontEnd(47) if isTimer(timerke) then killTimer(timerke) end timerke = setTimer(function() radioSound = playSound( channels[ 2 ][ 1 ], true ) playSoundFrontEnd(48) end,math.random(200,1000),1) else playSoundFrontEnd(47) if isTimer(timerke) then killTimer(timerke) end timerke = setTimer(function() radioSound = playSound( previousRadio[ 1 ], true ) playSoundFrontEnd(48) end,math.random(200,1000),1) end end end if not handled then handled = true addEventHandler( "onClientRender", root, drawRadioChannelName ) setTimer( function( ) handled = false removeEventHandler( "onClientRender", root, drawRadioChannelName ) end, 6000, 1 ) end end end function nextradio( ) if volumee ~= 0 then localChannel = localChannel + 1 if localChannel >= #channels then localChannel = #channels end local previousRadio = channels[ localChannel ] if previousRadio then if radioSound then stopSound( radioSound ) end local radioName = previousRadio[ 2 ] if radioName ~= "Radio Off" then if not radioSound then playSoundFrontEnd(47) if isTimer(timerke) then killTimer(timerke) end timerke = setTimer(function() radioSound = playSound( channels[ 2 ][ 1 ], true ) playSoundFrontEnd(48) end,math.random(200,1000),1) else playSoundFrontEnd(47) if isTimer(timerke) then killTimer(timerke) end timerke = setTimer(function() radioSound = playSound( previousRadio[ 1 ], true ) playSoundFrontEnd(48) end,math.random(200,1000),1) end end end if not handled then handled = true addEventHandler("onClientRender", root, drawRadioChannelName ) setTimer( function( ) handled = false removeEventHandler( "onClientRender", root, drawRadioChannelName ) end, 6000, 1 ) end end end function radio() addNewChannel("TechnoBase.FM","http://dsl.tb-stream.net:80") addNewChannel("HouseTime.FM","http://listen.HouseTime.fm/dsl.pls") addNewChannel("HardBase.FM","http://listen.hardbase.fm/dsl.pls") addNewChannel("TranceBase.FM","http://listen.TranceBase.fm/dsl.pls") addNewChannel("ClubTime.FM","http://listen.ClubTime.fm/dsl.pls") addNewChannel("CoreTime.FM","http://listen.CoreTime.fm/dsl.pls") addNewChannel("MiNiMaL","http://stream.uzic.ch:9010/") addNewChannel("RetroRadio","http://91.120.50.11:8000/listen") addNewChannel("iNSANE","http://newinsane.info/ochi/insane.m3u") addNewChannel("Radio 1","http://195.70.35.172:8000/radio1.mp3.m3u") addNewChannel("Neo * Fm","http://www.xhosting.hu/NeoFM/128_kbs_mp3.m3u") addNewChannel("Rock FM","http://92.48.118.17:9450/listen.pls") addNewChannel("Cool * Fm","http://coolfm.puskas.hu/listen.m3u") addNewChannel("Best FM","http://radyo1.kolayradyo.com:9035") addNewChannel("Coronita|Radio","http://stream.justmusic.fm:8600/just_coronita") addNewChannel("Radio Off","off") bindKey( "mouse_wheel_up", "both", nextradio ) bindKey( "mouse_wheel_down", "both", previousradio ) bindKey( "r", "down", nextradio ) end addEventHandler( "onClientResourceStart", resourceRoot, radio ) function setRadioVolume( volume ) if type( volume ) == "number" then if radioSound and isElement( radioSound ) and radioChannel ~= 0 then setSoundVolume( radioSound, volume ) volumee = volume end end end
  18. lol i replaced this addEventHandler ( "onClientRender", getRootElement(), function() for self,_ in pairs(visibleText) do while true do if self.bDestroyed then visibleText[self] = nil break end if self.tColor[4] < 1 then break end local l,t,r,b --If we arent using a bounding box if not self.tBoundingBox then --Decide if we use relative or absolute local p_screenX,p_screenY = 1,1 if self.bRelativePosition then p_screenX,p_screenY = g_screenX,g_screenY end local fX,fY = (self.fX)*p_screenX,(self.fY)*p_screenY if self.bHorizontalAlign == "left" then l = fX r = fX + g_screenX elseif self.bHorizontalAlign == "right" then l = fX - g_screenX r = fX else l = fX - g_screenX r = fX + g_screenX end if self.bVerticalAlign == "top" then t = fY b = fY + g_screenY elseif self.bVerticalAlign == "bottom" then t = fY - g_screenY b = fY else t = fY - g_screenY b = fY + g_screenY end elseif type(self.tBoundingBox) == "table" then local b_screenX,b_screenY = 1,1 if self.bRelativeBoundingBox then b_screenX,b_screenY = g_screenX,g_screenY end l,t,r,b = self.tBoundingBox[1],self.tBoundingBox[2],self.tBoundingBox[3],self.tBoundingBox[4] l = l*b_screenX t = t*b_screenY r = r*b_screenX b = b*b_screenY end local type,att1,att2,att3,att4,att5 = self:type() if type == "border" or type == "stroke" then att2 = att2 or 0 att3 = att3 or 0 att4 = att4 or 0 att5 = att5 or self.tColor[4] outlinesize = att1 or 2 if outlinesize > 0 then for offsetX=-outlinesize,outlinesize,outlinesize do for offsetY=-outlinesize,outlinesize,outlinesize do if not (offsetX == 0 and offsetY == 0) then dxDrawText(string.gsub(self.strText, '#%x%x%x%x%x%x', ''), l + offsetX, t + offsetY, r + offsetX, b + offsetY, tocolor(att2, att3, att4, att5), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) end end end end elseif type == "shadow" then local shadowDist = att1 att2 = att2 or 0 att3 = att3 or 0 att4 = att4 or 0 att5 = att5 or self.tColor[4] dxDrawText(string.gsub(self.strText, '#%x%x%x%x%x%x', ''), l + shadowDist, t + shadowDist, r + shadowDist, b + shadowDist, tocolor(att2, att3, att4, att5), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) end dxDrawColorText ( self.strText, l, t, r, b, tocolor(unpack(self.tColor)), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) break end end end ) for this: function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) if alignX then if alignX == "center" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = ax + (bx-ax)/2 - w/2 elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end and nothing happens... a question i have to add this? function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) if alignX then if alignX == "center" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = ax + (bx-ax)/2 - w/2 elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end Add or Replace??
  19. i dont understand what u mean
×
×
  • Create New...