Jump to content

damien111

Members
  • Posts

    270
  • Joined

  • Last visited

Everything posted by damien111

  1. Ah, okay Also, im having a new problem. It wont give the money still, and. it wont set the team. and i cant get the function deleteCar ( ) if ( isVehicleBlown ( theCar ) ) then destroyElement ( theCar ) end end to work. im having so many problems. i also still need to restrict the spawn, can you give me the functions like the one u just gave me for that? Thanks either way
  2. Ah..... Thats good to know. Can you answer any of the other questions? Like the one bout locking cars, or restricting it so each player can only spawn 1, or the one about the code that wasnt working, the one that deleted the car if blown? I hope im not spamming the forums btw. im just trying to get help
  3. Also here is a update on my code CLIENT function sellCar ( ) givePlayerMoney ( 10000 ) outputChatBox ( "You have sold your stolen car" ) end addEvent("sellcar", true) addEventHandler("sellcar",root,sellCar) --JOB local marker = createMarker( 1734.7218017578, 1993.3072509766, 11, "Cylinder", 2, 6, 183, 248, 153) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} windowjob = guiCreateWindow(1031,232,301,397,"Car Jacker job",false) guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,352,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,352,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,215,"To take Car Jacker team job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) function Medicjob(hitElement) if getElementType(hitElement) == "player" then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, Medicjob) function Medicjobleave(leaveElement) if getElementType(leaveElement) == "player" then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, Medicjobleave) function joinTeam() triggerServerEvent("setMedic",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeMedicWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeMedicWindow, false) SERVER theMarker = createMarker ( 1728.0740966797, 2010.6652832031, 10.5, "cylinder", 2, 255, 255, 0, 170 ) function spawnveh ( hitElement, matchingDimension ) local elementType = getElementType ( hitElement ) if ( elementType == "player" ) then destroyElement ( theCar ) triggerClientEvent ( "sellcar", localPlayer) end end addEventHandler ( "onMarkerHit", theMarker, spawnveh ) --job function createMedicTeam () MedicTeam = createTeam ("Car Jackers", 255, 0, 0) end local coordinates = { { 1725.9757080078, 1946.7092285156, 10, 0, 0, 0 }, { 1747.3811035156, 1980.2396240234, 10, 0, 0, 0 } } function getRandomCoordinates ( ) return unpack ( coordinates [ math.random ( #coordinates ) ] ) end local IDS = { { 402 }, { 542 }, { 603 }, { 475 }, { 576 }, { 575 }, { 567 } } function getRandomCoordinates1 ( ) return unpack ( IDS [ math.random ( #IDS ) ] ) end function deleteCar ( ) if ( isVehicleBlown ( theCar ) ) then destroyElement ( theCar ) end end function joinMedic() setPlayerTeam(source,MedicTeam) setElementModel(source,293) setElementData( source, "Occupation", "Car Jacker", true ) outputChatBox("You are now Car Jacker.",source,0,255,0) x, y, z, rx, ry, rz = getRandomCoordinates ( ) ID = getRandomCoordinates1 ( ) theCar = createVehicle ( ID, x, y, z, rx, ry, rz ) end addEvent("setMedic", true) addEventHandler("setMedic",root,joinMedic) it wont do the Client sellcar Function, i did trigger event and everything, also. the line of code: function deleteCar ( ) if ( isVehicleBlown ( theCar ) ) then destroyElement ( theCar ) end end wont work, it is suppose to destroy the spawned car if it blows ps - also can you gimme some functions and things for locking cars to players. pss - how to restrict how many times you can spawn something ill keep looking though. but still, it would be great if i could have some wiki links or something, cause i dont even know what to search on the wiki S:
  4. I am positive that is what i did O_O
  5. I need help with this car jacker script. i have everything done but this code. I need help with how to tell if a player is in a car when they go into the marker, and also. at the moment when a player walks into the marker , its suppose to delete the car and give them 10000$. it is not even doing that im very lost and any advise and wiki links will be greatly appreciated There are no debugscript 3 errors heres the code: SERVER theMarker = createMarker ( 2281.0270996094, 2451.3420410156, 10, "cylinder", 1.5, 255, 255, 0, 170 ) theVehicle = createVehicle ( 432, 2268.3127441406, 2451.1025390625, 10 ) function spawnveh ( hitElement, matchingDimension ) local elementType = getElementType ( hitElement ) if ( elementType == "player" ) then destroyElement ( theVehicle ) triggerClientEvent ( "sellcar", localPlayer) end end addEventHandler ( "onMarkerHit", theMarker, spawnveh ) CLIENT function sellCar ( ) givePlayerMoney ( 10000 ) outputChatBox ( "You have sold your stolen car" ) end addEvent("sellcar", true) addEventHandler("sellcar",root,sellCar) That Code Is Just For When They Drive Into The Marker, i just need help making it give the money, which wont work for some reason, and restricting it so only people in cars can enter. So again, this is just a piece of the code the part i need help with Also! How can i lock cars to user's/players
  6. if you CAN NOT script and are not WILLING TO LEARN to script then you should not put other peoples resources in your server and not give credit. in my opinion you do not deserve to have a server if you arent willing to learn. Gytis, what im trying to say is. before you open a server and try to add resources, and open up your server, learn some LUA and code some resources your not gonna get very far off leeching ,
  7. I searched but couldnt find it
  8. Okay, Also! Sorry! 1 More Thing! How can i make it so a player cant deal damage? and also how to take a players gun just send me wiki pages if u want
  9. Thanks! Also! can you showm e how to restrict resource to ACL Groups or Teams, and, how can i turn off /kill thanks
  10. Sorry, dont mean to be a bug but now i get this error : Warning : Loading script failed : police10/arrest_server.lua:15 'then' expected near 'return'
  11. Alright! Heres my code so far! It is not working, i did /debugscript 3, here are the errors if that will hep. i did not understand them : Loading script failed : POLICE5/arrest_server.lua:3 '' expected near '(' Loading script failed : POLICE5/arrest_client.lua:15 ')' expected (to close '(' at line 1) near CLIENT addEventHandler("onClientPlayerDamage", localPlayer, function (attacker, weapon) if (attacker and source ~= attacker) then if (getElementType ( attacker ) == "player") then if ( weapon == 3 and getTeamName(getPlayerTeam(attacker)) == "Police" ) then local SourceWantedLevel = getPlayerWantedLevel() if ( SourceWantedLevel > 0 ) then if ( getElementHealth ( source ) < 90 and getElementHealth ( source ) > 0 )then triggerServerEvent("POLICESYS:JailThePlayer", localPlayer, attacker) end end end end end end SERVER level = getPlayerWantedLevel ( source ) reward = 3000 function ( attacker ) local x = -4162.3032226563 local y = 1697.4566650391 local z = 1.0687500238419 givePlayerMoney ( attacker, reward ) --Give money to cop setElementPosition ( source, x, y, z, true ) setTimer ( releaseSuspect, 30000, 1 ) end addEvent("POLICESYS:JailThePlayer",true) addEventHandler("POLICESYS:JailThePlayer",root) function releaseSuspect ( ) local x = 2285.9599609375 local y = 2423.1164550781 local z = 10.8203125 setElementPosition ( source, x, y, z, true ) end
  12. Ah! Thanks! I love this forum!
  13. I cant get it to work Do you know any scripts that have the hitting with nightstick, then warping the suspect kind of scripts i can look at? i just need to learn how it works
  14. I need help with making it so when a player is hit with a nightstick and his wlevel is higher than 0 he is sent to the jail for 10seconds * wlevel. . doesnt matter who hits them with the nightstick, cause nighstick will be a police only weapon. sso can anyone help? Also. How can i make it so peoples money is saved, off topic but it will help me Thanks
  15. Im trying to make a gambling script here is a test i made, it makes the marker but it does not take money then randomly picks a number from a table, then determines if its more than 50. i cant get it to work If anyone can help thanks! SERVER local numbers = { { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { 6 }, { 7 }, { 8 }, { 9 }, { 10 }, { 11 }, { 12 }, { 13 }, { 14 }, { 15 }, { 16 }, { 17 }, { 18 }, { 19 }, { 20 }, { 21 }, { 22 }, { 23 }, { 24 }, { 25 }, { 26 }, { 27 }, { 28 }, { 29 }, { 30 }, { 31 }, { 32 }, { 33 }, { 34 }, { 35 }, { 36 }, { 37 }, { 38 }, { 39 }, { 40 }, { 41 }, { 42 }, { 43 }, { 44 }, { 45 }, { 46 }, { 47 }, { 48 }, { 49 }, { 50 }, { 51 }, { 52 }, { 53 }, { 54 }, { 55 }, { 56 }, { 57 }, { 58 }, { 59 }, { 60 }, { 61 }, { 62 }, { 63 }, { 64 }, { 65 }, { 66 }, { 67 }, { 68 }, { 69 }, { 70 }, { 71 }, { 72 }, { 73 }, { 74 }, { 75 }, { 76 }, { 77 }, { 78 }, { 79 }, { 80 }, { 81 }, { 82 }, { 83 }, { 84 }, { 85 }, { 86 }, { 87 }, { 88 }, { 89 }, { 90 }, { 91 }, { 92 }, { 93 }, { 94 }, { 95 }, { 96 }, { 97 }, { 98 }, { 99 }, { 100 }, } function getRandomCoordinates ( ) return unpack (numbers [ math.random ( #numbers ) ] ) end number = getRandomCoordinates ( ) gambling = createMarker ( 2226.3559570313, 1838.3266601563, 10.8203125, "checkpoint", 2.0, 0, 255, 255, 255 ) function startgamble ( hitElement, matchingDimension ) local elementType = getElementType ( hitElement ) if ( elementType == "player" ) then takePlayerMoney ( source, 5000 ) triggerClientEvent ( "takeMoney", localPlayer ) if number < 50 then triggerClientEvent ( "giveMoney", localPlayer ) givePlayerMoney ( source , 10000 ) else triggerClientEvent ( "looseMoney", localPlayer ) end end end addEventHandler ( "onMarkerHit", gambling, startgamble ) CLIENT function greetingHandler ( message ) outputChatBox ( "You have bet 5000") end addEvent( "takeMoney", true ) addEventHandler( "takeMoney", getRootElement ) function greetingHandler ( message ) outputChatBox ( "You have won 10000") end addEvent( "giveMoney", true ) addEventHandler( "giveMoney", getRootElement ) function greetingHandler ( message ) outputChatBox ( "You lose 5000") end addEvent( "looseMoney", true ) addEventHandler( "looseMoney", getRootElement ) Meta <meta> <info author="Curt" version="3.0" type="script" name="Delivery Boyg Job" description="I just made a small medic job, just a gui for the job with marker" /> <script src = "script.lua" type = "server" /> <script src = "client.lua" type = "client" /> </meta>
  16. line 44. i accidently didnt copy the hole code again >
  17. also, it did not work its not activating the panel
  18. ah, also how can i restrict resources to teams, or ACL Groups
  19. damien111

    Panel Help

    I am trying to make a panel that spawns objects and deletes them I cant get it to work, it is suppose to work on /stpanel here is my code CLIENT: GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(550,134,249,462,"State Trooper Panel",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,19,231,434,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Basic Controls",GUIEditor_TabPanel[1]) GUIEditor_Button[1] = guiCreateButton(14,9,200,36,"Turn On Blipless",false,GUIEditor_Tab[1]) GUIEditor_Button[2] = guiCreateButton(14,51,199,35,"Turn Off Blipless",false,GUIEditor_Tab[1]) GUIEditor_Button[3] = guiCreateButton(16,149,200,36,"Locate Player",false,GUIEditor_Tab[1]) GUIEditor_Edit[1] = guiCreateEdit(14,116,200,31,"",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Road Block Tools",GUIEditor_TabPanel[1]) GUIEditor_Button[4] = guiCreateButton(8,17,215,38,"Small Roadblock",false,GUIEditor_Tab[2]) GUIEditor_Button[5] = guiCreateButton(7,61,219,37,"Large Roadblock",false,GUIEditor_Tab[2]) GUIEditor_Button[6] = guiCreateButton(5,102,221,37,"Yellow Roadblock",false,GUIEditor_Tab[2]) GUIEditor_Button[7] = guiCreateButton(9,144,216,40,"Detour Sign",false,GUIEditor_Tab[2]) GUIEditor_Button[8] = guiCreateButton(7,188,219,42,"Traffic Cone",false,GUIEditor_Tab[2]) GUIEditor_Button[9] = guiCreateButton(11,233,213,45,"Warning Fence",false,GUIEditor_Tab[2]) GUIEditor_Button[10] = guiCreateButton(11,280,212,47,"Stinger",false,GUIEditor_Tab[2]) GUIEditor_Button[11] = guiCreateButton(10,346,211,53,"Delete All",false,GUIEditor_Tab[2]) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , turnOnBlipless, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , turnOffBlipless, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , locPlayer, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , RBSMALL, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , RBLARGE, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , RBYELLOW, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , RBSIGN, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , RBCONE, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , RBSTINGER, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , RBFENCE, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1] , RBDEL, false) function showgui ( ) guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end addCommandHandler("stpanel", showgui) rbs = { } function RBDEL(source,command) for index, roadb in ipairs( rbs ) do destroyElement( roadb ) end outputChatBox("*ROADBLOCK* Deleted all roadblocks.",source,255,255,0) end function RBSMALL(source) local x,y,z = getElementPosition(source) local rotX,rotY,rotZ = getElementRotation(source) table.insert(rbs, createObject(978,x,y,z-0.15,0,0,rotZ) ) setElementPosition ( source, x, y, z+1 ) outputChatBox("*ROADBLOCK* Added.",source,255,255,0) end function RBLARGE(source) local x,y,z = getElementPosition(source) local rotX,rotY,rotZ = getElementRotation(source) table.insert(rbs, createObject(981,x,y,z,0,0,rotZ+180) ) setElementID ( roadblockobject, rbo ) setElementPosition ( source, x, y, z+1 ) outputChatBox("*ROADBLOCK* Added.",source,255,255,0) end function RBYELLOW(source) local x,y,z = getElementPosition(source) local rotX,rotY,rotZ = getElementRotation(source) table.insert(rbs, createObject(3578,x,y,z-0.2,0,0,rotZ) ) setElementID ( roadblockobject, rbo ) setElementPosition ( source, x, y, z+1 ) outputChatBox("*ROADBLOCK* Added.",source,255,255,0) end function RBSIGN(source) local x,y,z = getElementPosition(source) local rotX,rotY,rotZ = getElementRotation(source) table.insert(rbs, createObject(3091,x,y,z-0.38,0,0,rotZ+180) ) setElementID ( roadblockobject, rbo ) setElementPosition ( source, x, y, z+1 ) outputChatBox("*ROADBLOCK* Added.",source,255,255,0) end function RBCONE(source) local x,y,z = getElementPosition(source) local rotX,rotY,rotZ = getElementRotation(source) table.insert(rbs, createObject(1238,x,y,z-0.65,0,0,rotZ) ) setElementID ( roadblockobject, rbo ) setElementPosition ( source, x, y, z+1 ) outputChatBox("*ROADBLOCK* Added.",source,255,255,0) end function fence(source,command) local x,y,z = getElementPosition(source) local rotX,rotY,rotZ = getElementRotation(source) table.insert(rbs, createObject(1459,x,y,z-0.4,0,0,rotZ) ) setElementID ( roadblockobject, rbo ) setElementPosition ( source, x, y, z+1 ) outputChatBox("*ROADBLOCK* Added.",source,255,255,0) end function line(source,command) local x,y,z = getElementPosition(source) local rotX,rotY,rotZ = getElementRotation(source) table.insert(rbs, createObject(2957,x,y,z-2.6,0,0,rotZ) ) setElementID ( roadblockobject, rbo ) setElementPosition ( source, x, y, z+1 ) outputChatBox("*ROADBLOCK* Added.",source,255,255,0) end function turnOnBlipless ( thePlayer ) for index, element in ipairs ( getAttachedElements ( thePlayer ) ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end function turnOffBlipless ( thePlayer ) for index, element in ipairs ( getAttachedElements ( thePlayer ) ) do if ( getElementType ( element ) == "blip" ) then setElementVisibleTo ( element, root, ( not isElementVisibleTo ( element ) ) ) end end end function locPlayer( ) local myPlayer = GUIEditor_Edit[1] ( ) outputChatBox ( getPlayerName ( myPlayer ).." is now being tracked!" ) createBlipAttachedTo ( myPlayer, [ 23, 2, 255, 0, 0, 255, 0, 99999.0] ) end and no server code
  20. didnt work colors still default State_Troopers = { car1 = createVehicle ( 598, 2808.2998046875, 927.5, 10.699999809265, 0, 0, 0 ), car2 = createVehicle ( 598, 2814.3994140625, 927.2998046875, 10.6999998092650, 0, 0, 0 ), car3 = createVehicle ( 598, 2820.5, 927.599609375, 10.699999809265, 0, 0, 0), car4 = createVehicle ( 598, 2827.099609375, 927.8994140625, 10.699999809265, 0, 0, 0), car5 = createVehicle ( 598, 2833.19921875, 927.599609375, 10.699999809265, 0, 0, 0 ), car6 = createVehicle ( 599, 2807.8999023438, 940.29998779297, 11, 0, 0, 0), car7 = createVehicle ( 599, 2814, 940.20001220703, 11, 0, 0, 0), car8 = createVehicle ( 599, 2820.1999511719, 940.20001220703, 11, 0, 0, 0), car9 = createVehicle ( 497, 2845.19921875, 902.599609375, 11, 0, 0, 0), car10 = createVehicle ( 497, 2832.19921875, 902.3994140625, 11, 0, 0, 0), car11 = createVehicle ( 428, 2857.2998046875, 925.8994140625, 11, 0, 0, 177.99499511719), car12 = createVehicle ( 428, 2860.099609375, 925.7998046875, 11, 0, 0, 177.99499511719), car13 = createVehicle ( 428, 2863, 925.69921875, 11, 0, 0, 177.99499511719), car14 = createVehicle ( 416, 2871.599609375, 924.7998046875, 11, 0, 0, 177.99499511719), car15 = createVehicle ( 416, 2867.7998046875, 925.099609375, 11, 0, 0, 177.99499511719), car16 = createVehicle ( 416, 2875.19921875, 924.5, 11, 0, 0, 177.99499511719), car17 = createVehicle ( 523, 2873.5, 911.5, 10.39999961853, 0, 0, 0), car18 = createVehicle ( 523, 2875.2998046875, 911.5, 10.39999961853, 0, 0, 0), car19 = createVehicle ( 523, 2871.69921875, 911.599609375, 10.39999961853, 0, 0, 0), car20 = createVehicle ( 523, 2869.7998046875, 911.2998046875, 10.39999961853, 0, 0, 0), car21 = createVehicle ( 427, 2863.599609375, 911.19921875, 11, 0, 0, 0), car22 = createVehicle ( 427, 2867.099609375, 911.19921875, 11, 0, 0, 0), car23 = createVehicle ( 427, 2859.7998046875, 911, 11, 0, 0, 0), car24 = createVehicle ( 427, 2855.8994140625, 910.7998046875, 11, 0, 0, 0) } for i,car in ipairs(State_Troopers) do setElementData(car,"Team","State Troopers") setVehicleColor ( car, 255, 215, 0 ) end addEventHandler("onVehicleStartEnter", root, function(player) local teamName = getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) if teamName ~= getElementData(source,"Team") then cancelEvent() end end i also tryed doing setVehicleColor for each thing, maybe ill try it without the car 1 = and stuff
×
×
  • Create New...