Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. drk

    I need a skin

    No need to post two times.
  2. For chating
  3. drk

    Problem setTimer

    No problem
  4. drk

    I need a skin

    Only for you.
  5. drk

    Problem setTimer

    setTimer ( function ( ) local cx = math.random ( 1005, 5555 ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do givePlayerMoney ( v, cx ) outputChatBox( 'You won ' .. cx, v, 255, 255, 255, false ) end end, 1000, 0 )
  6. drk

    Xtremepipes

    Upload in 4shared.
  7. drk

    TDMA

    WTF What is it Evil-Cod3r?! What is Weapon and what is source? And forgot a end!
  8. drk

    GUI Label Colorcodes

    I removed the getPlayerName function that removes hex color from _common.lua I will try now. Anyway Kenix is helping me. I think you can lock this post
  9. drk

    GUI Label Colorcodes

    Ye, it's in Race
  10. drk

    GUI Label Colorcodes

    I used getPlayerName(source) and it return without colors
  11. I'm trying to create a gui label and use color codes in the label. I tried editing guiCreateColorLabel ( you can find it on forum ) but it don't work. It appear without color codes but no colors Anyone knows a way to put color codes in a label and the colors appear?
  12. This skype group is for helping people in Lua scripting.
  13. Here it works.
  14. Server Side: addEvent("onMapStarting",true) addEvent('buyMap',true) function buyMap(thePlayer,mapName) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) if ( mapIsAlreadySet == false ) then if ( not mapName == "" ) then if ( playerCash >= mapCost ) then triggerEvent("onSetNextMap",thePlayer,thePlayer,mapName) else outputChatBox("#FF6600* #FFFFFFYou don't have enough money to set a map!",thePlayer,255,255,255,true) end else outputChatBox("#FF6600* #FFFFFFPlease select a map from the list first!",thePlayer,255,255,255,true) end else outputChatBox("#FF6600* #FFFFFFA map is already set at the moment! Please try again later.",thePlayer,255,255,255,true) end end addEventHandler('buyMap',root,buyMap) function resetMapSetStatus() mapIsAlreadySet = false end addEventHandler("onMapStarting",getRootElement(),resetMapSetStatus) addEvent("onSetNextMap",true) addEventHandler("onSetNextMap",getRootElement(), function (thePlayer,mapName) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) savePlayerData(thePlayer,"cash",playerCash-mapCost) outputChatBox("#FFFFFFNextmap: "..getPlayerName(thePlayer).."#FFFFFF has bought a next map!",getRootElement(),255,255,255,true) outputChatBox("#FFFFFFNextmap: #FF8800"..mapName,getRootElement(),255,255,255,true) mapIsAlreadySet = true scoreboardRefresh(thePlayer) achievement31(thePlayer) end ) Client Side: function buyNextMap() local selectedMap, column = guiGridListGetSelectedItem(gridMaps) if not selectedMap and not column and selectedMap == -1 and column == -1 then outputChatBox("#FF6600* #FFFFFFERROR! Please select a Map to buy!",255,255,255,true) -- you can't use color codes in client-side else local mapName = guiGridListGetItemText(gridMaps,colName,1) --change colName by your column name. triggerServerEvent("buyMap",localPlayer,localPlayer,mapName) end end addEventHandler("onClientGUIClick",btn_buyNextMap, buyNextMap, true)
  15. Server-side: addCommandHandler('deletemap', function(player,cmd,...) local map = table.concat(...,' ') local search = getResourceFromName(map) if search then deleteResource(search) outputChatBox("Map sucessfully deleted!",player,255,255,255,false) else outputChatBox("Map not found!",player,255,255,255,false) end end ) Add to meta.xml: <min_mta_version server="1.1.1-9.03316" /> Not tested. Command: /deletemap MapResourceName
  16. Admin resource probably is not in ACL.
  17. drk

    Xtremepipes

    Ye, reupload it please. Megaupload is down forever
  18. You have to change resolutionX and resolutionY in dxDrawRelativeRectangle and dxDrawRelativeText and put your resolution X, resolution Y.
  19. Ye.
  20. https://wiki.multitheftauto.com/wiki/Ser ... _functions
  21. local sx, sy = guiGetScreenSize() dxDrawText(join,(posX/yourResolutionX)*sx,(posY/yourResolutionY)*sy,(width/yourResolutionX)*sx,(height/yourResolutionY)*sy,tocolor(255,255,255,255),0.6,"pricedown","left","top",false,false,true) Example: local sx, sy = guiGetScreenSize() dxDrawText("My text",(10/800)*sx,(200/600)*sy,(10/800)*sx,(200/600)*sy,tocolor(255,255,255,255),0.6,"pricedown","left","center",false,false,true)
  22. I think this is more easy to understand... local join = '' local quit = '' addEventHandler('onClientRender',root, function() dxDrawText(join,x,y,width,height,color,size,font,left,top,clip,wordbreak,postGUI) dxDrawText(quit,x,y,width,height,color,size,font,left,top,clip,wordbreak,postGUI) end ) addEventHandler('onClientPlayerJoin',root, function() join = getPlayerName(source).." has joined the game!" setTimer( function() join = '' end, 5000,1) end ) addEventHandler('onClientPlayerQuit',root, function(reason) quit = getPlayerName(source).." has left the game! Reason: "..reason setTimer( function() quit = '' end, 5000,1) end )
  23. drk

    Noob problem

    I think that isn't called "Colshape"... I don't know the name.
  24. Kenix, your work but color codes appears and not colors. Cadu12, I've seen that r, g, b is nil then it sets r = 255, g = 255, b = 255. My code: function guiCreateColorLabel ( ax, ay, bx, by, str, relative, parent ) 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 r, g, b = 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 r == nil then r = 211 end if g == nil then g = 211 end if b == nil then b = 211 end if last <= #str then cap = str:sub( last ) string = string.gsub(cap,'%x%x%x%x%x%x','') label = guiCreateLabel ( ax, ay, bx, by, string, relative, parent ) guiLabelSetColor ( label, r, g, b ) return label end end
  25. No problem.
×
×
  • Create New...