Jump to content

Bankrob-system


Prodax

Recommended Posts

Posted

I would like to ask for a bank robbery every 10 seconds which system would give the player $ 2,000. command :/ rob

  thank you very much

Posted

You do realize that this is not a board where you come in without an intention to buy a script.

And those functions that csiguusz gave you are a good start for you.

Posted
function rob(rob,thePlayer) 
  
 if (robbed==0) then 
            outputChatBox("Start robbed", source, 255, 194, 14) 
        elseif (robbed==1) then 
            outputChatBox("Finish Robbed", source, 255, 194, 14) 
         
        end 
    givePlayerMoney ( rob, 1000 ) 
    setTimer(rob, 10000, 0, source) 
     
end 
addCommandHandler( "rob",rob ) 

no god.Please help thank you

Posted
function rob(sourcePlayer, commandName) 
    setTimer( function() 
        if (robbed==0) then 
            outputChatBox("Start robbed", sourcePlayer, 255, 194, 14) 
        elseif (robbed==1) then 
            outputChatBox("Finish Robbed", sourcePlayer, 255, 194, 14) 
        end 
        givePlayerMoney( sourcePlayer, 2000 ) 
    end, 10000, 0 ) 
end 
addCommandHandler( "rob", rob ) 

  • Moderators
Posted (edited)

-- client ..

  
local lastTickRob = 0 
function rob () 
      local tick = getTickCount () 
      local myTick = (tick-lastTickRob) 
      if 10000 < myTick then 
            lastTickRob = tick 
            givePlayerMoney( 2000 ) 
      else 
            outputChatBox(" You have to wait" .. math.ceil((10000-myTick)/1000) .. " secondes before you can rob the shop again.") 
      end 
addCommandHandler( "rob", rob ) 

Edited by Guest
  • Moderators
Posted
-- client 
local lastTickRob = 0 
function rob () 
    local tick = getTickCount () 
    local myTick = (tick-lastTickRob) 
    if 10000 < myTick then 
        lastTickRob = tick 
        triggerServerEvent ( "giveMoneyRob", getLocalPlayer() ) 
    else 
        outputChatBox(" You have to wait " .. math.ceil((10000-myTick)/1000) .. " secondes before you can rob the shop again.") 
    end 
end 
addCommandHandler( "rob", rob ) 

  
--server 
addEvent( "giveMoneyRob", true ) 
addEventHandler( "giveMoneyRob", getRootElement(), 
function () 
if isElement(source) and not isPedDead ( source ) then 
 givePlayerMoney(source, 2000 ) 
end 
end) 
  
  

Well he can build it him self, I don't know anything about rpg and role-play servers any way.

But thank you for let me solve the problem. :wink:

test it and it works.

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