Jump to content

Mta robbing notify to pd.


Benderos

Recommended Posts

Posted

Hi there, i have a problem. I cannot figure out how to make notify to department when somebodys robbing smthing like bank or atm. i want it to say to dep when somebodys robbing smthing like The jewelry store is being robbed, for all available units react.  Can somebody help me with this? Thanks forward.

Posted

Well u can try something like this

1.) U can create a function for notification in your cop / departament resource and export the function and use it in rob resource.

2.) if u had used setElementData in your cop/ departament resource then u can do somehting like this loop through all players in your rob resource and outputChatBox only for those who have "cop data" or "departament data".

 addCommandHandler("rob",function(thePlayer,commandName)
    if thePlayer then 
    if getElementData(thePlayer,"cop_data") == true or getElementData(thePlayer,"departament_data") == true then
    outputChatBox("[ROB] You are part of departament or cop team u cant rob",thePlayer,255,50,50)
    else
    local x,y,z = getElementPosition(thePlayer)
    for id,player in ipairs(getElementsByType("player")) do 
        if getElementData(player,"cop_data") == true or getElementData(player,"departament_data") == true then 
        
        local zone = getZoneName(x,y,z)
        outputChatBox("[ROB] Someone robbed a shop or ATM in "..zone.." area!!!",player,255,50,50)
                end
            end
        end
    end
 end)

 

DBFrame Resource owner.

Posted
43 minutes ago, Benderos said:

Can u help me how to do it with factions? Im using factions, not pd script.

Is the same like the one i wrote you but u replace in my example with your factions data or what data you use. I dont know what u use there so i just gave you a basic idea. I can help u but i have to see your faction script or what u use to add a player in a faction.

DBFrame Resource owner.

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...