Jump to content

MoeezKhan

Members
  • Posts

    142
  • Joined

  • Last visited

Everything posted by MoeezKhan

  1. Error: housesystem_mysql/server.lua:97: dbConnect failed; Can't connect to MySQL server on 'localhost' <10061> Error: Error: housesystem_mysql/server.lua:92: dbConnect failed; Can't connect to MySQL server on 'localhost' <10061>
  2. Hi All this is house system why this script not start . when i press start nothing happen ----client side--- ------------------------------------- -- HOUSE SYSTEM CREATED BY NONEATME -- -- -- - DO NOT REMOVE CREDITS - -- --- --YOU ARE NOT ALLOWED TO COMPILE THIS- -------------------------------------- -- EVENTS -- addEvent("onClientHouseSystemGUIStart", true) addEvent("onClientHouseSystemMenueOpen", true) addEvent("onClientHouseSystemMenueUpdate", true) addEvent("onClientHouseSystemColshapeAdd", true) addEvent("onClientHouseSystemInfoMenueOpen", true) -- SOME SETTINGS -- local gMe = getLocalPlayer() local houseInteriors = { -- I don't really use tables [1] = "223.0538482666, 1287.3552246094, 1082.140625, 1, Shitty house 1", [2] = "2233.6594238281, -1114.9837646484, 1050.8828125, 5, Hotel room 1", [3] = "2365.22265625, -1135.5612792969, 1050.8825683594, 8, Modern house 1", [4] = "2282.9401855469, -1140.1246337891, 1050.8984375, 11, Hotel room 2", [5] = "2196.7075195313, -1204.3569335938, 1049.0234375, 6, Modern house 2", [6] = "2270.0834960938, -1210.4854736328, 1047.5625, 10, Modern house 3", [7] = "2308.755859375, -1212.5498046875, 1049.0234375, 6, Shitty house 2", [8] = "2217.7729492188, -1076.2110595703, 1050.484375, 1, Hotel room 3", [9] = "2237.5009765625, -1080.9367675781, 1049.0234375, 2, Good house 1", [10] = "2317.7609863281, -1026.4268798828, 1050.2177734375, 9, Good Stair house 1", [11] = "261.05038452148, 1284.7646484375, 1080.2578125, 4, Goood house 2", [12] = "140.18000793457, 1366.7183837891, 1083.859375, 5, Modern house 4(Rich)", [13] = "83.037002563477, 1322.6156005859, 1083.8662109375, 9, Good Stair house 2", [14] = "-283.92623901367, 1471.0096435547, 1084.375, 15, Good Stair house 3", [15] = "-261.03778076172, 1456.6539306641, 1084.3671875, 4, Good Stair house 4", [16] = "-42.609268188477, 1405.8033447266, 1084.4296875, 8, Shitty house 3", [17] = "-68.839866638184, 1351.4775390625, 1080.2109375, 6, Shitty house 4", [18] = "2333.068359375, -1077.0648193359, 1049.0234375, 6, Shitty house 5", [19] = "1261.1168212891, -785.38037109375, 1091.90625, 5, Mad Doggs Mansion", [20] = "2215.1145019531, -1150.4993896484, 1025.796875, 15, Jefferson Motel", [21] = "2352.4575195313, -1180.9454345703, 1027.9765625, 5, Burning desire house(Buggy)", [22] = "421.94845581055, 2536.5021972656, 10, 10, Abandoned Tower", [23] = "2495.9753417969, -1692.4174804688, 1014.7421875, 3, Johnson house", [24] = "-2158.7209472656, 642.83074951172, 1052.375, 1, Bet Interior", [25] = "1701.1682128906, -1667.759765625, 20.21875, 18, Atrium lobby", [26] = "2324.499, -1147.071, 1050.71, 12, Modern House 5(Rich)", [27] = "244.411987,305.032989,999.148437, 1, 1 Room house", [28] = "271.884979,306.631988,999.148437, 2, 1 Room house", [29] = "302.180999,300.722991,999.148437, 4, 1 Room house", } local Guivar = 0 -- createhouse Menue local Guivar2 = 0 -- MENUE local Guivar3 = 0 local Fenster = {} local Knopf = {} local Label = {} local Edit = {} local Grid = {} local Bild = {} local Fenster2 = {} local Knopf2 = {} local Label2 = {} local Edit2 = {} local Radio2 = {} local Checkbox2 = {} local Grid2 = {} local Fenster3 = {} local Knopf3 = {} local Label3 = {} -------------------- -- EVENT HANDLERS -- -------------------- -- MENUE UPDATE -- addEventHandler("onClientHouseSystemMenueUpdate", getRootElement(), function(string, value, int) if(Guivar2 == 0) then return end if(string == "LOCKED") then if(value == 0) then guiSetText(Knopf2[6], "Lock house") else guiSetText(Knopf2[6], "Unlock house") end elseif(string == "MONEY") then guiSetText(Label2[3], "Current Money:\n"..value.."$") elseif(string == "WEAPON") then if(value == 1) then if(type(int) == "string") then guiSetText(Label2[6], "Slot 1: "..getWeaponNameFromID(gettok(int, 1, ",")).."\nAmmo: "..gettok(int, 2, ",")) else guiSetText(Label2[6], "Slot 1: -\nAmmo: -") end elseif(value == 2) then if(type(int) == "string") then guiSetText(Label2[7], "Slot 2: "..getWeaponNameFromID(gettok(int, 1, ",")).."\nAmmo: "..gettok(int, 2, ",")) else guiSetText(Label2[7], "Slot 2: -\nAmmo: -") end elseif(value == 3) then if(type(int) == "string") then guiSetText(Label2[9], "Slot 3: "..getWeaponNameFromID(gettok(int, 1, ",")).."\nAmmo: "..gettok(int, 2, ",")) else guiSetText(Label2[9], "Slot 3: -\nAmmo: -") end end elseif(string == "RENTABLE") then if(value == true) then guiSetText(Knopf2[9], "Set unrentable") else guiSetText(Knopf2[9], "Set rentable") end elseif(string == "RENTALPRICE") then guiSetText(Label2[15], "Rentalprice: $"..value) elseif(string == "TENANDS") then guiGridListClear(Grid2[1]) for index, player in pairs(value) do if(player ~= "no-one") then local row = guiGridListAddRow(Grid2[1]) guiGridListSetItemText(Grid2[1], row, 1, player, false, false) end end end end) -- INFO MENUE -- addEventHandler("onClientHouseSystemInfoMenueOpen", gMe, function(owner, x, y, z, price, locked, rentable, rentalprice, id, doingrent, isrentedin, canadd) if(Guivar3 == 1) then destroyElement(Fenster3[1]) showCursor(false) Guivar3 = 0 return end Guivar3 = 1 showCursor(true) guiSetInputMode("no_binds_when_editing") -- Make the variables -- local lockedstate = "no" if(tonumber(locked) == 1) then lockedstate = "yes" end local rentstate = "no" if(tonumber(rentable) == 1) then rentstate = "yes" end local X, Y, Width, Height = getMiddleGuiPosition(270,251) Fenster3[1] = guiCreateWindow(X, Y, Width, Height,"Houseinformation",false) Label3[1] = guiCreateLabel(12,43,253,15,"House ID: "..id,false,Fenster3[1]) guiLabelSetHorizontalAlign(Label3[1],"center",false) guiSetFont(Label3[1],"default-bold-small") Label3[2] = guiCreateLabel(10,22,257,15,"House Informations:",false,Fenster3[1]) guiLabelSetHorizontalAlign(Label3[2],"center",false) guiSetFont(Label3[2],"default-bold-small") Label3[3] = guiCreateLabel(10,25,259,15,"_______________________",false,Fenster3[1]) guiLabelSetColor(Label3[3],0, 255, 0) guiLabelSetHorizontalAlign(Label3[3],"center",false) Label3[4] = guiCreateLabel(12,61,251,18,"Location: "..getZoneName(x, y, z, false),false,Fenster3[1]) guiLabelSetHorizontalAlign(Label3[4],"center",false) guiSetFont(Label3[4],"default-bold-small") Label3[5] = guiCreateLabel(12,81,250,14,"Owner: "..owner,false,Fenster3[1]) guiLabelSetHorizontalAlign(Label3[5],"center",false) guiSetFont(Label3[5],"default-bold-small") Label3[6] = guiCreateLabel(12,100,252,15,"Price: $"..price,false,Fenster3[1]) guiLabelSetHorizontalAlign(Label3[6],"center",false) guiSetFont(Label3[6],"default-bold-small") Label3[7] = guiCreateLabel(12,118,250,14,"Rentable: "..rentstate,false,Fenster3[1]) guiLabelSetHorizontalAlign(Label3[7],"center",false) guiSetFont(Label3[7],"default-bold-small") Label3[8] = guiCreateLabel(12,137,247,14,"Rentalprice: $"..rentalprice,false,Fenster3[1]) guiLabelSetHorizontalAlign(Label3[8],"center",false) guiSetFont(Label3[8],"default-bold-small") Label3[9] = guiCreateLabel(12,155,247,12,"Locked: "..lockedstate,false,Fenster3[1]) guiLabelSetHorizontalAlign(Label3[9],"center",false) guiSetFont(Label3[9],"default-bold-small") Knopf3[1] = guiCreateButton(9,175,124,32,"Buy house",false,Fenster3[1]) Knopf3[2] = guiCreateButton(137,175,124,32,"Rent house",false,Fenster3[1]) Knopf3[3] = guiCreateButton(9,210,124,32,"Close",false,Fenster3[1]) Knopf3[4] = guiCreateButton(137,209,124,32,"Enter",false,Fenster3[1]) -------------- -- SETTINGS -- -------------- -- ENTER BUTTON -- if(getPlayerName(gMe) ~= owner) then if(isrentedin == true) then else if(tonumber(locked) == 1) then guiSetEnabled(Knopf3[4], false) end end end -- RENT HOUSE BUTTON -- if(getPlayerName(gMe) == owner) then guiSetEnabled(Knopf3[2], false) else if(doingrent == true) or(owner == "no-one") or (tonumber(rentable) == 0) or (canadd == false) then guiSetEnabled(Knopf3[2], false) end if(isrentedin == true) then guiSetEnabled(Knopf3[2], true) guiSetText(Knopf3[2], "Unrent house") end end -- BUYHOUSE BUTTON -- if(owner ~= "no-one") then guiSetEnabled(Knopf3[1], false) if(owner == getPlayerName(gMe)) then guiSetEnabled(Knopf3[1], true) guiSetText(Knopf3[1], "Sell house") end end -- EVENT HANDLERS -- -- RENT -- addEventHandler("onClientGUIClick", Knopf3[2], function() local text = guiGetText(Knopf3[2]) Guivar3 = 0 showCursor(false) destroyElement(Fenster3[1]) if(text == "Rent house") then triggerServerEvent("onHouseSystemInfoRent", gMe, id, true) else triggerServerEvent("onHouseSystemInfoRent", gMe, id, false) end end, false) -- BUY HOUSE -- addEventHandler("onClientGUIClick", Knopf3[1], function() local text = guiGetText(Knopf3[1]) Guivar3 = 0 showCursor(false) destroyElement(Fenster3[1]) if (text == "Buy house") then triggerServerEvent("onHouseSystemInfoBuy", gMe, id, true) else triggerServerEvent("onHouseSystemInfoBuy", gMe, id, false) end end, false) -- ENTER --
  3. give me some explan to make moving picture with shader
  4. your all script not working
  5. Hi All how i make police job anybody tell me.. I make only simple police job and GUI i Dont khow how i can add arrest part
  6. hi all I make mechanic_job when i press take job but skin not change all script have same problem . please fix it and please make it to show in tab panel Please read my all forum i have lot of problem in my script please please make it player get in towtruck and attach damage car with car wire and go i n mechanic garage and he automaticaly repair player get pay please make it ----client side----- local GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource( )), function() local guiX,guiY = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((guiX-500)/2, (guiY-350)/2, 500, 350, "Mechanic", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(10, 300, 110, 36, "Take job", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bAccept, hideGUImc, false) addEventHandler("onClientGUIClick", bAccept, joinMechanicTeam, false) bClose = guiCreateButton(126, 300, 110, 36, "Cancel", false, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bClose, hideGUImc, false) GUIEditor.memo[1] = guiCreateMemo(10, 30, 480, 264, "Mechanic\n".. "Your job is to help people repair their cars, refuel ".. "empty fueltanks and help other players in general by ".. "giving them transport to a pay'n'spray where their ".. "cars can be repaired\n\n".. "This job provides you with heavy and powerful vehicles ".. "like the towtruck wich should be used to tow vehicles, ".. "Do not use it for stealing cars since then you will be fired!\n\n".. "By using a pickup truck you can also deliver fuel to people who ".. "ran out of it and need help to reach a gasstation." , false, GUIEditor.window[1]) guiEditSetReadOnly(GUIEditor.memo[1],true) end ) local joinBD3 = createMarker(-1918, 255, 40, "cylinder", 1.5, 255, 200, 0, 50) local joinBD4 = createMarker(1065, -1029, 31, "cylinder", 1.5, 255, 200, 0, 50) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( )), function ( startedRes ) createBlipAttachedTo( joinBD3, 56, 2, 0, 0, 0, 0, 0, 400); createBlipAttachedTo( joinBD4, 56, 2, 0, 0, 0, 0, 0, 400); end ); function showGUImc(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end addEventHandler("onClientMarkerHit", joinBD3, showGUImc) addEventHandler("onClientMarkerHit", joinBD4, showGUImc) function hideGUImc() guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end function joinMechanicTeam() triggerServerEvent("mechanic", localPlayer, "teamSet") end element = nil function openVehicleGui ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) then local elementType = getElementType( clickedElement ) local dist = getDistanceBetweenPoints3D( worldX, worldY, worldZ, getElementPosition( localPlayer )) if elementType == "vehicle" and not getPedOccupiedVehicle( localPlayer ) and ((( getPlayerTeam( localPlayer ) == getTeamFromName( "Civilians" ) and getElementData( localPlayer, "Occupation" ) == "Mechanic" ) or getElementData( localPlayer, "admin" )) and (( not isTimer( cooldown ) and ( dist < 4 )) or getElementData( localPlayer, "admin" ))) then -- Open gui element = clickedElement local guiX,guiY = guiGetScreenSize() if isElement( GUIEditor.window[2] ) then destroyElement( GUIEditor.window[2] ) end GUIEditor.window[2] = guiCreateWindow((guiX-200)/2, (guiY-300)/2, 200, 300, "Vehicle", false) GUIEditor.button[3] = guiCreateButton(10, 30, 180, 40, "Repair", false, GUIEditor.window[2]) GUIEditor.button[4] = guiCreateButton(10, 80, 180, 40, "Refuel", false, GUIEditor.window[2]) GUIEditor.button[5] = guiCreateButton(10, 240, 180, 40, "Close", false, GUIEditor.window[2]) if getElementData( localPlayer, "admin" ) and not ( getPlayerTeam( localPlayer ) == getTeamFromName( "Civilians" )) then guiSetText( GUIEditor.button[3], "Destroy" ) guiSetText( GUIEditor.button[4], "Information" ) end showCursor ( true ) guiSetVisible( GUIEditor.window[2], true ) addEventHandler("onClientGUIClick", GUIEditor.button[3], button1 ) addEventHandler("onClientGUIClick", GUIEditor.button[4], button2 ) addEventHandler("onClientGUIClick", GUIEditor.button[5], buttonClose ) cooldown = setTimer( function() end, 1000, 1 ) end end end addEventHandler ( "onClientClick", getRootElement(), openVehicleGui ) function button1( ) if isElement( element ) then if getPlayerTeam( localPlayer ) == getTeamFromName( "Civilians" ) then destroyElement( GUIEditor.window[2] ) showCursor( false ) -- Create progress if getElementData( element, "owner" ) then repairTime = (1000-getElementHealth( element ))*60 if repairTime > 100 then pb = guiCreateProgressBar( 0.4, 0.9, 0.2, 0.05, true ) setTimer( function() local progress = guiProgressBarGetProgress( pb ) if progress < 99 then guiProgressBarSetProgress( pb, progress+1 ) else destroyElement( pb ) end end, math.floor(repairTime/100), 100 ) end triggerServerEvent( "fix", getRootElement(), element ) else topBarMessage( "This vehicle has no owner", 255, 255, 0 ) end elseif getElementData( localPlayer, "admin" ) then showCursor( false ) destroyElement( GUIEditor.window[2] ) exports["AC_message"]:outputTopBar( "Vehicle was sucsessfully removed!", 0, 255, 0 ) triggerServerEvent( "destroy", getRootElement(), element ) end end end function button2( ) if isElement( element ) then if getPlayerTeam( localPlayer ) == getTeamFromName( "Civilians" ) and not isTimer( cooldown ) then showCursor( false ) destroyElement( GUIEditor.window[2] ) local fuel = getElementData( element, "vehicleFuel" ) if tonumber( getElementData( element, "vehicleFuel" )) < 91 then setElementData( element, "vehicleFuel", fuel+10 ) exports["AC_message"]:outputTopBar( "Vehicle sucsessfully refueld (10 hits of fuel)", 0, 255, 0 ) else setElementData( element, "vehicleFuel", 100 ) exports["AC_message"]:outputTopBar( "This vehicle already have enough fuel", 255, 0, 0 ) end cooldown = setTimer( function() end, 10000, 1 ) elseif getElementData( localPlayer, "admin" ) then showCursor( false ) destroyElement( GUIEditor.window[2] ) local owner = getElementData( element, "owner" ) if owner then outputChatBox( "INFO: owner="..owner, 255, 255, 255 ) end end end end function buttonClose( ) showCursor ( false ) destroyElement( GUIEditor.window[2] ) end function topBarMessage( message, r, g, b ) exports["AC_message"]:outputTopBar( message, r, g, b ) end addEvent( "onTopMessage", true ) addEventHandler( "onTopMessage", getRootElement(), topBarMessage ) ----server side----- local team = getTeamFromName ( "Civilians" ) function teamSet( ) setElementData( client, "Occupation", "Mechanic" ) local team = getTeamFromName ( "Civilians" ) if team then setPlayerTeam ( client, team ) setPlayerNametagColor ( client, 255, 200, 0 ) local skinID = 50 setElementModel( client, skinID ) createBlipAttachedTo( client, 0, 2, 255, 200, 0, 255, 1 ) exports["AC_message"]:outputTopBar( "You are now emplyed as mechanic!", client, 0, 255, 0 ) setElementData( client, "admin", false ) else exports["AC_message"]:outputTopBar( "You are already emplyed as mechanic!", client, 255, 0, 0 ) end end addEvent( "mechanic", true) addEventHandler( "mechanic", root, teamSet ) function repair( veh ) if isElement( veh ) then local repairTime = (1000-getElementHealth( veh ))*60 if repairTime > 100 then local playerName = getElementData( veh, "owner" ) if playerName then local owner = getPlayerFromName( playerName ) outPutTopbarMessage( "Reparing vehicle...", client, 0, 255, 0 ) setPedAnimation( client, "GRAFFITI", "spraycan_fire", -1, true ) setTimer( fixVehicle, math.floor(repairTime), 1, veh ) setElementFrozen( veh, true ) setElementFrozen( client, true ) setTimer( showCursor, math.floor(repairTime), 1, client, false ) setTimer( setElementFrozen, math.floor(repairTime), 1, veh, false ) setTimer( setElementFrozen, math.floor(repairTime), 1, client, false ) setTimer( outPutTopbarMessage, math.floor(repairTime), 1, "Vehicle was sucsessfully repaired!", client, 0, 255, 0 ) setTimer( payRepair, math.floor(repairTime), 1, client, veh, repairTime ) setTimer( setPedAnimation, math.floor(repairTime), 1, client, nil, nil ) end else outPutTopbarMessage( "Vehicle is already in good condition", client, 0, 255, 0 ) end else outPutTopbarMessage( "No vehicle found", client, 255, 0, 0 ) end end addEvent ( "fix", true) addEventHandler ( "fix", root, repair ) function payRepair( mech, veh, owner, time ) if isElement( owner ) then givePlayerMoney( mech, (time/100 )) takePlayerMoney( owner, ((time/100)/2 )) end end function adminClean( veh ) if isElement( veh ) then destroyElement( veh ) end end addEvent( "destroy", true) addEventHandler ( "destroy", root, adminClean ) function outPutTopbarMessage( message, thePlayer, r, g, b ) exports["AC_message"]:outputTopBar( message, thePlayer, r, g, b ) end need police job please not convert in luac like that if you want to give thanks for reply
  7. hi all I make pilot_job when i press take job but skin not change . please fix it and please make it to show in tab panel.Please read my all fourm i have lot of problem in my script please ----client side----- local GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource( )), function() local guiX,guiY = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((guiX-500)/2, (guiY-350)/2, 500, 350, "Pilot", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(10, 300, 110, 36, "Take job", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bAccept, showGUIbf, false) addEventHandler("onClientGUIClick", bAccept, joinTeam, false) bClose = guiCreateButton(126, 300, 110, 36, "Cancel", false, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bClose, showGUIbf, false) GUIEditor.memo[1] = guiCreateMemo(10, 30, 480, 264, "Pilot\n".. "Fly around San Andreas and get payed\n" , false, GUIEditor.window[1]) guiEditSetReadOnly(GUIEditor.memo[1],true) end ) local joinBD = createMarker(-1546, -442, 5, "cylinder", 1.5, 255, 200, 0, 50) local joinBD2 = createMarker(1958, -2182, 12.5, "cylinder", 1.5, 255, 200, 0, 50) local joinBD3 = createMarker(1717, 1615.6, 9, "cylinder", 1.5, 255, 200, 0, 50) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( )), function ( startedRes ) createBlipAttachedTo( joinBD, 56, 2, 0, 0, 0, 0, 0, 400); createBlipAttachedTo( joinBD2, 56, 2, 0, 0, 0, 0, 0, 400); createBlipAttachedTo( joinBD3, 56, 2, 0, 0, 0, 0, 0, 400); end ); function showGUIbt(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end addEventHandler("onClientMarkerHit", joinBD, showGUIbt) addEventHandler("onClientMarkerHit", joinBD2, showGUIbt) addEventHandler("onClientMarkerHit", joinBD3, showGUIbt) function showGUIbf() guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end function joinTeam() triggerServerEvent("setTeam", localPlayer, "teamSet") end ----server side--- local pickups = { [1]={ 1985.55078125, -2252.1572265625, 13.722847938538, 103.69232177734 }, [2]={ 1977.173828125, -2306.5771484375, 13.726548194885, 117.84616088867 }, [3]={ 1978.21484375, -2375.298828125, 13.72612285614, 83.032989501953 }, [4]={ 1881.8857421875, -2618.0634765625, 13.723665237427, 354.06594848633 }, [5]={ 1822.025390625, -2616.158203125, 13.72287273407, 1.5384826660156 }, [6]={ 1565.8037109375, -2444.390625, 13.732352256775, 347.20880126953 }, [7]={ 1648.4814453125, -2442.1494140625, 13.746061325073, 311.34066772461 }, [8]={ 1726.4033203125, -2432.03515625, 14.044448852539, 316.79119873047 }, [9]={ 2065.685546875, 312.734375, 34.874977111816, 97.362640380859 }, [10]={ 1317.638671875, 1342.4091796875, 11.03280544281, 6.8132019042969 }, [11]={ 1332.490234375, 1596.5615234375, 10.997436523438, 119.69232177734 }, [12]={ 1475.1220703125, 1813.1171875, 10.996809959412, 5.6703491210938 }, [13]={ 1557.3193359375, 1500.7099609375, 11.015826225281, 30.637359619141 }, [14]={ 1557.189453125, 1360.5888671875, 11.044065475464, 301.23077392578 }, [15]={ 662.484375, 2152.4541015625, 20.68162727356, 355.03295898438 }, [16]={ 401.177734375, 2501.7470703125, 16.6618309021, 84.791229248047 }, [17]={ -40.1162109375, 2505.916015625, 16.770608901978, 89.098907470703 }, [18]={ -1818.6318359375, 2208.9130859375, 17.039325714111, 55.9560546875 }, [19]={ -1694.5498046875, -314.765625, 14.349038124084, 149.84616088867 }, [20]={ -1607.03125, -496.0966796875, 22.264881134033, 229.40660095215 }, [21]={ -1278.2822265625, -591.33984375, 14.32221031189, 14.901123046875 }, [22]={ -1235.732421875, -364.64453125, 14.478247642517, 162.94506835938 }, [23]={ -1312.7216796875, -202.8291015625, 14.327821731567, 135.07693481445 }, [24]={ -1225.6865234375, -12.3369140625, 14.343338012695, 47.164855957031 }, [25]={ -1286.9658203125, 95.5546875, 14.349571228027, 336.39559936523 }, } local dropoffss = { [1]={ 1985.55078125, -2252.1572265625, 13.722847938538, 103.69232177734 }, [2]={ 1977.173828125, -2306.5771484375, 13.726548194885, 117.84616088867 }, [3]={ 1978.21484375, -2375.298828125, 13.72612285614, 83.032989501953 }, [4]={ 1881.8857421875, -2618.0634765625, 13.723665237427, 354.06594848633 }, [5]={ 1822.025390625, -2616.158203125, 13.72287273407, 1.5384826660156 }, [6]={ 1565.8037109375, -2444.390625, 13.732352256775, 347.20880126953 }, [7]={ 1648.4814453125, -2442.1494140625, 13.746061325073, 311.34066772461 }, [8]={ 1726.4033203125, -2432.03515625, 14.044448852539, 316.79119873047 }, [9]={ 2065.685546875, 312.734375, 34.874977111816, 97.362640380859 }, [10]={ 1317.638671875, 1342.4091796875, 11.03280544281, 6.8132019042969 }, [11]={ 1332.490234375, 1596.5615234375, 10.997436523438, 119.69232177734 }, [12]={ 1475.1220703125, 1813.1171875, 10.996809959412, 5.6703491210938 }, [13]={ 1557.3193359375, 1500.7099609375, 11.015826225281, 30.637359619141 }, [14]={ 1557.189453125, 1360.5888671875, 11.044065475464, 301.23077392578 }, [15]={ 662.484375, 2152.4541015625, 20.68162727356, 355.03295898438 }, [16]={ 401.177734375, 2501.7470703125, 16.6618309021, 84.791229248047 }, [17]={ -40.1162109375, 2505.916015625, 16.770608901978, 89.098907470703 }, [18]={ -1818.6318359375, 2208.9130859375, 17.039325714111, 55.9560546875 }, [19]={ -1694.5498046875, -314.765625, 14.349038124084, 149.84616088867 }, [20]={ -1607.03125, -496.0966796875, 22.264881134033, 229.40660095215 }, [21]={ -1278.2822265625, -591.33984375, 14.32221031189, 14.901123046875 }, [22]={ -1235.732421875, -364.64453125, 14.478247642517, 162.94506835938 }, [23]={ -1312.7216796875, -202.8291015625, 14.327821731567, 135.07693481445 }, [24]={ -1225.6865234375, -12.3369140625, 14.343338012695, 47.164855957031 }, [25]={ -1286.9658203125, 95.5546875, 14.349571228027, 336.39559936523 }, } local team = getTeamFromName ( "Civilians" ) local planeVeh = { [592] = true, [577] = true, [511] = true, [548] = true, [593] = true, [487] = true, [519] = true, [513] = true, [553] = true, [488] = true, [469] = true } function teamSet ( ) local team = getTeamFromName ( "Civilians" ) if team and getElementData( client, "Occupation" ) ~= "Pilot" then setPlayerTeam ( client, team ) setPlayerNametagColor ( client, 255, 200, 0 ) setElementData( client, "Occupation", "Pilot", true ) local skinID = 61 setElementModel(client, skinID) createBlipAttachedTo ( client, 0, 2, 255, 200, 0, 255, 1 ) exports["AC_message"]:outputTopBar( "You are now a pilot!", client, 0, 255, 0 ) else exports["AC_message"]:outputTopBar( "You are already a pilot!", client, 255, 0, 0 ) end end addEvent ( "setTeam", true) addEventHandler ( "setTeam", root, teamSet ) local markers = { } local blips = { } mposi = { } mposii = {} function startJob ( thePlayer ) local x,y,z,r = 0,0,0,0 local px,py,pz = getElementPosition( thePlayer ) repeat x,y,z,r = unpack( pickups[math.random ( #pickups )]) until getDistanceBetweenPoints3D( px,py,pz, x,y,z ) > 800 markers[thePlayer] = createMarker( x, y, z, "cylinder", 5.0, 255, 255, 255, 30 ) mposi = { getElementPosition( markers[thePlayer] ) } blips[thePlayer] = createBlipAttachedTo( markers [ thePlayer ], 41, 2, 0, 0, 0, 255, 3, 9999999, thePlayer ) addEventHandler( "onMarkerHit", markers[thePlayer], warpit ) exports["AC_message"]:outputTopBar("Fly to the next location at: "..getZoneName(x,y,z), thePlayer, 0, 255, 0) end local taximeter = {} function inVEH ( thePlayer, seat, jacked ) if ( getElementType( thePlayer ) == "player" and isPedInVehicle( thePlayer ) ) and seat == 0 and getElementData( thePlayer, "Occupation" ) == "Pilot" then if ( planeVeh[getElementModel( source )] ) then startJob ( thePlayer ) end end -- Enable the taximeter if getElementType ( thePlayer ) == "player" then if ( planeVeh[getElementModel( source )] ) and seat > 0 then drivers = getVehicleOccupants ( source ) payForTaxi( drivers[0], thePlayer ) if isTimer( taximeter[thePlayer] ) then killTimer( taximeter[thePlayer] ) end taximeter[thePlayer] = setTimer( payForTaxi, 60000, 0, drivers[0], thePlayer ) end end end addEventHandler ( "onVehicleEnter", getRootElement(), inVEH ) function payForTaxi( driver, passenger ) if isElement( passenger ) then if getPlayerMoney( passenger ) > 55 then local theVehicle = getPedOccupiedVehicle( driver ) if isElement( driver ) and isElement( passenger ) and isElement( theVehicle ) and getVehicleOccupant ( theVehicle, 0 ) == driver and getElementData( driver, "Occupation" ) == "Pilot" then takePlayerMoney( passenger, 55 ) givePlayerMoney( driver, 55 ) end else removePedFromVehicle( passenger ) if isElement( taximeter[thePlayer] ) then destroyElement( taximeter[thePlayer] ) end exports["AC_message"]:outputTopBar( "You can't afford this flight anymore, GET OUT!", passenger, 255, 0, 0 ) end end end function stopPaymentTaxi ( thePlayer, seat, jacked ) if isTimer( taximeter[thePlayer] ) then killTimer( taximeter[thePlayer] ) end end addEventHandler ( "onVehicleExit", getRootElement(), stopPaymentTaxi ) function warpit( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehicle = getPedOccupiedVehicle ( thePlayer ) if ( planeVeh[getElementModel( vehicle )] ) then destroyJob ( thePlayer ) local x, y, z, r = unpack( dropoffss[math.random( #dropoffss )]) markers[thePlayer] = createMarker( x, y, z - 1, "cylinder", 5.0, 255, 255, 255, 30 ) mposii = { getElementPosition( markers[thePlayer]) } blips[thePlayer] = createBlipAttachedTo( markers [thePlayer], 41, 2, 0, 0, 0, 255, 3, 9999999, thePlayer ) addEventHandler( "onMarkerHit", markers[thePlayer], pickmeup ) exports["AC_message"]:outputTopBar("Loading passengers...", thePlayer, 0, 255, 0) setTimer( setElementFrozen, 1000, 1, getPedOccupiedVehicle(thePlayer), true ) setTimer( setElementFrozen, 10000, 1, getPedOccupiedVehicle(thePlayer), false ) setTimer( flyTo, 10000, 1, thePlayer, x,y,z) end end end function pickmeup ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then destroyJob ( thePlayer ) local mx, my, mz = unpack ( mposi ) local mmx, mmy, mmz = unpack ( mposii ) local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) finalmoney = math.floor ( money/5 ) fine = math.floor(finalmoney - (finalmoney*(1-( getElementHealth( getPedOccupiedVehicle( thePlayer ))/1000)))) if finalmoney then givePlayerMoney( thePlayer, fine ) exports["AC_message"]:outputTopBar("You have earned ".. tostring(fine) .."$!", thePlayer, 0, 255, 0) if (finalmoney - fine) > 0 then exports["AC_message"]:outputTopBar("Removed ".. tostring(finalmoney - fine) .."$ due to damaged plane!", thePlayer, 255, 0, 0) end setTimer( function( ) startJob ( thePlayer ) end , 1000, 1 ) setTimer( setElementFrozen, 1000, 1, getPedOccupiedVehicle(thePlayer), true ) setTimer( setElementFrozen, 10000, 1, getPedOccupiedVehicle(thePlayer), false ) end end end function deleteOnExit ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement ( blips [ thePlayer ] ) end if isElement( taximeter[thePlayer] ) then killTimer( taximeter[thePlayer] ) end end addEventHandler ( "onVehicleExit", getRootElement(), deleteOnExit ) function destroyJob ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end function flyTo(thePlayer,x,y,z) exports["AC_message"]:outputTopBar("Take the passengers to: "..getZoneName(x,y,z), thePlayer, 0, 255, 0) end
  8. hi all I make taxi_job when i press take job but skin not change . please fix it and please make it to show in tab panel.Please read my all fourm i have lot of problem in my script please ----client side----- local GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource( )), function() local guiX,guiY = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((guiX-500)/2, (guiY-350)/2, 500, 350, "Taxi Driver", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(10, 300, 110, 36, "Take job", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bAccept, showGUIbf, false) addEventHandler("onClientGUIClick", bAccept, joinTeam, false) bClose = guiCreateButton(126, 300, 110, 36, "Cancel", false, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bClose, showGUIbf, false) GUIEditor.memo[1] = guiCreateMemo(10, 30, 480, 264, "Taxi Driver\n".. "Get a taxi or cabbie and start to transport people around the city, ".. "players and peds that requested a taxi will be marked with a person ".. "icon so you can find them easy. \nPayment is depending on distance ".. "and remember to keep your car in good shape and don´t crash, otherwise ".. "your payment will be reduced.\n" , false, GUIEditor.window[1]) guiEditSetReadOnly(GUIEditor.memo[1],true) end ) local joinBD = createMarker(-1395, -326, 13, "cylinder", 1.5, 255, 200, 0, 50) local joinBD2 = createMarker(1681, -2328, 12.5, "cylinder", 1.5, 255, 200, 0, 50) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( )), function ( startedRes ) createBlipAttachedTo( joinBD, 56, 2, 0, 0, 0, 0, 0, 400); createBlipAttachedTo( joinBD2, 56, 2, 0, 0, 0, 0, 0, 400); end ); function showGUIbt(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end addEventHandler("onClientMarkerHit", joinBD, showGUIbt) addEventHandler("onClientMarkerHit", joinBD2, showGUIbt) function showGUIbf() guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end function joinTeam() triggerServerEvent("sTeame", localPlayer, "teamSet") end ----server side----- local pickups = { -- Los santos [1]={ 2060.7685546875, -1941.1181640625, 13.14103603363, 0 }, [2]={ 2114.5068359375, -1611.302734375, 13.167269706726, 0 }, [3]={ 1932.9521484375, -1776.1259765625, 13.16081237793, 0 }, [4]={ 1057.41796875, -1568.4853515625, 13.166387557983, 0 }, [5]={ 1133.2607421875, -1286.6201171875, 13.245727539063, 0 }, [6]={ 1197.380859375, -1576.9228515625, 13.2406873703, 0 }, [7]={ 1275.6181640625, -1717.5087890625, 13.241578102112, 0 }, [8]={ 1041.908203125, -1869.1728515625, 13.15417766571, 0 }, [9]={ 680.9248046875, -1763.6552734375, 13.168544769287, 0 }, [10]={ 597.5556640625, -1598.90234375, 16.215705871582, 0 }, [11]={ 357.197265625, -1443.72265625, 34.185447692871, 0 }, -- San fierro [12]={ -1994.7431640625, -791.5244140625, 32.171875, 271.03408813477 }, [13]={ -1963.4423828125, -1011.4267578125, 32.171875, 358.5305480957 }, [14]={ -1944.32421875, -999.3662109375, 32.171493530273, 179.97802734375 }, [15]={ -2245.8623046875, -93.220703125, 35.3203125, 92.140991210938 }, [16]={ -2266.119140625, -154.056640625, 35.3203125, 268.90270996094 }, [17]={ -2245.78125, 132.865234375, 35.3203125, 146.93063354492 }, [18]={ -2245.7216796875, 258.095703125, 35.3203125, 142.64041137695 }, [19]={ -2418.998046875, 333.048828125, 35.178676605225, 282.47103881836 }, [20]={ -2698.3173828125, 624.154296875, 14.453125, 266.00228881836 }, [21]={ -2573.623046875, 802.3056640625, 49.984375, 67.119262695313 }, [22]={ -2378.099609375, 910.8759765625, 45.4453125, 129.11056518555 }, [23]={ -2133.0947265625, 989.701171875, 80, 130.75305175781 }, [24]={ -1958.0361328125, 1186.9833984375, 45.4453125, 233.80087280273 }, [25]={ -1641.814453125, 1266.8388671875, 7.1797361373901, 182.0325012207 }, [26]={ -1638.9267578125, 1209.4814453125, 7.1796875, 15.438781738281 }, [27]={ -1567.83203125, 680.7314453125, 7.1875, 324.58776855469 }, [28]={ -1708.0625, 357.615234375, 7.1875, 272.58319091797 }, [29]={ -1805.083984375, -139.1630859375, 6.320643901825, 318.3694152832 }, [30]={ -1448.0556640625, -278.203125, 14.141115188599, 221.71571350098 } } local dropoffss = { -- Los santos [1]={ 1965.54296875 , -1883.013671875, 13.160305023193, 0 }, [2]={ 1467.3916015625, -1736.419921875, 13.242918014526, 0 }, [3]={ 2376.1064453125, -1728.4091796875, 13.162055015564, 0 }, [4]={ 1066.5029296875, -1200.86328125, 18.405519485474, 0 }, [5]={ 584.8916015625, -1328.7021484375, 13.25985622406, 0 }, [6]={ 989.75, -1372.083984375, 13.244333267212, 0 }, [7]={ 1116.333984375, -1410.7666015625, 13.267498970032, 0 }, [8]={ 1437.5244140625, -1039.8212890625, 23.564819335938, 0 }, [9]={ 2124.4521484375, -1116.4931640625, 25.031726837158, 0 }, [10]={ 2700.8857421875, -1091.896484375, 69.064071655273, 0 }, [11]={ 2769.2744140625, -1494.0517578125, 27.58003616333, 0 }, -- San fierro [12]={ -1994.7431640625, -791.5244140625, 32.171875, 271.03408813477 }, [13]={ -1963.4423828125, -1011.4267578125, 32.171875, 358.5305480957 }, [14]={ -1944.32421875, -999.3662109375, 32.171493530273, 179.97802734375 }, [15]={ -2245.8623046875, -93.220703125, 35.3203125, 92.140991210938 }, [16]={ -2266.119140625, -154.056640625, 35.3203125, 268.90270996094 }, [17]={ -2245.78125, 132.865234375, 35.3203125, 146.93063354492 }, [18]={ -2245.7216796875, 258.095703125, 35.3203125, 142.64041137695 }, [19]={ -2418.998046875, 333.048828125, 35.178676605225, 282.47103881836 }, [20]={ -2698.3173828125, 624.154296875, 14.453125, 266.00228881836 }, [21]={ -2573.623046875, 802.3056640625, 49.984375, 67.119262695313 }, [22]={ -2378.099609375, 910.8759765625, 45.4453125, 129.11056518555 }, [23]={ -2133.0947265625, 989.701171875, 80, 130.75305175781 }, [24]={ -1958.0361328125, 1186.9833984375, 45.4453125, 233.80087280273 }, [25]={ -1641.814453125, 1266.8388671875, 7.1797361373901, 182.0325012207 }, [26]={ -1638.9267578125, 1209.4814453125, 7.1796875, 15.438781738281 }, [27]={ -1567.83203125, 680.7314453125, 7.1875, 324.58776855469 }, [28]={ -1708.0625, 357.615234375, 7.1875, 272.58319091797 }, [29]={ -1805.083984375, -139.1630859375, 6.320643901825, 318.3694152832 }, [30]={ -1448.0556640625, -278.203125, 14.141115188599, 221.71571350098 } } local pedCus = { [1]={ 9 }, [2]={ 10 }, [3]={ 14 }, [4]={ 15 }, [5]={ 37 }, [6]={ 29 }, [7]={ 31 }, [8]={ 22 }, [9]={ 23 }, [10]={ 44 }, [11]={ 43 }, [12]={ 47 }, [13]={ 54 }, [14]={ 56 } } local team = getTeamFromName ( "Civilians" ) local taxiVehs = { [420] = true, [438] = true } function teamSet ( ) setElementData( client, "Occupation", "Taxi Driver", true ) local team = getTeamFromName ( "Civilians" ) if team then setPlayerTeam( client, team ) setPlayerNametagColor ( client, 255, 200, 0 ) local skinID = exports["AC_clothes"]:getBoughtSkin ( client ) or getElementModel( client ) or 0 setElementModel(client, skinID) createBlipAttachedTo ( client, 0, 2, 255, 200, 0, 255, 1 ) exports["AC_message"]:outputTopBar( "You are now employed as a Taxi Driver!", client, 0, 255, 0 ) else local teamw = getTeamFromName ( "Civilians" ) if teamw then cancelEvent() exports["AC_message"]:outputTopBar( "You are already a Taxi driver!", client, 255, 255, 0 ) end end end addEvent ( "sTeame", true) addEventHandler ( "sTeame", root, teamSet ) -- Vehicle enter passengerBlips = { } driversBlips = { } function enterVehicle( thePlayer, seat, jacked ) if getElementType( thePlayer ) == "player" then -- Is this really needed? - Nope --if ( taxiVehs[getElementModel ( source )] ) and getElementData( thePlayer, "Occupation" ) ~= "Taxi Driver" and seat == 0 then -- exports["AC_message"]:outputTopBar( "Only Taxi Drivers can drive this vehicle!", thePlayer, 255, 0, 0) -- cancelEvent() --end -- Public transportation if seat > 0 then if isElement( driversBlips[getVehicleOccupants( source )[0]] ) then destroyElement( driversBlips[getVehicleOccupants( source )[0]] ) end if isElement( passengerBlips[thePlayer] ) then destroyElement( passengerBlips[thePlayer] ) end end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) function notePublicTransport( source, cmd ) local counter = 0 local players = getElementsByType ( "player" ) for k,player in ipairs(players) do local ptTeam = getTeamFromName( "Civilians" ) if ( ptTeam == getPlayerTeam( player ) and ( getElementData( player, "Occupation" ) == "Taxi Driver" or getElementData( player, "Occupation" ) == "Pilot" or getElementData( player, "Occupation" ) == "Bus Driver" )) then if isElement( getPedOccupiedVehicle( player )) then counter = (counter + 1) local x,y,z = getElementPosition( source ) exports["AC_message"]:outputTopBar( getPlayerName( source ).." has called for transportation at: "..getZoneName(x,y,z), player, 0, 255, 0) outputChatBox( getPlayerName( source ).." has called for transportation at: "..getZoneName(x,y,z), player, 0, 150, 0) if isElement( driversBlips[player] ) then destroyElement( driversBlips[player] ) end if isElement( passengerBlips[source] ) then destroyElement( passengerBlips[source] ) end driversBlips[player] = createBlipAttachedTo( player, 59, 2, 0, 0, 0, 255, 10, 999999, source ) passengerBlips[source] = createBlipAttachedTo( source, 59, 2, 0, 0, 0, 255, 10, 999999, player ) end end end if counter > 0 then exports["AC_message"]:outputTopBar( "Your message has been sent to "..tostring(counter).." drivers", source, 0, 255, 0) outputChatBox( "Your message has been sent to "..tostring(counter).." drivers", source, 0, 150, 0) else exports["AC_message"]:outputTopBar( "There is no drivers available now, please try again later", source, 255, 0, 0) end end addCommandHandler( "taxi", notePublicTransport ) addCommandHandler( "pilot", notePublicTransport ) addCommandHandler( "bus", notePublicTransport ) local markers = { } local blips = { } local peds = { } mposi = { } mposii = {} function startJob ( thePlayer ) local limU, limL = 0, 0 if getElementData( thePlayer, "Location") == "SF" then limL = 12 limU = 30 elseif getElementData( thePlayer, "Location") == "LS" then limL = 1 limU = 11 else limL = 12 limU = 30 end local x, y, z, r = unpack ( pickups [ math.random ( limL, limU ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) mposi = { getElementPosition( markers [ thePlayer ] ) } local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) -- Clean up old peds and blips if isElement( peds[thePlayer] ) then destroyElement( peds[thePlayer] ) end if isElement( blips[thePlayer] ) then destroyElement( blips[thePlayer] ) end peds[thePlayer] = createPed( skins, x, y, z, r, false ) blips[thePlayer] = createBlipAttachedTo ( markers [ thePlayer ], 62, 2, 0, 0, 0, 255, 3, 99999, thePlayer ) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end local taximeter = {} function inVEH ( thePlayer, seat, jacked ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) and seat == 0 then if ( getElementModel ( source ) == 420 or getElementModel ( source ) == 438 ) then startJob ( thePlayer ) end end -- Enable the taximeter if getElementType ( thePlayer ) == "player" then if ( taxiVehs[getElementModel( source )] ) and seat > 0 then drivers = getVehicleOccupants ( source ) payForTaxi( drivers[0], thePlayer ) if isTimer( taximeter[thePlayer] ) then killTimer( taximeter[thePlayer] ) end taximeter[thePlayer] = setTimer( payForTaxi, 60000, 0, drivers[0], thePlayer ) end end end addEventHandler ( "onVehicleEnter", getRootElement(), inVEH ) function payForTaxi( driver, passenger ) if isElement( driver ) and isElement( passenger ) then if getPlayerMoney( passenger ) > 30 and getElementData( driver, "Occupation" ) == "Taxi Driver" then local theVehicle = getPedOccupiedVehicle( driver ) if isElement( theVehicle ) and getVehicleOccupant ( theVehicle, 0 ) == driver then takePlayerMoney( passenger, 30 ) givePlayerMoney( driver, 30 ) end else removePedFromVehicle ( passenger ) if isElement( taximeter[thePlayer] ) then destroyElement( taximeter[thePlayer] ) end exports["AC_message"]:outputTopBar( "You can't afford this taxi ride anymore!", passenger, 255, 0, 0 ) end end end function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehiclee = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehiclee ) == 420 or getElementModel ( vehiclee ) == 438 ) then setTimer ( warpPedIntoVehicle, 2000, 1, peds [ thePlayer ], vehiclee, 2 ) destroyJob ( thePlayer ) local limU,limL = 12,30 if getElementData( thePlayer, "Location") == "SF" then limL = 12 limU = 30 elseif
  9. no i want to place it in buliding
  10. Hi All Anybody tell me how i make a moving pictures and pictures change after 5 sec please tell
  11. why always me i make a lot of script but all script not working here is police job please help me ----client side--- GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} Marker = createMarker(2039.8497314453,1354.2642822266,10.671875,"cylinder",2,0,255,0) Blip = createBlip(2039.8497314453,1354.2642822266,10.671875, 55) addEventHandler( "onClientResourceStart", resourceRoot, function () GUIEditor_Window[2] = guiCreateWindow(629,219,481,301,"Police Station",false) guiWindowSetMovable(GUIEditor_Window[2],false) guiSetVisible(GUIEditor_Window[2], false ) GUIEditor_Label[1] = guiCreateLabel(158,172,166,16,"Move To Police Station ?",false,GUIEditor_Window[2]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[1] = guiCreateButton(18,199,205,93,"Yes",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[1],"clear-normal") GUIEditor_Button[2] = guiCreateButton(297,201,175,91,"Exit",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[2],"clear-normal") GUIEditor_Image[1] = guiCreateStaticImage(69,24,338,136,"images/mtalogo.png",false,GUIEditor_Window[2]) end ) addEventHandler( "onClientGUIClick", guiRoot, function () elseif (source == GUIEditor_Button[1]) then toggleAllControls(true) setElementInterior(localPlayer, 6) setElementPosition(localPlayer, 2039.8497314453,1354.2642822266,10.671875) guiSetVisible(GUIEditor_Window[2], false ) showCursor(false) elseif(source == GUIEditor_Button[2]) then guiSetVisible(GUIEditor_Window[2], false ) showCursor(false) toggleAllControls(false) end ) ----server side---- local function OnHit( pElement ) if getElementType( pElement ) == 'player' then local pTeam = getPlayerTeam( pElement ) if pTeam and isElement( pTeam ) and getTeamName( pTeam ) ~= 'Police' then if getPlayerWantedLevel( pElement ) > 0 then setElementInterior( pElement, 6 ) setElementPosition( pElement, 2039.8497314453,1354.2642822266,10.671875 ) end end end end addEventHandler( 'onPlayerDamage', root, function( pAttacker, nWeapon ) local pTeam = getPlayerTeam( source ) if pTeam and isElement( pTeam ) and getTeamName( pTeam ) == 'Police' then if getPlayerWantedLevel( pAttacker ) > 0 and nWeapon == 3 then local pArrestMarker = createMarker( 2039.8497314453,1354.2642822266,10.671875, 'cylinder', 2.5, 255, 255, 0, 150, source ) addEventHandler( 'onMarkerHit', pArrestMarker, OnHit ) toggleAllControls( pAttacker, false ) local fX, fY, fZ = getElementPosition( pAttacker ) local fX2, fY2, fZ2 = getElementPosition( source ) if getDistanceBetweenPoints3D( fX, fY, fZ, fX2, fY2, fZ2 ) > 10 then setElementPosition( pAttacker, fX2 - 5, fY2, fZ2 ) end end end end ) another script of police job it also not working -- Miniatures local cRoot = getRootElement() local cThis = getThisResource() local cThisRoot = getResourceRootElement(cThis) -- Configurations (modifyable) local jails = { -- ID : x position, y position, z position, interior, dimension, radius [1] = {1849.47, -1453.7, 13.39, 0, 0, 5} } -- Releasepoint's x, y, z, interior and dimension positions local releasepoint_x = 0 local releasepoint_y = 0 local releasepoint_z = 0 local releasepoint_interior = 0 local releasepoint_dimension = 0 -- Functions local addCommandHandler_ = addCommandHandler addCommandHandler = function(commandName, fn, restricted, caseSensitive) if type(commandName) ~= "table" then commandName = {commandName} end for key, value in ipairs(commandName) do if key == 1 then addCommandHandler_(value, fn, restricted, caseSensitive) else addCommandHandler_(value, function(player, ...) fn(player, ...) end ) end end end -- ~ [CUFF, HANDCUFF, RESTRAIN] ~ -- addCommandHandler({"cuff", "handcuff", "restrain"}, function(player, cmd, name) for i,v in ipairs(getElementsByType("ped")) do if tonumber(getElementData(player, "factions.player")) == tonumber(getElementData(v, "factions.id")) then if exports.brpExports:getFactionType(v) == "law" then if name then local target = exports.brpExports:findPlayer(name, player) if target then if player ~= target then local x, y, z = getElementPosition(player) if exports.brpExports:isElementInRangeOfPoint(target, x, y, z, 5) then if not getElementData(target, "police.cuffed") then toggleControl(target, "fire", false) toggleControl(target, "next_weapon", false) toggleControl(target, "previous_weapon", false) toggleControl(target, "sprint", false) toggleControl(target, "aim_weapon", false) toggleControl(target, "handbrake", false) toggleControl(target, "vehicle_fire", false) toggleControl(target, "vehicle_secondary_fire", false) toggleControl(target, "vehicle_left", false) toggleControl(target, "vehicle_right", false) toggleControl(target, "steer_forward", false) toggleControl(target, "steer_back", false) setElementData(target, "police.cuffed", true) outputChatBox("You are now restraining " .. getPlayerName(target) .. ".", player, 255, 255, 255, false) outputChatBox("You are now restrained by " .. getPlayerName(target) .. ".", target, 255, 255, 255, false) outputServerLog("[FACTIONS] [CMD/CUFF]: " .. getPlayerName(player) .. " is now restraining " .. getPlayerName(target) .. ".") else outputChatBox("That player is already handcuffed.", player, 255, 0, 0, false) end else outputChatBox("You are too far from the target.", player, 255, 0, 0, false) end else outputChatBox("You cannot cuff yourself.", player, 255, 0, 0, false) end else outputChatBox("Couldn't find such player.", player, 255, 0, 0, false) end else outputChatBox("Syntax: /" .. cmd .. " ", player, 220, 220, 0, false) end end end end end ) -- ~ [uNCUFF, UNHANDCUFF, UNRESTRAIN] ~ -- addCommandHandler({"uncuff", "unhandcuff", "unrestrain"}, function(player, cmd, name) for i,v in ipairs(getElementsByType("ped")) do if tonumber(getElementData(player, "factions.player")) == tonumber(getElementData(v, "factions.id")) then if exports.brpExports:getFactionType(v) == "law" then if name then local target = exports.brpExports:findPlayer(name, player) if target then if player ~= target then local x, y, z = getElementPosition(player) if exports.brpExports:isElementInRangeOfPoint(target, x, y, z, 5) then if getElementData(target, "police.cuffed") then toggleControl(target, "fire", true) toggleControl(target, "next_weapon", true) toggleControl(target, "previous_weapon", true) toggleControl(target, "sprint", true) toggleControl(target, "aim_weapon", true) toggleControl(target, "handbrake", true) toggleControl(target, "vehicle_fire", true) toggleControl(target, "vehicle_secondary_fire", true) toggleControl(target, "vehicle_left", true) toggleControl(target, "vehicle_right", true) toggleControl(target, "steer_forward", true) toggleControl(target, "steer_back", true) removeElementData(target, "police.cuffed") outputChatBox("You unrestrained " .. getPlayerName(target) .. ".", player, 255, 255, 255, false) outputChatBox("You are unrestrained by " .. getPlayerName(target) .. ".", target, 255, 255, 255, false) outputServerLog("[FACTIONS] [CMD/UNCUFF]: " .. getPlayerName(player) .. " now unrestrained " .. getPlayerName(target) .. ".") else outputChatBox("That player is not handcuffed.", player, 255, 0, 0, false) end else outputChatBox("You are too far from the target.", player, 255, 0, 0, false) end else outputChatBox("You cannot uncuff yourself.", player, 255, 0, 0, false) end else outputChatBox("Couldn't find such player.", player, 255, 0, 0, false) end else outputChatBox("Syntax: /" .. cmd .. " ", player, 220, 220, 0, false) end end end end end ) -- ~ [AUNCUFF, AUNHANDCUFF, AUNRESTRAIN] ~ -- addCommandHandler({"auncuff", "aunhandcuff", "aunrestrain"}, function(player, cmd, name) if exports.brpExports:isPlayerAdmin(player) then if name then local target = exports.brpExports:findPlayer(name, player) if target then if getElementData(target, "police.cuffed") then toggleControl(target, "fire", true) toggleControl(target, "next_weapon", true) toggleControl(target, "previous_weapon", true) toggleControl(target, "sprint", true) toggleControl(target, "aim_weapon", true) toggleControl(target, "handbrake", true) toggleControl(target, "vehicle_fire", true) toggleControl(target, "vehicle_secondary_fire", true) toggleControl(target, "vehicle_left", true) toggleControl(target, "vehicle_right", true) toggleControl(target, "steer_forward", true) toggleControl(target, "steer_back", true) removeElementData(target, "police.cuffed") outputChatBox("You unrestrained " .. getPlayerName(target) .. ".", player, 255, 255, 255, false) outputChatBox("You are unrestrained by " .. getPlayerName(target) .. ".", target, 255, 255, 255, false) outputServerLog("[FACTIONS] [CMD/UNCUFF]: " .. getPlayerName(player) .. " now unrestrained " .. getPlayerName(target) .. ".") else outputChatBox("That player is not handcuffed.", player, 255, 0, 0, false) end else outputChatBox("Couldn't find such player.", player, 255, 0, 0, false) end else outputChatBox("Syntax: /" .. cmd .. " ", player, 220, 220, 0, false) end end end ) addCommandHandler({"jail", "arrest"}, function(player, cmd, name, time, fine, ...) for i,v in ipairs(getElementsByType("ped")) do if tonumber(getElementData(player, "factions.player")) == tonumber(getElementData(v, "factions.id")) then if exports.brpExports:getFactionType(v) == "law" then local time = tonumber(time) local fine = tonumber(fine) if name and time and fine and (...) then if time > 0 and time <= 180 and fine >= 0 and fine <= 20000 then local reason = table.concat({ ... }, " ") if #reason > 0 then local target = exports.brpExports:findPlayer(name, player) if target then --if player ~= target then local x, y, z = getElementPosition(player) if exports.brpExports:isElementInRangeOfPoint(target, x, y, z, 5) then if not getElementData(target, "police.arrested") then for index,jail in ipairs(jails) do if exports.brpExports:isElementInRangeOfPoint(player, jails[index][1], jails[index][2], jails[index][3], jails[index][6]) and getElementInterior(player, jails[index][4]) and getElementDimension(player, jails[index][5]) and exports.brpExports:isElementInRangeOfPoint(target, jails[index][1], jails[index][2], jails[index][3], jails[index][6]) and getElementInterior(target, jails[index][4]) and getElementDimension(target, jails[index][5]) then setElementPosition(target, jails[index][1], jails[index][2], jails[index][3]) setElementInterior(target, jails[index][4]) setElementDimension(target, jails[index][5]) outputChatBox("You arrested " .. getPlayerName(target) .. " for " .. time .. " minutes and fined for $" .. fine .. ".", player, 120, 120, 255, false) outputChatBox("You were arrested by " .. getPlayerName(player) .. " for " .. time .. " minutes and fined for $" .. fine .. ".", target, 120, 120, 255, false) outputServerLog("[FACTIONS] [CMD/JAIL]: " .. getPlayerName(player) .. " arrested " .. getPlayerName(target) .. " for " .. time .. " minutes and fined for $" .. fine .. ".") setElementData(target, "police.arrested", true) if getElementData(target, "police.cuffed") then toggleControl(target, "fire", true) toggleControl(target, "next_weapon", true) toggleControl(target, "previous_weapon", true) toggleControl(target, "sprint", true) toggleControl(target, "aim_weapon", true) toggleControl(target, "handbrake", true) toggleControl(target, "vehicle_fire", true) toggleControl(target, "vehicle_secondary_fire", true) toggleControl(target, "vehicle_left", true) toggleControl(target, "vehicle_right", true) toggleControl(target, "steer_forward", true) toggleControl(target, "steer_back", true) removeElementData(target, "police.cuffed") end jailed = setTimer(function(target) if getElementData(target, "police.arrested") then setElementPosition(target, releasepoint_x, releasepoint_y, releasepoint_z) setElementInterior(target, releasepoint_interior) setElementDimension(target, releasepoint_dimension) outputChatBox("Your time has been served - behave from now on.", target, 120, 120, 255, false) outputServerLog("[FACTIONS] [AUTO/RELEASE]: " .. getPlayerName(target) .. " was released from jail automatically.") removeElementData(target, "police.arrested") end end, time * 60000, 1, target) end end else outputChatBox("That player is already arrested.", player, 255, 0, 0, false) end else outputChatBox("You are too far from the target.", player, 255, 0, 0, false) end --else -- outputChatBox("You cannot arrest yourself.", player, 255, 0, 0, false) --end else outputChatBox("Couldn't find such player.", player, 255, 0, 0, false) end else outputChatBox("Syntax: /" .. cmd .. " ", player, 220, 220, 0, false) end else outputChatBox("Syntax: /" .. cmd .. " ", player, 220, 220, 0, false) end else outputChatBox("Syntax: /" .. cmd .. "
  12. hi this turf system when i join in criminal and then i go in turf it blinking but colour not change ----client side---------- function godmodeHandler () cancelEvent () end addEvent ("enableGodMode",true) addEventHandler ("enableGodMode",getRootElement(), function() if (source == getLocalPlayer()) then addEventHandler ("onClientPlayerDamage",getRootElement(),godmodeHandler) end end) addEvent ("disableGodMode",true) addEventHandler ("disableGodMode",getRootElement(), function() if (source == getLocalPlayer()) then removeEventHandler ("onClientPlayerDamage",getRootElement(),godmodeHandler) end end) -----server side---- addEventHandler ("onResourceStart",getResourceRootElement(getThisResource()), function() local allGreenzones = getElementsByType ("radararea") for i,v in ipairs (allGreenzones) do local r,g,b,a = getRadarAreaColor (v) if (r == 0) and (g == 255) and (b == 0) and (a == 127) then local x,y = getElementPosition (v) local sx,sy = getRadarAreaSize (v) local col = createColCuboid (x,y, -50, sx,sy, 7500) setElementID (col, "greenzoneColshape") end end end) addEventHandler ("onColShapeHit", getRootElement(), function(hitElement, matchingDimension) if (isElement(hitElement)) and (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then triggerClientEvent (hitElement, "enableGodMode", hitElement) outputDebugString (getPlayerName(hitElement) .. " has entered the Grove turf") end end) addEventHandler ("onColShapeLeave", getRootElement(), function(leaveElement, matchingDimension) if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then triggerClientEvent (leaveElement, "disableGodMode", leaveElement) outputDebugString (getPlayerName(leaveElement) .. " has left the Grove turf") end end) --map side----- "-50" posY="-50" sizeX="100" sizeY="100" color="#000000" dimension="0" /> "25" posY="25" sizeX="100" sizeY="100" color="#7D053F" dimension="0" /> "60" posY="60" sizeX="100" sizeY="100" color="#565051" dimension="0" />
  13. MoeezKhan

    need help

    how i make a team and how i make it leader of team who is leader his team. he have panel he can invite player,kickplayer and set password thanks for reply
  14. I make a medic job but it not working. i hope you fix it -----client side----- GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.29, 0.24, 0.42, 0.49, "", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "", true, GUIEditor.window[1]) bAccept = guiCreateButton(0.60, 0.20, 0.34, 0.17, "Accept Job", true, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bAccept, showGUIbf, false) addEventHandler("onClientGUIClick", bAccept, joinTeam, false) bClose = guiCreateButton(0.67, 0.61, 0.20, 0.16, "CLOSE", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bClose, showGUIbf, false) GUIEditor.memo[1] = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "Become a Medic and heal people by using the command /heal player !", true, GUIEditor.window[1]) end triggerServerEvent("theMarker") triggerServerEvent("createCar") triggerServerEvent("setTeam") end ----server side---- local theMarker = createMarker ( 1103.3049316406,1079.1077880859,10.8359375, "cylinder", 1, 0, 0, 200, 170 ) -- creates the marker createBlip = ( 1103.3049316406,1079.1077880859,10.8359375, 55, 2) function MarkerHit ( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) setGUIvisable ("Panel") -- sets the triggered GUI visable triggerClientEvent() -- Triggers the GUI see Client end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) function createCar local createVehicle (416, -2591 584 15) -- ID X Y and Z setPedIntoCar(createVehicle) -- Warps the Player into the Created Car end function setTeam onGUIclick(bAccept) then setPlayerTeam("Medic") if getPlayerTeam = Medic then outputChatBox("You are already an Medic") end -- Adds the Command for Medic members to heal players local range = 50 addCommandHandler('heal', -- creates the command /heal function(p,c,who) local who = getPlayerFromName(who) if who then local mx,my,mz = getElementPosition(p) local ux,uy,uz = getElementPosition(who) if getDistanceBetweenPoints3D(mx,my,mz,ux,uy,uz) <= range then if getPlayerTeam(p) == getTeamFromName("Medic") then -- only for medics able setElementHealth(who, 100) -- sets full health setPlayerMoney(who, -100) -- Takes 100$ for healing end else outputChatBox("This player is too far away",p,0,0,225) end else outputChatBox('Player not found.',p,0,0,255) end end )
  15. MoeezKhan

    help me

    yes i want this you right
  16. MoeezKhan

    help me

    so you have no idea
  17. MoeezKhan

    help me

    how i make a video when player join he see a video first and then he spawn in airport if you want not tell me only tell which function and element i use
  18. no which i post script which file is server and client side
  19. one more questions what is client side and what is server side i think something wrong
  20. hi all i make police job but it not working anybody tell how i fix it GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} getSetVisible(GUIEditor_Window[2], false ) GUIEditor_Window[2] = guiCreateWindow(629,219,481,301,"Police Station",false) guiWindowSetMovable(GUIEditor_Window[2],false) GUIEditor_Label[1] = guiCreateLabel(158,172,166,16,"Move To Police Station ?",false,GUIEditor_Window[2]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[1] = guiCreateButton(18,199,205,93,"Yes",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[1],"clear-normal") GUIEditor_Button[2] = guiCreateButton(297,201,175,91,"Exit",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[2],"clear-normal") GUIEditor_Image[1] = guiCreateStaticImage(69,24,338,136,"images/mtalogo.png",false,GUIEditor_Window[2]) Marker = createMarker(1119,1034,10,"cylinder",2,0,255,0) addEventHandler('onClientMarkerHit', Marker, function (hit) if ( hit == localPlayer ) then getSetVisible(GUIEditor_Window[2], true ) showCursor(true) elseif (hit == GUIEditor_Button[1] ) then toggleAllControls( hit, true ) setElementInterior( hit, 6 ) setElementPosition( hit, 264.74969, 77.49036, 1001.03906 ) elseif(hit == GUIEditor_Button[2]) then getSetVisible(GUIEditor_Window[2], false ) showCursor(false) toggleAllControls( hit, false ) end end) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} getSetVisible(GUIEditor_Window[2], false ) GUIEditor_Window[2] = guiCreateWindow(629,219,481,301,"Police Station",false) guiWindowSetMovable(GUIEditor_Window[2],false) GUIEditor_Label[1] = guiCreateLabel(158,172,166,16,"Move To Police Station ?",false,GUIEditor_Window[2]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[1] = guiCreateButton(18,199,205,93,"Yes",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[1],"clear-normal") GUIEditor_Button[2] = guiCreateButton(297,201,175,91,"Exit",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[2],"clear-normal") GUIEditor_Image[1] = guiCreateStaticImage(69,24,338,136,"images/mtalogo.png",false,GUIEditor_Window[2]) Marker = createMarker(1119,1034,10,"cylinder",2,0,255,0) addEventHandler('onClientMarkerHit', Marker, function (hit) if ( hit == localPlayer ) then getSetVisible(GUIEditor_Window[2], true ) showCursor(true) elseif (hit == GUIEditor_Button[1] ) then toggleAllControls( hit, true ) setElementInterior( hit, 6 ) setElementPosition( hit, 264.74969, 77.49036, 1001.03906 ) elseif(hit == GUIEditor_Button[2]) then getSetVisible(GUIEditor_Window[2], false ) showCursor(false) toggleAllControls( hit, false ) end end)
  21. i make sound system on los santos under bridge but sound not starting.how i can fix it function onResourceStart() local sound1 = playSound3D("song.mp3", 1663.60546875, -1128.1083984375, 24.521713256836, true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart)
  22. yes i khow only simple thing because i am new in lua
×
×
  • Create New...