Sande Posted August 25, 2013 Share Posted August 25, 2013 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
Sande Posted August 25, 2013 Author Share Posted August 25, 2013 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
EstrategiaGTA Posted August 25, 2013 Share Posted August 25, 2013 Post the client script. Link to comment
iPrestege Posted August 25, 2013 Share Posted August 25, 2013 robbers defined as what. Link to comment
TAPL Posted August 25, 2013 Share Posted August 25, 2013 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
Sande Posted August 25, 2013 Author Share Posted August 25, 2013 Thanks tapl, that works Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now