Jump to content

Problem with exports!


Sande

Recommended Posts

Hey, i wanna do like if player jailed, it not give reward. But now theres something wrong can someone fix=?! thanks!

  
function finishCasinoRobbery ( ) 
    for robber, _ in pairs ( robbers ) do 
        if ( isElement ( robber ) ) then         
        if exports [ "cops" ]:isPlayerJailed ( robber ) then 
              outputChatBox("[Casino-robbery] You are in jail, so you do not get the reward.", robber, 255, 0, 0) 
              return  
              end        
        if exports [ "cops" ]:isPlayerArrested ( robber ) then 
              outputChatBox("[Casino-robbery] You are handcuffed, so you do not get the reward.", robber, 255, 0, 0) 
              return  
              end 
        else givePlayerMoney ( robber, reward ) 
            outputChatBox ( "Casino Robbery: You successfully robbed the casino, you got $".. reward ..".", robber, 0, 255, 0 ) 
            triggerClientEvent ( "soitaMusa", robber ) 
    end 
stopCasinoRobbery ( ) 
end 
end 

Link to comment

The problem is now, players who not jailed, or arrested not get money or the sound.

function finishCasinoRobbery ( ) 
    for robber, _ in pairs ( robbers ) do 
        if ( isElement ( robber ) ) then         
        if exports [ "cops" ]:isPlayerJailed ( robber ) then 
              outputChatBox("[Casino-robbery] You are in jail, so you do not get the reward.", robber, 255, 0, 0) 
              return 
              end       
        if exports [ "cops" ]:isPlayerArrested ( robber ) then 
              outputChatBox("[Casino-robbery] You are handcuffed, so you do not get the reward.", robber, 255, 0, 0) 
              return 
              end 
            givePlayerMoney ( robber, reward ) 
            outputChatBox ( "Casino Robbery: You successfully robbed the casino, you got $".. reward ..".", robber, 0, 255, 0 ) 
            triggerClientEvent ( "soitaMusa1", robber ) 
    end 
stopCasinoRobbery ( ) 
end 
end 

Link to comment
function finishCasinoRobbery() 
    for robber, _ in pairs (robbers) do 
        if isElement(robber) then         
            if exports["cops"]:isPlayerJailed(robber) then 
                outputChatBox("[Casino-robbery] You are in jail, so you do not get the reward.", robber, 255, 0, 0) 
            elseif exports["cops"]:isPlayerArrested(robber) then 
                outputChatBox("[Casino-robbery] You are handcuffed, so you do not get the reward.", robber, 255, 0, 0) 
            else 
                givePlayerMoney(robber, reward) 
                outputChatBox("Casino Robbery: You successfully robbed the casino, you got $"..reward..".", robber, 0, 255, 0 ) 
                triggerClientEvent(robber, "soitaMusa", robber) 
            end 
        end 
    end 
    stopCasinoRobbery ( ) 
end 

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