aL.Kfo Posted September 25, 2013 Share Posted September 25, 2013 السلام عليكم مرحبا شباب عندي مود تبع برستيج على ماا اضن مود الشرطه policejob مشكله المود الشرطي لا مات يرجع لتيم الاي كان قبل فيه يعني يخرج من الوظيفه انا ابيها لا مات يرجع ل مقر الشرطه و م يخرج من الوظيفه ذي اكواد كل المود gui.lua Wnd1 = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Free Vehicles", true ) -- guiSetAlpha( Wnd1, 1 ) buttonv = guiCreateButton ( 0.5, 0.8, 0.45, 0.15, "Close", true, Wnd1 ) button1v = guiCreateButton ( 0.01, 0.8, 0.45, 0.15, "Accept", true, Wnd1 ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "get free vehicle", true, Wnd1 ) showCursor(false) guiSetVisible( Wnd1, false ) guiWindowSetSizable( Wnd1, false ) guiWindowSetMovable( Wnd1, false ) vehicles = { {"Police LS", 596}, {"Police SF", 597}, {"Police LV", 598}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd1) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function useP() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehicePv", localPlayer, model) guiSetVisible(Wnd1,false) showCursor(false) end end end addEventHandler("onClientGUIClick", button1v, useP, false) function close() if (source == buttonv) then guiSetVisible(Wnd1,false) showCursor(false) end end addEventHandler("onClientGUIClick", buttonv, close) function showGUIpv() guiSetVisible(Wnd1,true) showCursor(true) end addEvent("showGUIpv",true) addEventHandler("showGUIpv", getRootElement(), showGUIpv) police-c.lua --\\\\\\\\\\\\\\\\\\\\\\\\\\ --// Setting local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; local markerp = createMarker( 1552.4996337891, -1677.3264160156, 15.1953125, 'Cylinder', 1.5, 0, 0, 255, 150 ); local marker1p = createMarker( -1604.5458984375, 712.25848388672, 12.8671875, 'Cylinder', 1.5, 0, 0, 255, 150 ); local marker2p = createMarker( 2340.9245605469, 2456.0463867188, 13.96875, 'Cylinder', 1.5, 0, 0, 255, 150 ); addEventHandler ( 'onClientRender', root, function ( ) -- local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( markerp ); local x2, y2, z2 = getElementPosition ( marker1p ); local x3, y3, z3 = getElementPosition ( marker2p ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance_2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); local distance_3 = getDistanceBetweenPoints3D( x, y, z, x3, y3, z3 ); -- -- Marker #1 if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "police job", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end -- Marker #2 elseif distance_2 <= gMaxDistance then local x2_, y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ); if x2_ and y2_ then -- local scale = 1 / ( gScale * ( distance_2 / gMaxDistance ) ); local alpha = ( ( distance_2 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "police job", x2_, y2_, x2_, y2_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end -- Marker #3 elseif distance_3 <= gMaxDistance then local x3_, y3_ = getScreenFromWorldPosition( x3, y3, z3 + 0.95, 0.06 ); if x3_ and y3_ then -- local scale = 1 / ( gScale * ( distance_3 / gMaxDistance ) ); local alpha = ( ( distance_3 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "police job", x3_, y3_, x3_, y3_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end end end ); -- ////////////////////////////////// -- // MATH FUNCTIONS // -- ////////////////////////////////// function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end Wnd = guiCreateWindow ( 0.2, 0.2, 0.50, 0.60, "police job v5.0", true ) guiSetAlpha( Wnd, 1 ) button = guiCreateButton ( 0.5, 0.8, 0.45, 0.15, "Close", true, Wnd ) button1 = guiCreateButton ( 0.01, 0.8, 0.45, 0.15, "get job", true, Wnd ) label = guiCreateLabel ( 0.05, 0.1, 0.9, 0.2, "get police job, policemen can arrest wanted players by hitting \nthem with the nighstick (3). if you don't have the station will \ngive you one.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) skins = { {"Officer 1", 280}, {"Officer 2", 281}, {"Ranger 1", 283}, {"Ranger 2", 288}, {"Traffic officer", 284}, } skinG = guiCreateGridList(0.01, 0.3, 0.99, 0.5, true, Wnd) guiGridListAddColumn(skinG, "Skins", 0.85) for i,skins in ipairs(skins) do row = guiGridListAddRow(skinG) -- guiGridListSetItemText(skinG, row, 1, tostring(skins[1]), false, false) guiGridListSetItemData(skinG, row, 1, tostring(skins[2])) end function SAPDjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(Wnd) then guiSetVisible(Wnd, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", markerp, SAPDjob) addEventHandler("onClientMarkerHit", marker1p, SAPDjob) addEventHandler("onClientMarkerHit", marker2p, SAPDjob) function takeJob() local row, col = guiGridListGetSelectedItem(skinG) if (row and col and row ~= -1 and col ~= -1) then local models = tonumber(guiGridListGetItemData(skinG, row, 1)) if model ~= "" then triggerServerEvent("getJob", localPlayer, models) guiSetVisible(Wnd,false) showCursor(false) end end end addEventHandler("onClientGUIClick", button1, takeJob, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) police-s.lua afText = {} myTextItem = {} function warnText ( aWText, player ) if ( myTextItem[player] ) then textDestroyTextItem ( myTextItem[player]) end afText[player] = textCreateDisplay () textDisplayAddObserver( afText[player], player ) myTextItem[player] = textCreateTextItem ( aWText, 0.22, 0.8,0.5 , 255, 0, 0, 255, 3 ) textDisplayAddText ( afText[player], myTextItem[player] ) -- outputChatBox ( textA, player ) setTimer ( textDestroyTextItem, 5000, 1, myTextItem[player], player ) end createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) function createSAPDTeam () SAPDteam = createTeam ("police", 100, 149, 237) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD(id) setPlayerTeam(source,SAPDteam) setPlayerNametagColor ( source, 100, 149, 237 ) setElementModel(source, id) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "police", true ) warnText("You are now SAPD agent.",source,0,255,0) end addEvent("getJob", true) addEventHandler("getJob",root,joinSAPD) function removeSAPD() setPlayerTeam(source, 0) takeWeapon(source, 3) playeraccount = getPlayerAccount(source) if not getAccountData(playeraccount, "standardskin") then setElementModel(source, 0) else setElementModel(source,getAccountData(playeraccount,"standardskin")) end warnText("You are now an unemployed.",source,255,0,0) end addEvent("removeSAPD", true) addEventHandler("removeSAPD",root,removeSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "ARMY" then setElementPosition (source, 1565.5, -1640.5, -80.0, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) warnText( "You have been jailed by "..theCop.. " for 10 seconds.", source ) warnText( "You have jailed the criminal "..theName, attacker ) local playeraccount = getPlayerAccount ( attacker ) oldArrest = getAccountData(playeraccount, "arrest") if oldArrest then newArrest = setAccountData(playeraccount, "arrest", tonumber(oldArrest) + 1 ) else newArrest = setAccountData(playeraccount, "arrest", 1 ) end givePlayerMoney (attacker, 100 * theWL ) setTimer ( setElementPosition, 1900000, 1, source, 1579.1157226563,-1640.5460205078,-80.043746948242) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) function consoleCreateMarker ( source ) local playerAccount = getPlayerAccount(source) local arrest = getAccountData(playeraccount, "arrest") if not arrest then outputChatBox("you dont have any arrest",source) else outputChatBox("arrest: "..arrest,source) end end addCommandHandler ( "arrest", consoleCreateMarker ) --function jail ( source ) --setElementPosition (source, 1562.6, -1618.1, -80.0, true) --end --addCommandHandler ( "jail", jail ) server.lua markerpv = createMarker( 1566.9652099609, -1610.640625, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) local vehicles = {} function spawnVehp(id) local x, y, z = getElementPosition(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(id, x + 2, y, z) warpPedIntoVehicle(source, vehicles[source]) end addEvent("CreVehicePv",true) addEventHandler("CreVehicePv", root, spawnVehp) addEventHandler("onPlayerQuit", root, function() if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end) function showGUIpv(hitPlayer) if hitPlayer and getElementType(hitPlayer) == "player" then if ( getPlayerTeam ( hitPlayer ) == getTeamFromName ( "police" ) ) then triggerClientEvent (hitPlayer,"showGUIpv",getRootElement(),hitPlayer) else warnText("vehicles for police only!",hitPlayer) end end end addEventHandler("onMarkerHit",markerpv,showGUIpv) wanted.lua addEventHandler("onPlayerJoin", root, function ( ) setPlayerNametagText ( source, getPlayerName ( source ) .."[".. getPlayerWantedLevel ( source ) .."]" ) end ) function updateNametagWantedLevel ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do setPlayerNametagText ( player, getPlayerName ( player ) .."[".. getPlayerWantedLevel ( player ) .."]" ) end end setTimer ( updateNametagWantedLevel, 3000, 0 ) wl.lua ------------------- -- Wanted System -- Mr.Pres[T]ege -- (; ------------------- local Timer = {} Bribe = {} xMain_ = function( ) for index,v in ipairs (getElementsByType("player")) do xWanted_(v) end end addEventHandler("onResourceStart", resourceRoot, xMain_); xWanted_ = function(v) if not isElement(v) then return end Timer[v] = setTimer( function(player) if isElement(player) then local team = getPlayerTeam(player) if ( team and getTeamName(team) == "Police" ) then return end local Wanted = getPlayerWantedLevel ( player ); local x,y,z = getElementPosition ( player ); local Name = getPlayerName ( player ); if ( Wanted >= 1 ) then if Bribe[player] and isElement(Bribe[player]) then return end Bribe[player] = createObject(1247,x,y,z); attachElements (Bribe[player],player,0,0,1.6) ; outputChatBox(" [ "..Name.." ] Have [ "..Wanted.." ] Wanted Level! ",v,255,0,0,true); elseif ( Wanted == 0 and Bribe[player] and isElement(Bribe[player]) ) then destroyElement(Bribe[player]); Bribe[player] = nil end end end ,5000,0,v); end xJoin_ = function ( ) xWanted_(source); end addEventHandler("onPlayerJoin",root,xJoin_); xWantedDestroy_ = function ( ) if Timer[source] and isTimer(Timer[source]) then killTimer(Timer[source]); Timer[source] = nil end; if Bribe[source] and isElement(Bribe[source]) then destroyElement(Bribe[source]); Bribe[source] = nil end end addEventHandler("onPlayerQuit",root,xWantedDestroy_); انا حاولت بالكود 4 ايام قبل اطرحه بس للاسف ما عرفت ولا ادري المشكله وين خبرتي بسيطه Link to comment
xFace[B]ook Posted September 25, 2013 Share Posted September 25, 2013 "onPlayerWasted" setPlayerTeam spawnPlayer getPlayerTeam getTeamFromName Link to comment
aL.Kfo Posted September 25, 2013 Author Share Posted September 25, 2013 "onPlayerWasted" setPlayerTeam spawnPlayer getPlayerTeam getTeamFromName طيب توضيح بسيط لو اني اعرف لها ما نزلت ذا الموضوع Link to comment
iMr.Dawix~# Posted September 25, 2013 Share Posted September 25, 2013 "onPlayerWasted" setPlayerTeam spawnPlayer getPlayerTeam getTeamFromName طيب توضيح بسيط لو اني اعرف لها ما نزلت ذا الموضوع اضغط على كل واحد وبتلقا لكل واحد مثال Link to comment
السهلي 717 Posted September 25, 2013 Share Posted September 25, 2013 هو طلب تعديل الكود مآطلب كود !! Link to comment
#DRAGON!FIRE Posted September 25, 2013 Share Posted September 25, 2013 هو طلب تعديل الكود مآطلب كود !! # < بـدأل م تتكلم عدل يلأ نشوف # الكودات مو حقنا كيف نعدل على شي م نعرفه والكود كبير # يعتمد على نفسه ويشوف الويكي في كل فنكشن يفهمه كل شي ومثال عليه Link to comment
السهلي 717 Posted September 25, 2013 Share Posted September 25, 2013 هو طلب تعديل الكود مآطلب كود !! # < بـدأل م تتكلم عدل يلأ نشوف # الكودات مو حقنا كيف نعدل على شي م نعرفه والكود كبير # يعتمد على نفسه ويشوف الويكي في كل فنكشن يفهمه كل شي ومثال عليه لآ أقصصد يوم حط الموضوع طلب تعديل الككود مآطلب كود + هآذآ المنتدى للمسآعده مب ( أعتمد على نفسكك ) ا Link to comment
aL.Kfo Posted September 25, 2013 Author Share Posted September 25, 2013 هو طلب تعديل الكود مآطلب كود !! # < بـدأل م تتكلم عدل يلأ نشوف # الكودات مو حقنا كيف نعدل على شي م نعرفه والكود كبير # يعتمد على نفسه ويشوف الويكي في كل فنكشن يفهمه كل شي ومثال عليه لآ أقصصد يوم حط الموضوع طلب تعديل الككود مآطلب كود + هآذآ المنتدى للمسآعده مب ( أعتمد على نفسكك ) ا كلام زي العسل و اكبر دليل المنتدى العا م يقولون طلب مودات لو اطلب مود قالو اعتمد ع نفسك Link to comment
xFace[B]ook Posted September 26, 2013 Share Posted September 26, 2013 الكود مو له عشان كذا ماعدلنا عليه وعاد عطيناه الفنكشنات يسويها ب نفسه بسيطةة Link to comment
iPrestege Posted September 26, 2013 Share Posted September 26, 2013 هذا الكود لي و شكلة حد خذاه وحطة بسكربت لة : ------------------- -- Wanted System -- Mr.Pres[T]ege -- (; ------------------- local Timer = {} Bribe = {} xMain_ = function( ) for index,v in ipairs (getElementsByType("player")) do xWanted_(v) end end addEventHandler("onResourceStart", resourceRoot, xMain_); xWanted_ = function(v) if not isElement(v) then return end Timer[v] = setTimer( function(player) if isElement(player) then local team = getPlayerTeam(player) if ( team and getTeamName(team) == "Police" ) then return end local Wanted = getPlayerWantedLevel ( player ); local x,y,z = getElementPosition ( player ); local Name = getPlayerName ( player ); if ( Wanted >= 1 ) then if Bribe[player] and isElement(Bribe[player]) then return end Bribe[player] = createObject(1247,x,y,z); attachElements (Bribe[player],player,0,0,1.6) ; outputChatBox(" [ "..Name.." ] Have [ "..Wanted.." ] Wanted Level! ",v,255,0,0,true); elseif ( Wanted == 0 and Bribe[player] and isElement(Bribe[player]) ) then destroyElement(Bribe[player]); Bribe[player] = nil end end end ,5000,0,v); end xJoin_ = function ( ) xWanted_(source); end addEventHandler("onPlayerJoin",root,xJoin_); xWantedDestroy_ = function ( ) if Timer[source] and isTimer(Timer[source]) then killTimer(Timer[source]); Timer[source] = nil end; if Bribe[source] and isElement(Bribe[source]) then destroyElement(Bribe[source]); Bribe[source] = nil end end addEventHandler("onPlayerQuit",root,xWantedDestroy_); بالتوفيق ذا لي الباقي لا . Link to comment
aL.Kfo Posted September 26, 2013 Author Share Posted September 26, 2013 هذا الكود لي و شكلة حد خذاه وحطة بسكربت لة : ------------------- -- Wanted System -- Mr.Pres[T]ege -- (; ------------------- local Timer = {} Bribe = {} xMain_ = function( ) for index,v in ipairs (getElementsByType("player")) do xWanted_(v) end end addEventHandler("onResourceStart", resourceRoot, xMain_); xWanted_ = function(v) if not isElement(v) then return end Timer[v] = setTimer( function(player) if isElement(player) then local team = getPlayerTeam(player) if ( team and getTeamName(team) == "Police" ) then return end local Wanted = getPlayerWantedLevel ( player ); local x,y,z = getElementPosition ( player ); local Name = getPlayerName ( player ); if ( Wanted >= 1 ) then if Bribe[player] and isElement(Bribe[player]) then return end Bribe[player] = createObject(1247,x,y,z); attachElements (Bribe[player],player,0,0,1.6) ; outputChatBox(" [ "..Name.." ] Have [ "..Wanted.." ] Wanted Level! ",v,255,0,0,true); elseif ( Wanted == 0 and Bribe[player] and isElement(Bribe[player]) ) then destroyElement(Bribe[player]); Bribe[player] = nil end end end ,5000,0,v); end xJoin_ = function ( ) xWanted_(source); end addEventHandler("onPlayerJoin",root,xJoin_); xWantedDestroy_ = function ( ) if Timer[source] and isTimer(Timer[source]) then killTimer(Timer[source]); Timer[source] = nil end; if Bribe[source] and isElement(Bribe[source]) then destroyElement(Bribe[source]); Bribe[source] = nil end end addEventHandler("onPlayerQuit",root,xWantedDestroy_); بالتوفيق ذا لي الباقي لا . برستيج الحين ذا الاي منزله معدل و يضبط لو ركبته او تعلمنا بس انه لك ياليت توضح يب و انا توي ادري امس يوم قلت لواحد تعرف لمود برتسيج مشكلته هيك و هيك قال مو ل برتسيج قال برستيج له ملف واحد ب المود و الباقي تبع اجنبي ـــــــــــــــــــــــــــــــ و بالنسبه للاي فوق يقول مو المود تبعي عشان نعدله له انا ما طلبت زياده غ المود انا ابي اشوف مشكله في المود لو ما انحلت المود ماله داعي و بعد اذنك ي برستيج الحين اخذت اذن من الاجنبي قبل تعدله او القانون علي انا Link to comment
iPrestege Posted September 26, 2013 Share Posted September 26, 2013 اذا تبي الجد بعض الناس كذا نفسية يقولك لازم اذن و ايام يساعد بدون اذن مثل ذا اللي مسوي المود حاط المود حقي معه بدون علمي وين الرابط بالكومنتي هو؟ هاته اذا عندك . Link to comment
aL.Kfo Posted September 26, 2013 Author Share Posted September 26, 2013 اذا تبي الجد بعض الناس كذا نفسية يقولك لازم اذن و ايام يساعد بدون اذن مثل ذا اللي مسوي المود حاط المود حقي معه بدون علمي وين الرابط بالكومنتي هو؟ هاته اذا عندك . https://community.multitheftauto.com/ind ... ls&id=5110 Link to comment
iPrestege Posted September 26, 2013 Share Posted September 26, 2013 شكراَ لك تم ازالتة بنجاح . Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now