Certain Ped required to activate event notification?

I am working on a .lua based script and I want the “notify event” to only be triggered by certain in game ped(s) how can I string that into a functioning code? I have seen you can set IsPedInAnyVehicle type stuff but unsure where the Ped related comes in, any help would be wonderful.

You can check the ped’s model using GetEntityModel and then check that up against whatever ped model you desire.

For example, this would check if the ped (in this case the player ped) is a “mp_m_freemode_01”.

local ped = PlayerPedId()
if GetEntityModel(ped) == `mp_m_freemode_01` then
    print(ped.." is a male mp freeemode ped!")
end

If you want to check for multiple models you could make a list like this:

local notifyPeds = {
    [`mp_m_freemode_01`] = true,
    [`mp_f_freemode_01`] = true,
}

local ped = PlayerPedId()
if notifyPeds[GetEntityModel(ped)] then
    print(ped.." is a mp freeemode ped!")
end

Oh sweet thanks, i’ll have to see if I can get this to work. Thanks alot!