-
Posts
313 -
Joined
-
Last visited
Everything posted by MAB
-
nice but my .png is just a red circle that was meant to look like if the player is aiming with laser anyway i tried what you said and it works but when i aim it is showing me a white point and four of my .png around it and when i shoot the white point goes and the four points move.... so this wasn't what i meant i just wanted to replace the gta sa cross hair with a red circle..
-
OMG best server i have ever seen in my life
-
i made a custom cross hair .png with photoshop now how to replace the default cross hair with the one i made?!
-
the dx tutorial is updated and i added an animation spoiler there. you can find the tutorial here. for the mod who is going to lock this go ahead lock it but you need to know that people should know that the tutorial is updated because if they don't know then they won't read it again because they think that they have read it all arleady.
-
Enter and check it yourself because that is better than screenshots
-
Hi forum... Two new servers are opened and they are fantastic they are RPG and DayZ game modes and you can check the forum logixgaming.ga RPG : mtasa://104.128.237.194:22003 DayZ : mtasa://104.128.237.194:22004 Features of RPG: 1. Nice gang system 2. Simple jobs 3. Amazing vehicle system 4. Many funny mini missions and other stuff like Haystuck , Shooter cars , High score racing , Drive the car , lottery , capture the flag and more... 5. Supporters are always online to help you and also you will be shown a tutorial once you have entered the server for the first time
-
i updated the dx gui tutorial and added 2 more things how to make lines around dx elements and other way to make dx elements fixed for all screen resolutions you can see the tutorial by clicking here please rate ...
-
to make a dx login panel should i start like that? addEventHandler("onClientResoureStart",getResourceRootElement(getThisResource()),function() --dx elements here??
-
You made that skin mod? the problem is coming from the DFF and TXD files like i see. You need to ask someone knows about modding for that.
-
You didn't understand hungry?!
-
i am making a speed cruise thats when you press W+C it turns on and drives the vehicle on the speed you pressed the button in. not working... if you get a better idea than mine to make a cruise please share. client : function getElementSpeed(theElement, unit) assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")") assert(getElementType(theElement) == "player" or getElementType(theElement) == "ped" or getElementType(theElement) == "object" or getElementType(theElement) == "vehicle", "Invalid element type @ getElementSpeed (player/ped/object/vehicle expected, got " .. getElementType(theElement) .. ")") assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)") unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit)) local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456) return (Vector3(getElementVelocity(theElement)) * mult).length end function setElementSpeed(element, unit, speed) if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then -- if true - element is valid, no need to check again local diff = speed/acSpeed if diff ~= diff then return end -- if the number is a 'NaN' return end. local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end function stoping () if isPedInVehicle(localPlayer) then if getElementData(localPlayer,"cruise") ~= false then local veh = getPedOccupiedVehicle(localPlayer) local speed = getElementSpeed(veh,1) local down = speed - 1 local data = getElementData(localPlayer,"cruise") setAnalogControlState("accelerate",1) if speed > data then setElementSpeed( veh, 1, down ) end else setAnalogControlState("accelerate",0) end end end addEventHandler("onClientRender",root,stoping) function toggle_cruise (key,keyState) if isPedInVehicle(localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if ( getElementModel(veh) ~= 510 and getElementModel(veh) ~= 509 and getElementModel(veh) ~= 481 ) then if getPedOccupiedVehicleSeat(localPlayer) == 0 then if getKeyState ("w") == true then local data = getElementData(localPlayer,"cruise") if data == false then local speed = getElementSpeed(veh,1) if speed > 30 then setElementData(localPlayer,"cruise",tostring(speed)) end else setElementData(localPlayer,"cruise",false) end end end end end end bindKey("c","down",toggle_cruise) local controls = { "fire", "next_weapon", "previous_weapon", "forwards", "backwards", "left", "right", "zoom_in", "zoom_out", "change_camera", "jump", "sprint", "look_behind", "crouch", "action", "walk", "aim_weapon", "conversation_yes", "conversation_no", "group_control_forwards", "group_control_back", "enter_exit", "vehicle_fire", "vehicle_secondary_fire", "vehicle_left", "vehicle_right", "steer_forward", "steer_back", "accelerate", "brake_reverse", "radio_next", "radio_previous", "radio_user_track_skip", "horn", "sub_mission", "handbrake", "vehicle_look_left", "vehicle_look_right", "vehicle_look_behind", "vehicle_mouse_look", "special_control_left", "special_control_right", "special_control_down", "special_control_up" } local boundControlsKeys = {} local bindsData = {} function unbindControlKeys(control) -- Ensure the argument has got the appropiate type assert(type(control) == "string", "Bad argument @ unbindControlKeys [string expected, got " .. type(control) .. "]") -- Check if we have a valid control local validControl for _, controlComp in ipairs(controls) do if control == controlComp then validControl = true break end end assert(validControl, "Bad argument @ unbindControlKeys [invalid control name]") -- Have we got a bind on this control? assert(boundControlsKeys[control], "Bad argument @ unbindControlKeys [There is no bind on such control]") -- Unbind each key of the control for _, bindData in pairs(bindsData[control]) do unbindKey(unpack(bindData)) end -- Remove references boundControlsKeys[control] = nil bindsData[control] = nil return true end function bindControlKeys(control, ...) -- Ensure the argument has got the appropiate type assert(type(control) == "string", "Bad argument 1 @ bindControlKeys [string expected, got " .. type(control) .. "]") -- Check if we have a valid control local validControl for _, controlComp in ipairs(controls) do if control == controlComp then -- Is the specified control in the table? validControl = true -- If so, it's a valid control break end end assert(validControl, "Bad argument 1 @ bindControlKeys [invalid control name]") -- Do we already have this control bound? if boundControlsKeys[control] then unbindControlKeys(control) -- Delete the first control keys bind end boundControlsKeys[control] = getBoundKeys(control) -- Store the keys of that control that will be bound bindsData[control] = {} -- Store bind data, so we can unbind each key of the control later for key in pairs(boundControlsKeys[control]) do -- Can we bind the key with the specified arguments? assert(bindKey(key, unpack(arg)), "Bad arguments @ bindControlKeys [Could not create key bind]") -- If so, register the bind data and continue table.insert(bindsData[control], { key, unpack(arg) }) end return true end function off () if isPedInVehicle(localPlayer) then if getElementData(localPlayer,"cruise") ~= false then setElementData(localPlayer,"cruise",false) end end end bindControlKeys("brake_reverse","down",off) bindControlKeys("handbrake","down",off) server : function out (player) setElementData(player,"true",false) if getElementData(player,"cruise") ~= false then setElementData(player,"cruise",false) end end addEventHandler ("onVehicleExit",getRootElement(),out)
-
one : viewtopic.php?f=91&t=92092 two : viewtopic.php?f=91&t=91669
-
1. understood.. it will take the dx one 2. all my codes are here
-
1. i didn't understand that 2. i tried but didn't work.. couldn't even see the ped 3. it was
-
this is a medic job codes 1. the old blips, markers etc... don't get destroyed if you exit and got in the ambulance again 2. i can't see the peds i see only the markers 3. how to make that serverside ped visible to the player who is working only and also can't be killed 4. how to display a timer on the player's screen when he get on in the ambulance .. make it 30 sec for example 5. please hurry up server local medic = createMarker (-2685.57227,638.31696,13.45313,"cylinder",2,255,255,0,255) local medic_blip = createBlipAttachedTo (medic,60) setElementData(medic,"JobHandler","medic") ambs = {} ambs_blips = {} ambs_spawns = { {-2705.15186, 608.86151, 14.45313}, {-2661.22217, 611.69843, 14.45313}, {-2634.44507, 611.14960, 14.45313} } addCommandHandler("rot",function(p) local rotx,roty,rotz = getElementRotation (p) outputChatBox("x = "..rotx..", y = "..roty..", z = "..rotz,p) end ) addEvent("start",true) function start (player) local x,y,z = unpack(ambs_spawns[math.random(#ambs_spawns)]) ambs[player] = createVehicle(416,x,y,z,0,0,180) ambs_blips[player] = createBlipAttachedTo(ambs[player],56) setElementData(ambs[player],"owner",getAccountName(getPlayerAccount(player))) setElementData(ambs[player],"jv",true) setElementVisibleTo(ambs_blips[player],root,false) setElementVisibleTo(ambs_blips[player],player,true) end addEventHandler("start",root,start) peds = {} peds_spawns = { {-2626.49707, 208.97466, 4.59974, 3.0075378417969, -2626.71362, 211.40800, 3.59591}, {-2596.55273, 9.26447, 4.32813, 91.366455078125, -2598.76660, 9.18804, 3.32813}, {-2430.27051, -93.64320, 35.32031, 268.06225585938, -2427.76245, -93.62108, 34.32031}, {-2107.03760, -196.01930, 36.32031, 183.82331848145, -2106.85205, -197.84091, 34.32031}, {-2025.07690, 67.10520, 28.43436, 268.46875, -2022.33093, 66.90797, 27.47522}, {-1896.05225, 276.31894, 41.04688, 182.97734069824, -1896.36011, 273.55161, 40.04688}, {-1942.93811, 517.28296, 35.17188, 184.27923583984, -1942.94666, 514.39331, 34.17188}, {-1881.05774, 822.72467, 35.17733, 44.552978515625, -1882.40417, 824.30682, 34.17519}, {-1754.20752, 962.91943, 24.88281, 183.67497253418, -1754.19238, 959.97577, 23.88281}, {-1639.83740, 1199.97375, 7.19314, 183.42778015137, -1639.77673, 1197.71912, 6.18750}, {-2018.75378, 1192.67859, 45.45645, 180.29663085938, -2018.69739, 1190.42798, 44.44531}, {-2278.68262, 767.94128, 47.44531, 279.93316650391, -2276.09521, 767.86768, 48.44531}, {-2075.05811, 899.69049, 64.13281, 1.6397399902344, -2075.05811, 902.69049, 63.13281}, {-2043.64758, 1261.60303, 9.17966, 0.21697998046875, -2043.64880, 1264.93750, 7.81435} } peds_blips = {} peds_markers = {} function begin (player) if getElementModel(source) == 416 then if getElementData(source,"jv") == true then if getElementData(source,"owner") == getAccountName(getPlayerAccount(player)) then if isElement(peds[player]) then destroyElement(peds[player]) end if isElement(peds_blips[players]) then destroyElement(peds_blips[players]) end if isElement(peds_markers[players]) then destroyElement(peds_markers[player]) end local x,y,z,r,a,b,c = unpack(peds_spawns[math.random(#peds_spawns)]) peds[player] = createPed (math.random(1,312),x,y,z,r) peds_markers[player] = createMarker(a,b,c,"cylinder",3,255,255,0,255) peds_blips[player] = createBlipAttachedTo(peds_markers[player],0,2,255,255,0,255) setElementVisibleTo(peds_markers[player],root,false) setElementVisibleTo(peds_blips[player],root,false) setElementVisibleTo(peds_blips[player],player,true) setElementVisibleTo(peds_markers[player],player,true) end end end end addEventHandler ( "onVehicleEnter", getRootElement(), begin ) function stop (player) if getElementModel(source) == 416 then if getElementData(source,"jv") == true then if getElementData(source,"owner") ~= getAccountName(getPlayerAccount(player)) then cancelEvent() if getElementData(player,"told") == false then outputChatBox("You can't enter this vehicle.",player,255,255,0) setElementData(player,"told",true) setTimer(setElementData,5000,1,player,"told",false) end end end end end addEventHandler("onVehicleStartEnter",root,stop) client : function MarkerHit(hitPlayer, matchingDimension) if (getElementData(source, "JobHandler") == "medic") then if (hitPlayer==getLocalPlayer()) then if not(isPedInVehicle(getLocalPlayer())) then if (not(getElementData(getLocalPlayer(), "Job") == "medic")) then outputChatBox("You are not a Medic.",255,0,0,true) else if getElementData(hitPlayer,"started") == false then setElementData(hitPlayer,"medic",true) showCursor(true) else outputChatBox("You have started this job before.",255,255,0) end end end end end end addEventHandler("onClientMarkerHit", getRootElement(), MarkerHit) local x,y = guiGetScreenSize() function draw () if getElementData(localPlayer,"medic") == true and getElementData(localPlayer,"started") == false then dxDrawRectangle((x - 306) / 2, (y - 124) / 2, (x - 678) / 2, (y - 520) / 2, tocolor(0, 0, 0, 100), false) dxDrawText("Medic", (x - 100) / 2, (y - 123) / 2, ((x - 100) / 2)+93, ((y - 123) / 2)+29, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Accept", (x - 304) / 2, (y + 70) / 2, ((x - 304) / 2)+88, ((y + 70) / 2)+23, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Close", (x + 130) / 2, ((y + 70) / 2), ((x + 130) / 2)+76, ((y + 70) / 2)+23, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) end end addEventHandler("onClientRender",root,draw) function click (b,s,r,z) if (b == "left" and s == "up") then if getElementData(localPlayer,"medic") == true then if (r > (x - 304) / 2 and r < ((x - 304) / 2)+88 and z > (y + 70) / 2 and z < ((y + 70) / 2)+23) then -- accept setElementData(localPlayer,"medic",false) showCursor(false) setElementData(localPlayer,"started",true) triggerServerEvent ("start",localPlayer,localPlayer) end if (r > (x + 130) / 2 and r < ((x + 130) / 2)+76 and z > (y + 70) / 2 and z < ((y + 70) / 2)+23) then -- close setElementData(localPlayer,"medic",false) showCursor(false) end end end end addEventHandler("onClientClick",root,click)
-
-___- function dxDrawCircle( posX, posY, radius, width, angleAmount, startAngle, stopAngle, color, postGUI ) if ( type( posX ) ~= "number" ) or ( type( posY ) ~= "number" ) then return false end local function clamp( val, lower, upper ) if ( lower > upper ) then lower, upper = upper, lower end return math.max( lower, math.min( upper, val ) ) end radius = type( radius ) == "number" and radius or 50 width = type( width ) == "number" and width or 5 angleAmount = type( angleAmount ) == "number" and angleAmount or 1 startAngle = clamp( type( startAngle ) == "number" and startAngle or 0, 0, 360 ) stopAngle = clamp( type( stopAngle ) == "number" and stopAngle or 360, 0, 360 ) color = color or tocolor( 255, 255, 255, 200 ) postGUI = type( postGUI ) == "boolean" and postGUI or false if ( stopAngle < startAngle ) then local tempAngle = stopAngle stopAngle = startAngle startAngle = tempAngle end for i = startAngle, stopAngle, angleAmount do local startX = math.cos( math.rad( i ) ) * ( radius - width ) local startY = math.sin( math.rad( i ) ) * ( radius - width ) local endX = math.cos( math.rad( i ) ) * ( radius + width ) local endY = math.sin( math.rad( i ) ) * ( radius + width ) dxDrawLine( startX + posX, startY + posY, endX + posX, endY + posY, color, width, postGUI ) end return true end -- now put your things here ._.
-
yes it is not working with dx elements it works with gui elements only so if you want to make animations on the dx element you must use interpolateBetween if you are interested in dx elements you can check my DirectX GUI tutorial
-
all useful functions needs its codes because useful functions aren't MTA functions they are scripted by normal scripters
-
never learn the hard way bro these is an easier and better way here at the 5th spolier https://forum.multitheftauto.com/viewtopic.php?f=148&t=91351&p=821076#p821076
