Jump to content

[Ajuda] Script de Proteção de Base


Recommended Posts

Olá!

eu peguei uma resource em um site de proteção de base, na qual estou precisando, eu peguei a script mas ela não funciona de jeito nenhum, tentei editar e tals para ver se conseguia funcionar, mas nada, a proteção simplesmente não funciona/ativa nas coordenadas selecionadas

no caso eu testei em coordenadas diferentes, testei para grupo e para acl, ambas não funcionaram

  
EnabledAlarm = true 
ColCuboid = false 
  
--------------------------------------- CONFIGS -------------------------------------------- 
  
  
RestricLocation["location1"] = {2153.12451,-1761.95825,13.54556} -- Local 1  
RestricLocation["location2"] = {2195.95605,-1818.96802,13.1796} -- Local 2  
TeleportLocation = {2186.80249,-1711.85938,13.34949} -- Local de TP  
GroupName = "PM" -- Nome da Gang ou Grupo ACL 
GroupNameBy = 2 -- 1 para Gang, e 2 para ACL 
MsgInvasao = "Voce Precisa ser do [PM] para poder entrar!" 
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 

Gostaria de saber qual seria o erro na script para que ele não esteja funcionando

Agradeço desde já!

Link to comment
Editei o script de Alarme e alterei algumas coisas:

eu sei quem é o criador deste script, por isso que eu estou falando, se é roubado ou não...

o criador deste script é o #good.cs procura por ele lá no forum :wink:

( acho que talvez ele não esteja mais ativo )

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...