Here is a list of useful things you can use in your own scripts.
Snippet:
Entity(ped).state.wantsDrugs = false--Stops the ped from being able to be sold to
Here is a example on making a ped unable to be sold to:
local location = vector4(0.0, 0.0, 70.0, 0.0)--Location the ped spawns at
local model = 'a_f_m_beach_01'--Model used.
--Request and ensure model is loaded
RequestModel(GetHashKey(model))
while not HasModelLoaded(GetHashKey(model)) do Citizen.Wait(100) end
--Create the ped
ped = CreatePed(5, GetHashKey(model), location.x, location.y, location.z -0.9, location.w, false)
--Entity(ped).state.wantsDrugs = false-- <--Can add it here but unwise, you should always check if the entity exists first.
while not DoesEntityExist(ped) do Wait(0) end
--What ever is needed for the ped (This could be completely empty or could call any number of functions.
--You can add 'Entity(ped).state.wantsDrugs = false' anywhere after the ped has been created.
Entity(ped).state.wantsDrugs = false-- <--Can add it here
SetEntityAsMissionEntity(ped, true, true)
FreezeEntityPosition(ped, true)