Jump to content

Help me! Store robbery[HELP]


Sande

Recommended Posts

I try to make store robbing, all other works but the price giving not working. Can some one fix? And i need some info how can make this robbery avaible on every 1h.

  
function resourceStart () 
  robMarker = createMarker (252.12193, -56.73697, 1.57031, "cylinder", 1.5, 255, 255, 0, 127, getRootElement()) 
  --[[setElementInterior (robMarker, 3)--]] 
end 
addEventHandler ("onResourceStart", getRootElement (), resourceStart) 
  
function robHit (hitPlayer, matchingDimesion ) 
    if (source == robMarker ) then 
    local team = getPlayerTeam ( hitPlayer ) 
    if getTeamName (team) == "Criminal" then 
    outputChatBox("Kirjoita /rob4 ryöstääksesi tämän kohteen. Muista olla punaisessa ympyrässä jotta ryöstö alkaa!", hitPlayer, 0,255,0) 
    end 
    end 
end 
addEventHandler ("onMarkerHit", getRootElement(), robHit) 
  
function timer(thePlayer) 
    outputChatBox("[ROB4] Holvi aukeaa 1min kuluttua.",source,0,255,0) 
    setTimer (startRob, 6000, 1 ) 
end 
addCommandHandler("rob4", timer ) 
  
function startRob() 
    if (source == robMarker ) then 
    local team = getPlayerTeam ( source ) 
    if getTeamName (team) == "Criminal" then 
    local rnd = math.random(3000,15000) 
    givePlayerMoney(source, rnd) 
    setPlayerWantedLevel(source, 6) 
    outputChatBox("[ROB4] Ryöstit likööri liikkeen sait jonkunverran rahaa.", source, 0,255,0) 
    outputChatBox("[ROB4] Pelaaja "..(source).." ryösti viinakaupan ja sai 6 tähteä!",255,0,0) 
end 
end 
end 
--[[(252.12193 -56.73697 )--]] 

Link to comment

((Not Tested))

  
function resourceStart () 
  robMarker = createMarker (252.12193, -56.73697, 1.57031, "cylinder", 1.5, 255, 255, 0, 127 ) 
  --[[setElementInterior (robMarker, 3)--]] 
end 
addEventHandler ("onResourceStart", getRootElement (), resourceStart) 
  
function robHit (hitPlayer, matchingDimesion ) 
    if (source == robMarker ) then 
        local team = getPlayerTeam ( hitPlayer ) 
        if team and getTeamName (team) == "Criminal" then 
            outputChatBox("Kirjoita /rob4 ryöstääksesi tämän kohteen. Muista olla punaisessa ympyrässä jotta ryöstö alkaa!", hitPlayer, 0,255,0) 
        end 
    end 
end 
addEventHandler ("onMarkerHit", getRootElement(), robHit) 
  
function timer(thePlayer) 
    outputChatBox("[ROB4] Holvi aukeaa 1min kuluttua.",thePlayer,0,255,0) 
    setTimer (startRob, 6000, 1, thePlayer ) 
end 
addCommandHandler("rob4", timer ) 
  
function startRob() 
    if (source == robMarker ) then 
        local team = getPlayerTeam ( thePlayer ) 
        if team and getTeamName (team) == "Criminal" then 
            local rnd = math.random(3000,15000) 
            givePlayerMoney(thePlayer, rnd) 
            setPlayerWantedLevel(thePlayer, 6) 
            outputChatBox("[ROB4] Ryöstit likööri liikkeen sait jonkunverran rahaa.", thePlayer, 0,255,0) 
            outputChatBox("[ROB4] Pelaaja "..(getPlayername ( thePlayer ) ).." ryösti viinakaupan ja sai 6 tähteä!", root, 255,0,0) 
        end 
    end 
end 
--[[(252.12193 -56.73697 )--]] 

Link to comment

New code, are there someway when player robbed goes 1h time, and then it again avaible.

  
function resourceStart () 
  robMarker = createMarker (252.12193, -56.73697, 1.57031, "cylinder", 1.5, 255, 255, 0, 127 ) 
  --[[setElementInterior (robMarker, 3)--]] 
end 
addEventHandler ("onResourceStart", getRootElement (), resourceStart) 
  
function robHit (hitPlayer, matchingDimesion ) 
    if (source == robMarker ) then 
        local team = getPlayerTeam ( hitPlayer ) 
        if team and getTeamName (team) == "Criminal" then 
        local rnd = math.random(3000,15000) 
            givePlayerMoney(hitPlayer, rnd) 
            setPlayerWantedLevel(hitPlayer, 6) 
            outputChatBox("[ROB4] Ryöstit likööri liikkeen sait "..(rnd).." rahaa.", hitPlayer, 0,255,0) 
            outputChatBox("[ROB4] Pelaaja "..(getPlayername ( hitPlayer ) ).." ryösti viinakaupan ja sai 6 tähteä!", root, 255,0,0) 
             end 
    end 
end 
addEventHandler ("onMarkerHit", getRootElement(), robHit) 
  

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