Jump to content

aguia

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by aguia

  1. I didn't understand anything from you raynner, I think you were using the google translate...
  2. Hello, my friend made this script for me but I got a problem with it. I want to remove the licence from the vehicles, from all of them. I tried removing the function doesPlayerHaveLiceForVehicle but didn't works... I were learning those lines, but didn't understood at all. So, I'd appreciate a help -- The Vehicle Spawn Gui -- vehiclesWindow = guiCreateWindow(395,237,241,413,"Vehicles",false) vehiclesGrid = guiCreateGridList(9,26,221,307,false,vehiclesWindow) guiGridListSetSelectionMode(vehiclesGrid,0) spawnVehicleSystemButton = guiCreateButton(9,337,220,30,"Spawn Vehicle",false,vehiclesWindow) closeWindowButton = guiCreateButton(9,373,220,30,"Close Window",false,vehiclesWindow) guiGridListSetSortingEnabled ( vehiclesGrid, false ) vehicleName = guiGridListAddColumn( vehiclesGrid, " Vehiclename:", 0.80 ) addEventHandler("onClientGUIClick", closeWindowButton, function() guiSetVisible(vehiclesWindow, false) showCursor(false,false) guiGridListClear ( vehiclesGrid ) end, false) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(vehiclesWindow,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(vehiclesWindow,x,y,false) guiWindowSetMovable (vehiclesWindow, true) guiWindowSetSizable (vehiclesWindow, false) guiSetVisible (vehiclesWindow, false) -- MTA VEHICLES IDS/NAMES -- local swatJobVehicles = { [596] = {"Police Car (LS)", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [597] = {"Police Car (SF)", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [598] = {"Police Car (LV)", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [599] = {"Police Ranger", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [415] = {"Cheetah", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [426] = {"Premier", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [428] = {"Securicar", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [451] = {"Turismo",131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [560] = {"Sultan",131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [579] = {"Huntley", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [601] = {"S.W.A.T", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [427] = {"Enforcer",131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, [523] = {"HPV1000", 106, 1, 1, 1}, [490] = {"FBI Rancher", 131,131,131,131,r=0,g=20,b=90,r2=255,g2=255,b2=255}, } local swatHeli = { [497] = {"Police Maverick", 53, 1, 1, 1}, [563] = {"Raindance",53,1,1,1}, [447] = {"Seasparrow",53, 1 , 1, 1}, [476] = {"Rustler", 53, 1 , 1, 1}, } -- VEHICLE SPAWNERS LOCATIONS /TEAM -- local vehicleMarkers = { --SWAT {1813.8505859375, -1370.5888671875, 24.537517547607, 39, 64, 225, swatHeli, "SWAT", "SWAT Team", 0, "noOccupation" }, {1793.8505859375, -1370.5888671875, 24.537517547607, 39, 64, 225, swatHeli, "SWAT", "SWAT Team", 0, "noOccupation" }, {1812.72265625, -1367.7529296875, 13.645312309265, 39, 64, 225, swatJobVehicles, "SWAT", "SWAT Team", 180, "noOccupation" }, {1803.361328125, -1367.7529296875, 13.645312309265, 39, 64, 225, swatJobVehicles, "SWAT", "SWAT Team", 180, "noOccupation" }, {1793.361328125, -1367.7529296875, 13.645312309265, 39, 64, 225, swatJobVehicles, "SWAT", "SWAT Team", 180, "noOccupation" }, } -- SCRIPT -- local JobsToTables = { } local amarkers = {} local workingWithTable=false for i,v in pairs(vehicleMarkers) do if getPlayerTeam ( localPlayer ) then local overRide=false if v[8] ~= nil and v[8] == "Police" then if getTeamName(getPlayerTeam ( localPlayer )) == "Police" or getTeamName(getPlayerTeam ( localPlayer )) == "SWAT" then overRide=true end end if overRide==false and getTeamName(getPlayerTeam ( localPlayer )) == v[8] and getElementData(localPlayer, "Occupation") == v[9] or getTeamName(getPlayerTeam ( localPlayer )) == v[8] and v[11] == "noOccupation" or getTeamName(getPlayerTeam ( localPlayer )) == v[11] or getTeamName(getPlayerTeam ( localPlayer )) == v[12] or v[8] == nil and v[9] == nil then elref = createMarker(v[1], v[2], v[3] -1, "cylinder", 2.2, v[4], v[5], v[6]) amarkers [elref ] = v[7] setElementData(elref, "freeVehiclesSpawnRotation", v[10]) setElementData(elref, "isMakerForFreeVehicles", true) if ( v[11] == "aGroup" ) then setElementData(elref, "groupMarkerName", v[15] ) end end end end local workingWith = {} addEventHandler("onClientMarkerHit", root, function(hitElement, matchingDimension) if getElementType ( hitElement ) == "player" and getElementData(source, "isMakerForFreeVehicles") == true and hitElement == localPlayer then guiGridListClear ( vehiclesGrid ) if not isPedInVehicle(localPlayer) then if (amarkers [source] ) then workingWithTable=amarkers [source] for i,v in pairs( amarkers [source] ) do if hitElement == localPlayer then local px,py,pz = getElementPosition ( hitElement ) local mx, my, mz = getElementPosition ( source ) if ( pz-3 < mz ) and ( pz+3 > mz ) then if ( getElementData( source, "groupMarkerName" ) ) and ( getElementData( localPlayer, "Group" ) ) and not ( getElementData( source, "groupMarkerName" ) == getElementData( localPlayer, "Group" ) ) then exports.dxmsg:createNewDxMessage("You are not allowed to use this vehicle marker!", 225 ,0 ,0) else if not(getElementData(localPlayer,"Group")) then exports.dxmsg:createNewDxMessage("You are not allowed to use this vehicle marker!", 225 ,0 ,0) return end local row = guiGridListAddRow ( vehiclesGrid ) workingWith[tostring(v[1])] = tonumber(i) guiGridListSetItemText ( vehiclesGrid, row, vehicleName, tostring(v[1]), false, false ) guiGridListSetItemData ( vehiclesGrid, row, vehicleName, tostring(i) ) guiSetVisible (vehiclesWindow, true) showCursor(true,true) theVehicleRoation = getElementData(source, "freeVehiclesSpawnRotation") theMarker = source end end end end end end end end) -- Reload the markers -- function reloadFreeVehicleMarkers () for i,v in pairs( amarkers ) do destroyElement(i) end amarkers = {} for i,v in pairs(vehicleMarkers) do if getTeamName(getPlayerTeam ( localPlayer )) == v[8] and getElementData(localPlayer, "Occupation") == v[9] or getTeamName(getPlayerTeam ( localPlayer )) == v[8] and v[11] == "noOccupation" or getTeamName(getPlayerTeam ( localPlayer )) == v[11] or getTeamName(getPlayerTeam ( localPlayer )) == v[12] or v[8] == nil and v[9] == nil then elref = createMarker(v[1], v[2], v[3] -1, "cylinder", 2.2, v[4], v[5], v[6]) amarkers [elref ] = v[7] setElementData(elref, "freeVehiclesSpawnRotation", v[10]) setElementData(elref, "isMakerForFreeVehicles", true) if ( v[11] == "aGroup" ) then setElementData(elref, "groupMarkerName", v[15] ) end end end end addEvent("reloadFreeVehicleMarkers", true) addEventHandler("reloadFreeVehicleMarkers", root, reloadFreeVehicleMarkers ) function spawnTheVehicle () local x,y,z = getElementPosition(theMarker) local selectedVehicle = guiGridListGetItemText ( vehiclesGrid, guiGridListGetSelectedItem ( vehiclesGrid ), 1 ) if selectedVehicle == "" or selectedVehicle == " " then exports.dxmsg:createNewDxMessage("You didnt select a vehicle!", 225 ,0 ,0) else local selectedRow, selectedColumn = guiGridListGetSelectedItem(vehiclesGrid) local theVehicleID = workingWith[tostring(selectedVehicle)] -- local theVehicleID = tonumber(guiGridListGetItemData ( vehiclesGrid, selectedRow, selectedColumn )) if ( tonumber( theVehicleID) == 481 ) or ( tonumber( theVehicleID) == 510 ) or ( tonumber( theVehicleID) == 509 ) or ( tonumber( theVehicleID) == 462 ) or ( getElementData( localPlayer, "Occupation" ) == "Criminal" ) then if ( getElementData( localPlayer, "wantedPoints" ) >= 20 ) then exports.dxmsg:createNewDxMessage("You can't spawn free vehicles when having more then 1 wanted stars!", 225 ,0 ,0) else local getTable = workingWithTable --JobsToTables[getElementData(localPlayer, "Occupation")] or JobsToTables[getTeamName(getPlayerTeam ( localPlayer ))] local vehicle,color1,color2,color3,color4 = getTable[theVehicleID][1],getTable[theVehicleID][2],getTable[theVehicleID][3],getTable[theVehicleID][4],getTable[theVehicleID][5]--unpack( getTable[tonumber( theVehicleID )] ) local r,g,b=nil,nil,nil local r2,g2,b2=nil,nil,nil if getTable[theVehicleID].r ~= nil then r,g,b=getTable[theVehicleID].r,getTable[theVehicleID].g,getTable[theVehicleID].b end if getTable[theVehicleID].r2 ~= nil then r2,g2,b2=getTable[theVehicleID].r2,getTable[theVehicleID].g2,getTable[theVehicleID].b2 end triggerServerEvent("spawnVehicleSystem", localPlayer, x, y, z, theVehicleID, color1, color2, color3, color4, theVehicleRoation,r,g,b,r2,g2,b2) guiSetVisible (vehiclesWindow, false) showCursor(false,false) guiGridListClear ( vehiclesGrid ) end elseif doesPlayerHaveLiceForVehicle(tonumber(theVehicleID)) then local getTable = workingWithTable --JobsToTables[getElementData(localPlayer, "Occupation")] or JobsToTables[getTeamName(getPlayerTeam ( localPlayer ))] local vehicle,color1,color2,color3,color4 = getTable[theVehicleID][1],getTable[theVehicleID][2],getTable[theVehicleID][3],getTable[theVehicleID][4],getTable[theVehicleID][5]--unpack( getTable[tonumber( theVehicleID )] ) local r,g,b=nil,nil,nil local r2,g2,b2=nil,nil,nil if getTable[theVehicleID].r ~= nil then r,g,b=getTable[theVehicleID].r,getTable[theVehicleID].g,getTable[theVehicleID].b end if getTable[theVehicleID].r2 ~= nil then r2,g2,b2=getTable[theVehicleID].r2,getTable[theVehicleID].g2,getTable[theVehicleID].b2 end triggerServerEvent("spawnVehicleSystem", localPlayer, x, y, z, theVehicleID, color1, color2, color3, color4, theVehicleRoation,r,g,b,r2,g2,b2) guiSetVisible (vehiclesWindow, false) showCursor(false,false) guiGridListClear ( vehiclesGrid ) else exports.dxmsg:createNewDxMessage("You don't have a licence for this type of vehicle!", 225 ,0 ,0) end end end addEventHandler("onClientGUIClick", spawnVehicleSystemButton, spawnTheVehicle, false) function doesPlayerHaveLiceForVehicle (vehicleID) local playtime = getElementData(localPlayer,"playTime") if getVehicleType ( vehicleID ) == "Automobile" or getVehicleType ( vehicleID ) == "Monster Truck" or getVehicleType ( vehicleID ) == "Quad" or getVehicleType ( vehicleID ) == "Trailer" then if playtime == false or playtime==nil then return true end if math.floor((tonumber(playtime)/60)) < 10 then return true end if getElementData(localPlayer, "carLicence") then return true else return false end elseif getVehicleType ( vehicleID ) == "Plane" then if getElementData(localPlayer, "planeLicence") then return true else return false end elseif getVehicleType ( vehicleID ) == "Helicopter" then if getElementData(localPlayer, "chopperLicence") then return true else return false end elseif getVehicleType ( vehicleID ) == "Bike" or getVehicleType ( vehicleID ) == "BMX" then if getElementData(localPlayer, "bikeLicence") then return true else return false end elseif getVehicleType ( vehicleID ) == "Boat" then if getElementData(localPlayer, "boatLicence") then return true else return false end end end Ex.: As a SWAT member I can spawn all those car from the "swatJobVehicles", less the "HPV1000". Why ? "You don't have a licence for this type of vehicle!" appears. The same thing applies for those all "swatHeli" vehicles.
  3. function toggleRadar() if isVisible then addEventHandler("onPlayerLogin", root, HUDNAME) else removeEventHandler("onPlayerLogin", root, HUDNAME) end isVisible = not isVisible end I made this, going to test in game right now --Not working * A question: If I place the event "onPlayerLogin" there, I must to edit the meta file (exporting something from the Login folder)?
  4. aguia

    [HELP] Swat Team

    Thank's Best-Killer. (SOLVED) Thanks for the support Karim.
  5. aguia

    [HELP] Swat Team

    I've created SWAT colours: 0,0,204 (as the scoreboard) type: service but when I'm near the ped nothing appears
  6. aguia

    [HELP] Swat Team

    in game or in resources? I'm going to make in-game and test that right now
  7. aguia

    [HELP] Swat Team

    Best-Killer1 I changed the SAEG to NG and those things, but nothing appers when I'm near the swat ped -- On your SAEG server have the swat-invite system, could explain me (with codes if possible) how you did that?
  8. aguia

    [HELP] Swat Team

    my meta file in NGJobs: "NG Scripting Team" name="NG Jobs" type="script" version="1.0" /> true -- Core scripts --> NGPlayerFunctions\server\teams: local teams = { { "Staff", 255, 140, 0 }, { "Criminals", 255, 0, 0 }, { "Law Enforcement", 0, 100, 255 }, { "Services", 255, 255, 0 }, { "Emergency", 0, 255, 255 }, { "Unemployed", 255, 92, 0 }, } local lawTeams = { ['Law Enforcement'] = true } local team = { } for i, v in ipairs ( teams ) do team[v[1]] = createTeam ( unpack ( v ) ) end function setTeam ( p, tem ) if ( p and getElementType ( p ) == 'player' and tem and type ( tem ) == 'string' ) then for i, v in ipairs ( teams ) do if ( v[1] == tem ) then return setPlayerTeam ( p, getTeamFromName ( v[1] ) ) end end end return false end addEventHandler ( "onResourceStop", root, function ( ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getPlayerTeam ( v ) ) then setElementData ( v, "NGPlayers:SavedTeam", getTeamName ( getPlayerTeam ( v ) ) ) end end end ) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do local t = getElementData ( v, 'NGPlayers:SavedTeam' ) if t and getTeamFromName ( t ) then setPlayerTeam ( v, getTeamFromName ( t ) ) else setPlayerTeam ( v, getTeamFromName ( t, "Unemployed" ) ) end end end ) function isTeamLaw ( team ) local team = tostring ( team ) if ( lawTeams[team] ) then return true end return false end --------------------- I shouldn't remove this: addEventHandler("onResourceStart", resourceRoot, function () createTeam("SWAT", 20, 255, 20) end) and add this in NGPlayerFunctions\server\teams?: local teams = { { "Staff", 255, 140, 0 }, { "Criminals", 255, 0, 0 }, { "SWAT", 255, 0, 0 }, { "Law Enforcement", 0, 100, 255 }, { "Services", 255, 255, 0 }, { "Emergency", 0, 255, 255 }, { "Unemployed", 255, 92, 0 }, } local lawTeams = { ['Law Enforcement'] = true, ['SWAT'] = true } local team = { } for i, v in ipairs ( teams ) do team[v[1]] = createTeam ( unpack ( v ) ) end function setTeam ( p, tem ) if ( p and getElementType ( p ) == 'player' and tem and type ( tem ) == 'string' ) then for i, v in ipairs ( teams ) do if ( v[1] == tem ) then return setPlayerTeam ( p, getTeamFromName ( v[1] ) ) end end end return false end addEventHandler ( "onResourceStop", root, function ( ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getPlayerTeam ( v ) ) then setElementData ( v, "NGPlayers:SavedTeam", getTeamName ( getPlayerTeam ( v ) ) ) end end end ) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do local t = getElementData ( v, 'NGPlayers:SavedTeam' ) if t and getTeamFromName ( t ) then setPlayerTeam ( v, getTeamFromName ( t ) ) else setPlayerTeam ( v, getTeamFromName ( t, "Unemployed" ) ) end end end ) function isTeamLaw ( team ) local team = tostring ( team ) if ( lawTeams[team] ) then return true end return false end
  9. aguia

    [HELP] Swat Team

    createJob ( 'Swat', 1839.1279296875, -1385.384765625, 13.5625, 90 )
  10. aguia

    [HELP] Swat Team

    I got this on my server: [21:03:45] Creating new DB table SWAT [21:03:45] SCRIPT ERROR: NGJobs\core_server.lua:400: ')' expected near '=' [21:03:45] ERROR: Loading script failed: NGJobs\core_server.lua:400: ')' expected near '=' [21:03:45] ERROR: NGJobs\community\mechanic\server.lua:11: attempt to call global 'create3DText' (a nil value) [21:03:46] SCRIPT ERROR: NGPlayerFunctions\server\teams.lua:14: '}' expected (to close '{' at line 11) near 'local' [21:03:46] ERROR: Loading script failed: NGPlayerFunctions\server\teams.lua:14: '}' expected (to close '{' at line 11) near 'local' In game doen't work and cause certain bugs... I've edited the positions.
  11. aguia

    [HELP] Swat Team

    I gonna test this, I've found out: elseif ( job == 'swat' ) then setElementData ( p, 'Job', 'SWAT Officer' ) setPlayerTeam(p, getTeamFromName("Criminal")) setElementModel ( p, 285 ) job = "SWAT Officer" weapons[1] = { weap=3, ammo=2 } Why did you place "Criminal" there ? And I'm also thinking there is not an invite system to join SWAT... Anyway, thanks Karim for the support/time; I'll post the result here later..
  12. I am currently using these resources: viewtopic.php?f=108&t=82870 (Nerd Gaming by MADEX) So, there are some jobs (police, criminal and civilians jobs), but I want to create a special police team (SWAT) with the same police functions the only thing I want different is the recruitment: Not all member can take the job, just who gets invited by the founder. NGJobs\core_client local _guiSetVisible = guiSetVisible function guiSetVisible ( window, visible ) --outputChatBox ( tostring ( window )..": "..tostring( visible ) ) _guiSetVisible ( window, visible ); end local do3dtextrender = false setTimer ( function ( ) do3dtextrender = exports.NGLogin:isClientLoggedin ( ) end, 1000, 1 ) addEvent ( "onClientPlayerLogin", true ) addEventHandler ( "onClientPlayerLogin", root, function ( ) do3dtextrender = true end ) jobDescriptions = { ['fisherman'] = [[With the Fisher job, you will be able to spawn a boat and drive around the water to collect caught items. To catch items, you need to be in a boat that's in the water, and you MUST be moving, or else you will just be wasting time. Once your holding area is full, you'll need to return to port to sell your fish.\n\nTo view your net, use the command /net]], ['medic'] = [[When you're a medic, you can go around healing other players and getting paid for it. The money that you get for healing the player, depends on the amount of the health that they had before.]], ['police'] = [[When you're a cop, you will be able to arrest wanted players, so they have to pay the tiem for their crime. To know if a player is wanted, you can check for their name in F5, or look at their name tag, and it will be (theirName)[wantedLevel]. They will also have a police star floating over their head. If a player decides to run from you, you can used the silenced pistol as a taser, and when you shoot them, they'll be put into a tased animation, so you can arrest them.]], ['mechanic'] = [[When you're employed as a mechanic, you can go around anywhere in Los Santos fixing players cars. To fix a car, you just need to click on it and then it'll ask the client if they'd like to fix it. If they accept, a progress bar will start and then when it finishes, their car will be fix and you'll be paid.]], ['criminal'] = [[As a criminal, you can go around stealing cars in Los Santos, picking up free weapons in San Fierron and turfing in Las Ventures, but be careful, the police are always after you.]], ['detective'] = [[When you are a detective in the Nerd Gaming server, you will still have all of the features availble to you as being a normal police officer (police panel, radio chat, arrests), other than when you are a detective you will be called on to crime cases when a fellow police officer is murdered. When you arive at the crime scene, you just have to look around for clues of the killer. You will also have the ability to spawn faster vehicles]], ['pilot'] = [[When you're a pilot, you will fly an aircraft around San Andreas, picking up and delivering passengers from waypoint to waypoint. You will also be able to pick up other players, they will be able to set a waypoint when you deliver them to their waypoint you will be paid]], ['stunter'] = [[If you are a stunter, you can go around San Andreas doing tricks on bikes or motorcycles. For every stunt that you do, you will be paid]], ['swat'] = [[swat description - not added yet]], } sx, sy = guiGetScreenSize ( ) rSX, rSY = sx / 1280, sx / 1024 local JobWindow = guiCreateWindow( ( sx / 2 - (rSX*500) / 2 ), (sy-(rSY*230))-rSY*15, rSX*500, rSY*230, "Nexus Gaming Job System", false) local JobDescription = guiCreateMemo((rSX*10), (rSY*23), (rSX*480), (rSY*150), "Job Description", false, JobWindow) local JobAccept = guiCreateButton((rSX*10), ((rSY*230)-(rSY*25))-rSY*10, (rSX*150), (rSY*25), "Accept Job", false, JobWindow) local JobDeny = guiCreateButton((rSX*170), ((rSY*230)-(rSY*25))-rSY*10, (rSX*150), (rSY*25), "Deny Job", false, JobWindow) guiSetVisible ( JobWindow, false ) guiWindowSetSizable(JobWindow, false) guiWindowSetMovable ( JobWindow, false ) guiSetFont(JobDeny, "default-bold-small") guiSetFont(JobAccept, "default-bold-small") guiMemoSetReadOnly ( JobDescription, true ) --guiSetFont(JobDescription, "default-bold-small") -- settings: { maxDist = 17, showBoarder & Hide rectangle = false } addEventHandler ( 'onClientPreRender', root, function ( ) if ( do3dtextrender ) then for ind, v in ipairs ( getElementsByType ( '3DText' ) ) do local continueRender = true local text = getElementData ( v, 'text' ) local pos = getElementData ( v, 'position' ) local color = getElementData ( v, 'color' ) local parent = getElementData ( v, 'parentElement' ) if ( parent ) then if ( isElement ( parent ) ) then if ( isPedInVehicle ( localPlayer ) and getElementType ( parent ) == 'vehicle' and getPedOccupiedVehicle ( localPlayer ) == parent ) then return end local offset = pos local px, py, pz = getElementPosition ( parent ) pos = { px+offset[1], py+offset[2], pz+offset[3] } if ( parent == localPlayer ) then continueRender = false end else destroyElement ( v ) end end if continueRender and text and pos and color then local x, y, z = unpack ( pos ) local z = z + 1.15 local settings = getElementData ( v, 'Settings' ) or { } local maxDist = settings[1] or 17 if ( settings[2] ) then showBoarder = true else showBoarder = false end local px, py, pz = getElementPosition ( localPlayer ) local _3DDist = getDistanceBetweenPoints3D ( x, y, z, px, py, pz ) if ( _3DDist <= maxDist and isLineOfSightClear ( x, y, z, px, py, pz, true, false, false, true, false, false ) ) then local x, y = getScreenFromWorldPosition ( x, y, z ) local r, g, b = unpack ( color ) if x then local textSize = rSY*2 local textSize = textSize * ( ( maxDist - _3DDist ) / maxDist ) --local textSize = 2 local textWidth = dxGetTextWidth(text,textSize,'default') local height = dxGetFontHeight ( textSize, 'default' ) local x = x-(textWidth/2) if x and y and r and g and b then if ( showBoarder ) then dxDrawRectangle ( x-6, y+1, textWidth+12, height+2, tocolor ( 0, 0, 0, 120 ) ) dxDrawText ( tostring ( text ), x, y, 0, 0, tocolor ( r, g, b, 255 ), textSize ) else dxDrawBoarderedText ( tostring ( text ), x, y, 0, 0, tocolor ( r, g, b, 255 ), textSize ) end end end end end end end end ) function dxDrawBoarderedText ( text, x, y, endX, endY, color, size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) local text = tostring ( text ) local x = tonumber(x) or 0 local y = tonumber(y) or 0 local endX = tonumber(endX) or x local endY = tonumber(endY) or y local color = color or tocolor ( 255, 255, 255, 255 ) local size = tonumber(size) or 1 local font = font or "default" local alignX = alignX or "left" local alignY = alignY or "top" local clip = clip or false local wordBreak = wordBreak or false local postGUI = postGUI or false local colorCode = colorCode or false local subPixelPos = subPixelPos or false local fRot = tonumber(fRot) or 0 local fRotCX = tonumber(fRotCX) or 0 local fRotCY = tonumber(fRotCy) or 0 local offSet = tonumber(offSet) or 1 local t_g = text:gsub ( "#%x%x%x%x%x%x", "" ) dxDrawText ( t_g, x-offSet, y-offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x-offSet, y, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x, y-offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x+offSet, y+offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x+offSet, y, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) dxDrawText ( t_g, x, y+offSet, endX, endY, tocolor(0,0,0,255), size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) return dxDrawText ( text, x, y, endX, endY, color, size, font, alignX, alignY, clip, wordBreak, postGUI, colorCode, subPixelPos, fRot, fRotCX, fRotCY, offSet ) end function create3DText ( str, pos, color, parent, settings ) if str and pos and color then local text = createElement ( '3DText' ) local settings = settings or { } setElementData ( text, "text", str ) setElementData ( text, "position", pos ) setElementData ( text, "color", color ) if ( not parent ) then parent = nil else if ( isElement ( parent ) ) then parent = parent else parent = nil end end setElementData ( text, "Settings", settings ) setElementData ( text, "parentElement", parent ) return text end return false end local peds = { } function refreshGodmodePeds ( ) for i, v in ipairs ( peds ) do destroyElement ( v ) end for i, v in ipairs ( getElementsByType ( 'GodmodePed' ) ) do local id = getElementData ( v, "Model" ) local x, y, z, rz = unpack ( getElementData ( v, "Position" ) ) peds[i] = createPed ( id, x, y, z, rz ) setElementFrozen ( peds[i], true ) addEventHandler ( 'onClientPedDamage', peds[i], function ( ) cancelEvent ( ) end ) end end refreshGodmodePeds ( ) setTimer ( refreshGodmodePeds, 30000, 0 ) openedJob = nil addEvent ( 'NGJobs:OpenJobMenu', true ) addEventHandler ( 'NGJobs:OpenJobMenu', root, function ( job ) openedJob = job guiSetVisible ( JobWindow, true ) showCursor ( true ) local desc = jobDescriptions [ job ] guiSetText ( JobDescription, tostring ( desc ) ) addEventHandler ( "onClientGUIClick", root, clickingevents_jobmenu ) end ) function clickingevents_jobmenu ( ) if ( source == JobDeny ) then desc = nil openedJob = nil guiSetVisible ( JobWindow, false ) showCursor ( false ) removeEventHandler ( "onClientGUIClick", root, clickingevents_jobmenu ) elseif ( source == JobAccept ) then triggerServerEvent ( "NGJobs:SetPlayerJob", localPlayer, openedJob ) desc = nil openedJob = nil guiSetVisible ( JobWindow, false ) showCursor ( false ) removeEventHandler ( "onClientGUIClick", root, clickingevents_jobmenu ) end end addEventHandler ( 'onClientPlayerWasted', root, function ( ) if ( source == localPlayer ) then showCursor ( false ) guiSetVisible ( JobWindow, false ) end end ) addEvent ( "onPlayerResign", true ) NGJobs\core_server max_wanted = { community = 2, law = 1, criminal = 7 } jobRanks = { ['criminal'] = { [0] = "L.G", [50] = "L.Y.G", [75] = "Y.G", [120] = "OYG", [200] = "O.G", [310] = "G.C.L", [499] = "G.L", }, ['police officer'] = { [0] ="Officer", [90]="Corporal", [200]="Trooper", [310]="Sergeant", [450]="Captain", [600]="Commander", [900]="Chief of Police", }, ['medic'] = { [0] = "Assistant", [50] = "Training", [100]= "Nurse", [130] = "Paramedic", [200] = "Doctor", [260] = "Surgeon" }, ['mechanic'] = { [0] = "Rookie", [40] = "Wheel Specialist", [100]= "Engine Specialist", [140]= "Vehicle Professional", [200]= "Motorcycle Specialist", [245]= "Vehicle Master" }, ['fisherman'] = { [0] = "Deck Hand", [20]= "Net Baiter", [75]= "Line Thrower", [100]="Line Roller", [140]="Boat Captain", [200]="Experienced Fisherman", [270]="Underwater Trap Setter" }, ['detective'] = { [0] = "Detective" }, ['pilot'] = { [0] = "Junior flight officer", [25] = "Flight Officer", [50] = "First Officer", [120] = "Captain", [180] = "Senior Captain", [250] = "Commercial First Officer", [310] = "Commercial Captain", [390] = "Commercial Commander", [460] = "Commercial Senior Commander", }, ['stunter'] = { [0] = "Crash Dummy", [50] = "Crash", [150] = "Experienced", [200] = "Professional", [300] = "Expert BMXer" } } function getJobRankTable ( ) return jobRanks end exports['Scoreboard']:scoreboardAddColumn ( "Job", root, 90, "Job", 4 ) exports['Scoreboard']:scoreboardAddColumn ( "Job Rank", root, 90, "Job Rank", 5 ) function create3DText ( str, pos, color, parent, settings ) if str and pos and color then local text = createElement ( '3DText' ) local settings = settings or { } setElementData ( text, "text", str ) setElementData ( text, "position", pos ) setElementData ( text, "color", color ) if ( not parent ) then parent = nil else if ( isElement ( parent ) ) then parent = parent else parent = nil end end setElementData ( text, "Settings", settings ) setElementData ( text, "parentElement", parent ) setElementData ( text, "sourceResource", sourceResource or getThisResource ( )) return text end return false end addEventHandler ( "onResourceStop", root, function ( r ) for i, v in pairs ( getElementsByType ( "3DText" ) ) do if ( r == getElementData ( v, "sourceResource" ) ) then destroyElement ( v ) end end end ) function createJob ( name, x, y, z, rz ) if ( name == 'Criminal' ) then create3DText ( 'Criminal', { x, y, z }, { 255, 0, 0 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 28 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 59, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.criminal ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.criminal )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'criminal' ) end end ) ---------------------------------- -- Law Jobs -- ---------------------------------- elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 281 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'police' ) end end ) elseif ( name == 'Detective' ) then create3DText ( 'Detective', { x, y, z }, { 0, 120, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 17 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end local arrests = getJobColumnData ( getAccountName ( getPlayerAccount ( p ) ), getDatabaseColumnTypeFromJob ( "police officer" ) ) if ( arrests < 150 ) then return exports.NGMessages:sendClientMessage ( "This job requires at least 150 arrests", p, 255, 255, 0 ) end triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'detective' ) end end ) ---------------------------------- -- Emergency Jobs -- ---------------------------------- elseif ( name == 'Medic' ) then create3DText ( 'Medic', { x, y, z }, { 0, 255, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 274 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 58, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.community ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.community )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'medic' ) end end ) ---------------------------------- -- Community Jobs -- ---------------------------------- elseif ( name == 'Mechanic' ) then create3DText ( 'Mechanic', { x, y, z }, { 255, 255, 0 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 30 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 60, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.community ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.community )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'mechanic' ) end end ) elseif ( name == 'Fisher' ) then create3DText ( 'Fisher', { x, y, z }, { 255, 255, 0 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 45 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 60, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.community ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.community )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'fisherman' ) end end ) elseif ( name == "Pilot" ) then create3DText ( 'Pilot', { x, y, z }, { 255, 255, 0 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 61 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 60, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.community ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.community )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'pilot' ) end end ) elseif ( name == 'Stunter' ) then create3DText ( 'Stunter', { x, y, z }, { 255, 255, 0 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 23 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 60, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.community ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.community )..".", p, 255, 0, 0 ) end triggerClientEvent ( p, 'NGJobs:OpenJobMenu', p, 'stunter' ) end end ) end end createJob ( 'Criminal', 1625.92, -1508.65, 13.6, 180 ) createJob ( 'Criminal', 2141.75, -1733.94, 17.28, 0 ) createJob ( 'Criminal', 2460.31, 1324.94, 10.82, -90 ) createJob ( 'Criminal', 1042.26, 2154.03, 10.82, -90 ) createJob
  13. I'm currently using NG resources, but there are not special teams and I were trying to create but failed at all.. I am looking for a resource with "special team" like swat, army, etc (with their functions to arrest/jail). If you know any resource that can help me, please, share it... Or, if ya know how to add the same police function (arrest, etc) to army/swat on NG resources, tell me NG Resources: github.com/braydondavis/Nerd-Gaming-Public
  14. Hello everybody, I'm new in the script section and I've starting studying these resources: viewtopic.php?f=108&t=82870 (made by xXMADEXx) Well, I were trying to place a new hud, but it appears while I'm on login panel, how can I let that hud hidden while the login system is working? *I'm also trying to place a new radar (same thing).
  15. Hi there, I'm looking for a script with own teams, like military and swat... With that "talk-to-ped" system to get the skin but, you can just talk to the ped if you got invited by the founder. If you know some resource wich have those teams/systems, please send me. Thank's. *I'm wanting to make a simple CnR w/ Gangs, Cops, Turf Was, Military, Swat and maybe Civilians. *** Sorry for that english, btw. ***
  16. Obrigado por tentar ajuda mas não manjo disso.
  17. Bom, quero que somente o trabalho de criminoso consiga ver o "Arms Dealer" no Mapa (O ícone). No server que estou estudando todos os empregos conseguem ver o Arms Dealer, mas isso é inútil, pois, somente o emprego de criminoso consegue pegá-lo. O mesmo ocorre com o "Car nao lembro o nome"; Se alguém souber de uma script assim, deixa pra download ou ensina como coloco... Valeu
  18. Quero o mesmo para diversão com alguns amigos.
  19. Muito obrigado! Você já testou esse Nerd Gaming RPG Public Release ? No mtaserver está assim : Mas no jogo nenhum dessas resources funcionam... Sabe porque ? Tenho que usar o SQL para funcionar ou algo assim ? Não sei como dar VIP para um player...
  20. Não entendi, não manjo nada... Onde tenho que colocar isso ?
×
×
  • Create New...