#Horus Posted September 18, 2018 Share Posted September 18, 2018 É um script de proteção de bases! Tipo, apenas quem está na acl ''MARINHA'' pode ir para a base da marinha brasileira, como faço pra mais de uma acl poder ir para essa base? SCRIPT: RestricLocation = {} TeleportLocation = {} EnabledAlarm = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {-264.21362304688,3335.7004394531,1.1062507629395} -- Local 1 RestricLocation["location2"] = {775.92932128906,2741.86544785156,150.10624694824} -- Local 2 TeleportLocation = {1976.0953369141,-1924.1055908203,13.546875} -- Local de TP GroupName = "MARINHA" -- Nome da Gang ou Grupo ACL GroupNameBy = 2 -- 1 para Gang, e 2 para ACL MsgInvasao = "Base da MARINHA! Você não pode entrar aqui!" EnableVehicleGodMode = true -- Habilitar HabilitarAdmin = false -- Todos admins vao poder entrar na base GodMode = false -- Ao entrar na área protegida, habilita GodMode NaoAtirar = false -- Ao entrar na área protegida, não podera atirar --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 0, 0, true ) end function EnterPlace ( theElement ) local veh = getPedOccupiedVehicle(theElement) local accName = getAccountName(getPlayerAccount(theElement)) if HabilitarAdmin == true then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then return end end if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) then sendMsg(theElement,MsgInvasao) if veh then setElementPosition( veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) end sendMsgOwners(theElement) elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if GodMode == true then setElementData(theElement,"blood",12000) end if NaoAtirar == true then toggleControl(theElement, "fire", true) toggleControl(theElement, "vehicle_fire", true) toggleControl(theElement, "vehicle_secondary_fire", true) toggleControl(theElement, "aim_weapon", true) end if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString("Erro, verifique: location1 e location2") end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," O Jogador " ..getPlayerName ( PlayerID ) .." esta tentando invadir a sua BASE !") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end Link to comment
Other Languages Moderators Lord Henry Posted September 18, 2018 Other Languages Moderators Share Posted September 18, 2018 if isObjectInACLGroup ("user."..accName, aclGetGroup ("MARINHA")) or isObjectInACLGroup ("user."..accName, aclGetGroup ("NOME2")) then Desse jeito aqui, vai permitir 2 ACL Groups simultaneamente. Se você quer fazer para vários grupos, dai vai precisar de uma table e um for para verificar cada um. Link to comment
#Horus Posted September 18, 2018 Author Share Posted September 18, 2018 3 hours ago, Lord Henry said: if isObjectInACLGroup ("user."..accName, aclGetGroup ("MARINHA")) or isObjectInACLGroup ("user."..accName, aclGetGroup ("NOME2")) then Desse jeito aqui, vai permitir 2 ACL Groups simultaneamente. Se você quer fazer para vários grupos, dai vai precisar de uma table e um for para verificar cada um. Maninhoo, eu meio q entendi +-, eu precisaria de 3 grupos na acl sabe ? por exemplo a marinha mesmo, eu precisaria de ''CmdMB'' e ''MB'' e ''RecrutaMB'' sabe ? eu nao entendi esse TABLE FOR Link to comment
Jonas^ Posted September 18, 2018 Share Posted September 18, 2018 4 minutes ago, #Horus said: Maninhoo, eu meio q entendi +-, eu precisaria de 3 grupos na acl sabe ? por exemplo a marinha mesmo, eu precisaria de ''CmdMB'' e ''MB'' e ''RecrutaMB'' sabe ? eu nao entendi esse TABLE FOR Quais grupos você quer permitir entrar nessa base? Link to comment
#Horus Posted September 18, 2018 Author Share Posted September 18, 2018 Ol 4 minutes ago, OverKILL said: Quais grupos você quer permitir entrar nessa base? Olá manoo! os grupos são : CmdMB, MB, RecrutaMB. ei maninho lembra o script painel vip q pedi ajuda pra bota o superman ? consegui colocar Link to comment
Jonas^ Posted September 18, 2018 Share Posted September 18, 2018 (edited) 4 minutes ago, #Horus said: Ol Olá manoo! os grupos são : CmdMB, MB, RecrutaMB. ei maninho lembra o script painel vip q pedi ajuda pra bota o superman ? consegui colocar Isso aí, nunca desista. Código: ( NÃO TESTEI ) RestricLocation = {} TeleportLocation = {} EnabledAlarm = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {-264.21362304688,3335.7004394531,1.1062507629395} -- Local 1 RestricLocation["location2"] = {775.92932128906,2741.86544785156,150.10624694824} -- Local 2 TeleportLocation = {1976.0953369141,-1924.1055908203,13.546875} -- Local de TP GroupName = "MARINHA" -- ACL 1 GroupName2 = "MB" -- ACL 2 GroupName3 = "RecrutaMB" -- ACL 3 GroupName4 = "CmdMB" -- ACL 4 GroupNameBy = 2 -- 1 para Gang, e 2 para ACL MsgInvasao = "Base da MARINHA! Você não pode entrar aqui!" EnableVehicleGodMode = true -- Habilitar HabilitarAdmin = false -- Todos admins vao poder entrar na base GodMode = false -- Ao entrar na área protegida, habilita GodMode NaoAtirar = false -- Ao entrar na área protegida, não podera atirar --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 0, 0, true ) end function EnterPlace ( theElement ) local veh = getPedOccupiedVehicle(theElement) local accName = getAccountName(getPlayerAccount(theElement)) if HabilitarAdmin == true then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then return end end if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) then sendMsg(theElement,MsgInvasao) if veh then setElementPosition( veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) end sendMsgOwners(theElement) elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if GodMode == true then setElementData(theElement,"blood",12000) end if NaoAtirar == true then toggleControl(theElement, "fire", true) toggleControl(theElement, "vehicle_fire", true) toggleControl(theElement, "vehicle_secondary_fire", true) toggleControl(theElement, "aim_weapon", true) end if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName2 ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName3 ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName4 ) ) ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString("Erro, verifique: location1 e location2") end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," O Jogador " ..getPlayerName ( PlayerID ) .." esta tentando invadir a sua BASE !") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end 5 minutes ago, #Horus said: Ol Olá manoo! os grupos são : CmdMB, MB, RecrutaMB. ei maninho lembra o script painel vip q pedi ajuda pra bota o superman ? consegui colocar Editei o código me deparei com um erro copie de novo. Edited September 18, 2018 by OverKILL Link to comment
#Horus Posted September 18, 2018 Author Share Posted September 18, 2018 5 minutes ago, OverKILL said: Isso aí, nunca desista. Código: ( NÃO TESTEI ) RestricLocation = {} TeleportLocation = {} EnabledAlarm = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {-264.21362304688,3335.7004394531,1.1062507629395} -- Local 1 RestricLocation["location2"] = {775.92932128906,2741.86544785156,150.10624694824} -- Local 2 TeleportLocation = {1976.0953369141,-1924.1055908203,13.546875} -- Local de TP GroupName = "MARINHA" -- ACL 1 GroupName2 = "MB" -- ACL 2 GroupName3 = "RecrutaMB" -- ACL 3 GroupName4 = "CmdMB" -- ACL 4 GroupNameBy = 2 -- 1 para Gang, e 2 para ACL MsgInvasao = "Base da MARINHA! Você não pode entrar aqui!" EnableVehicleGodMode = true -- Habilitar HabilitarAdmin = false -- Todos admins vao poder entrar na base GodMode = false -- Ao entrar na área protegida, habilita GodMode NaoAtirar = false -- Ao entrar na área protegida, não podera atirar --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 0, 0, true ) end function EnterPlace ( theElement ) local veh = getPedOccupiedVehicle(theElement) local accName = getAccountName(getPlayerAccount(theElement)) if HabilitarAdmin == true then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then return end end if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) then sendMsg(theElement,MsgInvasao) if veh then setElementPosition( veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) end sendMsgOwners(theElement) elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if GodMode == true then setElementData(theElement,"blood",12000) end if NaoAtirar == true then toggleControl(theElement, "fire", true) toggleControl(theElement, "vehicle_fire", true) toggleControl(theElement, "vehicle_secondary_fire", true) toggleControl(theElement, "aim_weapon", true) end if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName2 ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName3 ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName4 ) ) ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString("Erro, verifique: location1 e location2") end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," O Jogador " ..getPlayerName ( PlayerID ) .." esta tentando invadir a sua BASE !") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end mano estou com bom pressentimento..... vc é o cara manooooo! vo testar aqui, pelos novos esquemas adicionados acho que ja vai funcionar normalmente MANOO, sabe a primeira ACL ''MARINHA'' ? Eu removi ela e deixei apenas CmdMB - MB - RecrutaMB, Olha se removi corretamente RestricLocation = {} TeleportLocation = {} EnabledAlarm = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {-264.21362304688,3335.7004394531,1.1062507629395} -- Local 1 RestricLocation["location2"] = {775.92932128906,2741.86544785156,150.10624694824} -- Local 2 TeleportLocation = {1976.0953369141,-1924.1055908203,13.546875} -- Local de TP GroupName = "CmdMB" -- ACL 1 PADRÃO GroupName2 = "MB" -- ACL 2 GroupName3 = "RecrutaMB" -- ACL 3 GroupNameBy = 2 -- 1 para Gang, e 2 para ACL MsgInvasao = "Base da MARINHA! Você não pode entrar aqui!" EnableVehicleGodMode = true -- Habilitar HabilitarAdmin = false -- Todos admins vao poder entrar na base GodMode = false -- Ao entrar na área protegida, habilita GodMode NaoAtirar = false -- Ao entrar na área protegida, não podera atirar --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 0, 0, true ) end function EnterPlace ( theElement ) local veh = getPedOccupiedVehicle(theElement) local accName = getAccountName(getPlayerAccount(theElement)) if HabilitarAdmin == true then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then return end end if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) then sendMsg(theElement,MsgInvasao) if veh then setElementPosition( veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) end sendMsgOwners(theElement) elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if GodMode == true then setElementData(theElement,"blood",12000) end if NaoAtirar == true then toggleControl(theElement, "fire", true) toggleControl(theElement, "vehicle_fire", true) toggleControl(theElement, "vehicle_secondary_fire", true) toggleControl(theElement, "aim_weapon", true) end if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName2 ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName3 ) ) ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString("Erro, verifique: location1 e location2") end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," O Jogador " ..getPlayerName ( PlayerID ) .." esta tentando invadir a sua BASE !") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end 21 minutes ago, OverKILL said: Isso aí, nunca desista. Código: ( NÃO TESTEI ) RestricLocation = {} TeleportLocation = {} EnabledAlarm = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {-264.21362304688,3335.7004394531,1.1062507629395} -- Local 1 RestricLocation["location2"] = {775.92932128906,2741.86544785156,150.10624694824} -- Local 2 TeleportLocation = {1976.0953369141,-1924.1055908203,13.546875} -- Local de TP GroupName = "MARINHA" -- ACL 1 GroupName2 = "MB" -- ACL 2 GroupName3 = "RecrutaMB" -- ACL 3 GroupName4 = "CmdMB" -- ACL 4 GroupNameBy = 2 -- 1 para Gang, e 2 para ACL MsgInvasao = "Base da MARINHA! Você não pode entrar aqui!" EnableVehicleGodMode = true -- Habilitar HabilitarAdmin = false -- Todos admins vao poder entrar na base GodMode = false -- Ao entrar na área protegida, habilita GodMode NaoAtirar = false -- Ao entrar na área protegida, não podera atirar --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 0, 0, true ) end function EnterPlace ( theElement ) local veh = getPedOccupiedVehicle(theElement) local accName = getAccountName(getPlayerAccount(theElement)) if HabilitarAdmin == true then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then return end end if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) then sendMsg(theElement,MsgInvasao) if veh then setElementPosition( veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) end sendMsgOwners(theElement) elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if GodMode == true then setElementData(theElement,"blood",12000) end if NaoAtirar == true then toggleControl(theElement, "fire", true) toggleControl(theElement, "vehicle_fire", true) toggleControl(theElement, "vehicle_secondary_fire", true) toggleControl(theElement, "aim_weapon", true) end if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName2 ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName3 ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName4 ) ) ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString("Erro, verifique: location1 e location2") end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," O Jogador " ..getPlayerName ( PlayerID ) .." esta tentando invadir a sua BASE !") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end Editei o código me deparei com um erro copie de novo. mano deu certooooooooooooooooooooooooooooooooooooooooooooo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! muito obrigado mesmooooo deus lhe abençoe Link to comment
Jonas^ Posted September 18, 2018 Share Posted September 18, 2018 37 minutes ago, #Horus said: mano estou com bom pressentimento..... vc é o cara manooooo! vo testar aqui, pelos novos esquemas adicionados acho que ja vai funcionar normalmente MANOO, sabe a primeira ACL ''MARINHA'' ? Eu removi ela e deixei apenas CmdMB - MB - RecrutaMB, Olha se removi corretamente RestricLocation = {}TeleportLocation = {}EnabledAlarm = trueColCuboid = false--------------------------------------- CONFIGS --------------------------------------------RestricLocation["location1"] = {-264.21362304688,3335.7004394531,1.1062507629395} -- Local 1RestricLocation["location2"] = {775.92932128906,2741.86544785156,150.10624694824} -- Local 2TeleportLocation = {1976.0953369141,-1924.1055908203,13.546875} -- Local de TPGroupName = "CmdMB" -- ACL 1 PADRÃOGroupName2 = "MB" -- ACL 2GroupName3 = "RecrutaMB" -- ACL 3GroupNameBy = 2 -- 1 para Gang, e 2 para ACLMsgInvasao = "Base da MARINHA! Você não pode entrar aqui!"EnableVehicleGodMode = true -- HabilitarHabilitarAdmin = false -- Todos admins vao poder entrar na baseGodMode = false -- Ao entrar na área protegida, habilita GodModeNaoAtirar = false -- Ao entrar na área protegida, não podera atirar--------------------------------------- CONFIGS --------------------------------------------function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 0, 0, true )endfunction EnterPlace ( theElement )local veh = getPedOccupiedVehicle(theElement)local accName = getAccountName(getPlayerAccount(theElement)) if HabilitarAdmin == true then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then return end end if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) then sendMsg(theElement,MsgInvasao) if veh then setElementPosition( veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) end sendMsgOwners(theElement) elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) endendfunction ExitPlace ( theElement ) if GodMode == true then setElementData(theElement,"blood",12000) end if NaoAtirar == true then toggleControl(theElement, "fire", true) toggleControl(theElement, "vehicle_fire", true) toggleControl(theElement, "vehicle_secondary_fire", true) toggleControl(theElement, "aim_weapon", true) end if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) endendfunction PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName2 ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName3 ) ) ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end endendfunction ResourceStart( ) LoadLocations() CreateCollision()endaddEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart)function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] endendfunction CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString("Erro, verifique: location1 e location2") endendfunction ResourceStop( ) destroyElement ( ColCuboid )endaddEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop)function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," O Jogador " ..getPlayerName ( PlayerID ) .." esta tentando invadir a sua BASE !") end endendfunction SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) endend mano deu certooooooooooooooooooooooooooooooooooooooooooooo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! muito obrigado mesmooooo deus lhe abençoe De nada. Link to comment
#Horus Posted September 19, 2018 Author Share Posted September 19, 2018 59 minutes ago, OverKILL said: De nada. mano sem querer te pedir mt rsrsrs, eu vendo skins exclusivas no servidor, mas ao invez de eu ficar criando grupo la acl, para apenas a pessoa dona da skin exclusiva poder pegar.. eu queria que fosse por login ai como faço? function SkinProvado(ViejoModelo, ModeloNuevo) if ModeloNuevo == 287 then -- si es el modelo 109 que pase lo siguiente if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ("Console") ) then --si esta en el grupo ACL "admin" que pase lo siguiente outputChatBox("COMANDOS ANFIBIOS!!!!", source, 0, 255, 0) -- OPCIONAL else outputChatBox("Skin Exclusiva do Dono do Servidor!", source, 255, 0, 0) setTimer(setElementModel, 50, 1, source, ViejoModelo) -- devuelve el viejo skin end end end addEventHandler("onElementModelChange", root, SkinProvado) -- Evento al cambiar de modelo Link to comment
Jonas^ Posted September 19, 2018 Share Posted September 19, 2018 (edited) function SkinProvado(ViejoModelo, ModeloNuevo) if ModeloNuevo == 287 then if getAccountName(getPlayerAccount(source)) == "ContaAqui" then outputChatBox("COMANDOS ANFIBIOS!!!!", source, 0, 255, 0) else outputChatBox("Skin Exclusiva do Dono do Servidor!", source, 255, 0, 0) setTimer(setElementModel, 50, 1, source, ViejoModelo) end end end addEventHandler("onElementModelChange", root, SkinProvado) 13 minutes ago, #Horus said: mano sem querer te pedir mt rsrsrs, eu vendo skins exclusivas no servidor, mas ao invez de eu ficar criando grupo la acl, para apenas a pessoa dona da skin exclusiva poder pegar.. eu queria que fosse por login ai como faço? function SkinProvado(ViejoModelo, ModeloNuevo) if ModeloNuevo == 287 then -- si es el modelo 109 que pase lo siguiente if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ("Console") ) then --si esta en el grupo ACL "admin" que pase lo siguiente outputChatBox("COMANDOS ANFIBIOS!!!!", source, 0, 255, 0) -- OPCIONAL else outputChatBox("Skin Exclusiva do Dono do Servidor!", source, 255, 0, 0) setTimer(setElementModel, 50, 1, source, ViejoModelo) -- devuelve el viejo skin end endendaddEventHandler("onElementModelChange", root, SkinProvado) -- Evento al cambiar de modelo Editei o código atualiza a página. Não ta faltando uma parte deste código não? Edited September 19, 2018 by OverKILL Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now