[UCG]Mike Posted August 18, 2014 Share Posted August 18, 2014 hey guys i want to add Prograss to turf system Ex: local pCuboid1 = createColCuboid(1121.9619140625, 2722.2265625, 10, 410, 150, 60) local pArea1 = createRadarArea( 1121.9619140625, 2722.2265625, 410, 140, 255, 255, 255, 255 ) setElementData(pCuboid1, "friendly", "no") setElementData(pCuboid1, "ownedBy", "") function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end addEventHandler('onColShapeHit', pCuboid1, function(p) local getOwnedBy = getElementData(pCuboid1, "ownedBy") callClientFunction(p, "NeedMsg", 6, getOwnedBy) callClientFunction(p, "NeedMsg", 1) exports["DENdxmsg"]:sendClientMessage ("You entered a Radio Taken Turf", getOwnedBy, 0, 255, 0, true, 8 ) if (getPlayerTeam(p)) then local pTeam = getPlayerTeam( p ) local iR, iG, iB = getTeamColor( pTeam ) local rR, gG, bB = getRadarAreaColor( pArea1 ) local data = getElementData(pCuboid1, "friendly") if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) and ( data == "yes" ) then callClientFunction(p, "NeedMsg", 2) else setRadarAreaFlashing( pArea1, true ) capturing = setTimer( function( ) setElementData(pCuboid1, "friendly", "yes") setElementData(pCuboid1, "ownedBy", getTeamName(pTeam)) givePlayerMoney( p, 4000 ) callClientFunction(p, "NeedMsg", 4) setRadarAreaColor( pArea1, iR, iG, iB ) setRadarAreaFlashing( pArea1, false ) end, 5000, 1 ) end else callClientFunction(p, "NeedMsg", 3) end if (getPedOccupiedVehicle( p )) then callClientFunction(p, "NeedMsg", 5) end end ) addEventHandler('onColShapeLeave', pCuboid1, function(p) local getOwnedBy = getElementData(pCuboid1, "ownedBy") setRadarAreaFlashing( pArea1, false ) callClientFunction(p, "NeedMsg", 7, getOwnedBy) if isTimer(capturing) then killTimer(capturing) end end ) this is my turf system tHandler("onClientRender", root, function() if getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then else return end if isElementWithinColShape(localPlayer,LVcol) or isElementWithinColShape(localPlayer,seaCol) then x,y=AbsoluteToRelativ2(63, 737) x2,y2=AbsoluteToRelativ2(283, 762) dxDrawText(towerString1, x,y,x2,y2, tocolor(towerr,towerg,towerb, 255), 1, "default-bold", "center", "top", false, false, true, false, false) x,y=AbsoluteToRelativ2(63, 750) x2,y2=AbsoluteToRelativ2(283, 775) dxDrawText(towerString2, x,y,x2,y2, tocolor(towerr,towerg,towerb, 255), 1, "default-bold", "center", "top", false, false, true, false, false) end if currentTurfData == nil then return end if isPlayerMapVisible() then return end x,y=AbsoluteToRelativ2(1002,238) x2,y2=AbsoluteToRelativ2(212, 21) if currentTurfData.attackinggroup == "None" then if currentTurfData.owner=="Unoccupied" then dxDrawRectangle(x,y,x2*(currentTurfData.health/100),y2, tocolor(255,255,255, 255), true) elseif (currentTurfData.colors[currentTurfData.owner]) then dxDrawRectangle(x,y,x2*(currentTurfData.health/100),y2, tocolor(currentTurfData.colors[currentTurfData.owner][1],currentTurfData.colors[currentTurfData.owner][2],currentTurfData.colors[currentTurfData.owner][3], 255), true) else dxDrawRectangle(x,y,x2*(currentTurfData.health/100),y2, tocolor(255,255,255, 255), true) end else dxDrawRectangle(x,y,x2*(currentTurfData.health/100),y2, tocolor(currentTurfData.colors[currentTurfData.attackinggroup][1],currentTurfData.colors[currentTurfData.attackinggroup][2],currentTurfData.colors[currentTurfData.attackinggroup][3], 255), true) end x,y=AbsoluteToRelativ2(1000, 234) x2,y2=AbsoluteToRelativ2(217, 30) dxDrawRectangle(x,y,x2,y2, tocolor(19, 0, 0, 100), true) x,y=AbsoluteToRelativ2(1120, 234) x2,y2=AbsoluteToRelativ2(1120, 262) dxDrawLine(x,y,x2,y2, tocolor(9, 130, 0, 255), 1, true) x,y=AbsoluteToRelativ2(1041, 234) x2,y2=AbsoluteToRelativ2(1041, 262) dxDrawLine(x,y,x2,y2, tocolor(129, 2, 20, 255), 1, true) x,y=AbsoluteToRelativ2(996, 236) x2,y2=AbsoluteToRelativ2(1224, 262) dxDrawText(currentTurfData.barText, x,y,x2,y2, tocolor(255, 255, 255, 255), 1, "default", "center", "center", false, false, true, false, false) x,y=AbsoluteToRelativ2(1001, 292) x2,y2=AbsoluteToRelativ2(1216, 318) dxDrawText(">> Turf Influence <<", x,y,x2,y2, tocolor(0, 255, 0, 255), 1, "default", "center", "top", false, true, true, false, false) local i=1 for k,v in pairs(currentTurfData.influences) do local mult = 10^2 if k ~= "CNG Law" and k ~= "Criminals" then i=i+1 local imgY=292+(30*(i-1)) _,imgY=AbsoluteToRelativ2(0,imgY-7) x,y=AbsoluteToRelativ2(1001, 292+(30*(i-1))) x2,y2=AbsoluteToRelativ2(1216, 318) v=v/2 v = (math.floor(v * mult + 0.5) / mult) --v=math.floor(v) local vpos = v local vnum = v if v < 0 then vpos=vpos*-1 end local timesToDrawFull = math.floor(vpos) local timesToDrawHalf = 0 if vpos-timesToDrawFull > 0 then timesToDrawHalf=1 end if v > 0 then v="+"..v..""end dxDrawText(""..k.."", x,y,x2,y2, tocolor(currentTurfData.colors[k][1], currentTurfData.colors[k][2], currentTurfData.colors[k][3], 255), 1, "default", "center", "top", false, true, true, false, false) for i2=1,timesToDrawFull do if vnum > 0 then x3,y3=AbsoluteToRelativ2(1161+(30*(i2-1)), 317) else x3,y3=AbsoluteToRelativ2(1031-(30*(i2-1)), 317) end x4,y4=AbsoluteToRelativ2(36, 26) dxDrawImage(x3,imgY,x4,y4, "full.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end if timesToDrawHalf > 0 then if vnum > 0 then x3,y3=AbsoluteToRelativ2(1161+(30*(timesToDrawFull+1-1)), 317) else x3,y3=AbsoluteToRelativ2(1031-(30*(timesToDrawFull+1-1)), 317) end dxDrawImage(x3,imgY,x4,y4, "half.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end end end x,y=AbsoluteToRelativ2(1001, 265) x2,y2=AbsoluteToRelativ2(1216, 291) dxDrawText(""..currentTurfData.text.."", x,y,x2,y2, tocolor(textr,textg,textb, 255), 1, "default", "left", "top", false, false, true, false, false) end ) and this is the progress and sry for my bad english Link to comment
Et-win Posted August 18, 2014 Share Posted August 18, 2014 I doubt there is anyone going to help you making to script this. And yes, I know you are going to say "If you don't want to help, then stfu", but still, why don't you atleast try to make a part by yourself or even try to bother to typ anything into the script? Link to comment
Anubhav Posted August 18, 2014 Share Posted August 18, 2014 hey guys i want to add Prograss to turf systemEx: local pCuboid1 = createColCuboid(1121.9619140625, 2722.2265625, 10, 410, 150, 60) local pArea1 = createRadarArea( 1121.9619140625, 2722.2265625, 410, 140, 255, 255, 255, 255 ) setElementData(pCuboid1, "friendly", "no") setElementData(pCuboid1, "ownedBy", "") function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end addEventHandler('onColShapeHit', pCuboid1, function(p) local getOwnedBy = getElementData(pCuboid1, "ownedBy") callClientFunction(p, "NeedMsg", 6, getOwnedBy) callClientFunction(p, "NeedMsg", 1) exports["DENdxmsg"]:sendClientMessage ("You entered a Radio Taken Turf", getOwnedBy, 0, 255, 0, true, 8 ) if (getPlayerTeam(p)) then local pTeam = getPlayerTeam( p ) local iR, iG, iB = getTeamColor( pTeam ) local rR, gG, bB = getRadarAreaColor( pArea1 ) local data = getElementData(pCuboid1, "friendly") if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) and ( data == "yes" ) then callClientFunction(p, "NeedMsg", 2) else setRadarAreaFlashing( pArea1, true ) capturing = setTimer( function( ) setElementData(pCuboid1, "friendly", "yes") setElementData(pCuboid1, "ownedBy", getTeamName(pTeam)) givePlayerMoney( p, 4000 ) callClientFunction(p, "NeedMsg", 4) setRadarAreaColor( pArea1, iR, iG, iB ) setRadarAreaFlashing( pArea1, false ) end, 5000, 1 ) end else callClientFunction(p, "NeedMsg", 3) end if (getPedOccupiedVehicle( p )) then callClientFunction(p, "NeedMsg", 5) end end ) addEventHandler('onColShapeLeave', pCuboid1, function(p) local getOwnedBy = getElementData(pCuboid1, "ownedBy") setRadarAreaFlashing( pArea1, false ) callClientFunction(p, "NeedMsg", 7, getOwnedBy) if isTimer(capturing) then killTimer(capturing) end end ) this is my turf system tHandler("onClientRender", root, function() if getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then else return end if isElementWithinColShape(localPlayer,LVcol) or isElementWithinColShape(localPlayer,seaCol) then x,y=AbsoluteToRelativ2(63, 737) x2,y2=AbsoluteToRelativ2(283, 762) dxDrawText(towerString1, x,y,x2,y2, tocolor(towerr,towerg,towerb, 255), 1, "default-bold", "center", "top", false, false, true, false, false) x,y=AbsoluteToRelativ2(63, 750) x2,y2=AbsoluteToRelativ2(283, 775) dxDrawText(towerString2, x,y,x2,y2, tocolor(towerr,towerg,towerb, 255), 1, "default-bold", "center", "top", false, false, true, false, false) end if currentTurfData == nil then return end if isPlayerMapVisible() then return end x,y=AbsoluteToRelativ2(1002,238) x2,y2=AbsoluteToRelativ2(212, 21) if currentTurfData.attackinggroup == "None" then if currentTurfData.owner=="Unoccupied" then dxDrawRectangle(x,y,x2*(currentTurfData.health/100),y2, tocolor(255,255,255, 255), true) elseif (currentTurfData.colors[currentTurfData.owner]) then dxDrawRectangle(x,y,x2*(currentTurfData.health/100),y2, tocolor(currentTurfData.colors[currentTurfData.owner][1],currentTurfData.colors[currentTurfData.owner][2],currentTurfData.colors[currentTurfData.owner][3], 255), true) else dxDrawRectangle(x,y,x2*(currentTurfData.health/100),y2, tocolor(255,255,255, 255), true) end else dxDrawRectangle(x,y,x2*(currentTurfData.health/100),y2, tocolor(currentTurfData.colors[currentTurfData.attackinggroup][1],currentTurfData.colors[currentTurfData.attackinggroup][2],currentTurfData.colors[currentTurfData.attackinggroup][3], 255), true) end x,y=AbsoluteToRelativ2(1000, 234) x2,y2=AbsoluteToRelativ2(217, 30) dxDrawRectangle(x,y,x2,y2, tocolor(19, 0, 0, 100), true) x,y=AbsoluteToRelativ2(1120, 234) x2,y2=AbsoluteToRelativ2(1120, 262) dxDrawLine(x,y,x2,y2, tocolor(9, 130, 0, 255), 1, true) x,y=AbsoluteToRelativ2(1041, 234) x2,y2=AbsoluteToRelativ2(1041, 262) dxDrawLine(x,y,x2,y2, tocolor(129, 2, 20, 255), 1, true) x,y=AbsoluteToRelativ2(996, 236) x2,y2=AbsoluteToRelativ2(1224, 262) dxDrawText(currentTurfData.barText, x,y,x2,y2, tocolor(255, 255, 255, 255), 1, "default", "center", "center", false, false, true, false, false) x,y=AbsoluteToRelativ2(1001, 292) x2,y2=AbsoluteToRelativ2(1216, 318) dxDrawText(">> Turf Influence <<", x,y,x2,y2, tocolor(0, 255, 0, 255), 1, "default", "center", "top", false, true, true, false, false) local i=1 for k,v in pairs(currentTurfData.influences) do local mult = 10^2 if k ~= "CNG Law" and k ~= "Criminals" then i=i+1 local imgY=292+(30*(i-1)) _,imgY=AbsoluteToRelativ2(0,imgY-7) x,y=AbsoluteToRelativ2(1001, 292+(30*(i-1))) x2,y2=AbsoluteToRelativ2(1216, 318) v=v/2 v = (math.floor(v * mult + 0.5) / mult) --v=math.floor(v) local vpos = v local vnum = v if v < 0 then vpos=vpos*-1 end local timesToDrawFull = math.floor(vpos) local timesToDrawHalf = 0 if vpos-timesToDrawFull > 0 then timesToDrawHalf=1 end if v > 0 then v="+"..v..""end dxDrawText(""..k.."", x,y,x2,y2, tocolor(currentTurfData.colors[k][1], currentTurfData.colors[k][2], currentTurfData.colors[k][3], 255), 1, "default", "center", "top", false, true, true, false, false) for i2=1,timesToDrawFull do if vnum > 0 then x3,y3=AbsoluteToRelativ2(1161+(30*(i2-1)), 317) else x3,y3=AbsoluteToRelativ2(1031-(30*(i2-1)), 317) end x4,y4=AbsoluteToRelativ2(36, 26) dxDrawImage(x3,imgY,x4,y4, "full.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end if timesToDrawHalf > 0 then if vnum > 0 then x3,y3=AbsoluteToRelativ2(1161+(30*(timesToDrawFull+1-1)), 317) else x3,y3=AbsoluteToRelativ2(1031-(30*(timesToDrawFull+1-1)), 317) end dxDrawImage(x3,imgY,x4,y4, "half.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end end end x,y=AbsoluteToRelativ2(1001, 265) x2,y2=AbsoluteToRelativ2(1216, 291) dxDrawText(""..currentTurfData.text.."", x,y,x2,y2, tocolor(textr,textg,textb, 255), 1, "default", "left", "top", false, false, true, false, false) end ) and this is the progress and sry for my bad english No support for leaked scripts of CSG. You mixed the script of manve and CSG. We're not giving support for those things. Link to comment
Et-win Posted August 18, 2014 Share Posted August 18, 2014 Lol'd. Also stealing. Anyway I'm still wondering how you guys know these scripts are leaked and such? Link to comment
Anubhav Posted August 18, 2014 Share Posted August 18, 2014 Lol'd. Also stealing.Anyway I'm still wondering how you guys know these scripts are leaked and such? Sensei release those scripts ONLY FOR CREATING NEW CSG. It is back now Big~Bang own it. He must have downloaded those scripts and misused them. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now