Jump to content

DiGiTal

Members
  • Posts

    277
  • Joined

  • Last visited

Everything posted by DiGiTal

  1. VORTEX HOSTING it's a company that gives a free gameservers hosting for a posts. Vortex Hosting :We are specialists in free hosting services using clustered technology powered by one of the largest hosting organizations on the internet. Sign up here for fast free PHP & MySQL hosting including a free sub domain. A powerful control panel provided to manage your website, packed with hundreds of great features including website building tools, Email, FTP add-on domain and much more.We giving too a premuim hosting(see the premuim features down !!) for only 0.99$ Need help ? contact a admin in our forum. Premuim Web Hosting:Her Free Web Hosting:Here Our Website: Website Free game Server Hosting:Here About getting a server: (5 posts per month= 20 slots) for more informations check this Here UPDATED
  2. Hi, it's a turf system. i created the progress bar in the client. i want once a player joined a zone of turf it will trigger the client for to show the bar.but it didn't work. triggerEvent ( "drawed", root) triggerEvent ( "started", root) those are. drawed= for to draw the progress bar, started= for to start it. Thanks Client: local screenW, screenH = guiGetScreenSize() a = backgroundRectangle,progressRectangle,progressText -- Assign a local variable to know if it is currently drawing or not. local isCurrentlyDrawing = false -- Variable for telling the script whether the timer is active or not. local progressTimer = false -- The total and current progress, this should always be between 0-100. local totalProgress = 0 -- Math for converting the width. Originally the relative size to the screen was 2.575. So when totalProgress is at 100, renderProgress will be at 2.575. This will display the progress bar as full. local renderProgress = (totalProgress/100)/2.575 function startDrawing() -- Check if it is currently not drawing the rectangle. if(isCurrentlyDrawing == false) then -- Add the event handler to the function containing the drawings. addEventHandler("onClientRender", getRootElement(), stuffToDraw) -- Change the variable to true since you are now drawing it with every frame. isCurrentlyDrawing = true -- Check if it is currently drawing the rectangle. elseif(isCurrentlyDrawing == true) then -- If it is drawing, then remove the event handler. This will stop drawing the rectangle. removeEventHandler("onClientRender", getRootElement(), stuffToDraw) -- And change the variable back to false, since you're no longer drawing. isCurrentlyDrawing = false end end addEventHandler( "drawed", root, startDrawing ) addEvent ( "drawed", true ) function startTheProgress() -- Check so the timer isn't already running. if(progressTimer == false) then -- Change the variable, you know the drill about those from now on. progressTimer = true -- Start the timer, and assign it a variable so it can be killed later. theTimer = setTimer(function() -- Increase the totalProgress with a random value between 0 to 10. local randomProgress = math.random(0, 10) -- Increase the totalProgress with the returned integer from above. totalProgress = totalProgress+randomProgress -- For debugging, will out put the random number and total progress in the format of randomNumber(totalProgress). outputChatBox(tostring(randomProgress).."("..tostring(totalProgress)..")") -- Update the renderProgress variable. renderProgress = (totalProgress/100)/2.575 -- Check if the totalProgress becomes equal to or greater than 100. if(totalProgress >= 100) then -- Set the total progress to 100, in case it became greater than 100. This is to prevent the actual progress bar from becoming wider than the background. totalProgress = 100 -- Update the renderProgress variable, since you change totalProgress above. renderProgress = (totalProgress/100)/2.575 -- Update the timer variable. progressTimer = false -- Message to tell you that the progress became greater than or equal to 100. outputChatBox("Progress greater than or equal to 100, killed timer.") -- Kill the timer so it doesn't keep running. killTimer(theTimer) destroyElement(a) end end, 120000, 1) else outputChatBox("Already progressing!") end end addEvent ( "started", true ) addEventHandler( "started", root, startTheProgress ) function stuffToDraw() -- Add the drawings you want in here. Do note that this code will be run with every frame. So 30-60 times PER SECOND. Be careful when using other code attached to onClientRender and onClientPreRender. backgroundRectangle = dxDrawRectangle(screenW/3.0, screenH/1.4, screenW/2.5, screenH/15.0, tocolor(0, 0, 0, 110)) progressRectangle = dxDrawRectangle(screenW/2.95, screenH/1.38, screenW*renderProgress, screenH/22, tocolor(30,144,255, 255)) progressText = dxDrawText("Gang War: ("..totalProgress.."%)", screenW/2.15, screenH/1.37, screenW/2.575, screenH/22, tocolor(255, 255, 255, 255), 1) end Server: local turfElement = {} local turfTimer = {} local checkComplete = false local messages = { [1] = "Turf System by Sasuke* was started correctly!", [2] = "This territory already belongs to %s", [3] = "You enter into de %s's turf zone. Wait untill it's 100% and win 4000$", [4] = "[GANG ZONE]This Territor", [5] = "Congratulations. +4000$", [6] = "If you don't come back within 20s, you won't capture the turf", [7] = "You couldn't capture the turf because of absence" } addEventHandler ( "onColShapeHit", root, function ( player ) if turfElement[source] and source == turfElement[source][1] then local turf,area,id = unpack( turfElement[source] ) local playerGang = getElementData ( player, "gang" ) local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(id).."]" ) if ( turfGang[1].GangOwner == playerGang ) then exports.joinq:showText( messages[2]:format( turfGang[1].GangOwner or "None" ), player, 0, 255, 0, false ) else local playerGang = getElementData ( player, "gang" ) setElementData( source, "warTurf", playerGang ) if ( isTimer ( turfTimer[source][1] ) ) then if isTimer( turfTimer[source][2] ) then killTimer( turfTimer[source][2] ) end return end if ( playerGang ) then local r, g, b = unpack ( getGangColor ( playerGang ) ) -- local r, g, b = 255, 255, 255 setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then triggerEvent ( "drawed", root) triggerEvent ( "started", root) exports.joinq:showText( "You enter into de %s's turf zone. Wait untill it's 100% and win 4000$", player, 0, 255, 0, false ) else exports.joinq:showText( messages[4], player, 0, 255, 0, false ) end turfTimer[source][1] = setTimer ( function ( ) local players = getGangPlayersInTurf ( turf, playerGang ) setRadarAreaColor ( area, tonumber(r), tonumber(g), tonumber(b), 175 ) for _, player in ipairs ( players ) do exports.joinq:showText( messages[5], player, 0, 255, 0, false ) triggerEvent ("onTakeTurf", root) givePlayerMoney ( player, 4000 ) executeSQLQuery("UPDATE Turf_System SET GangOwner=?,r=?,g=?,b=? WHERE Turfs=?", playerGang, tonumber(r), tonumber(g), tonumber(b), "Turf["..tostring(id).."]" ) -- setElementData ( turf, "getTurfGang", playerGang ) end setRadarAreaFlashing ( area, false ) end ,120000, 1) end end end end )
  3. First,ou should learn Lua language.Second, go to wiki of mtasa then learn the mtasa scripting. with the exercise with scripting you will be able to create your own scripts.
  4. DiGiTal

    Admin ACL

    You have to restart it.
  5. you added the exports to your meta file? @Pirulax
  6. It's your server ?, if not i think the owner secured his files, try join others servers ?
  7. DiGiTal

    Help

    @Malone. hi, I'm using this https://community.multitheftauto.com/index.php?p=resources&s=details&id=9219 , it works 100%
  8. as i see. i think you don't have acces to download those files.
  9. good map
  10. DiGiTal

    [HELP] Save

    @DonOmar for Example: when a play changed the color of his car to Blue(The color of his car changed but when he reconnect , he will not see the blue Color). I mean a save system when he reconnect. his data it will be stored. SQL Can?
  11. DiGiTal

    [HELP] Save

    Hi, What can i do if somone do a action as buy a skin of infernus texture. when he come back he will find his texture. Thanks
  12. i try to do a function for to open/close the panel by bindkey,but it show this error call:failed to call 'dgs:dgsDXGUISetVisible'[string"?"] script file: DGS = exports.dgs matable = {} matable.window = DGS:dgsDxCreateWindow (0.10, 0.28, 0.78, 0.29, "VIP panel", true) matable.button = DGS:dgsDxCreateButton(0.34, 0.77, 0.31, 0.18, "set", true, window) matable.label = DGS:dgsCreateLabel(0.42, 0.31, 0.36, 0.43, "TrollSkin", true, window) function outputEditBox ( player) if source == matable.button then print("works1") setElementModel(getLocalPlayer (player ) ,10 ) print("skin of"..getPlayerName(player).."has been changed to VIP Troll Skin", 10, 186, 31) else print("don't work") end end function guiToggleVisible ( ) if ( DGS:dgsDxGUIGetVisible ( window ) == true ) then -- check if the dgs element is visible DGS:dgsDxGUISetVisible ( window, false ) -- if it is, we hide it showCursor(false) print("works2") else DGS:dgsDxGUISetVisible ( window, true ) -- if not, we make it visible showCursor(true) end end bindKey ( "F2", "down", guiToggleVisible ) --EventHandlers addEventHandler ( "onClientDgsDxMouseClick", matable.button, outputEditBox )
  13. ok thx. otherone question ;3 : how can i bind it with a key, as dgs didn't have yet visible function?
  14. hi, it's need dgs script is running? because if all player joined the server and each one downloading 8mb or more it's very high.???
  15. use : setPlayerMuted kickPlayer banPlayer
  16. thx. otherone question 0.1, 0.1, 0.2, 0.2 wht does it mean ???
  17. @NeXuS™ you didn't understand, How i get those pixels. you didn't understand, How i get those pixels.
×
×
  • Create New...