Search the Community

Showing results for tags 'help'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 621 results

  1. Hello these days i made a pretty beginner handling panel but unfortunately i got stuck as i can't load my handling.who can help please thx [Im noob :(] Script: local hand1 = "#1 Drift" local hand2 = "#2 Drift" local hand3 = "#3 Drift" local hand4 = "#4 Drift" local hand5 = "#5 Drift" local hand6 = "#6 Drift" local hand7 = "#7 Drift" local hand8 = "#8 Drift" local hand9 = "#9 Drift" local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) local Font = dxCreateFont("gfx/Roboto-Condensed.ttf", 13) ---<< Criando a fonte .. cor = {} function PainelDc() --1sor cor[1] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*460, y*320, x*100, y*30) then cor[1] = tocolor(255, 109, 0, 240) end cor[2] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*460, y*370, x*100, y*30) then cor[2] = tocolor(255, 109, 0, 240) end cor[3] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*460, y*420, x*100, y*30) then cor[3] = tocolor(255, 109, 0, 240) end --2sor cor[4] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*580, y*320, x*100, y*30) then cor[4] = tocolor(255, 109, 0, 240) end cor[5] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*580, y*370, x*100, y*30) then cor[5] = tocolor(255, 109, 0, 240) end cor[6] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*580, y*420, x*100, y*30) then cor[6] = tocolor(255, 109, 0, 240) end --3sor cor[7] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*700, y*320, x*100, y*30) then cor[7] = tocolor(255, 109, 0, 240) end cor[8] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*700, y*370, x*100, y*30) then cor[8] = tocolor(255, 109, 0, 240) end cor[9] = tocolor(0, 0, 0, 180) if isCursorOnElement(x*700, y*420, x*100, y*30) then cor[9] = tocolor(255, 109, 0, 240) end dxDrawRectangle(x*450, y*312, x*400, y*150, tocolor(0, 0, 0, 180), false) dxDrawRectangle(x*450, y*290, x*400, y*22, tocolor(255, 109, 0, 240), false) dxDrawText("M.D.SZ - Handling Panel", x*520, y*291, x*800, y*312, tocolor(255, 255, 255, 255), x*0.9, Font, "center", "center", false, false, false, false, false) dxDrawRectangle(x*460, y*320, x*100, y*30, cor[1], false)--gomb 1 dxDrawRectangle(x*460, y*370, x*100, y*30, cor[2], false)--gomb 2 dxDrawRectangle(x*460, y*420, x*100, y*30, cor[3], false)--gomb 3 dxDrawRectangle(x*580, y*320, x*100, y*30, cor[4], false)--gomb 2sor 4 dxDrawRectangle(x*580, y*370, x*100, y*30, cor[5], false)--gomb 2sor 5 dxDrawRectangle(x*580, y*420, x*100, y*30, cor[6], false)--gomb 2sor 6 dxDrawRectangle(x*700, y*320, x*100, y*30, cor[7], false)--gomb 3sor 7 dxDrawRectangle(x*700, y*370, x*100, y*30, cor[8], false)--gomb 3sor 8 dxDrawRectangle(x*700, y*420, x*100, y*30, cor[9], false)--gomb 3sor 9 dxDrawText("#1 Drift", x*200, y*358, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 1 dxDrawText("#2 Drift", x*200, y*460, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 2 dxDrawText("#3 Drift", x*200, y*560, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 3 dxDrawText("#4 Drift", x*445, y*358, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 2sor 1 dxDrawText("#5 Drift", x*445, y*460, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 2sor 1 dxDrawText("#6 Drift", x*445, y*560, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 2sor 1 dxDrawText("#7 Drift", x*690, y*358, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 2sor 1 dxDrawText("#8 Drift", x*690, y*460, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 2sor 1 dxDrawText("#9 Drift", x*690, y*560, x*820, y*312, tocolor(255, 255, 255, 255), x*1.00, Font, "center", "center", false, false, false, true, false)-- kiiras gombra 2sor 1 end Painelstt = false --<<<< Status do painel(PainelDc) function OpenPainel() --<<<<< Todo if significa == se for .. if Painelstt == false then --<<<< Verifica se o painel está fechado e logo após o abre e poe seu status como true(aberto) addEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = true showCursor(true) else --<<<< else(significa o contrario) se não for .. removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) end end addCommandHandler("hpan", OpenPainel) local handlings1 = "1300 2979.7 2 0 0.1 -0.8 70 0.6 0.66 0.66 5 150 25 10 4 p 5 0.66 false 75 0.85 0.15 0 0.15 -0.16 0.5 0 0.37 0 35000 A02800 730000C 1 1 0" --1 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*460, y*320, x*100, y*30) then setVehicleHandling (element "429", string "property", "..handlings1..") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand1.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) --2 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*460, y*370, x*100, y*30) then setClipboard(""..hand2.."") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand2.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) --3 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*460, y*430, x*100, y*30) then setClipboard(""..hand2.."") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand3.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) --4 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*580, y*320, x*100, y*30) then setClipboard(""..hand2.."") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand4.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) --5 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*580, y*370, x*100, y*30) then setClipboard(""..hand2.."") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand5.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) --6 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*580, y*420, x*100, y*30) then setClipboard(""..hand2.."") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand6.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) --7 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*700, y*320, x*100, y*30) then setClipboard(""..hand2.."") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand7.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) --8 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*700, y*370, x*100, y*30) then setClipboard(""..hand2.."") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand8.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) --9 function onClientButtonClick(Button, State) if Painelstt == true and Button == "left" and State == "down" then if isCursorOnElement(x*700, y*420, x*100, y*30) then setClipboard(""..hand2.."") outputChatBox("[#ff8f00Handling - Info#ffffff] #82f9fc"..hand9.." #ffffffHandling betöltve!", 255, 255, 255, true) removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) elseif isCursorOnElement(x*797, y*290, x*23, y*22) then removeEventHandler("onClientRender", getRootElement(), PainelDc) Painelstt = false showCursor(false) else end end end addEventHandler("onClientClick", getRootElement(), onClientButtonClick) function isCursorOnElement( posX, posY, width, height ) --<< Funçao que verifica a posiçao do Cursor (mouse) 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
  2. function SetCorpFT(player) if player and not isGuestAccount(getPlayerAccount(player)) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPECMD")) then setElementData (player,resname..":soucmd", true) setElementData (player,resname..":gerenciar", true) setElementData (player,resname..":promover", true) setElementData (player,resname..":expulsar", true) setElementData (player,resname..":recrutar", true) setElementData (player,resname..":skin1", true) setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":vtr3", true) setElementData (player,resname..":vtr4", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPE6")) then setElementData (player,resname..":gerenciar", true) setElementData (player,resname..":promover", true) setElementData (player,resname..":expulsar", true) setElementData (player,resname..":recrutar", true) setElementData (player,resname..":skin1", true) setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":vtr3", true) setElementData (player,resname..":vtr4", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPE5")) then setElementData (player,resname..":gerenciar", true) setElementData (player,resname..":skin1", true) setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":vtr3", true) setElementData (player,resname..":vtr4", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPE4")) then setElementData (player,resname..":skin1", true) setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":vtr3", true) setElementData (player,resname..":vtr4", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPE3")) then setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPE2")) then setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPE1")) then setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":soumembro", true) return 1 end end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then SetCorpFT(pl) end end end, 10000, 0) function checkskinsBOPE ( ) if ( getElementType ( source ) == "player" ) then if ( getElementModel ( source ) == 255 ) then if getElementData(source,"vdbbopevtr1") == false and not (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPECMD")) then showBox(source,"info",""..corp..": Acesso negado") return end end if ( getElementModel ( source ) == 256 ) then if getElementData(source,"vdbbopevtr2") == false and not (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPECMD")) then showBox(source,"info",""..corp..": Acesso negado") return end end if ( getElementModel ( source ) == 257 ) then if getElementData(source,"vdbbopevtr3") == false and not (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPECMD")) then showBox(source,"info",""..corp..": Acesso negado") return end end end end addEventHandler("onElementModelChange",getRootElement(),checkskinsBOPE) function CorpSkinBOPE(id) if tonumber(id) then setElementModel ( source, id ) showBox(source,"info","Você pegou skin "..corp..":") end end addEvent(resname..":setarskin", true) addEventHandler(resname..":setarskin", root, CorpSkinBOPE) function CorpKitBOPE() setElementHealth(source, 200) setPedArmor(source, 100) giveWeapon(source, 3, 200, true) giveWeapon(source, 23, 200, true) giveWeapon(source, 26, 200, true) giveWeapon(source, 28, 200, true) giveWeapon(source, 31, 200, true) giveWeapon(source, 34, 200, true) giveWeapon(source, 14, 200, true) showBox(source,"info","Você pegou Kit da "..corp..":") end addEvent(resname..":corpkitbope", true) addEventHandler(resname..":corpkitbope", root, CorpKitBOPE) function CorpTeleBaseBOPE () local CorpVTR = getPedOccupiedVehicle(source) if (CorpVTR) then setElementPosition(CorpVTR,1521.5, -1661.3000488281, 13.5) else setElementPosition(source,1521.5, -1661.3000488281, 13.5 ) end showBox(source,"info","Você teleportou-se para base da "..corp..":") end addEvent(resname..":corpteleportebasebope", true) addEventHandler(resname..":corpteleportebasebope", root, CorpTeleBaseBOPE) local CorpVTRBOPE = {} function CorpVTRvdbBOPE(viatura) local veiculo = getPedOccupiedVehicle ( source ) if veiculo and getVehicleController(veiculo) == source and isElement( CorpVTRBOPE[source] ) and veiculo == CorpVTRBOPE[source] then if tonumber(viatura) == 1 then setElementModel (veiculo,tonumber(547)) elseif tonumber(viatura) == 2 then setElementModel (veiculo,tonumber(490)) setVehicleColor(veiculo,255,255,255,255,255,255) elseif tonumber(viatura) == 3 then setElementModel (veiculo,tonumber(427)) elseif tonumber(viatura) == 4 then setElementModel (veiculo,tonumber(497)) end else if CorpVTRBOPE[source] and isElement( CorpVTRBOPE[source] ) then destroyElement( CorpVTRBOPE[source] ) CorpVTRBOPE[source] = nil end local x,y,z = getElementPosition(source) if tonumber(viatura) == 1 then CorpVTRBOPE[source] = createVehicle(547, x,y,z) warpPedIntoVehicle (source,CorpVTRBOPE[source]) showBox(source,"info","Você pegou VTR da "..corp..":") return 1 end if tonumber(viatura) == 2 then CorpVTRBOPE[source] = createVehicle(490, x,y,z) warpPedIntoVehicle (source,CorpVTRBOPE[source]) setVehicleColor(CorpVTRBOPE[source],255,255,255,255,255,255) showBox(source,"info","Você pegou VTR da "..corp..":") return 1 end if tonumber(viatura) == 3 then CorpVTRBOPE[source] = createVehicle(427, x,y,z) setVehicleDamageProof() warpPedIntoVehicle (source,CorpVTRBOPE[source]) showBox(source,"info","Você pegou Moto da "..corp..":") return 1 end if tonumber(viatura) == 4 then CorpVTRBOPE[source] = createVehicle(497, x,y,z) warpPedIntoVehicle (source,CorpVTRBOPE[source]) showBox(source,"info","Você pegou Moto da "..corp..":") return 1 end end end addEvent(resname..":corpviatura", true) addEventHandler(resname..":corpviatura", root, CorpVTRvdbBOPE) function CorpDestruirVTRBOPE() if CorpVTRBOPE[source] and isElement( CorpVTRBOPE[source] ) then destroyElement( CorpVTRBOPE[source] ) CorpVTRBOPE[source] = nil showBox(source,"info","Viatura destruida") end end addEvent(resname..":corpdestruirviatura", true) addEventHandler(resname..":corpdestruirviatura", root, CorpDestruirVTRBOPE) addEventHandler ("onPlayerQuit", root, CorpDestruirVTRBOPE) p_lights = {} p_timer = {} p_lvar = {} function CorpLuzesBOPE() local veh = getPedOccupiedVehicle(source) local id = getElementModel(veh) if (id == 547) or (id == 490) or (id == 427) or (id == 497) or (id == 427) or (id == 523) or (id == 490) or (id == 416) then if(p_lights[veh] == 0) or(p_lights[veh] == nil) then p_lights[veh] = 1 showBox(source,"info","Luzes de Alerta ligadas") setVehicleOverrideLights ( veh, 2 ) p_timer[veh] = setTimer( function() if(p_lvar[veh] == 0) or (p_lvar[veh] == nil) then p_lvar[veh] = 1 -- 0 = vorne links 1 = vorne rechts 2 = hinten links 3 = hinten rechts setVehicleLightState ( veh, 1, 0) setVehicleLightState ( veh, 2, 0) setVehicleLightState ( veh, 0, 1) setVehicleLightState ( veh, 3, 1) setVehicleHeadLightColor(veh, 0, 0, 255) else setVehicleLightState ( veh, 3, 0) setVehicleLightState ( veh, 0, 0) setVehicleLightState ( veh, 1, 1) setVehicleLightState ( veh, 2, 1) setVehicleHeadLightColor(veh, 255, 0, 0) p_lvar[veh] = 0 end end, 500, 0) else p_lights[veh] = 0 showBox(source,"info","Luzes de Alerta desligadas") killTimer(p_timer[veh]) setVehicleLightState ( veh, 0, 0) setVehicleLightState ( veh, 1, 0) setVehicleLightState ( veh, 2, 0) setVehicleLightState ( veh, 3, 0) setVehicleHeadLightColor(veh, 255, 255, 255) setVehicleOverrideLights ( veh, 1 ) end else showBox(source,"info","Este Veiculo Não é uma Viatura") end end addEvent(resname..":corpluzesbope", true) addEventHandler(resname..":corpluzesbope", root, CorpLuzesBOPE() addEventHandler ( "onVehicleExplode", getRootElement(), function() if(p_lights[source] == 1) then killTimer(p_timer[source]) end end ) addEventHandler ( "onVehicleRespawn", getRootElement(), function() if(p_lights[source] == 1) then killTimer(p_timer[source]) end end ) addEventHandler("onElementDestroy", getRootElement(), function () if getElementType(source) == "vehicle" then if(p_lights[source] == 1) then killTimer(p_timer[source]) end end end) function CorpAbandonarBOPE(cargo) local acl = aclGetGroup(cargo) if (acl) then local conta = getAccountName(getPlayerAccount(source)) local checkacl = isObjectInACLGroup ( "user." ..conta, acl) if (checkacl) then aclGroupRemoveObject(acl, "user."..conta) showBox(source,"info",""..corp..": Você abandonou a Corporação") setElementData (source, "vdbsoumembroBOPE",false) outputServerLog("ABANDONOU "..corp..": "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." > "..cargo.."") end end end addEvent(resname..":abandonarcorpbope", true) addEventHandler(resname..":abandonarcorpbope", getRootElement(), CorpAbandonarBOPE) function IsCorpGroupBOPE ( thePlayer ) local account = getPlayerAccount ( thePlayer ) local InBOPE = false for _, group in ipairs ( {"BOPECMD","BOPE6","BOPE5","BOPE4","BOPE3","BOPE2","BOPE1"} ) do if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then InBOPE = true break end end return InBOPE end function CorpGetMembrosActBOPE(player) local info = {} for _,players in pairs(getElementsByType("player")) do if getElementDimension( players) == 0 and getElementInterior(players) == 0 and not isGuestAccount ( getPlayerAccount ( players ) ) then if ( IsCorpGroupBOPE ( players ) ) then table.insert(info,{getPlayerName(players),players}) end end end triggerClientEvent(player,resname..":ListaCorp",player,info) end addEvent(resname..":corpmembrosativobope",true) addEventHandler(resname..":corpmembrosativobope",root,CorpGetMembrosActBOPE) function CorpGetMembrosBOPE(player) local info = {} for _,players in pairs(getElementsByType("player")) do if ( IsCorpGroupBOPE ( players ) ) then table.insert(info,{getPlayerName(players),players}) end end triggerClientEvent(player,resname..":ListaCorp",player,info) end addEvent(resname..":corptodosmembrosbope",true) addEventHandler(resname..":corptodosmembrosbope",root,CorpGetMembrosBOPE) function CorpGetAllPlayersBOPE(player) local info = {} for _,players in pairs(getElementsByType("player")) do if not isGuestAccount ( getPlayerAccount ( players ) ) and not ( IsCorpGroupBOPE ( players ) ) then table.insert(info,{getPlayerName(players),players}) end end triggerClientEvent(player,resname..":ListaCorp",player,info) end addEvent(resname..":corpgetplayersbope",true) addEventHandler(resname..":corpgetplayersbope",root,CorpGetAllPlayersBOPE) function CorpIrBOPE(teleporter) irtp = teleporter playerair = getPlayerFromName(irtp) if playerair then local veiculotp = getPedOccupiedVehicle(source) if (veiculotp) then showBox(source,"error","Saia do Veiculo") return end if getElementData(playerair,"emCombate") == true then showBox(source,"info","Erro o jogador esta em Combate "..irtp.."") return end local x,y,z = getElementPosition(playerair) setElementPosition(source, x, y, z + 2) showBox(source,"info","Você se teleportou até o jogador "..irtp.."") outputServerLog("TELEPORTE BOPE: Foi "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." > "..irtp.."") end end addEvent(resname..":TeleIrCorpbope", true) addEventHandler(resname..":TeleIrCorpbope", root, CorpIrBOPE) function CorpPuxarBOPE(teleporter) irtp = teleporter playerair = getPlayerFromName(irtp) if playerair then local veiculotp = getPedOccupiedVehicle(playerair) if (veiculotp) then showBox(source,"error","O Jogador esta em um veiculo") return end if getElementData(playerair,"emCombate") == true then showBox(source,"info","Erro o jogador esta em Combate "..irtp.."") return end local x,y,z = getElementPosition(source) setElementPosition(playerair, x, y, z + 2) showBox(source,"info","Você puxou o jogador "..irtp.." ") showBox(playerair,"info",""..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." puxou você") outputServerLog("TELEPORTE BOPE: Puxou "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." > "..irtp.."") end end addEvent(resname..":TelePuxarCorpbope", true) addEventHandler(resname..":TelePuxarCorpbope", root, CorpPuxarBOPE) function CorpRemoverMembroBOPE(player, cargo) local accountName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "BOPECMD" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "BOPE6" ) ) then arecrutar = getPlayerFromName(player) local contaarecrutar = getPlayerAccount(arecrutar) local cargoremove = aclGetGroup(cargo) if (cargoremove) then local contaaremover = getAccountName(contaarecrutar) local checkcargo = isObjectInACLGroup ( "user." ..contaaremover, cargoremove) if (checkcargo) then aclGroupRemoveObject(cargoremove, "user."..contaaremover) setElementData (arecrutar, "vdbsoumembroBOPE",false) showBox(arecrutar,"error",""..corp..": Você foi removido da Corporação") outputServerLog("EXPULSO "..corp..":: "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." > "..cargo.." > "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ") end end end end addEvent(resname..":corpremovermembrobope", true) addEventHandler(resname..":corpremovermembrobope", getRootElement(), CorpRemoverMembroBOPE) function CorpRecrutarBOPE(player, cargo) local accountName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "BOPECMD" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "BOPE6" ) ) then arecrutar = getPlayerFromName(player) local contaarecrutar = getPlayerAccount(arecrutar) --for _, checkcorp in ipairs ({}) do for _, checkcorp in ipairs ({"Suporte"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(arecrutar)), aclGetGroup( checkcorp )) then showBox(source,"error","o Jogador "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." pertence a outra Corp/Gang ["..checkcorp.."]") cancelEvent() return 1 end end local cargoset = aclGetGroup(cargo) if (cargoset) then local ncuenta = getAccountName(contaarecrutar) local checkrecrut = isObjectInACLGroup ( "user." ..ncuenta, cargoset) if (not checkrecrut) then aclGroupAddObject(cargoset, "user."..ncuenta) setElementData (arecrutar, "vdbsoumembroBOPE",false) showBox(arecrutar,"info",""..corp..": Você foi Recrutado (Aguarde 10 segundos até seu painel atualizar)") showBox(source,"info",""..corp..": Você Recrutou o "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." para "..corp.."") outputServerLog("RECRUTAMENTO "..corp..": "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." > "..cargo.." > "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ") end end end end addEvent(resname..":corprecrutarbope", true) addEventHandler(resname..":corprecrutarbope", getRootElement(), CorpRecrutarBOPE) function CorpPromoverBOPE(player, cargo) local accountName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "BOPECMD" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "BOPE6" ) ) then arecrutar = getPlayerFromName(player) local contaarecrutar = getPlayerAccount(arecrutar) for _, checkcorp in ipairs ({"Suporte"}) do --for _, checkcorp in ipairs ({}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(arecrutar)), aclGetGroup( checkcorp )) then showBox(source,"error","o Jogador "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." pertence a outra Corp/Gang ["..checkcorp.."]") cancelEvent() return 1 end end local cargoset = aclGetGroup(cargo) if (cargoset) then local ncuenta = getAccountName(contaarecrutar) local checkrecrut = isObjectInACLGroup ( "user." ..ncuenta, cargoset) if (not checkrecrut) then aclGroupAddObject(cargoset, "user."..ncuenta) setElementData (arecrutar, "vdbsoumembroBOPE",false) showBox(arecrutar,"info",""..corp..": Você foi Promovido (Aguarde 10 segundos até seu painel atualizar)") showBox(source,"info",""..corp..": Você Promoveu o "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." para "..corp.."") outputServerLog("PROMOVEU "..corp..": "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." > "..cargo.." > "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ") end end end end addEvent(resname..":corppromoverbope", true) addEventHandler(resname..":corppromoverbope", getRootElement(), CorpPromoverBOPE) function CorpOneACLBOPE(player, cargo) local accountName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "BOPECMD" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "BOPE6" ) ) then arecrutar = getPlayerFromName(player) local contaarecrutar = getPlayerAccount(arecrutar) local cargoremove = aclGetGroup(cargo) if (cargoremove) then local contaaremover = getAccountName(contaarecrutar) local checkcargo = isObjectInACLGroup ( "user." ..contaaremover, cargoremove) if (checkcargo) then aclGroupRemoveObject(cargoremove, "user."..contaaremover) setElementData (arecrutar, "vdbsoumembroBOPE",false) outputServerLog(""..corp..": CARGO ONE: "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." > "..cargo.." > "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ") end end end end addEvent(resname..":CorpCagoOnebope", true) addEventHandler(resname..":CorpCagoOnebope", getRootElement(), CorpOneACLBOPE) function QuitRemoverCorpBOPE () if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("BOPE1")) then aclGroupRemoveObject (aclGetGroup("BOPE1"), "user."..getAccountName(getPlayerAccount(source))) end end addEventHandler ( "onPlayerQuit", getRootElement(),QuitRemoverCorpBOPE) function CorpAcessoBOPE() showBoxBOPE(source,"error","Acesso não permitido") end addEvent("acessonegadobope", true) addEventHandler("acessonegadobope", root,CorpAcessoBOPE) function showBoxBOPE(player, value, str) if isElement(player) then triggerClientEvent(player, "CreateBox", getRootElement(), value, str) end end function corpmsgbope(source,type,msg) if source and type and msg then showBoxBOPE(source,type,msg) end end addEvent(resname..":corpmsgbope", true) addEventHandler(resname..":corpmsgbope", root, corpmsgbope) Other Panel Tactical Forty function SetCorp(player) if player and not isGuestAccount(getPlayerAccount(player)) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FTCMD")) then setElementData (player,resname..":soucmd", true) setElementData (player,resname..":gerenciar", true) setElementData (player,resname..":promover", true) setElementData (player,resname..":expulsar", true) setElementData (player,resname..":recrutar", true) setElementData (player,resname..":skin1", true) setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":vtr3", true) setElementData (player,resname..":vtr4", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FT6")) then setElementData (player,resname..":gerenciar", true) setElementData (player,resname..":promover", true) setElementData (player,resname..":expulsar", true) setElementData (player,resname..":recrutar", true) setElementData (player,resname..":skin1", true) setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":vtr3", true) setElementData (player,resname..":vtr4", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FT5")) then setElementData (player,resname..":gerenciar", true) setElementData (player,resname..":skin1", true) setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":vtr3", true) setElementData (player,resname..":vtr4", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FT4")) then setElementData (player,resname..":skin1", true) setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":vtr3", true) setElementData (player,resname..":vtr4", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FT3")) then setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":vtr2", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FT2")) then setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":vtr1", true) setElementData (player,resname..":soumembro", true) setElementData (player, "isPolice", true) return 1 end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FT1")) then setElementData (player,resname..":skin2", true) setElementData (player,resname..":skin3", true) setElementData (player,resname..":soumembro", true) return 1 end end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then SetCorp(pl) end end end, 10000, 0) function checkskinsFT ( ) if ( getElementType ( source ) == "player" ) then if ( getElementModel ( source ) == 96 ) then if getElementData(source,"vdbftvtr1") == false and not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FTCMD")) then showBox(source,"info",""..corp..": Acesso negado") return end end if ( getElementModel ( source ) == 286 ) then if getElementData(source,"vdbftvtr2") == false and not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FTCMD")) then showBox(source,"info",""..corp..": Acesso negado") return end end if ( getElementModel ( source ) == 97 ) then if getElementData(source,"vdbftvtr3") == false and not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FTCMD")) then showBox(source,"info",""..corp..": Acesso negado") return end end end end addEventHandler("onElementModelChange",getRootElement(),checkskinsFT) function CorpSkin(id) if tonumber(id) then setElementModel ( source, id ) showBox(source,"info","Você pegou skin "..corp..":") end end addEvent(resname..":setarskin", true) addEventHandler(resname..":setarskin", root, CorpSkin) function CorpKit() setElementHealth(source, 200) setPedArmor(source, 100) giveWeapon(source, 3, 200, true) giveWeapon(source, 23, 200, true) giveWeapon(source, 26, 200, true) giveWeapon(source, 28, 200, true) giveWeapon(source, 31, 200, true) giveWeapon(source, 34, 200, true) giveWeapon(source, 14, 200, true) showBox(source,"info","Você pegou Kit da "..corp..":") end addEvent(resname..":corpkit", true) addEventHandler(resname..":corpkit", root, CorpKit) function CorpTeleBase () local CorpVTR = getPedOccupiedVehicle(source) if (CorpVTR) then setElementPosition(CorpVTR,2184.8012695313, -1794.8519287109, 13.366186141968) else setElementPosition(source,2184.8012695313, -1794.8519287109, 13.366186141968 ) end showBox(source,"info","Você teleportou-se para base da "..corp..":") end addEvent(resname..":corpteleportebase", true) addEventHandler(resname..":corpteleportebase", root, CorpTeleBase) local CorpVTR = {} function CorpVTRvdb(viatura) local veiculo = getPedOccupiedVehicle ( source ) if veiculo and getVehicleController(veiculo) == source and isElement( CorpVTR[source] ) and veiculo == CorpVTR[source] then if tonumber(viatura) == 1 then setElementModel (veiculo,tonumber(598)) elseif tonumber(viatura) == 2 then setElementModel (veiculo,tonumber(496)) setVehicleColor(veiculo,255,255,255,255,255,255) elseif tonumber(viatura) == 3 then setElementModel (veiculo,tonumber(523)) elseif tonumber(viatura) == 4 then setElementModel (veiculo,tonumber(497)) end else if CorpVTR[source] and isElement( CorpVTR[source] ) then destroyElement( CorpVTR[source] ) CorpVTR[source] = nil end local x,y,z = getElementPosition(source) if tonumber(viatura) == 1 then CorpVTR[source] = createVehicle(598, x,y,z) warpPedIntoVehicle (source,CorpVTR[source]) showBox(source,"info","Você pegou VTR da "..corp..":") return 1 end if tonumber(viatura) == 2 then CorpVTR[source] = createVehicle(496, x,y,z) warpPedIntoVehicle (source,CorpVTR[source]) setVehicleColor(CorpVTR[source],255,255,255,255,255,255) showBox(source,"info","Você pegou VTR da "..corp..":") return 1 end if tonumber(viatura) == 3 then CorpVTR[source] = createVehicle(523, x,y,z) setVehicleDamageProof() warpPedIntoVehicle (source,CorpVTR[source]) showBox(source,"info","Você pegou Moto da "..corp..":") return 1 end if tonumber(viatura) == 4 then CorpVTR[source] = createVehicle(497, x,y,z) warpPedIntoVehicle (source,CorpVTR[source]) showBox(source,"info","Você pegou Moto da "..corp..":") return 1 end end end addEvent(resname..":corpviatura", true) addEventHandler(resname..":corpviatura", root, CorpVTRvdb) function CorpDestruirVTR() if CorpVTR[source] and isElement( CorpVTR[source] ) then destroyElement( CorpVTR[source] ) CorpVTR[source] = nil showBox(source,"info","Viatura destruida") end end addEvent(resname..":corpdestruirviatura", true) addEventHandler(resname..":corpdestruirviatura", root, CorpDestruirVTR) addEventHandler ("onPlayerQuit", root, CorpDestruirVTR) p_lights = {} p_timer = {} p_lvar = {} function CorpLuzes() local veh = getPedOccupiedVehicle(source) local id = getElementModel(veh) if (id == 598) or (id == 496) or (id == 523) or (id == 497) or (id == 427) or (id == 523) or (id == 490) or (id == 416) then if(p_lights[veh] == 0) or(p_lights[veh] == nil) then p_lights[veh] = 1 showBox(source,"info","Luzes de Alerta ligadas") setVehicleOverrideLights ( veh, 2 ) p_timer[veh] = setTimer( function() if(p_lvar[veh] == 0) or (p_lvar[veh] == nil) then p_lvar[veh] = 1 -- 0 = vorne links 1 = vorne rechts 2 = hinten links 3 = hinten rechts setVehicleLightState ( veh, 1, 0) setVehicleLightState ( veh, 2, 0) setVehicleLightState ( veh, 0, 1) setVehicleLightState ( veh, 3, 1) setVehicleHeadLightColor(veh, 0, 0, 255) else setVehicleLightState ( veh, 3, 0) setVehicleLightState ( veh, 0, 0) setVehicleLightState ( veh, 1, 1) setVehicleLightState ( veh, 2, 1) setVehicleHeadLightColor(veh, 255, 0, 0) p_lvar[veh] = 0 end end, 500, 0) else p_lights[veh] = 0 showBox(source,"info","Luzes de Alerta desligadas") killTimer(p_timer[veh]) setVehicleLightState ( veh, 0, 0) setVehicleLightState ( veh, 1, 0) setVehicleLightState ( veh, 2, 0) setVehicleLightState ( veh, 3, 0) setVehicleHeadLightColor(veh, 255, 255, 255) setVehicleOverrideLights ( veh, 1 ) end else showBox(source,"info","Este Veiculo Não é uma Viatura") end end addEvent(resname..":corpluzes", true) addEventHandler(resname..":corpluzes", root, CorpLuzes) addEventHandler ( "onVehicleExplode", getRootElement(), function() if(p_lights[source] == 1) then killTimer(p_timer[source]) end end ) addEventHandler ( "onVehicleRespawn", getRootElement(), function() if(p_lights[source] == 1) then killTimer(p_timer[source]) end end ) addEventHandler("onElementDestroy", getRootElement(), function () if getElementType(source) == "vehicle" then if(p_lights[source] == 1) then killTimer(p_timer[source]) end end end) function CorpAbandonar(cargo) local acl = aclGetGroup(cargo) if (acl) then local conta = getAccountName(getPlayerAccount(source)) local checkacl = isObjectInACLGroup ( "user." ..conta, acl) if (checkacl) then aclGroupRemoveObject(acl, "user."..conta) showBox(source,"info",""..corp..": Você abandonou a Corporação") setElementData (source, "vdbsoumembroFT",false) outputServerLog("ABANDONOU "..corp..": "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." > "..cargo.."") end end end addEvent(resname..":abandonarcorp", true) addEventHandler(resname..":abandonarcorp", getRootElement(), CorpAbandonar) function IsCorpGroup ( thePlayer ) local account = getPlayerAccount ( thePlayer ) local InFT = false for _, group in ipairs ( {"FTCMD","FT6","FT5","FT4","FT3","FT2","FT1"} ) do if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then InFT = true break end end return InFT end function CorpGetMembrosAct(player) local info = {} for _,players in pairs(getElementsByType("player")) do if getElementDimension( players) == 0 and getElementInterior(players) == 0 and not isGuestAccount ( getPlayerAccount ( players ) ) then if ( IsCorpGroup ( players ) ) then table.insert(info,{getPlayerName(players),players}) end end end triggerClientEvent(player,resname..":ListaCorp",player,info) end addEvent(resname..":corpmembrosativo",true) addEventHandler(resname..":corpmembrosativo",root,CorpGetMembrosAct) function CorpGetMembros(player) local info = {} for _,players in pairs(getElementsByType("player")) do if ( IsCorpGroup ( players ) ) then table.insert(info,{getPlayerName(players),players}) end end triggerClientEvent(player,resname..":ListaCorp",player,info) end addEvent(resname..":corptodosmembros",true) addEventHandler(resname..":corptodosmembros",root,CorpGetMembros) function CorpGetAllPlayers(player) local info = {} for _,players in pairs(getElementsByType("player")) do if not isGuestAccount ( getPlayerAccount ( players ) ) and not ( IsCorpGroup ( players ) ) then table.insert(info,{getPlayerName(players),players}) end end triggerClientEvent(player,resname..":ListaCorp",player,info) end addEvent(resname..":corpgetplayers",true) addEventHandler(resname..":corpgetplayers",root,CorpGetAllPlayers) function CorpIr(teleporter) irtp = teleporter playerair = getPlayerFromName(irtp) if playerair then local veiculotp = getPedOccupiedVehicle(source) if (veiculotp) then showBox(source,"error","Saia do Veiculo") return end if getElementData(playerair,"emCombate") == true then showBox(source,"info","Erro o jogador esta em Combate "..irtp.."") return end local x,y,z = getElementPosition(playerair) setElementPosition(source, x, y, z + 2) showBox(source,"info","Você se teleportou até o jogador "..irtp.."") outputServerLog("TELEPORTE FT: Foi "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." > "..irtp.."") end end addEvent(resname..":TeleIrCorp", true) addEventHandler(resname..":TeleIrCorp", root, CorpIr) function CorpPuxar(teleporter) irtp = teleporter playerair = getPlayerFromName(irtp) if playerair then local veiculotp = getPedOccupiedVehicle(playerair) if (veiculotp) then showBox(source,"error","O Jogador esta em um veiculo") return end if getElementData(playerair,"emCombate") == true then showBox(source,"info","Erro o jogador esta em Combate "..irtp.."") return end local x,y,z = getElementPosition(source) setElementPosition(playerair, x, y, z + 2) showBox(source,"info","Você puxou o jogador "..irtp.." ") showBox(playerair,"info",""..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." puxou você") outputServerLog("TELEPORTE FT: Puxou "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." > "..irtp.."") end end addEvent(resname..":TelePuxarCorp", true) addEventHandler(resname..":TelePuxarCorp", root, CorpPuxar) function CorpRemoverMembro(player, cargo) local accountName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "FTCMD" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "FT6" ) ) then arecrutar = getPlayerFromName(player) local contaarecrutar = getPlayerAccount(arecrutar) local cargoremove = aclGetGroup(cargo) if (cargoremove) then local contaaremover = getAccountName(contaarecrutar) local checkcargo = isObjectInACLGroup ( "user." ..contaaremover, cargoremove) if (checkcargo) then aclGroupRemoveObject(cargoremove, "user."..contaaremover) setElementData (arecrutar, "vdbsoumembroFT",false) showBox(arecrutar,"error",""..corp..": Você foi removido da Corporação") outputServerLog("EXPULSO "..corp..":: "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." > "..cargo.." > "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ") end end end end addEvent(resname..":corpremovermembro", true) addEventHandler(resname..":corpremovermembro", getRootElement(), CorpRemoverMembro) function CorpRecrutar(player, cargo) local accountName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "FTCMD" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "FT6" ) ) then arecrutar = getPlayerFromName(player) local contaarecrutar = getPlayerAccount(arecrutar) --for _, checkcorp in ipairs ({"Console","Admin","SuperModerator","Moderator","Suporte","PMCMD","PM6","PM5","PM4","PM3","PM2","PM1"}) do for _, checkcorp in ipairs ({"Suporte"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(arecrutar)), aclGetGroup( checkcorp )) then showBox(source,"error","o Jogador "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." pertence a outra Corp/Gang ["..checkcorp.."]") cancelEvent() return 1 end end local cargoset = aclGetGroup(cargo) if (cargoset) then local ncuenta = getAccountName(contaarecrutar) local checkrecrut = isObjectInACLGroup ( "user." ..ncuenta, cargoset) if (not checkrecrut) then aclGroupAddObject(cargoset, "user."..ncuenta) setElementData (arecrutar, "vdbsoumembroFT",false) showBox(arecrutar,"info",""..corp..": Você foi Recrutado (Aguarde 10 segundos até seu painel atualizar)") showBox(source,"info",""..corp..": Você Recrutou o "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." para "..corp.."") outputServerLog("RECRUTAMENTO "..corp..": "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." > "..cargo.." > "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ") end end end end addEvent(resname..":corprecrutar", true) addEventHandler(resname..":corprecrutar", getRootElement(), CorpRecrutar) function CorpPromover(player, cargo) local accountName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "FTCMD" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "FT6" ) ) then arecrutar = getPlayerFromName(player) local contaarecrutar = getPlayerAccount(arecrutar) for _, checkcorp in ipairs ({"Suporte"}) do --for _, checkcorp in ipairs ({"Console","Admin","SuperModerator","Moderator","Suporte","PMCMD","PM6","PM5","PM4","PM3","PM2","PM1"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(arecrutar)), aclGetGroup( checkcorp )) then showBox(source,"error","o Jogador "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." pertence a outra Corp/Gang ["..checkcorp.."]") cancelEvent() return 1 end end local cargoset = aclGetGroup(cargo) if (cargoset) then local ncuenta = getAccountName(contaarecrutar) local checkrecrut = isObjectInACLGroup ( "user." ..ncuenta, cargoset) if (not checkrecrut) then aclGroupAddObject(cargoset, "user."..ncuenta) setElementData (arecrutar, "vdbsoumembroFT",false) showBox(arecrutar,"info",""..corp..": Você foi Promovido (Aguarde 10 segundos até seu painel atualizar)") showBox(source,"info",""..corp..": Você Promoveu o "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." para "..corp.."") outputServerLog("PROMOVEU "..corp..": "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." > "..cargo.." > "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ") end end end end addEvent(resname..":corppromover", true) addEventHandler(resname..":corppromover", getRootElement(), CorpPromover) function CorpOneACL(player, cargo) local accountName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "FTCMD" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "FT6" ) ) then arecrutar = getPlayerFromName(player) local contaarecrutar = getPlayerAccount(arecrutar) local cargoremove = aclGetGroup(cargo) if (cargoremove) then local contaaremover = getAccountName(contaarecrutar) local checkcargo = isObjectInACLGroup ( "user." ..contaaremover, cargoremove) if (checkcargo) then aclGroupRemoveObject(cargoremove, "user."..contaaremover) setElementData (arecrutar, "vdbsoumembroFT",false) outputServerLog(""..corp..": CARGO ONE: "..getPlayerName(arecrutar):gsub("#%x%x%x%x%x%x","").." > "..cargo.." > "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ") end end end end addEvent(resname..":CorpCagoOne", true) addEventHandler(resname..":CorpCagoOne", getRootElement(), CorpOneACL) function QuitRemoverCorp () if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("FT1")) then aclGroupRemoveObject (aclGetGroup("FT1"), "user."..getAccountName(getPlayerAccount(source))) end end addEventHandler ( "onPlayerQuit", getRootElement(),QuitRemoverCorp) function CorpAcesso() showBox(source,"error","Acesso não permitido") end addEvent("acessonegado", true) addEventHandler("acessonegado", root,CorpAcesso) function showBox(player, value, str) if isElement(player) then triggerClientEvent(player, "CreateBox", getRootElement(), value, str) end end function corpmsg(source,type,msg) if source and type and msg then showBox(source,type,msg) end end addEvent(resname..":corpmsg", true) addEventHandler(resname..":corpmsg", root, corpmsg)
  3. local defaults = {} local function loadDefaults () defaults.luac = get 'luac', defaults.prep = get 'prep', defaults.prepa = get 'prepa', defaults.prepcache = get 'prepcache', defaults.luaccache = get 'luaccache', defaults.suffix = get 'suffix', defaults.extension = get 'extension', defaults.naming = get 'naming',--order is important, e=strip extension, s=add suffix, t=replace with target if target exists defaults.tgt = '', end loadDefaults() local function validateSetting ( key, value ) --TODO: create setting validator end local function processName ( name, naming, extension, suffix, target ) extension = extension or '' suffix = suffix or '' target = target or '' for directive in naming:gmatch '.' do if directive == 'e' then --extension is escaped and anchored to the string's end first name = name:gsub ( extension:gsub ( '%W', '%%%1' ) .. '$', '' )--remove extension elseif directive == 's' then name = name .. suffix--adds suffix elseif directive == 't' then name = #tgt > 0 and tgt or name--replace with target else outputDebugString ( "invalid naming directive: " .. directive, 2 ) end end return name end function processResource ( resourceName ) local metaxml = XML.load ( ':' .. resourceName .. '/meta.xml' ) or error "failed loading meta.xml" local defaults = { luac = get 'luac', prep = get 'prep', prepa = get 'prepa', prepcache = get 'prepcache', luaccache = get 'luaccache', suffix = get 'suffix', extension = get 'extension', naming = get 'naming',--order is important, e=strip extension, s=add suffix, t=replace with target if target exists tgt = '', } for l1i, l1node in ipairs ( metaxml.children ) do outputDebugString ( l1i .. ":" .. l1node.name ) if l1node.name == 'build' then for l2i, l2node in ipairs ( l1node.children ) do outputDebugString ( l2node.name ) if l2node.name == 'setting' then--update build settings local k, v = l2node:getAttribute 'key', l2node:getAttribute 'value' defaults [ k ] = v elseif l2node.name == 'obj' then--build directives for a file local src = l2node:getAttribute 'src' or error 'no src attribute' local tgt = l2node:getAttribute 'tgt' or defaults.tgt local luac = l2node:getAttribute 'luac' or defaults.luac local prep = l2node:getAttribute 'prep' or defaults.prep local prepa = l2node:getAttribute 'prepa' or defaults.prepa local luaccache = l2node:getAttribute 'luaccache' or defaults.luaccache local prepcache = l2node:getAttribute 'prepcache' or defaults.prepcache local naming = l2node:getAttribute 'naming' or defaults.naming local extension = l2node:getAttribute 'extension' or defaults.extension local suffix = l2node:getAttribute 'suffix' or defaults.suffix local out = src local srcf = File ( ':' .. resourceName .. '/' .. src, true ) local buffer = srcf:read ( srcf:getSize () ) buffer = prep == '1' and getPreProcessed ( buffer, loadstring ( 'return ' .. prepa ) () ) or buffer for directive in naming:gmatch '.' do if directive == 'e' then --extension is escaped and anchored to the string's end first out = out:gsub ( extension:gsub ( '%W', '%%%1' ) .. '$', '' )--remove extension elseif directive == 's' then out = out .. suffix--adds suffix elseif directive == 't' then out = #tgt > 0 and tgt or out--replace with target else outputDebugString ( "invalid naming directive: " .. directive, 2 ) end end outputDebugString ( 'out: ' .. tostring ( out ) ) assert ( out ~= src, "Output file is same as input, build aborted to prevent information loss" ) --TODO: send to compiler ---[[ out = ':' .. resourceName .. '/' .. out File.delete ( out )--remove previous output local outf = File.new ( out ) outf:write ( buffer ) outf:close () --]] outputDebugString ( "processed " .. src .. " to " .. out ) end end end end return true end
  4. I want to render a rectangle to the cursor, but the rectangle too far from the cursor.. How to fix this in my code? code: local sx_, sy_ = 1920, 1080 local sx__, sy__ = guiGetScreenSize() local xm, ym = sx__/sx_, sy__/sy_ function render() local screenx, screeny = getCursorPosition() dxDrawRectangle((sx_-687) * xm * screenx, (sy_/2+70) * ym * screeny, 170 * xm, 25 * ym,tocolor(255,181,64,80)) end addEventHandler("onClientRender",root,render) the problem:
  5. No errors / warnings in debugscript 3... then what wrong in this script? Client: requestBrowserDomains({"www.convertmp3.io"}) local browser = createBrowser( 1, 1, false ) local currentSound = {} addEvent( 'Play' , true ) addEventHandler( 'Play' , root , function( link ) local vehicle = getPedOccupiedVehicle ( source ) local x, y, z = getElementPosition(vehicle) currentSound[source] = playSound3D( link, x, y, z ) attachElements(currentSound[source],vehicle) setSoundMaxDistance(currentSound[source],30) setSoundVolume(currentSound[source],50) end ) function fetch(_,url) if url and url ~= "" then fetchRemote("http://www.convertmp3.io/fetch/?format=JSON&video="..url, callback) end end addCommandHandler("p",fetch) function callback(data, error) if (error ~= 0) then return outputChatBox(error) end if (data == "ERROR") then return outputChatBox("data error") end local data = fromJSON("["..data.."]") if (data) then outputChatBox("Title: "..data.title) outputChatBox("Length: "..data.length) outputChatBox("Link: "..data.link) loadBrowserURL( browser, data.link ) end end addEventHandler( "onClientBrowserNavigate", browser, function( link ) if not link:find("www.convertmp3.io") then triggerServerEvent( 'play' , localPlayer , link ) -- trigger the event when the script actially gets the playable link! end end ) server: addEvent( 'play' , true ) addEventHandler( 'play' , root , function( link ) triggerClientEvent( root , 'Play' , client , link ) end )
  6. E ae pessoal,tem como deixar o ShowCursor ativado e continuar usando o W,S,A,D ?
  7. Hello guys, I would like some help with this script below. My idea is to make two arenas (PvP), one of them is to kill any player with just one shot. The other arena is just killing with headshots! I was indicted to put elementData, but I don't know how to do that. Can someone help me? Sorry for bad English. Script Arena Oneshot function playerDamage_text ( attacker, weapon, bodypart, loss ) if ( bodypart == 3 and attacker and attacker ~= source ) then killPed ( source, attacker, weapon, bodypart ) end end addEventHandler ( "onPlayerDamage", root, playerDamage_text ) --------------------------_---------------------------------- Script Headshot function playerDamage_text ( attacker, weapon, bodypart, loss ) if ( bodypart == 9 and attacker and attacker ~= source ) then killPed ( source, attacker, weapon, bodypart ) end end addEventHandler ( "onPlayerDamage", root, playerDamage_text )
  8. Olá, esse script está crashando o mta de quem entra no servidor podem me ajudar ? local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local vzrx, vzry = (screenW/resW), (screenH/resH) local super = Class("Grid", LuaObject, function() static.font1 = dxCreateFont("utils/font.ttf", vzrx*10) static.font_10 = dxCreateFont("utils/font.ttf", vzrx*10) static.sx, static.sy = guiGetScreenSize() static.constructors = {} end).getSuperclass() local cursorOn; function Grid:init(x, y, w, h, postGUI) self.x = x self.y = y self.w = w self.h = h self.originalH = h self.columHeight = 30 self.itemHeight = 25 self.maxItems = self:getMaxPosition(); -- Max items self.pg = postGUI or false; self.items = {}; self.scrollTop = y + 18 + 2 self.listPos = 0; -- Scroll Level self.mo = nil; -- Mouse-on item self.visible = true -- Visible table.insert(Grid.constructors,self) return self end function Grid:destroy() for k, v in pairs(Grid) do if (v == self) then Grid[k] = nil end end return true end function Grid:setItemText(id, column, text) if self.items[column] and self.items[column][id] then self.items[column][id].text = text end end function Grid:setItemColor(id, column, r, g, b) if self.items[column] and self.items[column][id] then local color = tonumber(b) and tocolor(r, g, b) or tocolor(255, 255, 255) self.items[column][id].color = color end end function Grid:setVisible(visible) self.visible = visible end function Grid:isVisible() return self.visible end function Grid:addColumn(title, width) local data = { info = {title = title, width = width} }; table.insert (self.items, data); return #self.items; end function Grid:RemoveColumn(colum) self.items[colum] = nil; -- Recalculate the highest item count local highest = 0; for _, v in ipairs(self.items) do if #v > highest then highest =(#v - 1); end end return true end function Grid:getColumnCount() return #self.items end function Grid:addItem(colum, text, data, r, g, b) if self.items[colum] then local color = tonumber(b) and tocolor(r, g, b) or tocolor(255, 255, 255) table.insert(self.items[colum], {id = #self.items[colum] + 1, text = tostring(text), data = data, color = color}); self.h = self.columHeight + (self.maxItems*self.itemHeight) return #self.items[colum]; end end function Grid:removeItem( column, id) if self.items[column] and self.items[column][id] then -- Reset the selected item if necessary² if id == self.selected then local newItem = self.selected - 1 if newItem <= #self.items[colum] then self.selected = math.max(0, newItem); else self.selected = 0 end end table.remove(self.items[column], id); return true; end end function Grid:getItemCount(colum) if self.items[colum] then return #self.items[colum] end end function Grid:clear() for k, v in ipairs (self.items) do self.items[k] = {info = v.info} end self.selected = nil end function Grid:getSelectedItem() return self.selected; end function Grid:setSelectedItem (id) if id <= #self.items[1] then self.selected = id; end end function Grid:getItemDetails(column, id) if self.items[column] then if self.items[column][id] then return self.items[column][id].text, self.items[column][id].data end end end function paint() -- Is there any gridlist to render? if (#Grid.constructors > 0) then -- Loop through all grid lists for index, self in ipairs (Grid.constructors) do -- Is the gridlist visible? if self.visible then -- Draw the 'gridlist' itself dxDrawRectangle (self.x, self.y, self.w, self.h, tocolor(0, 0, 0, 0), self.pg); dxDrawRectangle(self.x, self.y + self.columHeight, self.w, self.h - self.columHeight, tocolor(0, 0, 0, 0), self.pg) -- Draw the column bar dxDrawRectangle(self.x, self.y, self.w, self.columHeight, tocolor(0, 0, 0, 0), self.pg) -- ScrollBar local uX, uY, uW = (self.x + self.w) + 1, self.y, 18 local b = 4 --UP Arow --[[ dxDrawRectangle(uX + 1, uY + 1, uW - 1, uW - 1, tocolor(0, 0, 0, 50), self.pg) dxDrawLine(uX + b , uY + uW - b, uX + uW/2, uY + b, tocolor(0, 0, 0, 70), 1, self.pg) dxDrawLine(uX - b + uW, uY + uW - b, uX + uW/2 , uY + b , tocolor(0, 0, 0, 70), 1, self.pg) --dxDrawLine(uX + b , uY + uW - b, uX + uW - b, uY + uW - b, tocolor(0, 0, 0, 70), 1, self.pg) ]] --DOWN Arow local dX, dY, dW, dH = (self.x + self.w) + 1, self.y + (self.h-18) + 1, 18 - 1, 18 - 1 --[[dxDrawRectangle(dX + 1, dY + 1, dW - 1, dW - 1, tocolor(0, 0, 0, 50), self.pg) dxDrawLine(dX + b , dH + dY - dW + b, dX + dW/2, dH + dY - b, tocolor(0, 0, 0, 70), 1, self.pg) dxDrawLine(dX + dW - b , dH + dY - dW + b, dX + dW/2, dH + dY - b, tocolor(0, 0, 0, 70), 1, self.pg) --dxDrawLine(dX + b , dH + dY - dW + b , dX + dW - b , dH + dY - dW + b, tocolor(0, 0, 0, 70), 1, self.pg) ]] --Thumb local x, y, w, h = (self.x + self.w) + 2, self.y + 18 + 2, 18 - 2, self.h - (18*2) - 2 --dxDrawRectangle(x, y, w, h, tocolor(0, 0, 0, 90)) local maxHeight = h self.thumbHeight = math.max(math.min(math.floor(maxHeight * self.maxItems / (#self.items[1])),maxHeight),18) local maxY = (y+h)-self.thumbHeight if (getKeyState("mouse1")) then if (isMouseInPosition(uX, uY, uW, uW)) then if (#self.items[1] > self.maxItems) then self.scrollTop = math.max(y,math.min(self.scrollTop - 1*maxHeight/100, maxY)) self.listPos = math.floor(((self.scrollTop - y) / (maxHeight-self.thumbHeight) * 100) * (#self.items[1]-self.maxItems) / 100) end elseif (isMouseInPosition(dX, dY, dW, dH)) then if (#self.items[1] > self.maxItems) then self.scrollTop = math.max(y,math.min(self.scrollTop + 1*maxHeight/100, maxY)) self.listPos = math.floor(((self.scrollTop - y) / (maxHeight-self.thumbHeight) * 100) * (#self.items[1]-self.maxItems) / 100) end end end if drag then local _, cy = getCursorPosition() local cy = cy*Grid.sy self.scrollTop = math.max(y,math.min(cy-space, maxY)) self.listPos = math.floor(((self.scrollTop - y) / (maxHeight-self.thumbHeight) * 100) * (#self.items[1]-self.maxItems) / 100) end local aa = 255 if (isMouseInPosition(x,self.scrollTop,w,self.thumbHeight)) then aa = 110 end -- Set cursorOn variable to the current gridlist, if it's selected self.cursorOn = nil if isMouseInPosition(self.x, self.y, self.w + 18, self.h) then cursorOn = index; end -- Is there any column? if #self.items > 0 then local cWidth = 0 -- Loop through all columns for cIndex, cData in ipairs(self.items) do -- we'll go beyond the gridlist width with this column ? if(( cWidth + cData.info.width) <= self.w) then local x = self.x + cWidth; -- Draw the column title dxDrawText(cData.info.title, x + 10, self.y, cData.info.width + x,(self.columHeight) + self.y, tocolor(255, 255, 255, 220), vzrx*1.4, "arial", "left", "center", true, true, self.pg, true, true); -- Is there any item ? if #cData > 0 then -- Loop the items local k = 0 for i=(self.listPos+1), (math.min(#self.items[1],self.maxItems)+self.listPos) do if cData[i] then -- Draw a rectangle to make it looks like selected dxDrawText(cData[i].text,x + 20,(self.columHeight + self.y)+(self.itemHeight*k),cData.info.width + x,(self.columHeight + self.y)+(self.itemHeight*k) + self.itemHeight, tocolor(255, 255, 255, 200), vzrx*1, Grid.font_10, "left", "center", true, true, self.pg, true, true) if (self.selected == i) then dxDrawRectangle(self.x,(self.columHeight + self.y)+(self.itemHeight*k),self.w,self.itemHeight,tocolor(255, 255, 255, 200), self.pg) dxDrawText(cData[i].text:gsub("#%x%x%x%x%x%x", ""),x + 20,(self.columHeight + self.y)+(self.itemHeight*k),cData.info.width + x,(self.columHeight + self.y)+(self.itemHeight*k) + self.itemHeight, tocolor(0, 0, 0, 220), vzrx*1, Grid.font_10, "left", "center", true, true, self.pg, true, true) end end k = k+1 end end -- Increase cWidth variable (to draw the columns correctly) cWidth = cWidth + cData.info.width; end end end end end end end addEventHandler("onClientRender", root, paint, true, "low-5") function onClientKey(key, press) if isCursorShowing() then if #Grid.constructors > 0 then if cursorOn then local self = Grid.constructors[cursorOn] if press and #key > 6 then if #self.items[1] > self.maxItems then local y = self.y + 18 + 2 local maxHeight = self.h - (18*2) - 2 if (isMouseInPosition(self.x,self.y,self.w+18,self.h)) then if (key == "mouse_wheel_down") then if (#self.items[1] > self.maxItems) then self.listPos = math.ceil(math.max(0,math.min(self.listPos + 1*#self.items[1]/100, #self.items[1]-self.maxItems))) self.scrollTop = y + ((self.listPos / (#self.items[1]-self.maxItems) * 100) * ((maxHeight)-self.thumbHeight) / 100) end elseif (key == "mouse_wheel_up") then if (#self.items[1] > self.maxItems) then self.listPos = math.floor(math.max(0,math.min(self.listPos - 1*#self.items[1]/100, #self.items[1]-self.maxItems))) self.scrollTop = y + ((self.listPos / (#self.items[1]-self.maxItems) * 100) * ((maxHeight)-self.thumbHeight) / 100) end end end end end end end end end addEventHandler("onClientKey", root, onClientKey) function onClientClick(button,state,absoluteX,absoluteY) if (button == "left" and state == "up") then drag = nil else if #Grid.constructors > 0 then if cursorOn then local self = Grid.constructors[cursorOn] local k = 0 for i=(self.listPos+1), (math.min(#self.items[1],self.maxItems)+self.listPos) do if isMouseInPosition(self.x,(self.columHeight + self.y)+(self.itemHeight*k),self.w,self.itemHeight) then self.selected = i end k = k+1 end if (#self.items[1] > self.maxItems) then local x, y, w, h = (self.x + self.w) + 2, self.y + 18 + 2, 18 - 2, self.h - (18*2) - 2 if (isMouseInPosition(x,self.scrollTop,w,self.thumbHeight)) then space = absoluteY-self.scrollTop drag = true elseif(isMouseInPosition((self.x + self.w) + 2,self.y + 18 + 2,18, self.h - (18*2) - 2)) then space = self.thumbHeight/2 drag = true end end end end end end addEventHandler("onClientClick",root,onClientClick) function Grid:getMaxPosition() local pos = 1 while true do if(pos*(24)+(24) <= self.originalH) then pos = pos + 1 else pos = pos - 2 break end end return pos end function isMouseInPosition(x, y, w, h) if (not isCursorShowing()) then return end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ((cx >= x and cx <= x + w) and (cy >= y and cy <= y + h)) end --[[ local grid = Grid(400,150,500,500) local colum = grid:addColumn("Colum",200) for k=1, 80 do grid:addItem(colum,(tostring(k))) end showCursor(true)]]
  9. Olá, o problema que estou enfrentado é que mesmo clicando na window, nas partes que não possuem botão, os dois botões estão sendo executado simultaneamente, mas não quero que isso aconteça, alguém consegue me ajudar? pedestre = createPed(46, 1504.4595947266,-1709.5983886719,14.046875, 270) setElementFrozen(pedestre, true) markerEmprego = createMarker(1504.5090332031,-1709.5562744141,14.046875, "cylinder", 1.5, 255,255,255, 0) janela = guiCreateWindow(0.37, 0.35, 0.25 , 0.2, "PEGAR EMPREGO", true) botao1 = guiCreateButton(0, 0.7, 1.2, 0.28, "FECHAR CONVERSA", true, janela) botao2 = guiCreateButton(0, 0.3, 1.2 , 0.28, "PEGAR O EMPREGO", true, janela) guiWindowSetMovable(janela, false) guiWindowSetSizable(janela, false) guiSetVisible(janela, false) guiSetVisible(botao1, false) guiSetVisible(botao2, false) function cancelarAtaqueEmPed(attacker) cancelEvent() end addEventHandler("onClientPedDamage", getRootElement(), cancelarAtaqueEmPed) function pegarEmprego(hitPlayer) guiSetVisible(janela, true) guiSetVisible(botao1, true) guiSetVisible(botao2, true) showCursor(true) outputChatBox("Olá mundo.") end addEventHandler("onClientMarkerHit", markerEmprego, pegarEmprego) Quem puder me ajudar receberá Thanks! O que está acontecendo: https://prnt.sc/ptvwl3
  10. I am looking to remove a certain mod from a server, which i suspect is the reason for which I cam no longer log into the server. It worked fine before they implemented the mod/change in script, and see if that solves it and if there's even a way to do it.
  11. local table = { {"1", "2", "3", "4"}, } function asdasdsdasdd() table.insert(table,"5","6","7","8") end What wrong? No errors and warnings in debugscript 3...
  12. I'm creating a blitz script, I already created the object, but I would like to delete this object and I don't know how. Could someone help? Script >< function Criarobjeto() local px, py, pz = getElementPosition ( getLocalPlayer ()) createObject(id, px, py, pz) end addCommandHandler("ob", Criarobjeto)
  13. Peace on you . Why do we use " shader " and make the value " texture " to change element texture instead of use "Texture" directly ? Why we need to make shader first ? Thanks !
  14. Hello everyone, I am very excited to start a new project in MTA but I am somewhat confused with the use of resources. I wish you could please help me to leave my project clean with nothing to start a game mode from scratch, in the mod folder there are many folders that confuse me and I don't know which to deactivate and which to leave activated. If you give me a hand to be able to configure my folder to be able to start my RPG project, it would be very helpful and I would appreciate it very much, thanks in advance.
  15. When I quit from server my ElementData gived isn't saved. I tried to do this code to save, follow: function SalvarDadosLogout (source) local ObterGalao = getElementData(source, "galao") local conta = getPlayerAccount (source) setAccountData(conta, "galao", ObterGalao) end addEventHandler("onPlayerQuit", root, SalvarDadosLogout) function DarDadosLogin (source) local conta = getPlayerAccount (source) local TemGalao = getAccountData(conta, "galao") setElementData(source, TemGalao) end addEventHandler("onPlayerLogin", root, DarDadosLogin)
  16. Estou com um problema, é o seguinte: Estou usando o setElementData, ele funciona perfeitamente para estocar o valor determinado. Porém quando o "source", o player sai do server como por exemplo dá "reconnect" esse valor estocado não fica salvo. Alguém tem ideia de como consigo fazer para salvar ? Desde já agradeço!
  17. Olá preciso de ajuda quando entro em servidores não aparece nada escrito Exemplo:para logar precisa postar seu nome e senha quando eu aperto pra botar e escrevo não aparece nada e se consigo logar as palavras (instruções,letras,números,guias,menus)não aparece nada como se estivesse tampado por umas tarjeta preta ou algo assim Preciso de ajuda per alguém sabe o que posso fazer para resolver
  18. Gostaria de colocar um interior na posição do mundo, e na dimensão zero, segue print de onde gostaria que ele ficasse para melhor entendimento: https://i.imgur.com/nDO6kX0.png Desde já agradeço!
  19. Como faço para desabilitar os sons de tiro que ficam no fundo quando o player está em Los Santos ? Tentei o seguinte código: addEventHandler( "onClientResourceStart", resourceRoot, function( ) setAmbientSoundEnabled( "general", false ) setAmbientSoundEnabled( "gunfire", false ) setWorldSoundEnabled (5, false) end ) Não funcionou... Alguém pode me ajudar ? Desde já agradeço!
  20. Gostaria de substituir o som de ignição do motor, já fiz um script em que o player consegue ligar de desligar o motor do veículo apertando determinado botão, mas gostaria de colocar um som para que todos aqueles que estiverem perto do carro do player consigam escutar o som da partida. Segue o link de download do som abaixo: https://drive.google.com/open?id=1ylXf3-E-Gw2wxAeIczvBMdLPduDMvh0p Não sei qual código utilizar, se puderem me ajudar agradeço!
  21. meu mta funciona tudo sertinho mas quandro entro em algum servidor nao aparece nada para escrever exemplo: para me cadastrar em um servidor preciso botar meu nome e senha mas quando aperto e escrevo nao aparece nada escrito mas contabilisa dai se eu conseguir fazer o registro eu voupara o jogo e nao da pra entender nada pois em vez de palavras fica tudo em branco
  22. Estou tentando criar uma função que faça com que a porta do veículo em que o Player estava seja fechada assim que ele deixar o carro. Não sei se isso é possível, mas tentei da seguinte maneira, porém sem sucesso: local theVehicle = getPedOccupiedVehicle ( source ) function SairVeiculo (theVehicle, leftSeat, jackerPlayer) if leftSeat == 0 and not jackerPlayer then setVehicleDoorOpenRatio ( theVehicle, 2, 0, 2500) setVehicleDoorOpenRatio ( theVehicle, 4, 0, 2500) end end addEventHandler("onPlayerVehicleExit", root, SairVeiculo) Se houver alguma maneira e puderem me ajudar, agradeço!
  23. Existe um script onde o player consegue atirar dentro do veículo desde que ele esteja em determinado veículo e ACL. Porém quando pego uma arma que no GTA:SA comum não é possível atirar de dentro do carro como por exemplo uma M4 eu consigo atirar, mas a arma não aparece em minha mão. Segue código e print abaixo para melhor explicação: IDs = { [426]=true} function Atirarmar ( jog, seat, jacked ) if ( IDs[getElementModel(source)] ) then local conta = getAccountName(getPlayerAccount(jog)) if ( isObjectInACLGroup("user." .. conta, aclGetGroup("Recruta Marinha BR"))) then bindKey (jog,"mouse2","down",bindatirocarro) else end end end addCommandHandler ("atira",Atirarmar) addEventHandler ( "onVehicleEnter", getRootElement(), Atirarmar ) function desbindaarma (jog) if (IDs[getElementModel(source)] ) then unbindKey (jog,"mouse2","down",bindatirocarro) end end addEventHandler ( "onVehicleExit", getRootElement(), desbindaarma) function bindatirocarro (jog) if (not isPedDoingGangDriveby (jog)) then setPedDoingGangDriveby (jog, true ) elseif (isPedDoingGangDriveby (jog)) then setPedDoingGangDriveby (jog,false) end end https://i.imgur.com/5hDRnw0.png Desde já agradeço!
  24. Iae rapaziada, seguinte. Eu to fazendo um script que é divido em três partes a parte 1 (Carregamento), parte 2 (Entrega do produto) e parte 3 (Revenda ao consumidor final) o meu plano final é fazer trabalhos interligados! Porém no momento estou fazendo tudo junto o Entregador faz o carregamento e entrega ( a parte de revenda ainda não desenvolvi!). O meu problema esta sendo na hora de colocar o produto no caminhão em setElementData(CamiNaMarker, "Caminhao:ProntoPcarregar", DataCaminhao + 1) ( linha 77). O máximo são 20 produtos que o Entregador pode colocar dentro do caminhão então sendo assim eu queria que cada vez que ele colocasse o produto no caminhão seria adicionado +1 no elementData até chegar aos 20! Após isso ele poderia retirar o caminhão da marker e fazer sua entrega! Erro no debugscript: Trabalho-CarregadorACPT\server.Lua:111: attempt to perform arithmetic on upvalue 'DataCaminhao' (a userdata value) Segue abaixo o script: MarkerCaminhao = createMarker(-486.762, -4996.24, 1.478 -1, "cylinder", 3.0, 210, 10, 10, 100) IniJob = createMarker(-476.458, -5001.667, 1.47 -1, "cylinder", 2.0, 3, 120, 210, 210) --EntJob = createMarker(-485.388, -4982.361, 1.478 -1, "cylinder", 2.0, 210, 120, 3, 210) local rad = math.random(13, 45) function CarregadorPegar (Jog) local fX, fY, fZ = getElementPosition( Jog ); if isElementWithinMarker(Jog, IniJob) then setPedAnimation( Jog, "CARRY", "liftup", 1.0, false ); setTimer(function() --caixa = createObject(2912, 0, 0, 0) setPedAnimation( Jog, nil ); setPedAnimation( Jog, "CARRY", "crry_prtial", 4.1, true, true, true ); toggleControl(Jog,"jump", false) toggleControl(Jog,"fire", false) caixa = createObject( 2912, fX, fY, fZ ); exports.bone_attach:attachElementToBone( caixa, Jog, 4, 0, 0.4, - 0.6, -90, 0, 0 ); setElementData(Jog, "Pegou:Caixa.Crgador", caixa) end, 1000, 1) end end addCommandHandler("pegar", CarregadorPegar) function PorCaminhao (cami) local CamiNaMarker = getVehicleInMarker( MarkerCaminhao ) outputChatBox("01") if (CamiNaMarker) and getElementModel(CamiNaMarker) == 499 then outputChatBox("02") setElementData(CamiNaMarker, "Caminhao:ProntoPcarregar", CamiNaMarker) outputChatBox("03") local x, y, z = getElementPosition(CamiNaMarker) outputChatBox("04") m1 = createMarker(x, y, z -1, "cylinder", 2.0, 0, 255, 255, 255) outputChatBox("05") attachElements(m1, CamiNaMarker, 0, - 4.2, - 1) outputChatBox("06") setElementFrozen(CamiNaMarker, true) outputChatBox("07") --end else outputChatBox("Este veiculo não pertence ao trabalho de entregador!") end end addCommandHandler("carregar", PorCaminhao) function CarregadorEntregar ( Jog) if getElementType( Jog ) == "player" and getElementData( Jog, "Pegou:Caixa.Crgador" ) then --if isElementWithinMarker(Jog, m1) then outputChatBox("01") local CamiNaMarker = getVehicleInMarker( MarkerCaminhao ) outputChatBox("02") local DataCaminhao = getElementData(CamiNaMarker, "Caminhao:ProntoPcarregar") outputChatBox("02") if (CamiNaMarker) then outputChatBox("03") if ( DataCaminhao ) then outputChatBox("04") setPedAnimation( Jog, "CARRY", "putdwn", 1.0, false, false, false, true ); outputChatBox("05") setTimer(function() if ( DataCaminhao ) == 20 then outputChatBox("caminhão cheio") else outputChatBox("06") DeleteBox( Jog ); outputChatBox("07") setElementData(CamiNaMarker, "Caminhao:ProntoPcarregar", DataCaminhao + 1) outputChatBox("08") --givePlayerMoney( Jog, rad); --outputChatBox("Você ganhou R$"..rad,Jog) setPedAnimation( Jog, "CARRY", "liftup", 0.0, false, false, false, false ); outputChatBox("09") toggleControl(Jog,"jump", true) toggleControl(Jog,"fire", true) end end, 1000, 1) else outputChatBox("Estacione o Caminhão Primeiro!") end end --end end end addCommandHandler("por", CarregadorEntregar) function TirarCaminhao (cami) local CamiNaMarker = getVehicleInMarker( MarkerCaminhao ) outputChatBox("01") if (CamiNaMarker) and getElementModel(CamiNaMarker) == 499 then outputChatBox("02") if getElementData(CamiNaMarker, "Caminhao:ProntoPcarregar") == 20 then outputChatBox("03") setElementData(CamiNaMarker, "Caminhao:Carregado", 20) outputChatBox("04") detachElements(m1, CamiNaMarker) outputChatBox("05") destroyElement(m1) outputChatBox("06") setElementFrozen(CamiNaMarker, false) outputChatBox("07") end end end addCommandHandler("carregado", TirarCaminhao)
  25. Editei um script de Prender o jogador que baixei da internet, ele obtém o jogador através do getPlayerFromPartialName. Gostaria de obter o jogador pelo script de ID, assim como no FiveM, aquele ID que aparece na cabeça do Player. Segue o código do script do ID e a função onde gostaria de obter o player pelo ID: function Start_Id ( _, acc ) if eventName == "onPlayerLogin" then setElementData ( source, "ID", getAccountID(acc) or "N/A" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffID: #00ff00( "..(getAccountID(acc) or "N/A") .." )", root, 255,255,255,true) elseif eventName == "onPlayerLogout" then removeElementData( source, "ID" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffDeslogou.", root, 255,255,255,true) elseif eventName == "onResourceStart" then for _, player in pairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setElementData( source, "ID", getAccountID(acc) or "N/A" ) end end end end addEventHandler("onResourceStart", resourceRoot, Start_Id) addEventHandler("onPlayerLogout", root, Start_Id) addEventHandler("onPlayerLogin", root, Start_Id) 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 --============================================================================================================================-- --=============================-- ----------- ID PLAYER ------------ --=============================-- function getnick(player, command, id, ...) if(id) then local playerID = tonumber(id) if(playerID) then local Player2 = getPlayerID(playerID) if(Player2) then outputChatBox ( "#00ff00✘ #ffffffINFO #00ff00✘➺ #ffffff Nome do Jogador #00ff00" .. getPlayerName(Player2) .."", player, 255,255,255,true) else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff O Jogador(a) de ID: #00ff00( " .. id .. " ) #ffffffNão Foi Encontrado!", player, 255,255,255,true) end else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff ID: #00ff00( " .. id .. " ) #ffffffInválido!", player, 255,255,255,true) end else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffffUse /id #00ff00[#ffffffID#00ff00]", player, 255,255,255,true) end end addCommandHandler("id", getnick) Função onde gostaria de obter o nome do player por ID: function colocanavtr (police, _, name) if hasObjectPermissionTo(police, "function.Prender") then local preso = getPlayerFromPartialName(name) -- Penso que tenha que alterar neste local. local px, py, pz = getElementPosition (police) local bx, by, bz = getElementPosition (preso) local dist = getDistanceBetweenPoints3D (px, py, pz, bx, by, bz) if not preso then return outputChatBox('#bebebe Jogador invalido.', police, 255, 255, 255, true) end if preso == police then return outputChatBox('#bebebe Você não pode prender a si mesmo.', police, 255, 255, 255, true) end if getPlayerWantedLevel(preso) == 0 then return outputChatBox('#bebebe Este jogador não está sendo procurado.', police, 255, 255, 255, true) end if getPedOccupiedVehicle(police) then return outputChatBox('#bebebe Você não pode prender de dentro da viatura.', police, 255, 255, 255, true) end if getPedOccupiedVehicle(preso) then return outputChatBox('#bebebe Você não pode prender um bandido enquanto ele estiver dentro de um veículo.', police, 255, 255, 255, true) end if dist >= 2 then return outputChatBox('#bebebe Você precisa chegar mais perto para prender.', police, 255, 255, 255, true) end setElementData (preso, 'navtr', true) addEventHandler('onPlayerCommand', preso, onCommand) local vtr = carros[police] setElementData (vtr, 'compreso', true) attachElements (preso, vtr, 0.2, -1.5, 0, 0,0,90) setElementFrozen (preso, true) toggleAllControls (preso, false) takeAllWeapons (preso) setPedAnimation (preso, 'ped','CAR_dead_LHS') vrx, vry, vrz = getElementRotation(vtr) setElementRotation(preso, vrx, vry, vrz+83) warpPedIntoVehicle (police, vtr) outputChatBox('#bebebeLeve o preso para a delegacia mais próxima #00ffff(sirenes azuis).', police, 255, 255, 255,true) end end addCommandHandler ('prender', colocanavtr) Se puderem me ajudar, agradeço!