Jump to content

[HELP] Box System


xXGhostXx

Recommended Posts

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

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