-
Posts
40 -
Joined
-
Last visited
Everything posted by zRodrigoMM
-
Agora não está dando mas o erro, porem quando tento reproduzir a animação no menu não funciona. client: local customBlockName = "HandPlant" -- load the IFP file local IFP = engineLoadIFP( "parkour.ifp", customBlockName ) -- informe-nos se o IFP falhou ao carregar if not IFP then outputChatBox( "Failed to load 'parkour.ifp'" ) end -- substituir a animação engineReplaceAnimation( localPlayer, "ped", "weapon_crouch", customBlockName, "HandPlant" ) meta: <meta> <info version="2.0" author="TEST"/> <script src="client.Lua" type="client" /> <file src="parkour.ifp" cache = "false" /> <min_mta_version server="1.3.0-9.04570" client="1.3.0-9.04570" /> </meta>
-
entendi, fiz o que você disse mas não deu certo aparece o seguinte erro; ERROR: [TEST2]\parkour\client.Lua:5: attempt to call global 'engineLoadIFP' (a nil value)
-
Ok vou tentar, tenho quê usar o anim manager para fazer alguma substituição na animação ? Tipo tenho algumas pronto ja pra introduzir.
-
Olá pessoal, eu gostaria de saber se tem como eu estar colocando uma animação personalizada, junto ao menu de animação do mod de celular, tipo danças novas que não sejam as padrões do jogo...estou confuso quando tento adicionar algo nessa lista que seja um arquivo animado.ifp de outro script não consigo ter exito, ele também não tem server side relacioando... animações.map -- aquivo que fica as animações padrão <map> <animationCategory id="Danças"> <animation id="STRIP 1" block="STRIP" code="strip_A" /> <animation id="STRIP 2" block="STRIP" code="strip_B" /> <animation id="STRIP 3" block="STRIP" code="strip_C" /> <animation id="STRIP 4" block="STRIP" code="strip_D" /> <animation id="STRIP 5" block="STRIP" code="strip_E" /> <animation id="STRIP 6" block="STRIP" code="strip_F" /> <animation id="STRIP 7" block="STRIP" code="strip_G" /> <animation id="Dança 1" block="DANCING" code="bd_clap" /> <animation id="Dança 2" block="DANCING" code="bd_clap1" /> <animation id="Dança 3" block="DANCING" code="Dança_loop" /> <animation id="Dança 4" block="DANCING" code="DAN_Down_A" /> <animation id="Dança 5" block="DANCING" code="DAN_Left_A" /> <animation id="Dança 6" block="DANCING" code="DAN_Loop_A" /> <animation id="Dança 7" block="DANCING" code="DAN_Right_A" /> <animation id="Dança 8" block="DANCING" code="DAN_Up_A" /> <animation id="Dança 9" block="DANCING" code="dnce_M_a" /> <animation id="Dança 10" block="DANCING" code="dnce_M_b" /> <animation id="Dança 11" block="DANCING" code="dnce_M_c" /> <animation id="Dança 12" block="DANCING" code="dnce_M_d" /> <animation id="Dança 13" block="DANCING" code="dnce_M_e" /> </animationCategory> <animationCategory id="Sentar"> <animation id="Sentar 1" block="BEACH" code="bather" /> <animation id="Sentar 2" block="BEACH" code="Lay_Bac_Loop" /> <animation id="Sentar 3" block="BEACH" code="ParkSentar_M_loop" /> <animation id="Sentar 4" block="BEACH" code="ParkSentar_W_loop" /> <animation id="Sentar 5" block="BEACH" code="SentarnWait_loop_W" /> </animationCategory> <animationCategory id="Engraçadas"> <animation id="Dormir" block="CRACK" code="crckidle2" /> <animation id=":O" block="ped" code=":Ou" /> <animation id="Falar" block="GANGS" code="prtial_gngtlkC" /> <animation id="Falando Cel." block="ped" code="phone_talk" /> <animation id="Crack 1" block="CRACK" code="crckidle1" /> <animation id="Crack 2" block="CRACK" code="crckidle3" /> <animation id="Crack 3" block="CRACK" code="crckidle4" /> </animationCategory> <animationCategory id="Outros"> <animation id="Outras 01" block="TEC" code="TEC_fire" /> <animation id="Outras 2" block="WUZI" code="CS_Dead_guy" /> <animation id="Outras 3" block="RYDER" code="RYD_Die_PT2" /> <animation id="Outras 4" block="SWORD" code="sword_IDLE" /> <animation id="Outras 5" block="SUNBATHE" code="ParkSentar_M_IdleA" /> <animation id="Outras 6" block="STRIP" code="STR_B2C" /> <animation id="Outras 7" block="BD_FIRE" code="M_smklean_loop" /> </animationCategory> <animationCategory id="NOVOS"> <animation id="Parkour 5" block="parkour" code="BckHndSpingBTuck" /> <animation id="Parkour 4" block="parkour" code="BckHndSping" /> <animation id="BckHndSpingBTuck" block="parkour" code="CartWheel" /> <animation id="BckHndSpingBTuck" block="parkour" code="FrntHndSpring" /> </animationCategory> </map> cliente -- parte da função das animações -------------------------------------animation----------------- function makeAnimationGUI() local x,y = guiGetScreenSize () animationWindow = guiCreateWindow(x/2-345/2, y/2-388/2, 345, 388,"Animições",false) guiSetVisible(animationWindow,false) guiSetAlpha(animationWindow, 0.87) animationCategoryList = guiCreateGridList(10, 34, 157, 251,false,animationWindow) animationList = guiCreateGridList(177, 34, 157, 251,false,animationWindow) column1 = guiGridListAddColumn(animationCategoryList,"Categoria",0.8) column2 = guiGridListAddColumn(animationList,"Animação",0.8) stopButton = guiCreateButton(10, 327, 133, 46,"Parar",false,animationWindow) backAnimation = guiCreateButton(204, 327, 131, 46, "Voltar", false, animationWindow) addEventHandler("onClientGUIClick",stopButton,PararAn) for k, v in ipairs (getElementsByType("animationCategory")) do local row = guiGridListAddRow(animationCategoryList) guiGridListSetItemText(animationCategoryList,row,column1,getElementID(v),false,false) end addEventHandler("onClientGUIClick",animationCategoryList,getAnimations) addEventHandler("onClientGUIClick",animationList,setAnimation) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),makeAnimationGUI) function PararAn() triggerServerEvent("setAnimationNil", localPlayer) end function getAnimations() selectedCategory = guiGridListGetItemText(animationCategoryList,guiGridListGetSelectedItem(animationCategoryList),1) if (selectedCategory ~= "") then guiGridListClear(animationList) for k, v in ipairs (getElementChildren(getElementByID(selectedCategory))) do local row = guiGridListAddRow(animationList) guiGridListSetItemText(animationList,row,column1,getElementID(v),false,false) end end if (selectedCategory == "") then guiGridListClear(animationList) end end
-
Olá estou com problemas com este script, ele mostra a lista dos carros na garagem como desconhecido e com placa fria, assim não podendo guarda los, não sei dizer se é conflito com os veículos dos empregos, como posso concertar isso ? OBS: SCRIPT PUBLICO. Cliente Side local customCarNames = { {401, "Chevette"}, {405, "GolG4"}, {551, "UnoFire"}, {479, "GolG5"}, {545, "Fusca"}, {585, "Sonata"}, {445, "AudiRS6"}, {415, "FerrariScuderia"}, {586, "TITAN160"}, {522, "S1000"}, } function getVehicleRealName(model) for k, v in ipairs(customCarNames) do if v[1] == model then return v[2] end end return "Desconhecido" end local odimension = getElementDimension(localPlayer) local ointerior = getElementInterior(localPlayer) local screenSize = {guiGetScreenSize()} screenSize.x, screenSize.y = screenSize[1], screenSize[2] local myScreenSource = dxCreateScreenSource(screenSize.x, screenSize.y) function infoSound(file) playSound("files/sounds/"..file..".mp3") end function isCursorHover(startX, startY, sizeX, sizeY) if isCursorShowing() then local cursorPosition = {getCursorPosition()} cursorPosition.x, cursorPosition.y = cursorPosition[1] * screenSize.x, cursorPosition[2] * screenSize.y if cursorPosition.x >= startX and cursorPosition.x <= startX + sizeX and cursorPosition.y >= startY and cursorPosition.y <= startY + sizeY then return true else return false end else return false end end local dashboardOpened = false local dutyskinOpened = false local width, height = 800, 450 local startX, startY = (screenSize.x - width) / 2 , (screenSize.y - height) / 2 local bgColor = tocolor(0, 0, 0, 180) local slotColor = tocolor(40, 40, 40, 200) local hoverColor = tocolor(154, 205, 50, 180) local secondColor = tocolor(154, 205, 50, 180) local cancelColor = tocolor(243, 85, 85, 180) local spacer = 2 local spacerBig = 5 local roboto = dxCreateFont("files/fonts/Roboto.ttf", 8, false, "proof") local robotoBold = dxCreateFont("files/fonts/Roboto.ttf", 10, true, "proof") local robotoBig = dxCreateFont("files/fonts/Roboto.ttf", 11, false, "proof") local robotoBig2 = dxCreateFont("files/fonts/Roboto.ttf", 10, false, "proof") local robotoGui = guiCreateFont("files/fonts/Roboto.ttf", 9) local menuPoints = {{"Propriedade", "property"}} local menuPointsWidth = (width - (#menuPoints - 1) * spacerBig) / #menuPoints local playerInfos = {} local optionsText = {"Ativado"} optionsText[0] = "Desligado" local changeTips = {"Desligar"} changeTips[0] = "Ligar" local vehicleTuningDatas = {{"engine", "Motor"}, {"turbo", "turbo"}, {"gearbox", "projeto de lei"}, {"ecu", "Ecu"}, {"pneus", "goma"}, {"brakes", "freio"}} local vehicleTunings = {"#999999Não", "#acd737Rua", "#ffcc00Profissional", "#ff6600Competição", "#ff1a1aEngrenagem" , "#ff1a1aEngrenagem"} vehicleTunings[0] = "#999999não" local optionsCreateColor = "" local optionsCreateText = "" local maxdistance = 0 local groupMembers = {} local groupVehicles = {} local meInGroup = {} local admins = {} local openedTick = getTickCount() - 2000 parkYerleri = {} park = dxCreateTexture("parking.png") parkYerleri = createMarker(1457.3518066406, -1783.7336425781, 13.546875-0.95, "cylinder", 2, 0, 176, 196, 10 ) parkYerleri2 = createMarker(1925.9207763672,-1857.4606933594,13.90625-0.95, "cylinder", 2, 0, 176, 196, 10 ) parkYerleri3 = createMarker(-2234.9548339844,2357.5026855469,5-0.95, "cylinder", 2, 0, 176, 196, 10 ) parkYerleri4 = createMarker(1782.6097412109,-1098.3834228516,24.078125-0.95, "cylinder", 2, 0, 176, 196, 10 ) parkYerleri5 = createMarker(2544.34, 2880.475, 104.769-0.95, "cylinder", 2, 0, 176, 196, 10 ) parkYerleri6 = createMarker(2133.725, 1441.048, 10.82-0.95, "cylinder", 2, 0, 176, 196, 10 ) local myBlip = createBlipAttachedTo ( parkYerleri, 55 ) local myBlip2 = createBlipAttachedTo ( parkYerleri2, 55 ) local myBlip3 = createBlipAttachedTo ( parkYerleri3, 55 ) local myBlip4 = createBlipAttachedTo ( parkYerleri4, 55 ) local myBlip5 = createBlipAttachedTo ( parkYerleri5, 55 ) local myBlip6 = createBlipAttachedTo ( parkYerleri6, 55 ) function parkYeri() _3DResim(parkYerleri,park); _3DResim(parkYerleri2,park); _3DResim(parkYerleri3,park); _3DResim(parkYerleri4,park); _3DResim(parkYerleri5,park); _3DResim(parkYerleri6,park); end addEventHandler("onClientRender", getRootElement(), parkYeri) addEventHandler( "onClientMarkerHit", parkYerleri6, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then currentPage = 1 dashboardOpened = true openedTick = getTickCount() getMyVehicles() maxVehicleRows = 9 currentVehicleRow = 1 lastVehicleRow = 1 selectedVehicle = 1 end end ) addEventHandler( "onClientMarkerLeave", parkYerleri6, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then dashboardOpened = false end end ) addEventHandler( "onClientMarkerHit", parkYerleri5, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then currentPage = 1 dashboardOpened = true openedTick = getTickCount() getMyVehicles() maxVehicleRows = 9 currentVehicleRow = 1 lastVehicleRow = 1 selectedVehicle = 1 end end ) addEventHandler( "onClientMarkerLeave", parkYerleri5, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then dashboardOpened = false end end ) addEventHandler( "onClientMarkerHit", parkYerleri4, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then currentPage = 1 dashboardOpened = true openedTick = getTickCount() getMyVehicles() maxVehicleRows = 9 currentVehicleRow = 1 lastVehicleRow = 1 selectedVehicle = 1 end end ) addEventHandler( "onClientMarkerLeave", parkYerleri4, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then dashboardOpened = false end end ) addEventHandler( "onClientMarkerHit", parkYerleri3, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then currentPage = 1 dashboardOpened = true openedTick = getTickCount() getMyVehicles() maxVehicleRows = 9 currentVehicleRow = 1 lastVehicleRow = 1 selectedVehicle = 1 end end ) addEventHandler( "onClientMarkerLeave", parkYerleri3, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then dashboardOpened = false end end ) addEventHandler( "onClientMarkerHit", parkYerleri2, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then currentPage = 1 dashboardOpened = true openedTick = getTickCount() getMyVehicles() maxVehicleRows = 9 currentVehicleRow = 1 lastVehicleRow = 1 selectedVehicle = 1 end end ) addEventHandler( "onClientMarkerLeave", parkYerleri2, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then dashboardOpened = false end end ) addEventHandler( "onClientMarkerHit", parkYerleri, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then currentPage = 1 dashboardOpened = true openedTick = getTickCount() getMyVehicles() maxVehicleRows = 9 currentVehicleRow = 1 lastVehicleRow = 1 selectedVehicle = 1 end end ) addEventHandler( "onClientMarkerLeave", parkYerleri, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then dashboardOpened = false end end ) addEventHandler("onClientDoubleClick", root, function(button) if button == "left" and dashboardOpened and currentPage == 1 then local selectedVehicleToGps = false lastVehicleRow = currentVehicleRow + maxVehicleRows - 1 for key, value in ipairs(myVehicles) do if key >= currentVehicleRow and key <= lastVehicleRow then key = key - currentVehicleRow + 1 local forY = startY + 2 * spacerBig + 30 + spacer + (key - 1) * 22 if isCursorHover(startX + 2 * spacerBig + spacer, forY, width / 2 - 4 * spacerBig - 2 * spacer, 20) then selectedVehicleToGps = key + currentVehicleRow - 1 end end end if tonumber(selectedVehicleToGps) then triggerServerEvent("updateINTDIM2", localPlayer, getElementData(myVehicles[selectedVehicleToGps], "ID")) gpsVehicle("gps", getElementData(myVehicles[selectedVehicleToGps], "ID")) end end end ) function gpsVehicle(commandName, vehicleId) if not vehicleId then outputChatBox("#9ACD32[BOT] #ffffffVocê não pode guardar um veículo com placa fria.",0,0,0,true) return end if vehicleId then for index, value in ipairs (getElementsByType("vehicle")) do if getElementData(value, "ID") == tonumber(vehicleId) then if not getElementData(value, "ownercar") == getElementData(localPlayer, "ID") then outputChatBox("#9ACD32[BOT] #ffffffVocê não é o dono do veículo!",0,0,0,true) return end local counter = 0 for seat, player in pairs(getVehicleOccupants(value)) do counter = counter + 1 end if counter > 0 then outputChatBox("#9ACD32[BOT] #ffffffNão pode guardar com um ocupante.",0,0,0,true) return end if (getElementDimension(value) == 0) then setElementData(value,"veiculo.garagem", true) triggerServerEvent("guardar", localPlayer, vehicleId) return end if (getElementData(value, "detranAP")) then outputChatBox("#9ACD32[BOT] #ffffffSeu veiculo está no detran!",0,0,0,true) triggerServerEvent("updateINTDIM22", localPlayer, vehicleId) else triggerServerEvent("updateINTDIM2", localPlayer, vehicleId) outputChatBox("#9ACD32[BOT] #ffffffVeiculo retirado.",0,0,0,true) setElementData(value,"veiculo.garagem", false) end end end end end addEventHandler("onClientKey", root, function(button, pressed) if pressed and getElementData(localPlayer, "CharLoggedIn") then --if button == "F4" then --changeState() --cancelEvent() --end if dashboardOpened then if currentPage == 1 then if isCursorHover(startX + 2 * spacerBig, startY + 2 * spacerBig + 30, width / 2 - 4 * spacerBig, maxVehicleRows * 22 + spacer) then if button == "mouse_wheel_down" then if currentVehicleRow < #myVehicles - (maxVehicleRows - 1) then currentVehicleRow = currentVehicleRow + 1 end elseif button == "mouse_wheel_up" then if currentVehicleRow > 1 then currentVehicleRow = currentVehicleRow - 1 end elseif button == "mouse1" then lastVehicleRow = currentVehicleRow + maxVehicleRows - 1 for key, value in ipairs(myVehicles) do if key >= currentVehicleRow and key <= lastVehicleRow then key = key - currentVehicleRow + 1 local forY = startY + 2 * spacerBig + 30 + spacer + (key - 1) * 22 if isCursorHover(startX + 2 * spacerBig + spacer, forY, width / 2 - 4 * spacerBig - 2 * spacer, 20) then selectedVehicle = key + currentVehicleRow - 1 end end end end end end end end end ) addEventHandler("onClientElementDataChange", root, function(dataName, oldValue) if source and getElementType(source) == "player" then if source == localPlayer then if dataName == "char:vehSlot" then getMyVehicles() end end end end) function thousandsStepper(amount) local formatted = amount 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 getMyVehicles() myVehicles = {} for key, value in ipairs(getElementsByType("vehicle")) do if value then table.insert(myVehicles, value) end end vehicleInfos = {"Garagem"} vehicleInfos2 = {"Clique duas vezes no veiculo para retirar/guardar"} end addEventHandler("onClientRender", root, function() if dashboardOpened then --if isChatVisible() then showChat(false) end if getElementData(localPlayer, "toggle-->All") then setElementData(localPlayer, "toggle-->All", false) end --dxDrawRectangle(startX, startY, width, height, bgColor) if currentPage == 1 then --- Vehicles local sizeX = ((width / 2 - 4 * spacerBig) - 2 * spacerBig) / 3 local key = 0 dxDrawText(vehicleInfos[key + 1], startX + 55 * spacerBig + key * (sizeX + spacerBig), startY + 5 * spacerBig, startX + 2 * spacerBig + key * (sizeX + spacerBig) + sizeX, startY + 2 * spacerBig + 30 - spacerBig, tocolor(255, 255, 255), 1, robotoBig, "center", "center") dxDrawText(vehicleInfos2[key + 1], startX + 55 * spacerBig + key * (sizeX + spacerBig), startY + 94 * spacerBig, startX + 2 * spacerBig + key * (sizeX + spacerBig) + sizeX, startY + 2 * spacerBig + 30 - spacerBig, tocolor(255, 255, 255), 1, robotoBig2, "center", "center") dxDrawRectangle(startX + 2 * spacerBig, startY + 2 * spacerBig + 30, width / 2 - 4 * spacerBig, maxVehicleRows * 22 + spacer, bgColor) if #myVehicles > 0 then for key = 0, maxVehicleRows - 1 do local forY = startY + 2 * spacerBig + 30 + spacer + key * 22 dxDrawRectangle(startX + 2 * spacerBig + spacer, forY, width / 2 - 4 * spacerBig - 2 * spacer, 20, slotColor) if isCursorHover(startX + 2 * spacerBig + spacer, forY, width / 2 - 4 * spacerBig - 2 * spacer, 20) or key == selectedVehicle - currentVehicleRow then dxDrawRectangle(startX + 2 * spacerBig + spacer, forY, width / 2 - 4 * spacerBig - 2 * spacer, 20, hoverColor) end end lastVehicleRow = currentVehicleRow + maxVehicleRows - 1 for key, value in ipairs(myVehicles) do if key >= currentVehicleRow and key <= lastVehicleRow then key = key - currentVehicleRow + 1 local forY = startY + 2 * spacerBig + 30 + spacer + (key - 1) * 22 local statusv = getElementData(localPlayer,"veiculo.garagem", true) local modelo = getElementModel(value) dxDrawText(getVehicleRealName(modelo), startX + 3 * spacerBig + spacer, forY, startX + 3 * spacerBig + spacer + width / 2 - 4 * spacerBig - 2 * spacer, forY + 20, tocolor(255, 255, 255), 1, roboto, "left", "center") dxDrawText("Status: "..math.floor(getElementHealth(value) / 10 + 0.5).."%", startX + 2 * spacerBig + spacer, forY, startX + 2 * spacerBig + spacer + width / 2 - 5 * spacerBig - 2 * spacer, forY + 20, tocolor(255, 255, 255), 1, roboto, "right", "center") if isCursorHover(startX + 2 * spacerBig + spacer, forY, width / 2 - 4 * spacerBig - 2 * spacer, 20) or key == selectedVehicle - currentVehicleRow + 1 then dxDrawText(getVehicleRealName(modelo), startX + 3 * spacerBig + spacer, forY, startX + 3 * spacerBig + spacer + width / 2 - 4 * spacerBig - 2 * spacer, forY + 20, tocolor(0, 0, 0), 1, roboto, "left", "center") dxDrawText("Status: "..math.floor(getElementHealth(value) / 10 + 0.5).."%", startX + 2 * spacerBig + spacer, forY, startX + 2 * spacerBig + spacer + width / 2 - 5 * spacerBig - 2 * spacer, forY + 20, tocolor(0, 0, 0), 1, roboto, "right", "center") end end end else dxDrawText("Nenhum veiculo", startX + 2 * spacerBig + spacerBig, startY + 2 * spacerBig + 30, startX + 2 * spacerBig + spacerBig + width / 2 - 4 * spacerBig, startY + 2 * spacerBig + 30 + maxVehicleRows * 22 + spacer, cancelColor, 1, robotoBig, "center", "center") end local rightSx = startX + 390 + 4 * spacerBig end end end) function dxDrawButton(text, startX, startY, width, height, color) dxDrawRectangle(startX - 1, startY, 1, height, bgColor) --left dxDrawRectangle(startX + width, startY, 1, height, bgColor) --right dxDrawRectangle(startX - 1, startY - 1, width + 2, 1, bgColor) --top dxDrawRectangle(startX - 1, startY + height, width + 2, 1, bgColor) --bottom dxDrawRectangle(startX, startY, width, height, color) dxDrawText(text, startX, startY, startX + width, startY + height, tocolor(255, 255, 255), 1, roboto, "center", "center", false, false, false, true) end function dxDrawEdit(startX, startY, width, height, element) dxDrawRectangle(startX - 1, startY, 1, height, bgColor) --left dxDrawRectangle(startX + width, startY, 1, height, bgColor) --right dxDrawRectangle(startX - 1, startY - 1, width + 2, 1, bgColor) --top dxDrawRectangle(startX - 1, startY + height, width + 2, 1, bgColor) --bottom dxDrawRectangle(startX, startY, width, height, slotColor) dxDrawText(guiGetText(element), startX + 4, startY, startX + width, startY + height, tocolor(255, 255, 255), 1, roboto, "left", "center") end function _3DResim(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 2 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) 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 dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end function dxDrawOctagon3D(x, y, z, radius, width, color) if type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" then return false end local radius = radius or 1 local radius2 = radius/math.sqrt(2) local width = width or 1 local color = color or tocolor(255,255,255,150) point = {} for i=1,8 do point[i] = {} end point[1].x = x point[1].y = y-radius point[2].x = x+radius2 point[2].y = y-radius2 point[3].x = x+radius point[3].y = y point[4].x = x+radius2 point[4].y = y+radius2 point[5].x = x point[5].y = y+radius point[6].x = x-radius2 point[6].y = y+radius2 point[7].x = x-radius point[7].y = y point[8].x = x-radius2 point[8].y = y-radius2 for i=1,8 do if i ~= 8 then x, y, z, x2, y2, z2 = point[i].x,point[i].y,z,point[i+1].x,point[i+1].y,z else x, y, z, x2, y2, z2 = point[i].x,point[i].y,z,point[1].x,point[1].y,z end dxDrawLine3D(x, y, z, x2, y2, z2, color, width) end return true end
-
Onde incrementar estes comandos ? eu apenas edito algumas coisas, tipo esse script tem uma database.db, separada da garagem, e não sei se tenho que criar uma para ela também.
-
O problema é que os carros não estão salvando após fechar o servidor, não sei o que está faltando.
-
Deu certo obrigado.
-
Olá, acabei descobrindo que esse script funciona com database externa, e gostaria de mudar isso, alguém pode me mentorear ? local customCarNames = { {585, ""}, {401, ""}, {545, ""}, {479, ""}, {529, ""}, {551, ""}, {405, ""}, {415, ""}, {445, ""}, {527, ""}, {468, ""}, {586, ""}, {581, ""}, {462, ""}, {522, ""}, {521, ""}, {461, ""}, } function getVehicleRealName(model) for k, v in ipairs(customCarNames) do if v[1] == model then return v[2] end end return "Desconhecido" end shopsVehSpawns = { [1] = { 2131, -1133, 25.6, 0,0,359 }, [2] = { 555, -1278, 18, 0,0,100 }, [3] = { 1941, 2097, 10.8, 0,0,350 }, [4] = { -1988, 272, 36, 0,0,259 }, [5] = { -1642, 1213, 7.17, 0,0, 227 }, } function getFreeID() local result = dbPoll(dbQuery(db, "SELECT ID FROM VehicleList ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then newID = i break end end if newID then return newID else return #result + 1 end end function getFreePlate(vehicle, NewID, source) local str = "ABCDEFGHIJKLMNPQRSTUVXWYZ" local plate = "" for index = 1, 3 do plate = plate .. string.char(str:byte(math.random(1, #str))) end plate = string.upper(plate) plate = plate .. "" for index = 1, 1 do plate = plate .. math.random(1, 9) end for index = 1, 1 do plate = plate .. string.char(str:byte(math.random(1, #str))) end for index = 1, 2 do plate = plate .. math.random(1, 9) end setVehiclePlateText(vehicle, plate) setElementData(vehicle,"Placa",plate) dbExec(db, "UPDATE VehicleList SET Placa=? WHERE Account=? AND ID=?", plate, getAccountID(getPlayerAccount(source)),tonumber(NewID)) end function getFreePlate2(source) local theVehicle = getPedOccupiedVehicle ( source ) if theVehicle then local str = "ABCDEFGHIJKLMNPQRSTUVXWYZ" local plate = "" for index = 1, 3 do plate = plate .. string.char(str:byte(math.random(1, #str))) end plate = string.upper(plate) plate = plate .. "" for index = 1, 1 do plate = plate .. math.random(1, 9) end for index = 1, 1 do plate = plate .. string.char(str:byte(math.random(1, #str))) end for index = 1, 2 do plate = plate .. math.random(1, 9) end setVehiclePlateText(theVehicle, plate) end end addEventHandler("onVehicleEnter",getRootElement(), getFreePlate2) function getVehicleByID(id) v = false for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "ID") == id then v = veh break end end return v end function getVehicleByPlate(Placa) v = false for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "Placa") == Placa then v = veh break end end return v end function updateVehicleInfo(player) if isElement(player) then local result = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountID(getPlayerAccount(player))), -1) if type(result) == "table" then setElementData(player, "VehicleInfo", result) end end end addEventHandler("onResourceStart", resourceRoot, function() db = dbConnect("sqlite", "database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS VehicleList (ID, Placa, Account, Model, X, Y, Z, RotZ, Colors, Upgrades, Paintjob, Cost, HP, new_hydr)") for i, player in ipairs(getElementsByType("player")) do updateVehicleInfo(player) end end) addEvent("onOpenGui", true) addEventHandler("onOpenGui", root, function() updateVehicleInfo(source) end) addEvent("onBuyNewVehicle", true) addEventHandler("onBuyNewVehicle", root, function(Model, cost, r1, g1, b1, r2, g2, b2) abc = false local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountID(getPlayerAccount(source))), -1) for i, data in ipairs (data) do if data["Model"] == Model then abc = true break end end if #data >= 20 then outputMessage("#838B83[#FFFF00BcV#838B83]#FFFF00 Voce Pode Comprar Apenas 20 Veiculos.", source, 38, 122, 216, true) return end if abc then outputMessage("#c1c1c1Você já tem este veiculo.", source, 38, 122, 216, true) return end if getPlayerMoney(source) >= tonumber(cost) then takePlayerMoney ( source, cost ) local x, y, z = getElementPosition(source) local _, _, rz = getElementRotation(source) local shopID = getElementData ( source, "atVehShop") local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 if shopID and shopsVehSpawns[shopID] then vehicle = createVehicle(Model, shopsVehSpawns[shopID][1], shopsVehSpawns[shopID][2], shopsVehSpawns[shopID][3], shopsVehSpawns[shopID][4], shopsVehSpawns[shopID][5], shopsVehSpawns[shopID][6]) else vehicle = createVehicle(Model, x-5, y+5, z, 0, 0, rz) end setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) setElementData(vehicle, "Owner", source) local NewID = getFreeID() setElementData(vehicle, "ID", NewID) local NewPlate = getFreePlate(vehicle,NewID, source) local Placa = getElementData(vehicle,"Placa") dbExec(db, "INSERT INTO VehicleList VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", NewID, Placa, getAccountID(getPlayerAccount(source)), Model, x-5, y+5, z, rz, color, "", 3, cost, 1000, 0) outputMessage("#c1c1c1Por: #00FF66$"..cost, source, 38, 122, 216, true) updateVehicleInfo(source) setElementData(vehicle, "ownercar", getAccountID(getPlayerAccount(source))) warpPedIntoVehicle ( source, vehicle ) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 150, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountID(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) else outputMessage("#838B83[#FFFF00BcV#838B83]#FFFF00 Voce Não Tem Dinheiro Pra Comprar Esse Veiculo", source, 38, 122, 216, true) end end) vv = {} addEvent("SpawnMyVehicle", true) addEventHandler("SpawnMyVehicle", root, function(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountID(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then if getVehicleByID(id) then outputMessage("#c1c1c1O seu veiculo #00FF66"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1já está spawnado.", source, 38, 122, 216, true) else local color = split(data[1]["Colors"], ',') r1 = color[1] or 255 g1 = color[2] or 255 b1 = color[3] or 255 r2 = color[4] or 255 g2 = color[5] or 255 b2 = color[6] or 255 vehicle = createVehicle(data[1]["Model"], data[1]["X"], data[1]["Y"], data[1]["Z"], 0, 0, data[1]["RotZ"]) setElementData(vehicle, "ID", id) local upd = split(tostring(data[1]["Upgrades"]), ',') for i, upgrade in ipairs(upd) do addVehicleUpgrade(vehicle, upgrade) end local Paintjob = data[1]["Paintjob"] or 3 setVehiclePaintjob(vehicle, Paintjob) setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) if tonumber(data[1]["HP"]) <= 255.5 then data[1]["HP"] = 255 end if data[1]["new_hydr"] and data[1]["new_hydr"] == 1 then setElementData(vehicle, "NewHydr", true) else setElementData(vehicle, "NewHydr", false) end setElementData(vehicle, "ownercar", getAccountID(getPlayerAccount(source))) Placa = data[1]["Placa"] setElementData(vehicle, "Placa",Placa) setElementHealth(vehicle, data[1]["HP"]) setElementData(vehicle, "Owner", source) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 50, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountID(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) outputMessage("#c1c1c1O seu veiculo #00FF66"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi spawnado.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1Há um problema com o veiculo, notifique o administrador.", source, 38, 122, 216, true) end end) addEvent("DestroyMyVehicle", true) addEventHandler("DestroyMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountID(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then destroyVehicle(vehicle) outputMessage ("#c1c1c1O seu veiculo #00FF66"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi removido.", source, 38, 122, 216, true) else outputMessage("#c1c1c1Selecione um veiculo.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("LightsMyVehicle", true) addEventHandler("LightsMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local Vehicle = getPedOccupiedVehicle(source) if Vehicle == vehicle then if getVehicleOverrideLights(vehicle) ~= 2 then setVehicleOverrideLights(vehicle, 2) outputMessage("#c1c1c1Seu veiculo #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1teve as luzes acesas.", source, 38, 122, 216, true) elseif getVehicleOverrideLights(vehicle) ~= 1 then setVehicleOverrideLights(vehicle, 1) outputMessage("#c1c1c1Seu veiculo #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1teve as luzes apagadas.", source, 38, 122, 216, true) end else outputMessage("#838B83[#FFFF00ATRP#838B83]#FFFF00 Voce Não Está no Veiculo!", source, 38, 122, 216, true) end else outputMessage("#838B83[#FFFF00ATRP#838B83]#FFFF00 Seu Veiculo Não Está Spawnado", source, 38, 122, 216, true) end end) addEvent("LockMyVehicle", true) addEventHandler("LockMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then if not isVehicleLocked(vehicle) then setVehicleLocked(vehicle, true) setVehicleDoorsUndamageable(vehicle, true) setVehicleDoorState(vehicle, 0, 0) setVehicleDoorState(vehicle, 1, 0) setVehicleDoorState(vehicle, 2, 0) setVehicleDoorState(vehicle, 3, 0) outputMessage("#c1c1c1O seu transporte #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi #00FF66fechado.", source, 38, 122, 216, true) elseif isVehicleLocked(vehicle) then setVehicleLocked(vehicle, false) setVehicleDoorsUndamageable(vehicle, false) outputMessage("#c1c1c1O seu transporte #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi #00FF66aberto.", source, 38, 122, 216, true) end else outputMessage("#838B83[#FFFF00ATRP#838B83]#FFFF00 Seu Veiculo Não Foi Spawnado", source, 38, 122, 216, true) end end) addEvent("BlipMyVehicle", true) addEventHandler("BlipMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then if not getElementData(vehicle, "ABlip") then setElementData(vehicle, "ABlip", true) createBlipAttachedTo(vehicle, 41, 2, 255, 0, 0, 255, 0, 65535, source) outputChatBox("#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Seu veículo Foi Marcado no Mapa, Aperte F11 Pra Encontra-lo.", source, 38, 122, 216, true) else local attached = getAttachedElements(vehicle) if (attached) then for k,element in ipairs(attached) do if getElementType(element) == "blip" then destroyElement(element) end end end setElementData(vehicle, "ABlip", false) outputChatBox("#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Seu veículo Foi Desmarcado do Mapa.", source, 38, 122, 216, true) end else outputChatBox("#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Seu Veiculo Não foi Spawnado.", source, 38, 122, 216, true) end end) addEvent("FixMyVehicle", true) addEventHandler("FixMyVehicle", root, function(id) if getPlayerMoney(source) >= tonumber(500) then takePlayerMoney ( source, 500 ) local vehicle = getVehicleByID(id) if isElement(vehicle) then fixVehicle(vehicle) setVehicleEngineState(vehicle, true) if isVehicleDamageProof(vehicle) then setVehicleDamageProof(vehicle, false) end end dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND ID = ?", 1000, getAccountID(getPlayerAccount(source)), id) updateVehicleInfo(source) outputMessage ("#c1c1c1O seu transporte foi reparado.", source, 38, 122, 216, true) else outputMessage("#c1c1c1Você não tem dinheiro suficiente para reparar.", source, 38, 122, 216, true) outputMessage("#c1c1c1Preço: #00FF66$500.", source, 38, 122, 216, true) end end) addEvent("WarpMyVehicle", true) addEventHandler("WarpMyVehicle", root, function(id) if not isPedInVehicle (source) then if getElementInterior(source) == 0 then if getPlayerMoney(source) >= tonumber(500) then local vehicle = getVehicleByID(id) if isElement(vehicle) then takePlayerMoney ( source, 500 ) local x, y, z = getElementPosition(source) setElementPosition(vehicle, x, y, z) warpPedIntoVehicle ( source, vehicle ) outputMessage ("#c1c1c1O seu veiculo #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi entregue a você.", source, 38, 122, 216, true) else outputMessage("#838B83[#FFFF00ATRP#838B83]#FFFF00 Seu Veiculo Não Está Spawnado.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1Você não tem os meios de se teletransportar para o veiculo.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1Você só poderá mudar de veiculo se sair do atual.", source, 38, 122, 216, true) end else outputMessage("#838B83[#FFFF00ATRP#838B83]#FFFF00 Nós não podemos dirigir seu veiculo. Por favor, sair do outro veiculo.", source, 38, 122, 216, true) end end) addEvent("SellMyVehicle", true) addEventHandler("SellMyVehicle", root, function(id) local vehicle = getVehicleByID(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountID(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then local Money = math.ceil((data[1]["Cost"]*.9)*math.floor(data[1]["HP"])/100/10) givePlayerMoney (source, Money) if isElement(vehicle) then destroyElement(vehicle) end dbExec(db, "DELETE FROM VehicleList WHERE Account = ? AND ID = ?", getAccountID(getPlayerAccount(source)), id) updateVehicleInfo(source) outputMessage("#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Voce Vendeu Seu Veiculo por R$:"..Money, source, 38, 122, 216, true) end end) function getDataOnLogin(_, account) updateVehicleInfo(source) end addEventHandler("onPlayerLogin", root, getDataOnLogin) addEvent("inviteToBuyCarSended", true) addEventHandler("inviteToBuyCarSended", root, function(player, price, veh_name, veh_id) if player and price and veh_name and veh_id then local pl = getPlayerFromName ( player ) if pl then triggerClientEvent ( pl, "recieveInviteToBuyCar", pl, getPlayerName (source), getAccountID(getPlayerAccount(source)), price, veh_name, veh_id ) else outputMessage ( "#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Jogador Não Encontrado", source, 250, 10, 10, true) triggerClientEvent ( source, "cleanCarInvitations", source ) end end end) addEvent("invitationBuyCarNotAccepted", true) addEventHandler("invitationBuyCarNotAccepted", root, function(player, acc, price, veh_name, veh_id) local pl = getPlayerFromName ( player ) if pl then triggerClientEvent ( pl, "cleanCarInvitations", pl ) outputMessage ( "#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 o Jogador Recusou a Oferta", pl, 250, 10, 10,true) end end) addEvent("invitationBuyCarAccepted", true) addEventHandler("invitationBuyCarAccepted", root, function(player, acc, price, veh_name, veh_id) local pl = getPlayerFromName ( player ) local avail = false if pl and getAccountID ( getPlayerAccount (pl)) == acc then avail = true triggerClientEvent ( pl, "cleanCarInvitations", pl ) --outputMessage ( "Игрок отказался покупать ваше авто", pl, 250, 10, 10) else for i, v in ipairs( getElementsByType ( 'player' ) ) do if getAccountID(getPlayerAccount ( v )) == acc then avail = true pl = v break end end end price = tonumber(price) or 0 if avail then if isGuestAccount ( getPlayerAccount ( source ) ) then triggerClientEvent ( pl, "cleanCarInvitations", pl ) outputMessage ( "#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Voce Não Está Logado em Sua Conta", source, 250, 10, 10,true ) outputMessage ( "#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 o Jogador Não Está Logado", pl, 250, 10, 10,true ) return true end if getPlayerMoney ( source ) >= price then local vehicle = getVehicleByID(tonumber(veh_id)) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountID(getPlayerAccount(pl)), veh_id), -1) if type(data) == "table" and #data ~= 0 and isElement ( vehicle ) then givePlayerMoney ( pl, price ) takePlayerMoney ( source, price ) dbExec(db, "UPDATE VehicleList SET Account = ? WHERE Account = ? AND ID = ?", getAccountID(getPlayerAccount(source)), getAccountID(getPlayerAccount(pl)), veh_id) updateVehicleInfo(source) updateVehicleInfo(pl) setElementData(vehicle, "Owner", source) setElementData(vehicle, "ownercar", getAccountID(getPlayerAccount(source))) outputMessage("#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Voce Vendeu Seu Veiculo Por R$:"..price, pl, 38, 122, 216, true) outputMessage("#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Comprou Um Veiculo Por R$:"..price, source, 38, 122, 216, true) triggerClientEvent ( pl, "cleanCarInvitations", pl ) else outputMessage ( "#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 o Veiculo Não Está Spawnado", source, 250, 10, 10,true ) outputMessage ( "#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 o Veiculo Não Está Spawnado", pl, 250, 10, 10,true ) triggerClientEvent ( pl, "cleanCarInvitations", pl ) end else outputMessage ( "#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Voce Não Tem Dinheiro Suficiente", source, 250, 10, 10,true ) end else outputMessage ( "#838B83[#FFFF00 ATRP#838B83 ]#FFFF00 Jogador Não Encontrado", source, 250, 10, 10,true) end end) function consultarPlaca(source, Command, Placa) local accName = getAccountName(getPlayerAccount(source)) if not isObjectInACLGroup("user."..accName,aclGetGroup("ComandosPolicia")) then return outputChatBox( "Você não tem permissão para este comando.", source, 250, 10, 10,true) end local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Placa = ?", Placa), -1) if not getVehicleByPlate(Placa) then outputChatBox( "Prenda o condutor Imediatamente.#FFFF00 Placa Fria", source, 250, 10, 10,true) return end if type(data) == "table" and #data ~= 0 then local dono = data[1]["Account"] local modelo = data[1]["Model"] outputChatBox( "#FFFF00*________________________*", source, 255,255,255,true) outputChatBox( "#FFFF00*__Banco de Dados DETRAN__*", source, 255,255,255,true) outputChatBox( "Nome Do Veículo:#FFFF00"..getVehicleRealName(modelo), source, 255,255,255,true) outputChatBox( "ID Proprietário:#FFFF00"..dono, source, 255,255,255,true) getnick(tonumber(dono)) outputChatBox( "Placa Consultada:#FFFF00"..Placa, source, 255,255,255,true) outputChatBox( "#FFFF00*________________________*", source, 255,255,255,true) else outputChatBox( "Veículo não spawnado ou inexistente", source, 250, 10, 10,true) end end addCommandHandler("consultar",consultarPlaca) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function getnick(dono) if(dono) then local playerID = tonumber(dono) if(playerID) then local Player2 = getPlayerID(playerID) if(Player2) then outputChatBox ( "Nome do Proprietário:#FFFF00" .. getPlayerName(Player2) .."", player, 255,255,255,true) else outputChatBox ( "Nome do Proprietário( " .. dono .. " ) #ffffffOFFLINE!", player, 255,255,255,true) end end end end function outputMessage (text, player, r, g, b) return exports["scr-Lib"]:outputMessage(player, text, r, g, b); end
-
Estou precisando de ajuda, eu estou tentando editar esse script, para que funcione os comandos com as binds que eu coloquei, más agora está só abrindo o chat local, alguém pode corrigir pra mim ? Script que coloquei as bind: --[[ ################################################ # # # # FACEBOOK.COM/AIRNEWSCR # # # # # ################################################ --]] function getPlayerID(player) return getElementData(player,"ID") end function getPlayerIDG(thePlayer) return getElementData(thePlayer,"ID") end -------------------------------------------------------------------------------------------- DistanciaDoChatLocal = 80 -- Metros ValorDoChatGlobal = 0 -- Dinheiro -------------------------------------------------------------------------------------------- -- Config do Chat Local addEventHandler("onPlayerChat", root, function(tresc, msgtype) if (msgtype == 0) then cancelEvent() local x,y,z = getElementPosition(source) for key, gracze in ipairs(getElementsByType("player")) do local x2,y2,z2 = getElementPosition(gracze) if getElementData (source, "ChatLocal:Delay", true) then outputChatBox ( MensagemFalandoRapidoDemaisLocal, source, 255, 255, 255, true ) return end if ( getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) < DistanciaDoChatLocal ) then local int = getElementInterior ( source ) local dim = getElementDimension ( source ) local int2 = getElementInterior ( gracze ) local dim2 = getElementDimension ( gracze ) if ( int == int2 and dim == dim2 ) then conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #ffffff"..getPlayerName(source).. "[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Administrador" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador3" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador1" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #40E0D0*Vip Simples #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #00FFFF*Vip Avançado #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] "..getPlayerName(source).. "[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) end end end end end setElementData (source, "ChatLocal:Delay",true) setTimer (setElementData, 100, 1, source, "ChatLocal:Delay", false) end) -------------------------------------------------------------------------------------------- -- Config do Chat Global function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if ( isPlayerMuted(thePlayer) ) then outputChatBox ( MensagemVoceEstaMutadoGlobal, thePlayer, 255, 255, 255, true ) return end if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end local money = getPlayerMoney(thePlayer) if (money < ValorDoChatGlobal ) then outputChatBox ( MensagemDinheiroInsuficienteGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Administrador" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador3" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador1" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] "..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff#ffffff"..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay1",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay1", false ) end addCommandHandler ( Global, adminchat ) -------------------------------------------------------------------------------------------- -- Chat Twitter function adminchat2 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador3" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador1" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( Twitter, adminchat2 ) ----------------------------------------------------------- -- Chat olx function adminchat3 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador3" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador1" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( OLX, adminchat3 ) -------------------------------------------------------------- -- Chat Anonimo function adminchat4 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#838b83@Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#838b83@Anónimo: #ffffff: "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#838b83@Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then outputChatBox("#838b83@Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#838b83@Anónimo: #ffffff"..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( Anonimo, adminchat4 ) --------------------------------------------------------------------- function isPlayerOnGroup ( thePlayer ) local account = getPlayerAccount ( thePlayer ) local inGroup = false for _, group in ipairs ( { "Everyone" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then inGroup = true break end end return inGroup end -------------------------------------------------------------------------------------------- addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "i", "down", "chatbox", "Global") bindKey(source, "y", "down", "chatbox", "Twitter") bindKey(source, "o", "down", "chatbox", "OLX") bindKey(source, "u", "down", "chatbox", "Anonimo") end ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(source, "i", "down", "chatbox", "Global") bindKey(source, "y", "down", "chatbox", "Twitter") bindKey(source, "o", "down", "chatbox", "OLX") bindKey(source, "u", "down", "chatbox", "Anonimo") end end ) Script original usado: --[[ ################################################ # # # # # FACEBOOK.COM/AIRNEWSCR # # # # # ################################################ --]] function getPlayerID(player) return getElementData(player,"ID") end function getPlayerIDG(thePlayer) return getElementData(thePlayer,"ID") end -------------------------------------------------------------------------------------------- DistanciaDoChatLocal = 80 -- Metros ComandoDoChatGlobal = "rp" -- Ex /g Mensagem ComandoDoChatGlobal2 = "twitter" -- Ex /g Mensagem ComandoDoChatGlobal3 = "olx" -- Ex /g Mensagem ComandoDoChatGlobal4 = "anonimo" -- Ex /g Mensagem ValorDoChatGlobal = 0 -- Dinheiro -------------------------------------------------------------------------------------------- -- Config do Chat Local addEventHandler("onPlayerChat", root, function(tresc, msgtype) if (msgtype == 0) then cancelEvent() local x,y,z = getElementPosition(source) for key, gracze in ipairs(getElementsByType("player")) do local x2,y2,z2 = getElementPosition(gracze) if getElementData (source, "ChatLocal:Delay", true) then outputChatBox ( MensagemFalandoRapidoDemaisLocal, source, 255, 255, 255, true ) return end if ( getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) < DistanciaDoChatLocal ) then local int = getElementInterior ( source ) local dim = getElementDimension ( source ) local int2 = getElementInterior ( gracze ) local dim2 = getElementDimension ( gracze ) if ( int == int2 and dim == dim2 ) then conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #ffffff"..getPlayerName(source).. "[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Administrador" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador3" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador1" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #40E0D0*Vip Simples #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #00FFFF*Vip Avançado #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[#FFFFFFLocal#ffffff] "..getPlayerName(source).. "[ID:"..getPlayerID(source).."]: #ffffff"..tresc, gracze, 255, 255, 255, true) end end end end end setElementData (source, "ChatLocal:Delay",true) setTimer (setElementData, 100, 1, source, "ChatLocal:Delay", false) end) -------------------------------------------------------------------------------------------- -- Config do Chat Global function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if ( isPlayerMuted(thePlayer) ) then outputChatBox ( MensagemVoceEstaMutadoGlobal, thePlayer, 255, 255, 255, true ) return end if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end local money = getPlayerMoney(thePlayer) if (money < ValorDoChatGlobal ) then outputChatBox ( MensagemDinheiroInsuficienteGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Administrador" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador3" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador1" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] "..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff#ffffff"..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay1",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay1", false ) end addCommandHandler ( ComandoDoChatGlobal, adminchat ) -------------------------------------------------------------------------------------------- -- Chat Twitter function adminchat2 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador3" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador1" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( ComandoDoChatGlobal2, adminchat2 ) ----------------------------------------------------------- -- Chat olx function adminchat3 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador3" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador1" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]: #ffffff"..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( ComandoDoChatGlobal3, adminchat3 ) -------------------------------------------------------------- -- Chat olx function adminchat4 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#838b83@Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#838b83@Anónimo: #ffffff: "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#838b83@Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then outputChatBox("#838b83@Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#838b83@Anónimo: #ffffff"..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( ComandoDoChatGlobal4, adminchat4 ) --------------------------------------------------------------------- function isPlayerOnGroup ( thePlayer ) local account = getPlayerAccount ( thePlayer ) local inGroup = false for _, group in ipairs ( { "Everyone" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then inGroup = true break end end return inGroup end --------------------------------------------------------------------------------------------
-
ok, vou tentar aqui obrigado.
-
Você poderia adicionar ao script para eu ter uma noção, depois tento proceder com o resto do script ? é que sou não tenho muita experiencia ainda eu apenas edito algumas coisas.
-
Eu gostaria de saber como faço para adicionar grupos ACL nestes chat, para poder definir quem é staff pra por tag, e mostrar ID dos jogadores... function MensagemTwitter(source, cmd, ...) local MessagemT = table.concat ( { ... }, " " ) local name = getPlayerName(source); for _,v in ipairs(getElementsByType("player")) do outputChatBox("#00BFFF[ Twitter ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) end end addCommandHandler("Twitter", MensagemTwitter) function MensagemAnon(source, cmd, ...) local MessagemANS = table.concat ( { ... }, " " ); for _,v in ipairs(getElementsByType("player")) do outputChatBox("#ffffff[ #696969 Anônimo #ffffff] #696969"..MessagemANS,v, 255, 255, 255, true) end end addCommandHandler("Ans", MensagemAnon) function MensagemRP(source, cmd, ...) local MessagemFRP = table.concat ( { ... }, " " ); local name = getPlayerName(source); for _,v in ipairs(getElementsByType("player")) do outputChatBox("#000000[ #ffffff Fora RP #000000] "..name.." #ffffff"..MessagemFRP,v, 255, 255, 255, true) end end addCommandHandler("forarp", MensagemRP) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "m", "down", "chatbox", "Twitter") bindKey(source, "n", "down", "chatbox", "Ans") bindKey(source, "i", "down", "chatbox", "forarp") end ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"m", "down", "chatbox", "Twitter") bindKey(player,"n", "down", "chatbox", "Ans") bindKey(player, "i", "down", "chatbox", "forarp") end end )