Jump to content

Need some help.


Parazitas

Recommended Posts

Hello guys! I'm a bad scripter and i need edit one thing... Edit this script cuz just criminals can rob the shop.

function createRob() 
    Marker = createMarker ( 252.3,-54.6,0.9, "cylinder", 1, 255, 255, 0, 170 ) 
    setElementCollisionsEnabled( Marker, false ) 
    bl = createBlipAttachedTo(Marker,49) 
    outputChatBox( "Liquor store robbery is available. You can rob it in a wine glass blip.", root, 0, 255, 0 ) 
end 
addEventHandler("onResourceStart", resourceRoot,createRob) 
  
addEventHandler("onMarkerLeave",root, 
function ( player ) 
    if ( source ~= Marker ) then 
        return 
    end 
    if ( isPedInVehicle( player ) ) then 
        return 
    end 
        destroyElement( Marker ) 
        destroyElement( bl ) 
        randomMoney = math.random ( 5000, 20000 ) 
        randomWanted = math.random ( 1, 6 ) 
        givePlayerMoney(player,randomMoney) 
        setPlayerWantedLevel ( player, randomWanted ) 
        robPlayer = getPlayerName(player) 
        outputChatBox("#ffffff[#00ff00ALARM!#ffffff] #c48027" .. robPlayer .. " #ff0000robbed a liquor store and got: #00ff00" .. tostring(randomMoney) .."$ #ff0000and #00ff00" .. tostring(randomWanted) .. "#ff0000 wanted stars.",root,0,255,0,true) 
        setTimer( createRob, 600000, 1 ) 
    end 
) 
  

Link to comment
function createRob() 
    Marker = createMarker ( 252.3,-54.6,0.9, "cylinder", 1, 255, 255, 0, 170 ) 
    setElementCollisionsEnabled( Marker, false ) 
    bl = createBlipAttachedTo(Marker,49) 
    outputChatBox( "Liquor store robbery is available. You can rob it in a wine glass blip.", root, 0, 255, 0 ) 
end 
addEventHandler("onResourceStart", resourceRoot,createRob) 
  
addEventHandler("onMarkerLeave",root, 
function ( player ) 
    if ( source ~= Marker ) then 
        return 
    end 
    if ( isPedInVehicle( player ) ) then 
        return 
    end 
    if ( getTeamName(getPlayerTeam( player )) == "TeamName") then 
        destroyElement( Marker ) 
        destroyElement( bl ) 
        randomMoney = math.random ( 5000, 20000 ) 
        randomWanted = math.random ( 1, 6 ) 
        givePlayerMoney(player,randomMoney) 
        setPlayerWantedLevel ( player, randomWanted ) 
        robPlayer = getPlayerName(player) 
        outputChatBox("#ffffff[#00ff00ALARM!#ffffff] #c48027" .. robPlayer .. " #ff0000robbed a liquor store and got: #00ff00" .. tostring(randomMoney) .."$ #ff0000and #00ff00" .. tostring(randomWanted) .. "#ff0000 wanted stars.",root,0,255,0,true) 
        setTimer( createRob, 600000, 1 ) 
    end 
end 
) 

Replace 'TeamName' with criminal team name, on line 17.

Link to comment
  • 2 months later...

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