-
Posts
64 -
Joined
-
Last visited
Everything posted by SkillZNT
-
Caralho eu admito como eu sou burro so hj notei q tu alterou a function cuff kkkkkkkkkkkk
-
Eu acho q errei alguma coisa no codigo :p consegue dar uma arrumada não sei se coloquei algo de errado no codigo function setPedAnimationSpeed(player,anim,speed) setPedAnimation(player,anim,speed) end function setCuffPlayer(player) setPedAnimation(player, nil) setPedAnimation(player,'ped', 'pass_Smoke_in_car', 0, true, true, true) setTimer(setPedAnimationSpeed,60,1,player, 'pass_Smoke_in_car', 0) local x, y, z = getElementPosition(player) local box = createObject(364, x, y, z) exports.bone_attach:attachElementToBone(box, player, 12, 0,0,0, 0,40,-10) setElementCollisionsEnabled(box, false) setElementData(player,'cuffOb', box) toggleControl(player, 'jump', false) setTimer(function(player) if getElementData(player,'cuff') and getElementData(player,'cuff') == true then toggleControl(player, 'fire', false) end end,60,0,player) toggleControl(player, 'crouch', false) end local corpACLS = { -- NOME DAS ACLS Q PODEM ALGEMAR UMA PESSOA! "BOPE", "PMRJ", } function cuff(hit,_,name) local player = getPlayerFromPartialName() local x,y,z = getElementPosition(player) local x1,y1,z1 = getElementPosition(hit) if isPlayerPermission(hit) then -- FUNÇÃO UTIL, BASICAMENTE VERIFICA SE O POLICIAL (hit) ESTA DENTRO DE UMA DAS ACL'S BOPE OU PMRJ! if tonumber(getDistanceBetweenPoints3D(x1,y1,z1,x,y,z)) <= 20 then if not getElementData(player,'cuff') or getElementData(player,'cuff') ~= true then if isPedInVehicle(player) then setControlState(player,'enter_exit',true) setTimer(setCuffPlayer,2800,1,player) setElementData(player,'cuff', true) else setCuffPlayer(player) setElementData(player,'cuff', true) end outputChatBox(' '..getPlayerName(hit)..'#ff0000 Algemou você',player,255,255,255,true) else removeElementData(player,'cuff') destroyElement(getElementData(player,'cuffOb')) removeElementData(player, 'cuff') toggleControl(player, 'jump', true) toggleControl(player, 'crouch', true) toggleControl(player, 'fire', true) setPedAnimation(player, 'ped', 'pass_Smoke_in_car', 0, false, false, false, false) outputChatBox(' '..getPlayerName(hit)..'#008800 Soltou suas algemas',player,255,255,255,true) end else outputChatBox("Você está longe demais!",hit,255,0,0,true) end end -- end do if ifPlayerPermission then end addCommandHandler('a',cuff) addEventHandler('onPlayerQuit', root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onPlayerWasted',root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onVehicleStartEnter', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then if seat ~= 0 then destroyElement(getElementData(player,'cuffOb')) else cancelEvent() outputChatBox('Você não pode dirigir você tem algemas!',player,255,0,0) end end end) setTimer(function() for _,player in ipairs(getElementsByType("player")) do if getElementData(player,'cuff') == true then if isPedInWater(player) then setTimer(function(player) if isPedInWater(player) then killPed(player) end end,5000,1,player) end end end end,1000,0) addEventHandler('onVehicleExit', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then setCuffPlayer(player) end end) -- ABAIXO UMA FUNÇÃO UTIL QUE FOI DEMONSTRADA por @MainSCR no seu outro post, deveria ter usado isto em vez da outra! function isPlayerPermission(thePlayer) -- faz um loop das acls declaradas na tabela e verifica se a acl do jogador é uma das acls declarada na tabela if isElement(thePlayer) and getElementType(thePlayer) == "player" then if isGuestAccount(getPlayerAccount(thePlayer)) then return end for _, group in ipairs(corpACLS) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup(group)) then -- preste atenção acima, ("user."..Nome da Conta , qual a acl )) return true end end end return false end
-
function cuff(hit,_,name) local player = getPlayerFromName(name) local x,y,z = getElementPosition(player) local x1,y1,z1 = getElementPosition(hit) if isPlayerPermission(hit) then -- FUNÇÃO UTIL, BASICAMENTE VERIFICA SE O POLICIAL (hit) ESTA DENTRO DE UMA DAS ACL'S BOPE OU PMRJ! if tonumber(getDistanceBetweenPoints3D(x1,y1,z1,x,y,z)) <= 20 then if not getElementData(player,'cuff') or getElementData(player,'cuff') ~= true then if isPedInVehicle(player) then setControlState(player,'enter_exit',true) setTimer(setCuffPlayer,2800,1,player) setElementData(player,'cuff', true) else setCuffPlayer(player) setElementData(player,'cuff', true) end outputChatBox(' '..getPlayerName(hit)..'#ff0000 Algemou você',player,255,255,255,true) else removeElementData(player,'cuff') destroyElement(getElementData(player,'cuffOb')) removeElementData(player, 'cuff') toggleControl(player, 'jump', true) toggleControl(player, 'crouch', true) toggleControl(player, 'fire', true) setPedAnimation(player, 'ped', 'pass_Smoke_in_car', 0, false, false, false, false) outputChatBox(' '..getPlayerName(hit)..'#008800 Soltou suas algemas',player,255,255,255,true) end else outputChatBox("Você está longe demais!",hit,255,0,0,true) end end -- end do if ifPlayerPermission then end addCommandHandler('a',cuff) Assim?
-
Ei quase esqueci sobre aquele script de algemar sabe ele ta com um erro no debug sim Quando uso /a apareçe isso ai Se poder ajudar tambem nessa parte kkkk sabe Eu tentei ate hj arrumar kk so q ficava dando ums erros no debug as vezes pouco erro as vezes algums esse aq e o seu q so apareçeu um erro no debug ao digitar o /a Codigo sem alterar nada apenas o setPedAnimationSpeed function setPedAnimationSpeed(player,anim,speed) setPedAnimation(player,anim,speed) end function setCuffPlayer(player) setPedAnimation(player, nil) setPedAnimation(player,'ped', 'pass_Smoke_in_car', 0, true, true, true) setTimer(setPedAnimationSpeed,60,1,player, 'pass_Smoke_in_car', 0) local x, y, z = getElementPosition(player) local box = createObject(364, x, y, z) exports.bone_attach:attachElementToBone(box, player, 12, 0,0,0, 0,40,-10) setElementCollisionsEnabled(box, false) setElementData(player,'cuffOb', box) toggleControl(player, 'jump', false) setTimer(function(player) if getElementData(player,'cuff') and getElementData(player,'cuff') == true then toggleControl(player, 'fire', false) end end,60,0,player) toggleControl(player, 'crouch', false) end local corpACLS = { -- NOME DAS ACLS Q PODEM ALGEMAR UMA PESSOA! "BOPE", "PMRJ", } function cuff(hit,_,name) local player = getPlayerFromName(name) local x,y,z = getElementPosition(player) local x1,y1,z1 = getElementPosition(hit) if isPlayerPermission(hit) then -- FUNÇÃO UTIL, BASICAMENTE VERIFICA SE O POLICIAL (hit) ESTA DENTRO DE UMA DAS ACL'S BOPE OU PMRJ! if getDistanceBetweenPoints3D(x1,y1,z1,x,y,z) <= 20 then if not getElementData(player,'cuff') or getElementData(player,'cuff') ~= true then if isPedInVehicle(player) then setControlState(player,'enter_exit',true) setTimer(setCuffPlayer,2800,1,player) setElementData(player,'cuff', true) else setCuffPlayer(player) setElementData(player,'cuff', true) end outputChatBox(' '..getPlayerName(hit)..'#ff0000 Algemou você',player,255,255,255,true) else removeElementData(player,'cuff') destroyElement(getElementData(player,'cuffOb')) removeElementData(player, 'cuff') toggleControl(player, 'jump', true) toggleControl(player, 'crouch', true) toggleControl(player, 'fire', true) setPedAnimation(player, 'ped', 'pass_Smoke_in_car', 0, false, false, false, false) outputChatBox(' '..getPlayerName(hit)..'#008800 Soltou suas algemas',player,255,255,255,true) end else outputChatBox("Você está longe demais!",hit,255,0,0,true) end end -- end do if ifPlayerPermission then end addCommandHandler('a',cuff) addEventHandler('onPlayerQuit', root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onPlayerWasted',root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onVehicleStartEnter', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then if seat ~= 0 then destroyElement(getElementData(player,'cuffOb')) else cancelEvent() outputChatBox('Você não pode dirigir você tem algemas!',player,255,0,0) end end end) setTimer(function() for _,player in ipairs(getElementsByType("player")) do if getElementData(player,'cuff') == true then if isPedInWater(player) then setTimer(function(player) if isPedInWater(player) then killPed(player) end end,5000,1,player) end end end end,1000,0) addEventHandler('onVehicleExit', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then setCuffPlayer(player) end end) -- ABAIXO UMA FUNÇÃO UTIL QUE FOI DEMONSTRADA por @MainSCR no seu outro post, deveria ter usado isto em vez da outra! function isPlayerPermission(thePlayer) -- faz um loop das acls declaradas na tabela e verifica se a acl do jogador é uma das acls declarada na tabela if isElement(thePlayer) and getElementType(thePlayer) == "player" then if isGuestAccount(getPlayerAccount(thePlayer)) then return end for _, group in ipairs(corpACLS) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup(group)) then -- preste atenção acima, ("user."..Nome da Conta , qual a acl )) return true end end end return false end Debugscript 3: ERRO:algemas/server.Lua:33: attempt to compare boolean with number
-
Deu erro no debug como você disse
-
Eu testei não e bem isso e tipo assim o player so pode usar o comando dps de 5 segundos entendeu pra evitar flood se poder ajudar plis E tambem pq maioria dos players floodam ultilizando comando dos teleportes sabe ai por isso queria colocar uma mensagem com um tempo pra usar o comando denovo assim Aguarde 5 segundos para ultilizar o teleporte novamente! So queria resolver isso com um tempo de espera pra usar o comando dnv
-
Olá quero por um tempo de espera com mensagem de 5 segundos nesses dois teleportes quem pode ajudar local posicoes = { { 2488, -1670, 14 }, } function PosicaoPlayer ( thePlayer, command ) local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#FFFFFF[ #00FF00Tele#FFFFFF ]: #FFFFFF' .. getPlayerName(thePlayer) .. ' #828282Foi Para A Casa Do Cj #FFFFFF(#00FF00 /cj #FFFFFF)', root, 255, 255, 255, true) end addCommandHandler ( "cj", PosicaoPlayer ) --- local posicoes = { { 324, -1779, 5 }, } function PosicaoPlayer ( thePlayer, command ) local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#FFFFFF[ #00FF00Tele#FFFFFF ]: #FFFFFF' .. getPlayerName(thePlayer) .. ' #828282Foi Para A Praia #FFFFFF(#00FF00 /praia #FFFFFF)', root, 255, 255, 255, true) end addCommandHandler ( "praia", PosicaoPlayer ) ---
-
Deu erro no debugscript 3 tentei usar so n aconteceu nd algemar/server.Lua:3 attempt to call global 'getplayerfrompartialname' value
-
Bom o /algemar ele trava o jogador + o chat não da pra apertar a tecla T então queria pedir ajuda pra alguem que saiba resolver pra mim Codigo 1 - function setPedAnimationSpeed (player, anim, speed) triggerClientEvent (player, "animSped", player, player, anim, speed) end function setCuffPlayer (player) setPedAnimation (player, nil) setPedAnimation (player, 'ped', 'pass_Smoke_in_car', 0, true, true, true) setTimer (setPedAnimationSpeed, 60, 1, player, 'pass_Smoke_in_car', 0) local x, y, z = getElementPosition (player) local box = createObject(364, x, y, z) exports.bone_attach:attachElementToBone (box, player, 12, 0,0,0, 0,40,-10) setElementCollisionsEnabled (box, false) setElementData (player,'cuffOb', box) toggleControl (player, 'jump', false) setTimer(function (player) if (getElementData (player, 'cuff') and getElementData (player, 'cuff') == true) then toggleControl (player, 'fire', false) end end, 60, 0, player) toggleControl (player, 'crouch', false) end function cuff (thePlayer, cmd, nick) if (isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("BOPE")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("PMRJ"))) then local nickJogador = getPlayerFromPartialName (nick) if (nickJogador) then local x, y, z = getElementPosition (thePlayer) local x1, y1, z1 = getElementPosition (nickJogador) if (getDistanceBetweenPoints3D (x1, y1, z1, x, y, z) <= 20) then if not (getElementData (nickJogador, 'cuff')) then -- if isPedInVehicle (nickJogador) then -- setControlState (nickJogador, 'enter_exit', true) -- setTimer (setCuffPlayer, 2800, 1, nickJogador) -- setElementData (nickJogador, 'cuff', true) -- else setCuffPlayer (nickJogador) setElementData (nickJogador, 'cuff', true) toggleAllControls (nickJogador, false) outputChatBox (getPlayerName(thePlayer)..'#ff0000 Algemou você agora você não pode se mover', nickJogador, 255, 255, 255, true) -- end else removeElementData (nickJogador, 'cuff') destroyElement (getElementData (nickJogador, 'cuffOb')) removeElementData (nickJogador, 'cuff') toggleAllControls (nickJogador, true) setPedAnimation (nickJogador, 'ped', 'pass_Smoke_in_car', 0, false, false, false, false) outputChatBox (getPlayerName(thePlayer)..'#008800 Soltou suas algemas e agora você esta livre', nickJogador, 255, 255, 255, true) end else outputChatBox ("O jogador estã longe demais se aproxime!", thePlayer, 255, 0, 0) end else outputChatBox ("Nenhum jogador com esse nick foi encontrado!", thePlayer, 255, 0, 0) end else outputChatBox ("Você não tem acesso a esse comando!", thePlayer, 255, 0, 0) end end addCommandHandler ('a', cuff) addEventHandler ('onPlayerQuit', root, function () if (getElementData (source, 'cuff') == true) then destroyElement(getElementData(source, 'cuffOb')) removeElementData (source, 'cuff') end end) addEventHandler ('onPlayerWasted', root, function () if (getElementData (source, 'cuff') == true) then destroyElement(getElementData(source, 'cuffOb')) removeElementData (source, 'cuff') end end) addEventHandler ('onVehicleStartEnter', getRootElement(), function (player, seat) if (getElementData (player, 'cuff') == true) then if (seat ~= 0) then destroyElement(getElementData(player, 'cuffOb')) else cancelEvent () outputChatBox ('Você não pode dirigir você tem algemas!', player, 255, 0, 0) end end end) setTimer(function () for _, player in ipairs(getElementsByType("player")) do if (getElementData (player, 'cuff') == true) then if isElementInWater(player) then setTimer(function(player) if isElementInWater(player) then killPed (player) end end, 5000, 1, player) end end end end, 1000, 0) addEventHandler ('onVehicleExit', getRootElement(), function (player, seat) if (getElementData (player, 'cuff') == true) then setCuffPlayer (player) end end) function getPlayerFromPartialName (name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end Codigo - 2 addEventHandler ( 'onClientResourceStart', getResourceRootElement(getThisResource()), function() txd = engineLoadTXD('cuff.txd',364) engineImportTXD(txd,364) dff = engineLoadDFF('cuff.dff',364) engineReplaceModel(dff,364) end) function animSped(player,anim, speed) setPedAnimationSpeed(player,anim, speed) setPedAnimationProgress(player, 'pass_Smoke_in_car', 0) toggleControl('fire', false) end addEvent("animSped", true) addEventHandler( "animSped", root, animSped)
-
Eu queria um script de todos os players nascerem com todas as habilidades de armas se alguem poder ajudar ai
-
Eu quero diminuir o dinheiro que o player ganha com o drift se alguem poder me ajudar p Codigo - 1 local newFont2 = dxCreateFont( "font/ITCBauhausMedium.ttf", 21 ) --these are the banned vehicle ids where you cannot get drift points. local BannedIDs = { 432, 532 } local rootElem = getRootElement() local thisRoot = getResourceRootElement(getThisResource()) local player = getLocalPlayer() local vehicle local size = 1.2 local modo = 0.01 local score = 0 local screenScore = 0 local tick local idleTime local multTime local driftTime local Yellow = tocolor(255,255,255) local Red = tocolor(255,255,255) local TempCol = Yellow local mult = 1 local tablamult = {350,1400,4200,11200} local anterior = 0 local mejor = 0 local total = 0 local global_mejor = 0 local global_nombre = "N/A" local screenWidth, screenHeight = guiGetScreenSize() local x1,y1,x2,y2 = screenWidth*0.2,screenHeight*0.1,screenWidth*0.8,screenHeight*0.8 addEventHandler("onClientResourceStart", thisRoot, function() addEventHandler("onClientRender", rootElem, showText) triggerServerEvent("driftClienteListo", rootElem, player) end ) addEventHandler("onClientResourceStop", thisRoot, function() removeEventHandler("onClientRender", rootElem, showText) end ) function isValidVehicle() local temp = getPedOccupiedVehicle(player) if not temp or getVehicleOccupant(temp,0) ~= player or getVehicleType(temp) ~= "Automobile" then return false end local vehID = getElementModel(temp) for k,v in ipairs(BannedIDs) do if vehID == v then return false end end return temp end function showText() vehicle = isValidVehicle() if not vehicle then return end if size > 1.3 then modo = -0.01 elseif size < 1.2 then modo = 0.01 end size = size + modo tick = getTickCount() local angulo,velocidad = angle() local tempBool = tick - (idleTime or 0) < 750 if not tempBool and score ~= 0 then anterior = score setElementData(player, "Último Drift", anterior) total = total+anterior setElementData(player, "Total de Drift", total) if score > mejor then mejor = score setElementData(player, "Drift", mejor) end triggerEvent("onVehicleDriftEnd", rootElem, tick-driftTime-750) score = 0 end if angulo ~= 0 then if score == 0 then triggerEvent("onVehicleDriftStart", rootElem) driftTime = tick end if tempBool then score = score + math.floor(angulo*velocidad)*mult else score = math.floor(angulo*velocidad)*mult end if TempCol == Red then TempCol = Yellow end screenScore = score idleTime = tick end if velocidad <= 0.3 and mult ~= 1 then end if tick - (idleTime or 0) < 3000 then local temp = "Voce Fez" if score >= 100000 then temp = "Drift King" elseif score >= 50000 then temp = "Drift Insano" elseif score >= 20000 then temp = "Drift Massa" elseif score >= 15000 then temp = "Drift Incrivel" elseif score >= 7000 then temp = "Super Drift" elseif score >= 3000 then temp = "Grande Drift" elseif score >= 1000 then temp = "Bom Drift" end dxDrawText(temp, x1,y1,x2,y2, TempCol, 1.2, newFont2,"center","top", false,true,false) dxDrawText(string.format("\n%d",screenScore), x1,y1-10,x2,y2, TempCol, size,newFont2,"center","top", false,true,false) end end function angle() local vx,vy,vz = getElementVelocity(vehicle) local modV = math.sqrt(vx*vx + vy*vy) if not isVehicleOnGround(vehicle) then return 0,modV end local rx,ry,rz = getElementRotation(vehicle) local sn,cs = -math.sin(math.rad(rz)), math.cos(math.rad(rz)) local deltaT = tick - (multTime or 0) if mult~= 1 and modV <= 0.3 and deltaT > 750 then mult = mult-1 multTime = tick elseif deltaT > 1500 then local temp = 1 if score >= 11200 then temp = 5 elseif score >= 4200 then temp = 4 elseif score >= 1400 then temp = 3 elseif score >= 350 then temp = 2 end if temp>mult then mult = temp multTime = tick end end if modV <= 0.2 then return 0,modV end --speed over 40 km/h local cosX = (sn*vx + cs*vy)/modV if cosX > 0.966 or cosX < 0 then return 0,modV end --angle between 15 and 90 degrees return math.deg(math.acos(cosX))*0.5, modV end addEvent("driftCarCrashed", true) addEventHandler("driftCarCrashed", rootElem, function() if score ~= 0 then score = 0 mult = 1 TempCol = Red triggerEvent("onVehicleDriftEnd", rootElem, 0) end end ) addEvent("driftActualizarRecord", true) addEventHandler("driftActualizarRecord", rootElem, function(score, name) global_mejor = score global_nombre = name end ) function resetScore() anterior,mejor,total = 0,0,0 setElementData(player, "Último Drift", anterior) setElementData(player, "Total De Drift", total) setElementData(player, "Drift", mejor) end addEvent("driftResetAllScores", true) addEventHandler("driftResetAllScores", rootElem, resetScore) addCommandHandler("resetdrift", resetScore) function checkPuntaje() if total > global_mejor then triggerServerEvent("driftNuevoRecord", rootElem, total, getPlayerName(player)) end end addEventHandler("onClientPlayerFinish", rootElem, checkPuntaje) addEventHandler("onClientPlayerOutOfTime", rootElem, checkPuntaje) addEventHandler("onElementDataChange", getRootElement(), function (ElementData) if ElementData == "Drift" then givePlayerMoney(source, getElementData(source, ElementData)) end end) Codigo - 2 local root = getRootElement() local thisResourceRoot = getResourceRootElement(getThisResource()) local drift_records = {} local drift_mejor = 0 local drift_nombre = "N/A" addEventHandler ( "onResourceStart", thisResourceRoot, function() call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Drift") executeSQLCreateTable("recordsDrift","pista TEXT, nombre TEXT, score INTEGER") addEvent("driftClienteListo", true) addEventHandler("driftClienteListo", root, function(player) triggerClientEvent(player, "driftActualizarRecord", root, drift_mejor, drift_nombre) if drift_mejor == 0 then else end end) end ) addEventHandler ( "onResourceStop", thisResourceRoot, function() call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "Drift") end ) addEventHandler ( "onGamemodeMapStart", root, function(mapResource) local mapname = getResourceInfo(mapResource, "name") or getResourceName(mapResource) local command = string.format("pista='%s'",mapname) local record = executeSQLSelect("recordsDrift","nombre, score",command) if #record == 0 then executeSQLInsert("recordsDrift",string.format("'%s', 'N/A', 0",mapname)) drift_mejor = 0 drift_nombre = "N/A" else drift_mejor = record[1]["score"] drift_nombre = record[1]["nombre"] end triggerClientEvent(root, "driftActualizarRecord", root, drift_mejor, drift_nombre) triggerClientEvent(root, "driftResetAllScores", root) if drift_mejor == 0 then else end end) addEventHandler ( "onGamemodeMapStop", root, function(mapResource) local mapname = getResourceInfo(mapResource, "name") or getResourceName(mapResource) if not mapname then return end local command = string.format("pista='%s'",mapname) executeSQLUpdate("recordsDrift",string.format("Nome = '%s', score = %d", drift_nombre, drift_mejor), command) end) addEventHandler("onVehicleDamage", root, function() thePlayer = getVehicleOccupant(source, 0) if thePlayer then triggerClientEvent(thePlayer, "driftCarCrashed", root, source) end end) addEvent("driftNuevoRecord", true) addEventHandler("driftNuevoRecord", root, function(score, name) if score > drift_mejor then drift_mejor = score drift_nombre = name triggerClientEvent(root, "driftActualizarRecord", root, drift_mejor, drift_nombre) end end) addEventHandler("onElementDataChange", getRootElement(), function (ElementData) if ElementData == "Drift" then givePlayerMoney(source, getElementData(source, ElementData)) end end)
-
Codigo - 1 local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 11) local dxfont1_fonte = dxCreateFont("font/fonte.ttf", 13) atmTxd = engineLoadTXD("models/atm/kmb_atmx.txd") engineImportTXD(atmTxd, 2942) bankTxd = engineLoadTXD("models/bank/lanblokd.txd") engineImportTXD(bankTxd, 4005) local bankBot = createPed(150, 359.71246, 173.56975, 1008.38281, -90) local atm1 = createObject(2942, 359.86437, 188.99635, 1008.04281) local atm2 = createObject(2942, 360.86437, 188.99635, 1008.04281) local atm3 = createObject(2942, 361.86437, 188.99635, 1008.04281) local atm4 = createObject(2942, 1928.58215, -1768.56689, 13.14688, 0, 0, 90) local atm5 = createObject(2942, 1815.18152, -1557.53162, 13.08579, 0, 0, 70) local atm6 = createObject(2942, 1682.24341, -1272.46252, 14.41477, 0, 0, 0) local atm7 = createObject(2942, 1051.96143, -1131.20642, 23.42813, 0, 0, 0) local atm8 = createObject(2942, 537.36407, -1740.75659, 11.87771, 0, 0, 180) setElementInterior(atm1, 3) setElementDimension(atm1, 2) setElementInterior(atm2, 3) setElementDimension(atm2, 2) setElementInterior(atm3, 3) setElementDimension(atm3, 2) setElementInterior(bankBot, 3) setElementDimension(bankBot, 2) setElementFrozen(bankBot, true) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function dxDrawLinedRectangle( x, y, width, height, color, _width, postGUI ) _width = _width or 1 dxDrawLine ( x, y, x+width, y, color, _width, postGUI ) -- Top dxDrawLine ( x, y, x, y+height, color, _width, postGUI ) -- Left dxDrawLine ( x, y+height, x+width, y+height, color, _width, postGUI ) -- Bottom return dxDrawLine ( x+width, y, x+width, y+height, color, _width, postGUI ) -- Right end local szx,szy = guiGetScreenSize() local tx, ty, tz = 1411.80339, -1699.87390, 13.53949 local sz = tz-2.5 local marker = createMarker (tx, ty, sz, "cylinder", 1, 241, 155, 0, 0) local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) local l_0_1 = false local l_0_2, l_0_3 = guiGetScreenSize() local l_0_4 = dxCreateScreenSource(l_0_2, l_0_3) grid = dxGrid:Create(x*497, y*406, x*325, y*139) colum = grid:AddColumn("Jogadores", x*200) grid:SetVisible(false) for i, player in ipairs(getElementsByType("player")) do --if not (player == getLocalPlayer()) then grid:AddItem(colum, getPlayerName(player):gsub("#%x%x%x%x%x%x", "")) -- end end addEventHandler("onClientRender", root, function() if l_0_1 then dxUpdateScreenSource(l_0_4) dxDrawImage(0, 0, l_0_2, l_0_3, l_0_4) end end ) addEventHandler ( "onClientRender", root, function ( ) vx, vy, vz = getElementPosition(marker) scX, scY = getScreenFromWorldPosition(vx, vy, vz+3.5) cx,cy,cz,clx,cly,clz,crz,cfov = getCameraMatrix() dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz+3.5) if scX then largura, altura = 626, 350 Tx = scX-(5000/dist)*szx/626/largura*cfov Ty = scY-(100/dist)*szy/350/altura*cfov Tw = (5000/dist)*szx/400/largura*cfov Th = (5000/dist)*szy/400/altura*cfov if dist < 80.0 then if (isLineOfSightClear(cx, cy, cz, vx, vy, vz+1.5, true, false, false)) then if not isElementWithinMarker(localPlayer, marker) then --dxDrawText("$", Tx, Ty, Tw, Th + 40, tocolor(255, 255, 255, math.abs(math.sin(getTickCount()/700))*200), 1.00, dxfont1_fonte, "left", "top", false, false, true, true, false) --dxDrawText("Loja de #f19b00vida #ffffffe #f19b00colete", Tx, Ty + 120, Tw, Th + 40, tocolor(255, 255, 255, math.abs(math.sin(getTickCount()/700))*200), 1.00, dxfont2_fonte, "left", "top", false, false, true, true, false) dxDrawImage ( Tx, Ty, Tw, Th, "gfx/joinIcon.png",0,0,0,tocolor(255,255,255,255)) end end end end end) function cancelPedDamage(attacker) cancelEvent() end addEventHandler("onClientPedDamage", bankBot, cancelPedDamage) function caixaUI() local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Caixa")) exports["[VZR]Blur2"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768, isCursorOnElement(x*464, y*366, x*93, y*95) and "gfx/ui/t_button2.png" or "gfx/ui/t_button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768, isCursorOnElement(x*625, y*366, x*93, y*95) and "gfx/ui/d_button2.png" or "gfx/ui/d_button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768, isCursorOnElement(x*778, y*366, x*93, y*95) and "gfx/ui/r_button2.png" or "gfx/ui/r_button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", ""), x*310, y*158, x*406, y*182, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("R$ "..money, x*339, y*189, x*426, y*213, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("R$ "..bankMoney, x*340, y*216, x*427, y*240, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) if getElementData(localPlayer, "Notification") then dxDrawText("[Erro] "..getElementData(localPlayer, "Notification"), x*240, y*680, x*706, y*441, tocolor(255, 0, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end if getElementData(localPlayer, "Notification:S") then dxDrawText("[Sucesso] "..getElementData(localPlayer, "Notification:S"), x*240, y*680, x*706, y*441, tocolor(0, 255, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end end function acessingUI() exports["[VZR]Blur2"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end function depositUI() local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Caixa")) exports["[VZR]Blur2"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bgd.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", ""), x*310, y*158, x*406, y*182, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("R$ "..money, x*339, y*189, x*426, y*213, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("R$ "..bankMoney, x*340, y*216, x*427, y*240, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*564, x*540, y*56, isCursorOnElement(x*502, y*564, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) createEditBox("2", 0.379, 0.443, 0.22, 0.06, true, "", false, 7, "arial", false, 1, {0, 0, 0, 127 }, true, { 0, 0, 0, 55 }, 1, true, 60, true, "Digite o valor", { 0, 0, 0, 127 }, true, 1, "arial", true, true, {0, 0, 0}, false) dxDrawText(" Cancelar", x*619, y*580, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*480, x*540, y*56, isCursorOnElement(x*502, y*480, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) dxDrawText(" Depositar", x*619, y*497, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) if getElementData(localPlayer, "Notification") then dxDrawText("[Erro] "..getElementData(localPlayer, "Notification"), x*240, y*680, x*706, y*441, tocolor(255, 0, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end if getElementData(localPlayer, "Notification:S") then dxDrawText("[Sucesso] "..getElementData(localPlayer, "Notification:S"), x*240, y*680, x*706, y*441, tocolor(0, 255, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end end function sacUI() local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Caixa")) exports["[VZR]Blur2"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bgr.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", ""), x*310, y*158, x*406, y*182, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("R$ "..money, x*339, y*189, x*426, y*213, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("R$ "..bankMoney, x*340, y*216, x*427, y*240, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*564, x*540, y*56, isCursorOnElement(x*502, y*564, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) createEditBox("3", 0.379, 0.443, 0.22, 0.06, true, "", false, 7, "arial", false, 1, {0, 0, 0, 127 }, true, { 0, 0, 0, 55 }, 1, true, 60, true, "Digite o valor", { 0, 0, 0, 127 }, true, 1, "arial", true, true, {0, 0, 0}, false) dxDrawText(" Cancelar", x*619, y*580, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*480, x*540, y*56, isCursorOnElement(x*502, y*480, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) dxDrawText(" Retirar", x*619, y*497, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) if getElementData(localPlayer, "Notification") then dxDrawText("[Erro] "..getElementData(localPlayer, "Notification"), x*240, y*680, x*706, y*441, tocolor(255, 0, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end if getElementData(localPlayer, "Notification:S") then dxDrawText("[Sucesso] "..getElementData(localPlayer, "Notification:S"), x*240, y*680, x*706, y*441, tocolor(0, 255, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end end function transUI() local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Caixa")) exports["[VZR]Blur2"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bgt.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", ""), x*310, y*158, x*406, y*182, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("R$ "..money, x*339, y*189, x*426, y*213, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("R$ "..bankMoney, x*340, y*216, x*427, y*240, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*564, x*540, y*56, isCursorOnElement(x*502, y*564, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) createEditBox("1", 0.379, 0.443, 0.22, 0.06, true, "", false, 7, "arial", false, 1, {0, 0, 0, 127 }, true, { 0, 0, 0, 55 }, 1, true, 60, true, "Digite o valor", { 0, 0, 0, 127 }, true, 1, "arial", true, true, {0, 0, 0}, false) dxDrawText("Transferir", x*619, y*580, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) if getElementData(localPlayer, "Notification") then dxDrawText("[Erro] "..getElementData(localPlayer, "Notification"), x*240, y*680, x*706, y*441, tocolor(255, 0, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end if getElementData(localPlayer, "Notification:S") then dxDrawText("[Sucesso] "..getElementData(localPlayer, "Notification:S"), x*240, y*680, x*706, y*441, tocolor(0, 255, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end end function render() local screenx, screeny, worldx, worldy, worldz = getCursorPosition() local px, py, pz = getCameraMatrix() local hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, worldx, worldy, worldz ) local tx, ty, tz = getElementPosition(localPlayer) local rx, ry, rz = getElementPosition(atm1) local rx2, ry2, rz2 = getElementPosition(atm2) local rx3, ry3, rz3 = getElementPosition(atm3) local rx4, ry4, rz4 = getElementPosition(atm4) local rx5, ry5, rz5 = getElementPosition(atm5) local rx6, ry6, rz6 = getElementPosition(atm6) local rx7, ry7, rz7 = getElementPosition(atm7) local rx8, ry8, rz8 = getElementPosition(atm8) local distancia = getDistanceBetweenPoints3D(tx, ty, tz, rx, ry, rz) local distancia2 = getDistanceBetweenPoints3D(tx, ty, tz, rx2, ry2, rz2) local distancia3 = getDistanceBetweenPoints3D(tx, ty, tz, rx3, ry3, rz3) local distancia4 = getDistanceBetweenPoints3D(tx, ty, tz, rx4, ry4, rz4) local distancia5 = getDistanceBetweenPoints3D(tx, ty, tz, rx5, ry5, rz5) local distancia6 = getDistanceBetweenPoints3D(tx, ty, tz, rx6, ry6, rz6) local distancia7 = getDistanceBetweenPoints3D(tx, ty, tz, rx7, ry7, rz7) local distancia8 = getDistanceBetweenPoints3D(tx, ty, tz, rx8, ry8, rz8) if not isEventHandlerAdded("onClientRender", root, caixaUI) then if (distancia <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if hit then if elementHit == atm1 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia2 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if hit then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if elementHit == atm2 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia3 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if hit then if elementHit == atm3 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia4 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if hit then if elementHit == atm4 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia5 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if hit then if elementHit == atm5 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia6 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if hit then if elementHit == atm6 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia7 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if hit then if elementHit == atm7 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia8 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if hit then if elementHit == atm8 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end end end addEventHandler("onClientClick", root, render) local rootElement = getRootElement() local screenWidth, screenHeight = guiGetScreenSize() local maxrange = 20 function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font, ...) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getCameraMatrix() local distance = distance or 20 local height = height or 1 local value1 = 2 local value2 = 2 if (isLineOfSightClear(x, y, z+2, x2, y2, z2, ...)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawText(text, sx+value1, sy+value2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center", false, false, false, true, false) end end end end function wolrdTexts() dxDrawTextOnElement(bankBot,"Atendente #1066e7(BOT)",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm1,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm2,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm3,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm4,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm5,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm6,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm7,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm8,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") end addEventHandler("onClientRender",rootElement, wolrdTexts) function closePanel(_,state) if isEventHandlerAdded("onClientRender", root, caixaUI) then if state == "down" then if isCursorOnElement(x*1068, y*94, x*36, y*38) then showCursor(false) showChat(true) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, caixaUI) end end end if isEventHandlerAdded("onClientRender", root, transUI) then if state == "down" then if isCursorOnElement(x*1068, y*94, x*36, y*38) then showCursor(false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(true) playSound("sfx/hit.mp3", false) grid:SetVisible(false) removeEventHandler("onClientRender", root, transUI) changeVisibility("1", false) end end end if isEventHandlerAdded("onClientRender", root, depositUI) then if state == "down" then if isCursorOnElement(x*1068, y*94, x*36, y*38) then showCursor(false) showChat(true) playSound("sfx/hit.mp3", false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) changeVisibility("2", false) removeEventHandler("onClientRender", root, depositUI) end end end if isEventHandlerAdded("onClientRender", root, sacUI) then if state == "down" then if isCursorOnElement(x*1068, y*94, x*36, y*38) then showCursor(false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(true) playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, sacUI) changeVisibility("3", false) end end end if isEventHandlerAdded("onClientRender", root, sacUI) then if state == "down" then if isCursorOnElement(x*502, y*564, x*320, y*56) then playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, sacUI) addEventHandler("onClientRender", root, caixaUI) changeVisibility("3", false) end end end if isEventHandlerAdded("onClientRender", root, depositUI) then if state == "down" then if isCursorOnElement(x*502, y*564, x*320, y*56) then playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, depositUI) addEventHandler("onClientRender", root, caixaUI) changeVisibility("2", false) end end end end addEventHandler("onClientClick", root, closePanel) function uiButtons(_,state) if isEventHandlerAdded("onClientRender", root, caixaUI) then if state == "down" then if not isEventHandlerAdded("onClientRender", root, transUI) or isEventHandlerAdded("onClientRender", root, depositUI) or isEventHandlerAdded("onClientRender", root, sacUI) then if isCursorOnElement(x*464, y*366, x*93, y*95) then -- trans playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, caixaUI) addEventHandler("onClientRender", root, transUI) grid:SetVisible(true) changeVisibility("1", true) end end if not isEventHandlerAdded("onClientRender", root, depositUI) or isEventHandlerAdded("onClientRender", root, sacUI) or isEventHandlerAdded("onClientRender", root, transUI) then if isCursorOnElement(x*625, y*366, x*93, y*95) then -- deposit playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, caixaUI) addEventHandler("onClientRender", root, depositUI) changeVisibility("2", true) end end if not isEventHandlerAdded("onClientRender", root, sacUI) or isEventHandlerAdded("onClientRender", root, depositUI) or isEventHandlerAdded("onClientRender", root, transUI) then if isCursorOnElement(x*778, y*366, x*93, y*95) then -- sac playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, caixaUI) addEventHandler("onClientRender", root, sacUI) changeVisibility("3", true) end end end end end addEventHandler("onClientClick", root, uiButtons) function depositButton(_,state) if isEventHandlerAdded("onClientRender", root, depositUI) then if state == "down" then if isCursorOnElement(x*502, y*480, x*320, y*56) then if getText("2") then if tonumber(getText("2")) < getPlayerMoney(localPlayer) or tonumber(getText("2")) == getPlayerMoney(localPlayer) then playSound("sfx/hit.mp3", false) addEventHandler("onClientRender", root, caixaUI) changeVisibility("2", false) removeEventHandler("onClientRender", root, depositUI) setElementData(localPlayer, "Bank:Caixa", getElementData(localPlayer, "Bank:Caixa") + tonumber(getText("2"))) setElementData(localPlayer, "Notification", false) triggerServerEvent("onDepositMoney", localPlayer, localPlayer, tonumber(getText("2"))) setElementData(localPlayer, "Notification:S", "Depósito de R$ "..tonumber(getText("2")).." feito!") setTimer(setElementData, 7000, 1, localPlayer, "Notification:S", false) else playSound("sfx/hit.mp3", false) setElementData(localPlayer, "Notification:S", false) setElementData(localPlayer, "Notification", "Você não possui este valor!") setTimer(setElementData, 7000, 1, localPlayer, "Notification", false) end end end end end end addEventHandler("onClientClick", root, depositButton) function saqueButton(_,state) if isEventHandlerAdded("onClientRender", root, sacUI) then if state == "down" then if isCursorOnElement(x*502, y*480, x*320, y*56) then if getText("3") then if tonumber(getText("3")) == getElementData(localPlayer, "Bank:Caixa") or tonumber(getText("3")) < getElementData(localPlayer, "Bank:Caixa") then playSound("sfx/hit.mp3", false) addEventHandler("onClientRender", root, caixaUI) removeEventHandler("onClientRender", root, sacUI) changeVisibility("3", false) setElementData(localPlayer, "Bank:Caixa", getElementData(localPlayer, "Bank:Caixa") - tonumber(getText("3"))) setElementData(localPlayer, "Notification", false) triggerServerEvent("saqueBankMoney", localPlayer, localPlayer, tonumber(getText("3"))) setElementData(localPlayer, "Notification:S", "Retirada de R$ "..tonumber(getText("3")).." feito!") setTimer(setElementData, 7000, 1, localPlayer, "Notification:S", false) else playSound("sfx/hit.mp3", false) setElementData(localPlayer, "Notification:S", false) setElementData(localPlayer, "Notification", "Você não possui este valor!") setTimer(setElementData, 7000, 1, localPlayer, "Notification", false) end end end end end end addEventHandler("onClientClick", root, saqueButton) function transButton(_,state) if isEventHandlerAdded("onClientRender", root, transUI) then if state == "down" then if isCursorOnElement(x*502, y*564, x*320, y*56) then if getText("1") then if tonumber(getText("1")) == getElementData(localPlayer, "Bank:Caixa") or tonumber(getText("1")) < getElementData(localPlayer, "Bank:Caixa") then playSound("sfx/hit.mp3", false) local gridItem = grid:GetSelectedItem() local item = grid:GetItemDetails(colum, gridItem) addEventHandler("onClientRender", root, caixaUI) grid:SetVisible(false) changeVisibility("1", false) removeEventHandler("onClientRender", root, transUI) setElementData(localPlayer, "Bank:Caixa", getElementData(localPlayer, "Bank:Caixa") - tonumber(getText("1"))) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", "Transferência de R$ "..tonumber(getText("1"))..", para "..item.." feito!") setTimer(setElementData, 7000, 1, localPlayer, "Notification:S", false) triggerServerEvent("transMoney", localPlayer, tonumber(getText("1")), item) else playSound("sfx/hit.mp3", false) setElementData(localPlayer, "Notification:S", false) setElementData(localPlayer, "Notification", "Você não possui este valor!") setTimer(setElementData, 7000, 1, localPlayer, "Notification", false) end end end end end end addEventHandler("onClientClick", root, transButton) function isCursorOnElement( posX, posY, width, height ) if isCursorShowing( ) then local mouseX, mouseY = getCursorPosition( ) local clientW, clientH = guiGetScreenSize( ) local mouseX, mouseY = mouseX * clientW, mouseY * clientH if ( mouseX > posX and mouseX < ( posX + width ) and mouseY > posY and mouseY < ( posY + height ) ) then return true end end return false end -- ########### VARIÁVEIS ########### local markerJoin = createMarker(1411.80339, -1699.87390, 13.53949, "cylinder", 1, 16, 102, 231, 0) local inutil2 = createMarker(1411.80339, -1699.87390, 12.23949, "cylinder", 1, 16, 102, 231, 50) local exitLS1 = createMarker(390.45071, 173.79091, 1008.38281, "cylinder", 1, 16, 102, 231, 0) local inutil = createMarker(390.45071, 173.79091, 1007.18281, "cylinder", 1, 16, 102, 231, 50) createBlip(1411.80339, -1699.87390, 13.53949, 52) createBlip(1928.58215, -1768.56689, 13.14688, 52) createBlip(1815.18152, -1557.53162, 13.08579, 52) createBlip(1682.24341, -1272.46252, 14.41477, 52) createBlip(1051.96143, -1131.20642, 23.42813, 52) createBlip(537.36407, -1740.75659, 11.87771, 52) -- ########### VARIÁVEIS ########### setElementInterior(exitLS1, 3) setElementDimension(exitLS1, 2) setElementInterior(inutil, 3) setElementDimension(inutil, 2) function saveData4(conta) if conta then local source = getAccountPlayer(conta) if isElement(source) then local bank = getElementData(source,"Bank:Caixa") or 0 setAccountData(conta, "Bank:Caixa",tonumber(bank)) end end end function loadData4(conta) if not (isGuestAccount (conta)) then if (conta) then local source = getAccountPlayer(conta) if isElement(source) then local bank = getAccountData(conta,"Bank:Caixa") if type(bank) == "boolean" or "Bank:Caixa" == nil then bank = 0 end setElementData(source, "Bank:Caixa", tonumber(bank)) end end end end addEventHandler("onPlayerLogin", root, function(_, acc) setTimer(loadData4,1000,1,acc) end ) function saveOnStartScript(res) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then loadData4(acc) end end end end addEventHandler("onResourceStart", getRootElement(), saveOnStartScript) function saveOnStopScript(res) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then saveData4(acc) end end end end addEventHandler("onResourceStop", getRootElement(), saveOnStopScript) function saveOnQuit(quitType) local acc = getPlayerAccount(source) if not (isGuestAccount(acc)) then if acc then saveData4(acc) end end end addEventHandler("onPlayerQuit", getRootElement(), saveOnQuit) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function fadeCameraDelayed(player) if (isElement(player)) then fadeCamera(player, true, 0.5) end end function dxMsg(source, text, type) exports.dxmessages:outputDx(source, text, type) end function entrarLS1(thePlayer) setElementDimension(thePlayer, 2) fadeCamera(thePlayer, false, 1.0, 0, 0, 0) setTimer(fadeCameraDelayed, 1000, 1, thePlayer) setTimer(function() setElementInterior(thePlayer, 3, 386.85941, 173.74263, 1008.38281) end, 1000, 1) end addEventHandler("onMarkerHit", markerJoin, entrarLS1) function sairLS1(thePlayer) if getElementDimension(thePlayer) == 2 then setElementDimension(thePlayer, 0) fadeCamera(thePlayer, false, 1.0, 0, 0, 0) setTimer(fadeCameraDelayed, 1000, 1, thePlayer) setTimer(function() setElementInterior(thePlayer, 0, 1414.01062, -1700.99475, 13.53949) end, 1000, 1) end end addEventHandler("onMarkerHit", exitLS1, sairLS1) function onDepositMoney(thePlayer, money) takePlayerMoney(thePlayer, money) end addEvent("onDepositMoney", true) addEventHandler("onDepositMoney", root, onDepositMoney) function saqueBankMoney(thePlayer, money) givePlayerMoney(thePlayer, money) end addEvent("saqueBankMoney", true) addEventHandler("saqueBankMoney", root, saqueBankMoney) function transMoney(money, item) if grid == "" then return end local bankPlayer = getPlayerFromPartialName(item) setElementData(bankPlayer, "Bank:Caixa", getElementData(bankPlayer, "Bank:Caixa") + money) end addEvent("transMoney", true) addEventHandler("transMoney", root, transMoney) Codigo -2 espero que consiga resolver esse problema pra mim
-
Meu servidor tem um sistema de caixa eletronico eu queria saber como apago o salvamento dele tipo eu apago o resource dps coloco ao inves do banco zerar continua o mesmo saldo Não apararece nenhuma pasta salva pelo resource na pasta de mods do servidor
-
So uma duvida isso ai vai sumir pra todos os jogadores que estiverem online no servidor ou e visual exemplo so pra mim?
-
Meu servidor tem uma hud so que tipo a outra do GTA as vezes da um bug que fica apareçendo as duas gostaria de saber se e possivel ou não remover a outra hud do servidor a hud antiga do GTA
-
Opa estou com um probleminha uma mensagem chamada DIE apareçe toda vez que algum player morre Eu queria saber como remove algums amigos meus falaram que e na pasta gamemode Se alguem souber
-
Não funcionou ;([ o nome do meu arquivo aqui e script.Lua meta So estou ultilizando estes dois arquivos na pasta tem algo de errado? Funcionou obrigado! thanks
-
Estou com um problema depois de muito tempo vendo outras coisas etc reparei que tipo todo mundo que morre no meu servidor vem com uma skin aleatoria existe alguma forma de deixar a skin 0 padrão do CJ quem poder me dizer fico feliz
-
Obrigado resolveu meu problema pois eu estava muito nervoso sem isso pq eu não estava conseguindo de jeito nenhum sabe vlw Obrigada pela ajuda tbm maninho vlw
-
Funcionou so q esta acontecendo ums bugs tipo uso /algemar apareçe a mensagem nenhum jogador com esse nick encontrado agora quando uso /algemar nick da pessoa tipo n sai nada e quando uso a sigla do inicio apareçe Huster soltou suas algemas so que apareçe pra mim a msg com meu nick enviando pra mim msm se souber resolver pacas
-
Poderia me explicar sobre debug e pq sou meio novato assim mais ou menos em linguagem Lua essas coisas se poder dar uma força nessa E pq eu to mt meio nervoso pq meu servidor tem 2 corps so que ta tudo certo /prender /revistar menos o /algemar isso que me deixa meio nervoso
-
Estranho eu coloquei aq so n aconteceu nada ? ligo o resource mais nenhum dos comandos dele funciona
-
Meu /algemar não ta funcionando não oq ouve nele se alguem poder dar um helpzinho Ligo o resource so que não acontece nada quando uso o /algemar coloquei o comando dele pra /a e coloquei o if isObjectInACLGroup("user."..accountname, aclGetGroup("BOPE")) or if isObjectInACLGroup("user."..accountname, aclGetGroup("PMRJ")) then function setPedAnimationSpeed(player,anim,speed) triggerClientEvent(player, "animSped", player, player,anim,speed) end function setCuffPlayer(player) setPedAnimation(player, nil) setPedAnimation(player,'ped', 'pass_Smoke_in_car', 0, true, true, true) setTimer(setPedAnimationSpeed,60,1,player, 'pass_Smoke_in_car', 0) local x, y, z = getElementPosition(player) local box = createObject(364, x, y, z) exports.bone_attach:attachElementToBone(box, player, 12, 0,0,0, 0,40,-10) setElementCollisionsEnabled(box, false) setElementData(player,'cuffOb', box) toggleControl(player, 'jump', false) setTimer(function(player) if getElementData(player,'cuff') and getElementData(player,'cuff') == true then toggleControl(player, 'fire', false) end end,60,0,player) toggleControl(player, 'crouch', false) end function cuff(hit,_,name) local player = getPlayerFromName(name) local x,y,z = getElementPosition(player) local x1,y1,z1 = getElementPosition(hit) if getDistanceBetweenPoints3D(x1,y1,z1,x,y,z) <= 20 then if not getElementData(player,'cuff') or getElementData(player,'cuff') ~= true then if isPedInVehicle(player) then setControlState(player,'enter_exit',true) setTimer(setCuffPlayer,2800,1,player) setElementData(player,'cuff', true) else setCuffPlayer(player) setElementData(player,'cuff', true) end outputChatBox(' '..getPlayerName(hit)..'#ff0000 Algemou você',player,255,255,255,true) else removeElementData(player,'cuff') destroyElement(getElementData(player,'cuffOb')) removeElementData(player, 'cuff') toggleControl(player, 'jump', true) toggleControl(player, 'crouch', true) toggleControl(player, 'fire', true) setPedAnimation(player, 'ped', 'pass_Smoke_in_car', 0, false, false, false, false) outputChatBox(' '..getPlayerName(hit)..'#008800 Soltou suas algemas',player,255,255,255,true) end else outputChatBox("Você está longe demais!",hit,255,0,0,true) end end if isObjectInACLGroup("user."..accountname, aclGetGroup("BOPE")) or if isObjectInACLGroup("user."..accountname, aclGetGroup("PMRJ")) then addCommandHandler('a',cuff) addEventHandler('onPlayerQuit', root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onPlayerWasted',root,function() if getElementData(source,'cuff') == true then destroyElement(getElementData(source,'cuffOb')) removeElementData(source, 'cuff') end end) addEventHandler('onVehicleStartEnter', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then if seat ~= 0 then destroyElement(getElementData(player,'cuffOb')) else cancelEvent() outputChatBox('Você não pode dirigir você tem algemas!',player,255,0,0) end end end) setTimer(function() for _,player in ipairs(getElementsByType("player")) do if getElementData(player,'cuff') == true then if isPedInWater(player) then setTimer(function(player) if isPedInWater(player) then killPed(player) end end,5000,1,player) end end end end,1000,0) addEventHandler('onVehicleExit', getRootElement(), function(player, seat) if getElementData(player,'cuff') == true then setCuffPlayer(player) end end)
-
kkk obrigado Não foi acho pq tem um segunda arquivo dele q tem o stinger E mais ou menos um painelzinho se poder dar uma verificada kkkk local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 10) local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) function resetData() if getElementData(localPlayer, "creatingBarrier2") then setElementData(localPlayer, "creatingBarrier2", false) end if getElementData(localPlayer, "creatingBarrier") then setElementData(localPlayer, "creatingBarrier", false) end if getElementData(localPlayer, "creatingStinger") then setElementData(localPlayer, "creatingStinger", false) end if getElementData(localPlayer, "creatingCone") then setElementData(localPlayer, "creatingCone", false) end end addEventHandler("onClientResourceStart", resourceRoot, resetData) function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function dxDrawLinedRectangle( x, y, width, height, color, _width, postGUI ) _width = _width or 1 dxDrawLine ( x, y, x+width, y, color, _width, postGUI ) -- Top dxDrawLine ( x, y, x, y+height, color, _width, postGUI ) -- Left dxDrawLine ( x, y+height, x+width, y+height, color, _width, postGUI ) -- Bottom return dxDrawLine ( x+width, y, x+width, y+height, color, _width, postGUI ) -- Right end function menu() dxDrawRectangle(x*403, y*563, x*554, y*197, tocolor(0, 0, 0, 194), false) dxDrawRectangle(x*403, y*563, x*554, y*25, tocolor(0, 0, 0, 194), false) dxDrawText("Sistema de Blitz - #1066e7Minigun 2", x*408, y*567, x*535, y*598, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText('Pressione #1066e7"M"#FFFFFF, selecione um objeto abaixo, e depois pressione #1066e7"M"#FFFFFF novamente.', x*408, y*598, x*535, y*619, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText('Para criar o objeto selecionado utilize a tecla #1066e7"Space"#FFFFFF.', x*408, y*619, x*535, y*640, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(x*413, y*650, x*226, y*25, isCursorOnElement(x*413, y*650, x*226, y*25) and tocolor(16, 102, 231, 100) or tocolor(0, 0, 0, 194), false) dxDrawRectangle(x*413, y*675, x*226, y*25, isCursorOnElement(x*413, y*675, x*226, y*25) and tocolor(16, 102, 231, 100) or tocolor(0, 0, 0, 194), false) dxDrawRectangle(x*413, y*700, x*226, y*25, isCursorOnElement(x*413, y*700, x*226, y*25) and tocolor(16, 102, 231, 100) or tocolor(0, 0, 0, 194), false) dxDrawRectangle(x*413, y*725, x*226, y*25, isCursorOnElement(x*413, y*725, x*226, y*25) and tocolor(16, 102, 231, 100) or tocolor(0, 0, 0, 194), false) dxDrawText("Cone ", x*418, y*654, x*545, y*675, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("Barreira", x*418, y*679, x*545, y*700, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("Tapete de pregos", x*418, y*704, x*545, y*725, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("Barreira (2)", x*418, y*729, x*526, y*729, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawLine(x*663, y*650, x*663, y*745, tocolor(254, 254, 254, 90), 1, false) dxDrawRectangle(x*677, y*715, x*260, y*30, isCursorOnElement(x*677, y*715, x*260, y*30) and tocolor(16, 102, 231, 100) or tocolor(0, 0, 0, 194), false) dxDrawText("Destruir Blitz", x*759, y*719, x*886, y*740, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("Para destruir a Blitz pressione o botão", x*677, y*650, x*804, y*671, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("#1066e7abaixo#FFFFFF.", x*677, y*671, x*804, y*692, tocolor(255, 255, 255, 208), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) if getElementData(localPlayer, "creatingCone") then dxDrawRectangle(x*413, y*650, x*3, y*25, tocolor(16, 102, 231, 160), false) end if getElementData(localPlayer, "creatingBarrier") then dxDrawRectangle(x*413, y*675, x*3, y*25, tocolor(16, 102, 231, 160), false) end if getElementData(localPlayer, "creatingStinger") then dxDrawRectangle(x*413, y*700, x*3, y*25, tocolor(16, 102, 231, 160), false) end if getElementData(localPlayer, "creatingBarrier2") then dxDrawRectangle(x*413, y*725, x*3, y*25, tocolor(16, 102, 231, 160), false) end end function render() if not isEventHandlerAdded("onClientRender", root, menu) then addEventHandler("onClientRender", root, menu) end end addEvent("renderBlitz", true) addEventHandler("renderBlitz", root, render) function closePanel() if isEventHandlerAdded("onClientRender", root, menu) then removeEventHandler("onClientRender", root, menu) end end addEvent("removeRenderBlitz", true) addEventHandler("removeRenderBlitz", root, render) function blitzButtons(_,state) if isEventHandlerAdded("onClientRender", root, menu) then if state == "down" then -- #CONE if isCursorOnElement(x*413, y*650, x*226, y*25) then if getElementData(localPlayer, "creatingBarrier2") then setElementData(localPlayer, "creatingBarrier2", false) end if getElementData(localPlayer, "creatingBarrier") then setElementData(localPlayer, "creatingBarrier", false) end if getElementData(localPlayer, "creatingStinger") then setElementData(localPlayer, "creatingStinger", false) end setElementData(localPlayer, "creatingCone", true) playSound("sfx/hit.mp3", false) end -- #createBarrier if isCursorOnElement(x*413, y*675, x*226, y*25) then if getElementData(localPlayer, "creatingBarrier2") then setElementData(localPlayer, "creatingBarrier2", false) end if getElementData(localPlayer, "creatingCone") then setElementData(localPlayer, "creatingCone", false) end if getElementData(localPlayer, "creatingStinger") then setElementData(localPlayer, "creatingStinger", false) end setElementData(localPlayer, "creatingBarrier", true) playSound("sfx/hit.mp3", false) end -- #createBarrier2 if isCursorOnElement(x*413, y*725, x*226, y*25) then if getElementData(localPlayer, "creatingBarrier") then setElementData(localPlayer, "creatingBarrier", false) end if getElementData(localPlayer, "creatingCone") then setElementData(localPlayer, "creatingCone", false) end if getElementData(localPlayer, "creatingStinger") then setElementData(localPlayer, "creatingStinger", false) end setElementData(localPlayer, "creatingBarrier2", true) playSound("sfx/hit.mp3", false) end -- #createStinger if isCursorOnElement(x*413, y*700, x*226, y*25) then if getElementData(localPlayer, "creatingBarrier2") then setElementData(localPlayer, "creatingBarrier2", false) end if getElementData(localPlayer, "creatingCone") then setElementData(localPlayer, "creatingCone", false) end if getElementData(localPlayer, "creatingBarrier") then setElementData(localPlayer, "creatingBarrier", false) end setElementData(localPlayer, "creatingStinger", true) playSound("sfx/hit.mp3", false) end if isCursorOnElement(x*677, y*715, x*260, y*30) then triggerServerEvent("destroyBlitz", localPlayer) playSound("sfx/hit.mp3", false) end end end end addEventHandler("onClientClick", root, blitzButtons) function createSelectedObject() if isEventHandlerAdded("onClientRender", root, menu) then if getElementData(localPlayer, "creatingCone") then triggerServerEvent("createCone", localPlayer) end if getElementData(localPlayer, "creatingBarrier") then triggerServerEvent("createBarrier", localPlayer) end if getElementData(localPlayer, "creatingBarrier2") then triggerServerEvent("createBarrier2", localPlayer) end if getElementData(localPlayer, "creatingStinger") then triggerServerEvent("createStinger", localPlayer) end end end bindKey("Space", "down", createSelectedObject) function isCursorOnElement( posX, posY, width, height ) if isCursorShowing( ) then local mouseX, mouseY = getCursorPosition( ) local clientW, clientH = guiGetScreenSize( ) local mouseX, mouseY = mouseX * clientW, mouseY * clientH if ( mouseX > posX and mouseX < ( posX + width ) and mouseY > posY and mouseY < ( posY + height ) ) then return true end end return false end