Jump to content

Tarek1

Members
  • Posts

    95
  • Joined

  • Last visited

Everything posted by Tarek1

  1. انا قصد كتابه شي في الماب y3ne msln Police Job
  2. Mapالسلام عليكم ممكن كود وضع اسم في ال
  3. fixed and other quesiton how to add more turfs ?
  4. السلام عليكم لا يتغير اي شئcancelEvent()لايموت وجرب 100 مره ان احذفpedليه عندما اقوم بالتصويب علي local allowedWeapons = { [22] = "9mm", [23] = "silenced", [24] = "deagle" , [25] = "shotgun", [27] = "combat_shotgun", [28] = "micro_smg", [29] = "mp5", [30] = "ak47", [31] = "m4", [32] = "micro_smg", [34] = "sniper_rifle", } local sx, sy = guiGetScreenSize ( ) local rsx, rsy = sx / 1280, sy / 1024 local selectedOption = 0 local isRendering = false local sourceMarker = nil local selectedWeapon = nil local isTraining = false local winW = rsx * 250 local winX = rsx * 30 local winH = rsy * 220 local winY = (sy/2)-(winH/2) local progWidth = 0 local progNum = 0 local training = { } local dummyPeds = { } local trainingWeapon = true addEvent ( "NGAmmunation:Module->Training:onClientHitMarker", true ) addEventHandler ( "NGAmmunation:Module->Training:onClientHitMarker", root, function ( s ) if isTraining then return end local w = getPedWeapon ( localPlayer ) local d = getElementData ( localPlayer, "NGSQL:WeaponStats" ) if not ( d[allowedWeapons[w]] ) then return exports.NGMessages:sendClientMessage ( "This weapon isn't allowed to be trained.", 255, 255, 0 ) end if ( d[allowedWeapons[w]] > 90 ) then return exports.NGMessages:sendClientMessage ( "This weapon has maximum efficiency!", 255, 255, 0 ) end sourceMarker = s local x, y, z = getElementPosition ( s ) setElementPosition ( localPlayer, x, y, z + 0.2 ) setPedRotation ( localPlayer, 0 ) if not isRender then addEventHandler ( "onClientRender", root, Training_OnRender ) end isRender = true showCursor ( true ) bindKey ( "arrow_d", "down", Training_Binds ) bindKey ( "arrow_u", "down", Training_Binds ) bindKey ( "space", "down", Training_Binds ) selectedOption=0 trainingWeapon = w addEventHandler ( "onClientMarkerLeave", s, Training_OnMarkerLeave ) end ) local windowX = rsx * 10 local windowW = rsx * 250 local windowH = rsy * 400 local windowY = ( sy / 2 - windowH / 2 ) local info = { accept = { x = windowX+(rsx*20), y = windowY+(rsy*300) }, exit = { x = windowX+(rsx*20), y = windowY+(rsy*345) }, rect = { } } info.rect.y = info.accept.y function Training_OnRender ( ) if not isRender or getKeyState("backspace") then Training_CloseWindow ( ) return end dxDrawRectangle ( windowX, windowY, windowW, windowH, tocolor ( 0, 0, 0, 150 ) ) dxDrawBorderedText ( "Training", windowX, windowY-(rsy*25), windowX+windowW, windowY+windowH, tocolor(255,255,255,255), rsy*2, "beckett", "center", "top", false, false, false, false, false ) dxDrawText ( "Here at the Ammu-nation weapon training center, you can increase your weapon skills. Most of the weapons (Shown in F3 -> Stats) have a weapon rank of 0-100. Here, you can increase the weapon so that they can shoot faster, you can have duel, or many others.", windowX + ( rsx * 20 ), windowY + ( rsy * 40 ), ( windowX+windowW)-(rsx * 20 ), (windowY+windowH)-(rsy*50), tocolor ( 255, 255, 255, 255 ), rsy*1.1, "default-bold", "left", "top", false, true ) dxDrawText ( "Selected Weapon: N/A\nSkill: 0/100\nSession Cost: $1,200", windowX + ( rsx * 20 ), windowY + ( rsy * 225 ), ( windowX+windowW)-(rsx * 20 ), (windowY+windowH)-(rsy*280), tocolor ( 255, 200, 65, 255 ), rsy*1.1, "default-bold", "left", "top", false, true ) dxDrawRectangle ( windowX+(rsx*20), info.rect.y, windowW-(rsx*40), rsy*35, tocolor ( 0, 0, 0, 150 ) ) dxDrawText ( "Accept & Train", info.accept.x, info.accept.y, windowX+(windowW-(rsx*40)), info.accept.y+(rsy*35), tocolor(255,255,255,255), rsy*1.2, "default-bold", "center", "center" ) dxDrawText ( "Exit", info.exit.x, info.exit.y, windowX+(windowW-(rsx*40)), info.exit.y+(rsy*35), tocolor(255,255,255,255), rsy*1.2, "default-bold", "center", "center" ) if ( selectedOption == 0 ) then if ( info.rect.y ~= info.accept.y ) then if ( info.rect.y > info.accept.y ) then info.rect.y = info.rect.y - ( rsy * 2 ) if ( info.rect.y < info.accept.y ) then info.rect.y = info.accept.y end else info.rect.y = info.rect.y + ( rsy * 2 ) if ( info.rect.y > info.accept.y ) then info.rect.y = info.accept.y end end end else if ( info.rect.y ~= info.exit.y ) then if ( info.rect.y > info.exit.y ) then info.rect.y = info.rect.y - ( rsy * 2 ) if ( info.rect.y < info.exit.y ) then info.rect.y = info.exit.y end else info.rect.y = info.rect.y + ( rsy * 2 ) if ( info.rect.y > info.exit.y ) then info.rect.y = info.exit.y end end end end end function Training_CloseWindow ( doBinds ) if ( isRender ) then removeEventHandler ( "onClientRender", root, Training_OnRender ) end if ( doBinds == nil ) then doBinds = true end isRender = false selectedWeapon = nil isTraining = false showCursor ( false ) info.rect.y = info.accept.y unbindKey ( "arrow_d", "down", Training_Binds ) unbindKey ( "arrow_u", "down", Training_Binds ) unbindKey ( "space", "down", Training_Binds ) if ( training.IsStatsRendering ) then training.IsStatsRendering = false removeEventHandler ( "onClientRender", root, Training_UserStats ) end for i, v in pairs ( dummyPeds ) do if ( isElement ( v ) ) then destroyElement ( v ) end dummyPeds[i] = nil end if doBinds then toggleControl ( "next_weapon", true ) toggleControl ( "previous_weapon", true ) toggleControl ( "aim_weapon", true ) toggleControl ( "fire", true ) toggleControl("forwards", true) toggleControl("backwards", true ) toggleControl("left", true ) toggleControl ( "right", true ) toggleControl ( "jump", true ) toggleControl ( "crouch", true ) end if ( isElement ( sourceMarker ) ) then removeEventHandler ( "onClientMarkerLeave", sourceMarker, Training_OnMarkerLeave ) sourceMarker = nil end end function Training_Binds ( k, s ) if ( k == "space" ) then playSoundFrontEnd ( 33 ) if ( selectedOption == 1 ) then Training_CloseWindow ( true ) elseif ( selectedOption == 0 ) then if ( not allowedWeapons [ getPedWeapon ( localPlayer ) ] ) then return exports.NGMessages:sendClientMessage ( "This weapon isn't allowed" ) end if ( getPlayerMoney ( ) < 1200 ) then return exports.NGMessages:sendClientMessage ( "You don't have $1,200 to train this weapon", 255, 255, 0 ) end Training_CloseWindow ( false ) Training_StartTraining ( ) end return end playSoundFrontEnd ( 32 ) if selectedOption == 0 then selectedOption = 1 else selectedOption = 0 end end function Training_StartTraining ( ) if isTraining then return end isTraining = true toggleControl ( "next_weapon", false ) toggleControl ( "previous_weapon", false ) toggleControl ( "aim_weapon", false ) toggleControl ( "fire", false ) toggleControl("forwards", false) toggleControl("backwards", false ) toggleControl("left",false ) toggleControl ( "right", false ) toggleControl ( "jump", false ) toggleControl ( "crouch", false ) training.textHeight = sy training.remainingTimeForCountdown = 5 training.RequiredPeds = 15 training.TargetShot = 0 training.IsStatsRendering = false progNum = 0 progWidth = 0 addEventHandler ( "onClientRender", root, Training_CountdownRender ) setTimer ( function ( ) training.remainingTimeForCountdown = training.remainingTimeForCountdown - 1 end, 1000, 5 ) Training_SpawnDummyPeds ( ) triggerServerEvent ( "NGAmmunation:Modules->Training:TakePlayerMoney", localPlayer, localPlayer, 1200 ) end --[[ -- For developers addCommandHandler ( 'rest', function ( ) toggleControl ( "next_weapon", true ) toggleControl ( "previous_weapon", true ) toggleControl ( "forwards", true ) toggleControl ( "backwards", true ) toggleControl ( "left", true ) toggleControl ( "right", true ) toggleControl ( "aim_weapon", true ) toggleControl ( "crouch", true ) toggleControl ( "jump", true ) toggleControl ( "sprint", true ) toggleControl ( "fire", true ) end ) ]] function Training_UserStats ( ) if not training.IsStatsRendering or not isTraining then return removeEventHandler ( "onClientRender", root, Training_UserStats ) end dxDrawRectangle ( winX, winY, winW, winH, tocolor ( 0, 0, 0, 150 ) ) local prog = 0 local killed = training.TargetShot local required = training.RequiredPeds local prog = 10 * ( (100 * killed) / ( required .. 0 ) ) if ( prog ~= progNum ) then if ( progNum < prog ) then progNum = progNum + 1 else progNum = progNum - 1 end end local prog2 = (winW-(rsx*58))*(prog*0.01) if ( progWidth ~= prog2 ) then if ( prog2 > progWidth ) then progWidth = progWidth + ( rsx * 1 ) if ( progWidth > prog2 ) then progWidth = prog2 end else progWidth = progWidth - ( rsx * 1 ) if ( progWidth < prog2 ) then progWidth = prog2 end end end if ( localPlayer.interior ~= 1 ) then Training_OnMarkerLeave ( ) end dxDrawText ( "Stats", winX, winY+(rsy*5), winX+winW, winY+winH, tocolor ( 255, 255, 255, 255 ), rsy*2, "default-bold", "center" ) dxDrawText ( "Killed Peds: "..tostring(training.TargetShot), winX+(rsx*25), winY+(rsy*50), 0, 0, tocolor ( 255, 160, 0, 255 ), rsy*1.5, "default-bold" ) dxDrawText ( "Required Peds: "..tostring(training.RequiredPeds), winX+(rsx*25), winY+(rsy*90), 0, 0, tocolor ( 255, 160, 0, 255 ), rsy*1.5, "default-bold" ) dxDrawRectangle ( winX+(rsx*25), (winY+winH)-(rsx*60), winW-(rsx*50), rsy*35, tocolor ( 0, 0, 0, 150 ) ) dxDrawRectangle ( winX+(rsx*29), (winY+winH)-(rsx*56), progWidth, rsy*27, tocolor ( 255, 140, 0, 255 ) ) dxDrawText ( progNum.."%", winX+(rsx*25), (winY+winH)-(rsx*60), (winX+(rsx*25))+(winW-(rsx*50)), ((winY+winH)-(rsx*60))+(rsy*35), tocolor ( 255, 255, 255, 255 ), rsy * 1.3, "default-bold", "center", "center" ) end local pedLocs = { { 297.59, -17.63, 1001.52, 180 }, { 294.49, -19.36, 1001.52, 180 }, { 292.03, -15.71, 1001.52, 180 }, { 290.52, -12.82, 1001.52, 180 }, { 291.51, -9.1, 1001.52, 180 }, { 296.64, -10.78, 1001.52, 180 }, { 298.07, -14.06, 1001.52, 180 }, { 286.5, -7.54, 1001.52, 180 }, { 293.74, -12.63, 1001.52, 180 }, { 288.79, -17.26, 1001.52, 180 }, { 286, -11.67, 1001.52, 180 }, { 296.87, -6.78, 1001.52, 180 }, { 295.56, -15.8, 1001.52, 180 }, { 287, -13.9, 1001.52, 180 }, { 288.47, -8.96, 1001.52, 180 }, { 290.22, -14.57, 1001.52, 180 }, { 293.42, -10.2, 1001.52, 180 }, { 292.02, -18, 1001.52, 180 }, { 286.01, -17, 1001.52, 180 }, } function Training_SpawnDummyPeds ( ) local usedIndexs = { } local int = getElementInterior ( localPlayer ) for i=1,training.RequiredPeds do local n = math.random ( #pedLocs ) while ( usedIndexs [ n ] ) do n = math.random ( #pedLocs ) end usedIndexs [ n ] = true local x, y, z, r = unpack ( pedLocs [ n ] ) local p = createPed ( 0, x, y, z ) setPedRotation ( p, r ) setElementInterior ( p, int ) p.dimension = localPlayer.dimension addEventHandler ( "onClientPedDamage", p, Training_OnDummyDamage ) addEventHandler ( "onClientPedWasted", p, Training_OnDummyWasted ) dummyPeds[i] = p end end function Training_OnDummyDamage ( attacker) if ( not attacker or getElementType ( attacker ) ~= "player" or attacker ~= localPlayer ) then cancelEvent() return end end function Training_OnDummyWasted ( attacker ) if ( attacker and attacker == localPlayer ) then training.TargetShot = training.TargetShot + 1 if ( training.TargetShot == training.RequiredPeds ) then setTimer ( function ( ) Training_CloseWindow ( ) if ( trainingWeapon ~= getPedWeapon ( localPlayer ) ) then return exports.NGMessages:sendClientMessage ( "You have changed your weapon.... No skills added.", 255, 0, 0 ) end local w = getPedWeapon ( localPlayer ) local d = getElementData ( localPlayer, "NGSQL:WeaponStats" ) d[allowedWeapons[w]] = d[allowedWeapons[w]] + 10 setElementData ( localPlayer, "NGSQL:WeaponStats", d ) exports.NGMessages:sendClientMessage ( "Weapon ranked up! New level: "..d[allowedWeapons[w]].."/100", 0, 255, 0 ) triggerServerEvent ( "NGAmmunation:Modules->Training:onClientLevelWeaponUp", localPlayer, allowedWeapons[w], d[allowedWeapons[w]], w ) -- weapon name , new skill level , weapon ID ) trainingWeapon = nil end, 1000, 1 ) end end end function Training_OnMarkerLeave ( ) Training_CloseWindow ( ) trainingWeapon = nil end function Training_CountdownRender ( ) local t = training.remainingTimeForCountdown local h = training.textHeight local alpha = 255 if not training.CountdownTextAlpha then training.CountdownTextAlpha = alpha else alpha = training.CountdownTextAlpha end if ( t == 0 ) then t = "Begin Shooting The Targets" if ( h > ( rsy * 75 ) ) then h = h - ( rsy * 10 ) training.textHeight = h end if not training.IsStatsRendering then training.IsStatsRendering = true addEventHandler ( "onClientRender", root, Training_UserStats ) toggleControl ( "aim_weapon", true ) toggleControl ( "fire", true ) toggleControl("forwards", true) toggleControl("backwards", true ) toggleControl("left",true ) toggleControl ( "right", true ) toggleControl ( "jump", true ) toggleControl ( "crouch", true ) return end if not training.removeCountdownTick then training.removeCountdownTick = getTickCount ( ) + 3000 elseif ( training.removeCountdownTick <= getTickCount ( ) ) then alpha = alpha - 2 training.CountdownTextAlpha = alpha if ( alpha < 20 ) then training.remainingTimeForCountdown = nil training.textHeight = nil training.CountdownTextAlpha = nil training.removeCountdownTick = nil removeEventHandler ( "onClientRender", root, Training_CountdownRender ) return end end end dxDrawBorderedText ( tostring ( t ), 0, 0, sx, h, tocolor ( 255, 255, 0, alpha ), rsy*2.5, "pricedown", "center", "center", false, true ) end
  5. why i can 't open scoreboard/adminpanel ?
  6. طب لو معيش طريقه حفظ اعمل ايه
  7. السلام عليكم شباب من كود عندما يقبض احد من البوليس تيم علي 50 شخص يتغير السكن الخاص به مثلا من 280 الي300 وعندما يضغط علي F2 مثلا تظهر نافذه تقوم بعد الاشخاص الذي قبض عليهم
  8. لكن عندما يصل الاعب الي الهدف المطلوب لا تختفي السياره و لا يتم اعطاءه مال Criminal Teamهيا شغاله لل
  9. السلام عليكم يتم اعطاءه سيارهAcceptويضغط علي Marker1فكره السكربت هو عندما يذهب الاعب الي يتم اختفاء السياره ويحصل علي$ 7000marker2وعندما يصل الي لا تختفي السياره ولا يتم اعطاء الاعب 7000$:مشاكل السكربت فقطCriminalطلب بسيط اخر ممكن كود اضافه المود الي تيم --Client marker1 = createMarker(1614.43103, -1506.77539, 13.21113,"cylinder",2,220, 20, 60) marker2 = createMarker(1022.42944, 2376.18359, 9.82031,"cylinder",4,255,0,0) addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) window = guiCreateWindow(282, 129, 708, 425, "Drug Delivary", false) guiWindowSetSizable(window, false) memo = guiCreateMemo(24, 42, 674, 103, "Welcome to Drug Delivary, after you press accept the server will move you into a car you must go with it into the marker you can find this marrker into the truck blip in the map :)) if you found any bug Contact staff team or report\nit @theForum [ 7000$ ]", false, window) accept = guiCreateButton(25, 331, 95, 84, "Accept", false, window) Close = guiCreateButton(597, 327, 95, 84, "Close", false, window) --guiWindowSetSizable(window, false) guiSetVisible ( window , false ) end ); addEventHandler ( "onClientMarkerHit" , root , function ( player ) if ( source == marker1 and player == localPlayer and not isPedInVehicle ( player ) ) then guiSetVisible ( window , true ) guiWindowSetSizable(window, true) showCursor ( true ) guiSetInputEnabled ( true ) end end ); addEventHandler ( "onClientGUIClick" , root , function ( ) if ( source == accept ) then guiSetVisible ( window , false ) showCursor ( false ) guiSetInputEnabled ( false ) triggerServerEvent ( "CreateVehicle_" , localPlayer ) elseif ( source == Close ) then guiSetVisible ( window , false ) showCursor ( false ) guiSetInputEnabled ( false ) end end ); addEvent("GiveWe",true) addEventHandler("GiveWe",marker2,function() DestroyElmenet(table [ source ]) givePlayerMoney(7000) end) --Server local table = { } addEvent ( "CreateVehicle_" , true ) addEventHandler ( "CreateVehicle_" , getRootElement ( ) , function ( ) if isElement ( table [ source ] ) then destroyElement ( table [ source ] ) end local x , y , z = getElementPosition ( source ) table [ source ] = createVehicle ( 482, 1605.30298, -1464.82532, 13.56153 +1 ) warpPedIntoVehicle(source, table [ source ]) triggerClientEvent("GiveWe",playerSource) end ) ;
  10. مش شغاله aTeam = createTeam ( "Police" , 100, 149, 237 ); addEvent("JoinPolice",true) addEventHandler("JoinPolice",root , function ( ) if ( getPlayerTeam ( source ) and getPlayerTeam ( source ) == aTeam ) then return outputChatBox ("* you have this team",source,255,0,0,true) end setPlayerTeam ( source , aTeam ) setPlayerSkin (source,280) giveWeapon ( source, 3, 1 ) giveWeapon ( source, 23, 200 ) outputChatBox ( 'Now You Are in police job!',source,0,255,0 ) end ); -- get a table with all teams local allTeams = getElementsByType ( "Police" ) -- for every team, for index, theTeam in ipairs(allTeams) do -- if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- switch it on setTeamFriendlyFire ( theTeam, true ) end end
  11. "Police"انا جربتها بس مش عارف اعمل لل
  12. ممكن مثال يعني تكون لتيم البوليس ?
  13. السلام عليكم لبعضهم البعض damage من نفس التيم لا يستطيعون ان يعملون Playersشباب ممكن كود يجعل ال
  14. [01:43:48] ERROR:Jobs\server.lua:153: attempt to compare nil with number
  15. السلام عليكم Policeيدخل تيم Accept فكره المود : الاعب يذهب الي الماركر وعندما يلمس الماركر يظهر نافذه و عندما يضغط علي Client.lua --thePed local PolicePed = createPed(280,1554.33032, -1675.53552, 16.19531,90) -- Creates a ped function cancelPedDamage() cancelEvent() end addEventHandler("onClientPedDamage", PolicePed, cancelPedDamage) -- When thePed is damaged, cancelPedDamage is called -- GUI local marker = createMarker(1553.61292, -1675.59033, 15.19531,"cylinder",2,100, 149, 237) function gui() window = guiCreateWindow(0.30, 0.19, 0.44, 0.46, "Police Job", true) guiWindowSetSizable(window, false) guiSetProperty(window, "CaptionColour", "FF1544C9") buttonaccept = guiCreateButton(10, 293, 91, 50, "Accept", false, window) guiSetFont(buttonaccept, "default-bold-small") buttonclose = guiCreateButton(497, 295, 90, 48, "Close", false, window) guiSetFont(buttonclose, "default-bold-small") showCursor ( true ) end addEventHandler ( "onClientMarkerHit", marker,gui ) --buttons function buttons( ) if ( source == buttonaccept ) then guiSetVisible ( window , false ) guiSetInputEnabled ( false ) showCursor( false ) triggerServerEvent ( "Job", resourceRoot) elseif ( source == buttonclose ) then guiSetVisible ( window , false ) showCursor ( false ) guiSetInputEnabled ( false ) end end addEventHandler ( "onClientGUIClick",root,buttons ) Server.lua local Police = createTeam ( 'Police',100, 149, 237) function test(source,Police) if Police then setPlayerTeam ( source, Police ) end end addEvent( "Job",true ) addEventHandler ( "Job",root,test)
×
×
  • Create New...