# Dicas de Integração

Dicas importantes para integrar o EQPG-Pro com outros scripts e evitar conflitos com as proteções do anticheat.

***

## Scripts de Casas / Dimensões

Scripts que mudam o jogador de dimensão e spawnam armas (como scripts de casas, apartamentos ou instâncias) podem causar conflitos com o anticheat.

### Problema

Ao mudar de dimensão, as armas podem ser detectadas como spawn ilegal.

### Solução

Adicione o seguinte código **no client-side** ao transicionar entre dimensões:

```lua
SetCurrentPedWeapon(PlayerPedId(), GetHashKey("WEAPON_UNARMED"), true)
```

### Exemplo Completo

```lua
-- Client-side: ao entrar em uma casa
RegisterNetEvent("casas:entrar")
AddEventHandler("casas:entrar", function(dimensao)
    -- Desarmar o jogador antes de mudar de dimensão
    SetCurrentPedWeapon(PlayerPedId(), GetHashKey("WEAPON_UNARMED"), true)
    
    -- Mudar de dimensão
    -- ... seu código de mudança de dimensão
end)
```

***

## Scripts de Admin

Para scripts de admin que utilizam noclip e teleport:

```lua
-- Server-side: ao ativar modo admin
exports["eqpg-pro"]:BypassProtect(source, "[noclip-1]", true)

-- Server-side: ao desativar modo admin
exports["eqpg-pro"]:BypassProtect(source, "[noclip-1]", false)
```

***

## Scripts de Armas / Inventário

**Sempre** use os exports do EQPG-Pro para spawnar armas:

```lua
-- ❌ ERRADO — Será detectado como cheat
GiveWeaponToPed(GetPlayerPed(source), "WEAPON_PISTOL", 100, false, true)

-- ✅ CORRETO — Método 1
exports["eqpg-pro"]:giveWeapons(source, {
    ["WEAPON_PISTOL"] = { ammo = 100, isHidden = false, bForceInHand = true }
})

-- ✅ CORRETO — Método 2 (substituto direto da native)
exports["eqpg-pro"]:EQPGWeapon(GetPlayerPed(source), "WEAPON_PISTOL", 100, false, true)
```

***

## Scripts com Attach entre Jogadores

Para scripts de algemas, carregar jogadores, etc:

```lua
-- Desativar proteção para ambos os jogadores envolvidos
TriggerClientEvent("AttachmentSanitization", source, false)
TriggerClientEvent("AttachmentSanitization", otherSource, false)

-- ... realizar o attach ...

-- Reativar proteção após desanexar
TriggerClientEvent("AttachmentSanitization", source, true)
TriggerClientEvent("AttachmentSanitization", otherSource, true)
```

***

## Checklist de Integração

Use esta checklist ao integrar um novo script:

* [ ] O script spawna armas? → Use `giveWeapons` ou `EQPGWeapon`
* [ ] O script spawna veículos? → Use `setSpawnClient`
* [ ] O script usa noclip ou teleport? → Use `BypassProtect`
* [ ] O script faz attach entre jogadores? → Desative `AttachmentSanitization`
* [ ] O script muda de dimensão com armas? → Use `SetCurrentPedWeapon` para desarmar


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eqpg-network.gitbook.io/eqpg-docs/guias-de-integracao/dicas-integracao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
