Jump to content

Infiniuh

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Infiniuh

  1. Here is the server side: ]] function createRobberTeam () robberTeam = createTeam ( "Criminal", 202, 12, 57 ) end addEventHandler ( "onResourceStart", resourceRoot, createRobberTeam ) addEvent ( "robberJobAccepted", true ) function givePlayerJob ( ) setPlayerTeam ( source, robberTeam ) setElementModel ( source, 2 ) end addEventHandler ( "robberJobAccepted", root, givePlayerJob ) addEvent ( "givePlayerPay", true ) function givePlayerRobPay () money = math.random ( 350, 1020 ) givePlayerMoney ( source, money ) outputChatBox ( "You succesfully robbed the house and made $" ..money, source ) fadeCamera ( source, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, source, true, 1 ) end addEventHandler ( "givePlayerPay", root, givePlayerRobPay )
  2. Infiniuh

    [HELP] Blip

    So i found this script, i've tested it out. It doesn't make a blip on the random marker from "robberHouses" list. Any help? local robberHouses = { { -683.95148, 939.66760, 13.63281 }; -- change to your values. { -669.77100, 964.31586, 11.63281 } } function unpackRobberHouses () return unpack ( robberHouses [ math.random ( #robberHouses ) ] ) end function resourceBootUp () ourPed = createPed ( 7, -705.94788, 940.12787, 12.42719 ) ourBlip = createBlipAttachedTo ( ourPed, 41 ) setBlipVisibleDistance ( ourBlip, 300 ) setElementFrozen ( ourPed, true ) setElementRotation ( ourPed, 0, 0, 0 ) setElementInterior ( ourPed, 0 ) setElementDimension ( ourPed, 0 ) end addEventHandler ( "onClientResourceStart", resourceRoot, resourceBootUp ) local robberWindow = guiCreateWindow ( 0.314, 0.2513, 0.3809, 0.3893, "JOB", true ) local robberLabel = guiCreateLabel ( 0.0193, 0.0736, 0.9903, 0.1104, "Criminal 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 will be able to rob houses, hijack cars for money and rob banks (WIP). Go to the blip created on \nyour minimap (red house icon). Once you enter the marker you will steal some money and you have a chance to get wanted.", 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 detectClickOnPed ( button, state, absX, absY, wx, wy, wz, element ) if ( element and element == ourPed and not isPedInVehicle ( localPlayer ) ) then local x, y, z = getElementPosition ( localPlayer ) if ( getDistanceBetweenPoints3D ( x, y, z, wx, wy, wz ) <= 3 ) then guiSetVisible ( robberWindow, true ) end end end addEventHandler ( "onClientClick", root, detectClickOnPed ) 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", 3, 255, 51, 102, 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 )
  3. How can i lock a spawn class to a acl? I am using 50p's spawn menu. Let's say i wanna lock the SWAT class, and i dunno how to do it.. And how do i make it so it says which class a player is on the tab (Column)? Any help please? Resource: https://community.multitheftauto.com/in ... ls&id=1152 Thanks, Infiniuh/Technoz
  4. function createSAPDTeam () SAPDteam = createTeam ("Police", 0, 102, 204) end function joincriminal() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then local wlevel = getPlayerWantedLevel( source ) end end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() setPlayerTeam(source,SAPDteam) setPlayerNametagColor ( thePlayer, 0, 102, 204) setElementFrozen ( ped, true ) setElementHealth ( ped, 500 ) giveWeapon ( source, 3 ) setElementData( source, "Occupation", "Police Officer", true ) setElementData ( source, "Rank", "N/A" ) end addCommandHandler("criminal",joinSAPD) addEvent("gov", true) addEventHandler("gov",root,joinSAPD) What's wrong, why doesn't it set the correct name tag colour, any help please?
×
×
  • Create New...