jomarisk8er Posted May 26, 2012 Share Posted May 26, 2012 -----client--- local robberHouses = { {240.7,-1377,52.2}; {192.2,-1307.8,69.3}; {210.6,-1237.8,77.3}; {237.6, -1200.7,75.1}; {316.6,-1138,80.5}; {434,-1136.8,72.7}; {485.3,-1155.2,70.6}; {485.1,-1116.8,81.3}; {561,-1111.4,61.8}; {566.5,-1099,68}; {610.6,-1083.2,57.8}; {647.1,-1057.7,51.5}; {671.1,-1019,54.7}; {743.4,-1006.9,51.7}; {785.4,-826.9,69.2}; {809.7,-758.7,75.5}; {849.6,-743.9,93.9}; {866.7,-710.3,104.6}; {895.2,-793.9,100.4}; {895.1,-645.3,115.9}; {952,-720.2,121.2}; {992.8,-697.6,120.6}; {977.6,-768.1,111.2}; {1047.6,-656.1,119.1}; {1094.9,-662.6,112.6}; {1016.9,-760.7,111.5}; {830.2,-923.5,54.2}; {1894.3,-1065.17,23.9}; {1893.1,-1070.6,23.9}; {1915.6,-1065,23.1}; {1935,-1071.7,23.4}; {1957.6,-1069.7,23.8}; {1959.2,-1102,25.75}; {1936.5,-1103.57,25.45}; {1925.4,-1101.5,25.07}; {1908.22,-1102.37,24.6}; {1997.76,-1103.29,25.78}; {2020.64,-1109.4,25.2}; {2033.74,-1112.4,24.7}; {2090.28,-1113.54,25.7}; {2105.83,-1142.86,24.58}; {2103,-1168.75,24.6}; {2104.2,-1188.47,25}; {2122.2,-1185.8,23}; {2031.6,-1043.16,24.2}; {2044.44,-1050.6,24.6}; {2059.4,-1056.44,25.65}; {2012.82,-967.22,41.46}; {2050.25,-954.7,47}; {2066.4,-992,47.7}; {2068,-959.8,51.87}; {2090.9,-973,50.9}; {2092.9,-1011.32,50}; {2123.4,-968,56.76}; {2130.4,-976.2,58.3}; {2177.1,-983,63.4}; {2205,989.38,62.9}; {2261,-1020.53,58.3}; {2155.8,-1071.8,38.7}; {2334.4,-1203,27}; {2334.7,-1233.7,27}; {2334.7,-1264.9,27}; {2404.16,-1281.7,24}; {2515.8,-1224.9,38}; {2558.2,-1210.4,53.5}; {2585.3,-1200.2,58.2}; {2682.6,-1200,65.7}; {2756.45,-1881.9,68.3}; {2780.25,-1340.7,29.6}; {2451.8,-1642.7,12.7}; {2512.7,-1651.13,12.9}; {2514.25,-1700.7,12.4}; {2455,-1709.2,12.6}; {2323.46,-1796.1,12.5}; {2342.1,-1895.25,12.6}; } function unpackRobberHouses () return unpack ( robberHouses [ math.random ( #robberHouses ) ] ) end local robberWindow = guiCreateWindow ( 0.314, 0.2513, 0.3809, 0.3893, "Robber Job GUI", true ) local robberLabel = guiCreateLabel ( 0.0193, 0.0736, 0.9903, 0.1104, "Robber Job", true, robberWindow ) guiLabelSetColor ( robberLabel, 255, 0, 0 ) guiLabelSetHorizontalAlign ( robberLabel, "center", false ) guiSetFont ( robberLabel, "default-bold-small" ) local robberInfoLabel = guiCreateLabel ( 0.0309, 0.2441, 0.944, 0.3077, "If you accept this job, you are able to rob houses. \nDrive to the blip created on your minimap (an house icon) Once you enter the marker\nyou will get paid.\nAnd another house will be able to be robbed.", true, robberWindow ) local robberAcceptButton = guiCreateButton ( 0.3533 ,0.7993, 0.1409, 0.1204, "Accept", true, robberWindow ) local robberCloseButton = guiCreateButton ( 0.5309, 0.7993, 0.1409, 0.1204, "Close", true, robberWindow ) guiSetVisible ( robberWindow, false ) function buttonClick ( button ) if ( button ~= "left" ) then return end if ( source == robberCloseButton ) then guiSetVisible ( robberWindow, false ) showCursor ( false ) elseif ( source == robberAcceptButton ) then destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) triggerServerEvent ( "robberJobAccepted", localPlayer ) guiSetVisible ( robberWindow, false ) showCursor ( false ) triggerEvent ( "createHouseEvent", localPlayer ) outputChatBox ( "You are now employed as a Robber!" ) end end addEventHandler ( "onClientGUIClick", resourceRoot, buttonClick ) addEvent ( "createHouseEvent", true ) function createHouses () x, y, z = unpackRobberHouses () robhouseMarker = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 85, localPlayer ) robhouseBlip = createBlipAttachedTo ( robhouseMarker, 32, localPlayer ) end addEventHandler ( "createHouseEvent", root, createHouses ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( source == robhouseMarker and not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then triggerServerEvent ( "givePlayerPay", localPlayer ) destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) triggerEvent ( "createHouseEvent", localPlayer ) playSound ( "files/cash.mp3", false ) end end ) addEventHandler ( "onClientPedDamage", resourceRoot, function () cancelEvent () end ) function showRobberWindow() if (guiGetVisible(robberWindow)) then guiSetVisible (robberWindow, false) showCursor (false) else guiSetVisible (robberWindow, true) showCursor (true) end end addEvent ("showRobberWindow",true) addEventHandler ("showRobberWindow", root, showRobberWindow) addEventHandler("onClientGUIClick", Button, showRobberWindow) ---server--- robbermarker = createMarker(929.1,-919.87,41.6,"cylinder",1.5,255,0,0) robberjobblip = createBlipAttachedTo(robbermarker,41) setBlipVisibleDistance(robberjobblip, 300) function createRobberTeam () robberTeam = createTeam ( "Robber", 250, 0, 0 ) end addEventHandler ( "onResourceStart", resourceRoot, createRobberTeam ) addEvent ( "robberJobAccepted", true ) function givePlayerJob () setPlayerTeam ( source, robberTeam ) local paccount = getPlayerAccount ( source ) local skinid = getAccountData ( paccount , "boughtskin" ) if skinid then setElementModel ( source , tonumber ( skinid ) ) setPlayerNametagColor(source, 255,0,0) end end addEventHandler ( "robberJobAccepted", root, givePlayerJob ) function showGUI(hitElement) if (source == robbermarker) and (isPedInVehicle(hitElement) == false) then triggerClientEvent(hitElement,"showRobberWindow",hitElement) end end addEventHandler("onMarkerHit",resourceRoot,showGUI) addEvent ( "givePlayerPay", true ) function givePlayerRobPay () local wl = getPlayerWantedLevel(source) money = math.random ( 350, 1020 ) givePlayerMoney ( source, money ) setPlayerWantedLevel(source, wl+1) outputChatBox ( "You succesfully robbed the house and made $" ..money, source,0,255,0,false ) fadeCamera ( source, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, source, true, 1 ) end addEventHandler ( "givePlayerPay", root, givePlayerRobPay ) -how to get if theres a near cop, so whn i rob, i got 1 star when they point at me or looking at me.. pls help Link to comment
Smart. Posted May 26, 2012 Share Posted May 26, 2012 (edited) setPlayerWantedLevel getDistanceBetweenPoints3D getPlayerTeam Edited May 26, 2012 by Guest Link to comment
jomarisk8er Posted May 26, 2012 Author Share Posted May 26, 2012 oh sorry, im removing it cause for its much messy. sorry Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now