Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. I think it will work... local alreadyWon = false local words = { '39s939k239' 'ds9sd8409' } setTimer( function() word = words[math.random(#words)] money = math.random(50,500) outputChatBox("Say "..word.." to win $"..money.."!",root,255,255,false) end, 100000,0) addEventHandler('onPlayerChat',root, function(message, messageType) if (messageType == 0 and message == word) then if ( not alreadyWon ) then alreadyWon = true givePlayerMoney(source, money) outputChatBox(getPlayerName(source) .." was The First Player and got $"..money.. "!",root,255,255,0,false) else outputChatBox("Next Time Try To Be More Faster !",source,255,0,255,false) end end end )
  2. I get no error but It don't work... It appear with color codes. And no colors I tried with: 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 = tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if r == nil then r = 255 end if g == nil then g = 255 end if b == nil then b = 255 end if last <= #str then cap = str:sub( last ) label = guiCreateLabel ( ax, ay, bx, by, cap, relative, parent ) guiLabelSetColor ( label, r, g, b ) return label end end But I get error on guiLabelSetColor. I don't know why I get expected number, colors don't have to be numbers? oO
  3. Your code is wrong. local first = false addEventHandler('onPlayerChat',root, function(message,messageType) if messageType == "0" and message == "money" then if first then givePlayerMoney(source,100) outputChatBox(getPlayerName(source).." was the first and got 100$!",root,255,255,255,false) else outputChatBox("Next time try to be more faster!",source,255,255,255,false) end end end ) Only a example.
  4. By PM, code is a little big.
  5. My bad.. Copy my code again
  6. I never changed Votemanager, I don't know how it works..
  7. Try: Server Side: addEvent("onMapStarting",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 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",getLocalPlayer(),mapName,getPlayerName(localPlayer)) end end addEventHandler("onClientGUIClick",btn_buyNextMap, buyNextMap, true) Updated. Verify if btn_buyNextMap exists !!
  8. He wants to put a "Random" selection in votemanager, then when you select Random votemanager starts a random map.
  9. You're welcome. Any problem, don't hesitate to contact us! We are here to help ( or try to help )
  10. I tried but still don't work I tried to add events again when a map start but don't work. Maybe the problem isn't that.
  11. Why? '-' Only when change map it happens. I don't know what I have to check.
  12. Then use Print Code and copy the code.
  13. Your GUIEditor have to be in a folder. But you can right click on the screen click Print Code then select the code and press Ctrl + C. Then paste the code in your lua file.
  14. I'm using onClientMouseEnter and onClientMouseLeave but when I map stop and start other event's don't work anymore Here the code: addEventHandler('onClientMouseEnter',root, function() if source == contacts then guiSetVisible ( ipad['contacts_label'], true ) elseif source == music then guiSetVisible ( ipad['music_label'], true ) elseif source == profile then guiSetVisible ( ipad['profile_label'], true ) elseif source == settings then guiSetVisible ( ipad['settings_label'], true ) elseif source == sms then guiSetVisible ( ipad['sms_label'], true ) elseif source == stats then guiSetVisible ( ipad['stats_label'], true ) elseif source == top then guiSetVisible ( ipad['top_label'], true ) end end ) addEventHandler('onClientMouseLeave',root, function() if source == contacts then guiSetVisible ( ipad['contacts_label'], false ) elseif source == music then guiSetVisible ( ipad['music_label'], false ) elseif source == profile then guiSetVisible ( ipad['profile_label'], false ) elseif source == settings then guiSetVisible ( ipad['settings_label'], false ) elseif source == sms then guiSetVisible ( ipad['sms_label'], false ) elseif source == stats then guiSetVisible ( ipad['stats_label'], false ) elseif source == top then guiSetVisible ( ipad['top_label'], false ) end end ) GUI: ipad['window'] = guiCreateStaticImage((93/800)*x,(-430/600)*y,(607/800)*x,(412/600)*y,'_utils/_data/_image/ipad.png',false) ipad['close'] = guiCreateLabel((529/800)*x,(191/600)*y,(31/800)*x,(27/600)*y,'',false,ipad['window']) ipad['topbar'] = guiCreateStaticImage((89/800)*x,(10/600)*y,(429/800)*x,(78/600)*y,'_utils/_data/_image/task-bar.png',false,ipad['window']) ipad['topbar_time'] = guiCreateLabel((383/800)*x,(36/600)*y,(45/800)*x,(14/600)*y,'',false,ipad['topbar']) guiLabelSetVerticalAlign(ipad['topbar_time'],"center") guiLabelSetHorizontalAlign(ipad['topbar_time'],"center",false) guiSetFont(ipad['topbar_time'],wsCFont) ipad['news'] = guiCreateLabel((89/800)*x,(340/600)*y,(429/800)*x,(23/600)*y,"",false,ipad['window']) guiSetAlpha(ipad['news'],0.80000001192093) guiLabelSetColor(ipad['news'],0,0,0,100) guiLabelSetVerticalAlign(ipad['news'],"center") guiLabelSetHorizontalAlign(ipad['news'],"center",false) guiSetFont(ipad['news'],newsFont) --ipad['top'] = guiCreateStaticImage((93/800)*x,(16/600)*y,(607/800)*x,(412/600)*y,"_utils/_data/_image/top.png",false,ipad['window']) --ipad['top2'] = guiCreateStaticImage((89/800)*x,(10/600)*y,(429/800)*x,(78/600)*y,"_utils/_data/_image/top.png",false,ipad['top']) --ipad['top3'] = guiCreateStaticImage((119/800)*x,(-136/600)*y,(429/800)*x,(23/600)*y,"_utils/_data/_image/top.png",false,ipad['top2']) ipad['contacts'] = guiCreateStaticImage((52/800)*x,(68/600)*y,(173/800)*x,(103/600)*y,"_utils/_data/_image/contacts.png",false,ipad['window']) ipad['music'] = guiCreateStaticImage((104/800)*x,(68/600)*y,(170/800)*x,(103/600)*y,"_utils/_data/_image/music.png",false,ipad['window']) ipad['profile'] = guiCreateStaticImage((145/800)*x,(65/600)*y,(193/800)*x,(110/600)*y,"_utils/_data/_image/profile.png",false,ipad['window']) ipad['settings'] = guiCreateStaticImage((194/800)*x,(63/600)*y,(203/800)*x,(116/600)*y,"_utils/_data/_image/settings.png",false,ipad['window']) ipad['shutoff'] = guiCreateStaticImage((229/800)*x,(254/600)*y,(159/800)*x,(96/600)*y,"_utils/_data/_image/shutoff.png",false,ipad['window']) ipad['sms'] = guiCreateStaticImage((261/800)*x,(65/600)*y,(180/800)*x,(113/600)*y,"_utils/_data/_image/sms.png",false,ipad['window']) ipad['stats'] = guiCreateStaticImage((302/800)*x,(61/600)*y,(201/800)*x,(121/600)*y,"_utils/_data/_image/stats.png",false,ipad['window']) ipad['top'] = guiCreateStaticImage((367/800)*x,(63/600)*y,(183/800)*x,(117/600)*y,"_utils/_data/_image/top.png",false,ipad['window']) ipad['state'] = guiCreateLabel((102/800)*x,(193/600)*y,(403/800)*x,(52/600)*y,'',false,ipad['window']) guiSetAlpha(ipad['state'],0.80000001192093) guiLabelSetColor(ipad['state'],0,0,0,100) guiLabelSetVerticalAlign(ipad['state'],"center") guiLabelSetHorizontalAlign(ipad['state'],"center",false) guiSetFont(ipad['state'],stateFont) contacts = guiCreateLabel((216/800)*x,(114/600)*y,(31/800)*x,(42/600)*y,"",false) music = guiCreateLabel((267/800)*x,(114/600)*y,(30/800)*x,(43/600)*y,"",false) profile = guiCreateLabel((317/800)*x,(113/600)*y,(34/800)*x,(47/600)*y,"",false) settings = guiCreateLabel((369/800)*x,(113/600)*y,(38/800)*x,(49/600)*y,"",false) sms = guiCreateLabel((426/800)*x,(114/600)*y,(36/800)*x,(49/600)*y,"",false) stats = guiCreateLabel((475/800)*x,(112/600)*y,(40/800)*x,(53/600)*y,"",false) top = guiCreateLabel((534/800)*x,(113/600)*y,(34/800)*x,(51/600)*y,"",false) guiBringToFront(contacts) guiBringToFront(music) guiBringToFront(profile) guiBringToFront(settings) guiBringToFront(sms) guiBringToFront(stats) guiBringToFront(top) ipad['contacts_label'] = guiCreateLabel((207/800)*x,(95/600)*y,(51/800)*x,(15/600)*y,"Contacts",false) guiSetAlpha(ipad['contacts_label'],0.89999997615814) guiLabelSetColor(ipad['contacts_label'],0,0,0,100) guiSetFont(ipad['contacts_label'],wsCFont) ipad['music_label'] = guiCreateLabel((258/800)*x,(94/600)*y,(51/800)*x,(15/600)*y,"Music",false) guiSetAlpha(ipad['music_label'],0.89999997615814) guiLabelSetColor(ipad['music_label'],0,0,0) guiLabelSetVerticalAlign(ipad['music_label'],"center") guiLabelSetHorizontalAlign(ipad['music_label'],"center",false) guiSetFont(ipad['music_label'],wsCFont) ipad['profile_label'] = guiCreateLabel((310/800)*x,(94/600)*y,(51/800)*x,(15/600)*y,"Profile",false) guiSetAlpha(ipad['profile_label'],0.89999997615814) guiLabelSetColor(ipad['profile_label'],0,0,0) guiLabelSetVerticalAlign(ipad['profile_label'],"center") guiLabelSetHorizontalAlign(ipad['profile_label'],"center",false) guiSetFont(ipad['profile_label'],wsCFont) ipad['settings_label'] = guiCreateLabel((366/800)*x,(94/600)*y,(51/800)*x,(15/600)*y,"Settings",false) guiSetAlpha(ipad['settings_label'],0.89999997615814) guiLabelSetColor(ipad['settings_label'],0,0,0) guiSetFont(ipad['settings_label'],wsCFont) ipad['sms_label'] = guiCreateLabel((419/800)*x,(94/600)*y,(51/800)*x,(15/600)*y,"SMS",false) guiSetAlpha(ipad['sms_label'],0.89999997615814) guiLabelSetColor(ipad['sms_label'],0,0,0) guiLabelSetHorizontalAlign(ipad['sms_label'],"center",false) guiSetFont(ipad['sms_label'],wsCFont) ipad['stats_label'] = guiCreateLabel((470/800)*x,(92/600)*y,(51/800)*x,(15/600)*y,"Stats",false) guiSetAlpha(ipad['stats_label'],0.89999997615814) guiLabelSetColor(ipad['stats_label'],0,0,0) guiLabelSetVerticalAlign(ipad['stats_label'],"center") guiLabelSetHorizontalAlign(ipad['stats_label'],"center",false) guiSetFont(ipad['stats_label'],wsCFont) ipad['top_label'] = guiCreateLabel((525/800)*x,(93/600)*y,(51/800)*x,(15/600)*y,"Top",false) guiSetAlpha(ipad['top_label'],0.89999997615814) guiLabelSetColor(ipad['top_label'],0,0,0) guiLabelSetHorizontalAlign(ipad['top_label'],"center",false) guiSetFont(ipad['top_label'],wsCFont) local rand = news[math.random(#news)] guiSetText(ipad['news'],tostring(rand)) setTimer( function() local rand = news[math.random(#news)] guiSetText(ipad['news'],tostring(rand)) end, 3600000,0) guiSetVisible ( ipad['window'], true ) state = false
  15. LOL Guieditor supports Load GUI. Start GUIEditor, press Shift + G, right click on the screen and click Load GUI, click on gui elements you want to change and be happy!
  16. If the skins are compatible with gtasa ( txd and dff files ) you can. Use engineLoadDFF, engineImportTXD. Example: addEventHandler('onClientResourceStart',root, function() skin1 = engineLoadDFF ( 'skin1.dff', SkinID ) engineReplaceModel ( skin1, SkinID ) skin12 = engineLoadTXD ( 'skin1.txd' ) engineImportTXD ( skin12, SkinID ) end )
  17. drk

    Noob problem

    I'm trying to create a "colshape" ( I don't know the name ) in my map ( like you can't see the water and others things, only the black "colshape" ) I don't know if you get it, I can't explain better. If anyone understand me please help
  18. drk

    Help

    LOL? What you have changed?
  19. drk

    question

    Some mistakes in the code...
  20. Sarcasm? There are these guys who have horrible taste, and don't care about how many times was something been done, they still like it. Something like this sh*tty game called "Dante's Inferno", that was almost a rip-off from "God of War", and still achieved popularity. So, there is no sarcasm in that phrase. B4ckflip say "Nice map" in all map topics LOL
  21. drk

    Hotkey help

    No need to post this, the problem has been solved by Kenix.
  22. drk

    Hotkey help

    WTF? Why you post this? First, start tabulating your code. Second, you don't need to fix the vehicle when player spawns. bindKey('F3','down', function() if isPedInVehicle(localPlayer) then local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then fixVehicle(vehicle) end end end )
  23. Why you think that? You are trying to start a deathmatch map on race. Obviously, it will not start because the map is not Race mode. This is the problem.
  24. LOL Your map is deathmatch mode. You are trying to start it on race gamemode.
×
×
  • Create New...