Z4Zy Posted October 20, 2018 Share Posted October 20, 2018 You can include 1st optional argument called 'sendTo' of "triggerClientEvent" in this occasion. Server Side :- function bazKardanBox (thePlayer, command) local account = getPlayerAccount(thePlayer) local box = getAccountData(account, "pBox") local jayeze = math.random(50000,300000) if ( box and box > 0 ) then triggerClientEvent(thePlayer, "sedabox", resourceRoot) givePlayerMoney(thePlayer, jayeze) setAccountData( account,"pBox", box-1) outputChatBox("#FF00FF[Pro-Box]: #ffffff"..getPlayerName(thePlayer).." Az Box Mablagh #FF00FF$"..jayeze.." #ffffffBe Dast Avord!", root, 255, 255, 255, true) else if box == 0 then outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) else setAccountData( account,"pBox", 0) outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) end end end addCommandHandler("openbox", bazKardanBox) Link to comment
xXGhostXx Posted October 20, 2018 Author Share Posted October 20, 2018 17 minutes ago, DeadthStrock said: You can include 1st optional argument called 'sendTo' of "triggerClientEvent" in this occasion. Server Side :- function bazKardanBox (thePlayer, command) local account = getPlayerAccount(thePlayer) local box = getAccountData(account, "pBox") local jayeze = math.random(50000,300000) if ( box and box > 0 ) then triggerClientEvent(thePlayer, "sedabox", resourceRoot) givePlayerMoney(thePlayer, jayeze) setAccountData( account,"pBox", box-1) outputChatBox("#FF00FF[Pro-Box]: #ffffff"..getPlayerName(thePlayer).." Az Box Mablagh #FF00FF$"..jayeze.." #ffffffBe Dast Avord!", root, 255, 255, 255, true) else if box == 0 then outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) else setAccountData( account,"pBox", 0) outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) end end end addCommandHandler("openbox", bazKardanBox) Thanks men ! Do you have skype ? Link to comment
Dimos7 Posted October 20, 2018 Share Posted October 20, 2018 function bazKardanBox (thePlayer, command) local account = getPlayerAccount(thePlayer) local box = getAccountData(account, "pBox") local jayeze = math.random(50000,300000) if ( box and box > 0 ) then triggerClientEvent(thePlayer,"sedabox", root) givePlayerMoney(thePlayer, jayeze) setAccountData( account,"pBox", box-1) outputChatBox("#FF00FF[Pro-Box]: #ffffff"..getPlayerName(thePlayer).." Az Box Mablagh #FF00FF$"..jayeze.." #ffffffBe Dast Avord!", root, 255, 255, 255, true) else if box == 0 then outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) else setAccountData( account,"pBox", 0) outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) end end end addCommandHandler("openbox", bazKardanBox) 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