Jump to content

Bankrob-system


Prodax

Recommended Posts

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

Link to comment
  • Moderators
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 ) 

Link to comment
  • Moderators

-- 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
Link to comment
  • Moderators
-- 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.

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