Jump to content

Bassam*Syria

Members
  • Posts

    391
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Bassam*Syria

  1. لعفو موفق حياك الله
  2. الله يسلمك ________________________-- تم تعديل الاكواد الرجاء التجريب ذذ
  3. لو تبي مودات روح خلي مبرمج يعملك ياها او دور بالمنتدى حق المودات https://community.multitheftauto.com/
  4. يزن ثقه حلوه بالنفس وماشالله عليك دائما واثق بنفسك مافي عطل بس انت منقص التعريف لما يضغط الزر يجي الماركر و البليب عشان كذا الوظيفه خربت معاك المهم -- سيرفر trucssker = createTeam ( "Electricity fix", 255, 255, 0 ) addEvent( "doSomething", true) addEventHandler("doSomething", root, function () setElementModel(source,153) setPlayerTeam(source,trucssker) setPlayerNametagColor ( source, 255, 255, 0 ) end ) addEventHandler("doSomethin", root, doStuf) local vehicleTable = {} addEvent( "sum", true) addEventHandler("sum", getRootElement(), function(car) local truck = vehicleTable[source] -- if truck then -- if isElement( truck ) then destroyElement( truck ) end vehicleTable[source]= nil -- end if isElement(source) then local truck = createVehicle ( 546, -1708.04919,983.96619,17.58594 ) warpPedIntoVehicle ( source, truck ) vehicleTable[source]= truck end end ) addEventHandler("onPlayerQuit",root, function () local truck = vehicleTable[source] if truck then if isElement( truck ) then destroyElement( truck ) end vehicleTable[source]= nil end end) --doSomething function HaveTruckerJob() setPlayerTeam(source,getTeamFromName("Drug Job")) end addEvent ( "HaveTruckerJob", true) addEventHandler("HaveTruckerJob", root, HaveTruckerJob) addEvent ( "givePlayerPay", true ) function givePlayerRobPay () money = math.random ( 1500, 2000 ) givePlayerMoney ( source, money ) Stars = math.random ( 1, 1 ) setPlayerWantedLevel ( source, Stars ) fadeCamera ( source, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 2500, 1, source, true, 1 ) end addEventHandler ( "givePlayerPay", root, givePlayerRobPay ) كلنت local blip = createBlip ( 693.62897,1967.65674,5.53906, 56 ) local skin1 = createPed ( 153, 693.62897,1967.65674,5.53906, 180 ) local getjobmarker = createMarker ( 693.62897,1967.65674,5.53906, "cylinder", 2, 0, 0, 0, 0 ) setElementFrozen(skin1,true) addEventHandler("onClientPedDamage",root, function () if source == skin1 then cancelEvent() end end) addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition(skin1) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+1.3) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 30) then dxDrawText("Electricity fix", sx+2, sy+2, sx, sy, tocolor(0,0,0), 2-(distance/20), "arial", "center", "center") dxDrawText("Electricity fix", sx, sy, sx, sy, tocolor(255,255,0), 2-(distance/20), "arial", "center", "center") end end end end) local x,y = guiGetScreenSize() addEventHandler("onClientMarkerHit",root, function (hit) if source == getjobmarker then if localPlayer == hit then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end end) GUIEditor = { gridlist = {}, window = {}, button = {} } function unpackDestinations ()-- return unpack ( destinations [ math.random ( #destinations ) ] )-- end-- addEventHandler("onResourceStart",getjobmarker, function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(getjobmarker,true) showCursor(true) end end)-- local x = x - 332 local y = y - 333 GUIEditor.window[1] = guiCreateWindow(259,10,332,518 , "Electricity fix Jop", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.button[1] = guiCreateButton(1,451,153,41, "Take Job", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(170, 450, 189, 41, "Cancel", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") Memo1 = guiCreateMemo(9,25,314,261, "قم بالذهاب الى عامود الكهرباء لبدء تصليحه,العلامه \nالحمراء في الخريطه علامة العامود الذي سيتم تصليحه.\nيجب تركيب سلم عند الذهاب الى العامود لكي تبدأ التصليح\nبعد تصليح العامود سيتم اعطائك مال من قبل الشركه \n", false, GUIEditor.window[1]) guiMemoSetReadOnly(Memo1, true) GUIEditor.gridlist[1] = guiCreateGridList(12, 300, 310, 140, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "skin", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "", 0.3) for i = 1, 3 do guiGridListAddRow(GUIEditor.gridlist[1]) end guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "153", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "1", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 3, "", false, false) addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.button[1] then outputChatBox ("you has been Successfully took Drug Job",0,255,0, true) outputChatBox ("Please back to the Skin to get the Vehicle",0,255,0, true) triggerEvent ( "createMssssrMarkers",getRootElement() ) triggerServerEvent ( "doSomething", localPlayer) showCursor(false) guiSetVisible ( GUIEditor.window[1], false ) end end ) addEventHandler("onClientGUIClick",GUIEditor.window[1], function(b,thePlayer) if b == "left" then if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end end) local destinationsMrker = { {702.38892,1941.66589,5.53906}, {702.38892,1941.66589,5.53906} } function unpackDestinations () return unpack ( destinations [ math.random ( #destinationsMrker ) ] ) end addEventHandler("onClientResourceStart",root, function() if getElementType(player) == "player" then if not ( isPedInVehicle ( player ) ) then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end end) addEvent ( "createMssssrMarkers", true ) addEventHandler("createMssssrMarkers",root, function () local num = math.random (#destinationsMrker) local x = destinationsMrker [num][1] local y = destinationsMrker [num][2] local z = destinationsMrker [num][3] truckerMarker = createMarker(x,y,z,"cylinder",2.0,255,255,0,255) truckerBlip = createBlip(x,y,z,41) end ) قلي لو ظبت معاك او لا
  5. الكود ناقص اطرح كودك كامل السيرفر مع الكلنت لو سمحت عشان نعرف نصلح ذذ
  6. يا baba, ماقلتلي المود اشتغل معاك او لا ؟ ابي اعرف ض !
  7. اخوي انا حاولت اضيفك بس جاني كتير اسماء انت ضيفني skype : bassam_medane الصوره : جوكر نفس الي محوطه هنا
  8. قصدك كودي؟ ترا انا جربته الحين و اشتغل
  9. سمحلي اخوي اتأخرت عليك عشان صراحه انا اول مره استخدم الاكواد ذي المهم نشالله يظبت رد لي خبر لاهنتك بي اعرف نتيجه تعبي ذذ TimeGuiSetRightC = { } function guiMoveRightToCenter(gui) if getElementData(gui,"HelhGui") == false then setElementData(gui,"HelhGui",true) local s1,s2=guiGetScreenSize() local w1,w2=guiGetSize(gui,false) local x,y = (s1-w1)/2,(s2-w2)/2 guiSetPosition(gui,-x,y,false) TimeGuiSetRightC[gui] = setTimer(guiMoveRightToCenter,50,0,gui) end local a,b=guiGetScreenSize() local w1,w2=guiGetSize(gui,false) local x,y = (a-w1)/2,(b-w2)/2 local x1,y1 = guiGetPosition ( gui, false) if (x1 >= x) then killTimer(TimeGuiSetRightC[gui]) setElementData(gui,"HelhGui",false) else guiSetPosition(gui,x1+10,y,false) end end GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function ( ) guiSetPosition(GUIEditor.window[1],x,y,false) x = 364 y = -277 GUIEditor.window[1] = guiCreateWindow(x,y,659, 472, "maz.png", false) guiWindowSetSizable(GUIEditor.window[1], false ) guiSetVisible ( GUIEditor.window[1], false ) guiSetAlpha(GUIEditor.window[1], 1) function Jose ( ) guiSetVisible (GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) if ( guiGetVisible ( GUIEditor.window[1] ) ) then guiMoveRightToCenter( GUIEditor.window[1] ) end showCursor( not isCursorShowing() ) end bindKey ( "f2", "down", Jose ) end ) function panel ( ) if source == GUIEditor.button[1] then triggerServerEvent( "fee" , getLocalPlayer() ) elseif source == GUIEditor.button[2] then triggerServerEvent( "fee1" , getLocalPlayer() ) elseif source == GUIEditor.button[3] then triggerServerEvent( "fee2" , getLocalPlayer() ) elseif source == GUIEditor.button[4] then triggerServerEvent( "fee3" , getLocalPlayer() ) elseif source == GUIEditor.button[5] then triggerServerEvent( "fee4" , getLocalPlayer() ) elseif source == GUIEditor.button[6] then triggerServerEvent( "fee5" , getLocalPlayer() ) end end addEventHandler ( "onClientGUIClick", root, panel ) بس انا غيرت الوحه عشان لوحتك ما تطلع الشاشه شكلها صغيره او مكان خارج الشاشه
  10. end هلا اخوي انت ناسي المهم جرب لو ما اشتغل قلي TimeGuiSetRightC = { } function guiMoveRightToCenter(gui) if getElementData(gui,"HelhGui") == false then setElementData(gui,"HelhGui",true) local s1,s2=guiGetScreenSize() local w1,w2=guiGetSize(gui,false) local x,y = (s1-w1)/2,(s2-w2)/2 guiSetPosition(gui,-x,y,false) TimeGuiSetRightC[gui] = setTimer(guiMoveRightToCenter,50,0,gui) end local a,b=guiGetScreenSize() local w1,w2=guiGetSize(gui,false) local x,y = (a-w1)/2,(b-w2)/2 local x1,y1 = guiGetPosition ( gui, false) if (x1 >= x) then killTimer(TimeGuiSetRightC[gui]) setElementData(gui,"HelhGui",false) else guiSetPosition(gui,x1+10,y,false) end end GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} TimeGuiSetRightC = { } } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateStaticImage(0.05, 0.2, 0.9, 0.40, "maz.png", true) guiWindowSetSizable(GUIEditor.window[1], false ) guiSetVisible ( GUIEditor.window[1], false ) guiSetAlpha(GUIEditor.window[1], 1) guiMoveRightToCenter( GUIEditor.window[1] ) end ) function Jose () guiSetVisible (GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor( not isCursorShowing() ) end bindKey ("F3","down",Jose ) function panel() if source == GUIEditor.button[1] then triggerServerEvent( "fee" , getLocalPlayer() ) elseif source == GUIEditor.button[2] then triggerServerEvent( "fee1" , getLocalPlayer() ) elseif source == GUIEditor.button[3] then triggerServerEvent( "fee2" , getLocalPlayer() ) elseif source == GUIEditor.button[4] then triggerServerEvent( "fee3" , getLocalPlayer() ) elseif source == GUIEditor.button[5] then triggerServerEvent( "fee4" , getLocalPlayer() ) elseif source == GUIEditor.button[6] then triggerServerEvent( "fee5" , getLocalPlayer() ) end end addEventHandler("onClientGUIClick",root,panel )
  11. السلام عليم و رحمه الله و ركاته انا عندي مشكله ب شي المهم في مشكله بالكود الي بطرحه الكود انو يتحقق من فلوسه و ينقصها و كذا الكود يتحقق بس ما ينقص ! ممكن حل؟ نشوف الكود function BMoney(amount) if amount then local money = getPlayerMoney(localPlayer) if money then if tonumber(money) >= tonumber(amount) then setPlayerMoney(localPlayer, tonumber(money - tonumber(amount))) return true else showText("#FF0000You don't have enough money !") return false end end end end
  12. تفضل اخوي نشالله تكون فهمت كيف local skins = { "Skin Jobs 1 (skin: 271)", "Skin Jobs 2 (skin: 298)" } GUIEditor = { --label = {}, button = {}, window = {}, memo = {}, gridlist = {} } GUIEditor.window = guiCreateStaticImage(256, 98, 294, 435, "P.png", false) -- P.png اسم الصوره مع سيغتها guiWindowSetSizable(GUIEditor.window, false) GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, " \"{SMILIES_PATH}/icon_razz.gif\" alt=\"\" title=\"Razz\" /> ", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "اختار شخصياتك", 0.9) guiSetVisible(GUIEditor.window, false) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor.gridlist ) guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.aceptar ) then local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 ) if ( skinName == "Skin Jobs 1 (skin: 271)" ) then triggerServerEvent ( "setBarco", localPlayer, 271 ) elseif ( skinName == "Skin Jobs 2 (skin: 298)" ) then triggerServerEvent ( "setBarco", localPlayer, 298 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "اخترا شخصيتك ", 255, 0, 0 ) end elseif ( source == GUIEditor.cancelar ) then guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) end end ) function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("baba", true) addEventHandler ("baba",root, pe) addEvent ( "barco_set_location", true ) addEventHandler ( "barco_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {535,600} GUIEditor_Marker[1] = createMarker(2473.52051, -1696.91187, 12.51631,"cylinder",3,255,255,0,255) GUIEditor_Marker[2] = createMarker(2459.45264, -1690.21484, 12.54478,"cylinder",3,255,0,0,0) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(200,147,246,314,"baba",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,34,228,155,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(20,208,210,41,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(20,252,210,41,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'baba' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end)
  13. هههههههههه يا مبدع وش تبي تسوي بالظبت يعني اي فنكشن تبي ولا تبي المود كامل مو مشفر 0_0 ؟
  14. اخوي اطرح لوحتك مع اسم الصوره الموجوده في ملف المود ( الي تبي تحطها بدال الوحه العاديه بظبتها لك و انت اتعلم من كودك
  15. شوف الميتا اخوي احتمال يكون منها ض2 لو المود ما يشتغل العطل يكون من الميتا رجع الميتا
  16. اها يعني تبي بدال الوحه العاديه تبي تحط صوره من عندك ؟ شوف ذي الوحه العاديه يعني لوحه من برنامج جوي اديتور GUIEditor.window[1] = guiCreateWindow(321,90,292,332, "", false) GUIEditor.button[1] = guiCreateButton(9,433,138,43, "Take Job", false, GUIEditor.window[1]) كيف اسوي الوحه صوره ؟ شوف كيف تصير تبدل guiCreateWindow ب guiCreateStaticImage يعي يصير GUIEditor.Image[1] = guiCreateStaticImage(321,90,292,332, "p.png", false) p.png = اسم الصوره مع صيغتها p= اسم الصوره \ png = صيغتها و الزر الي يكون عليها يصير GUIEditor.button[1] = guiCreateButton(9,433,138,43, "Take Job", false, GUIEditor.Image[1]) اتمنا تكون فهمت
  17. مشكور اخوي تابل ما قصرت
  18. ابيها تضل النار ما ابي تروح هي اصلها تروح بعد 15 ثانيه
  19. طبعا الحدود عباره عن ماركر موجود بس مخفي استخدم [code]addEventHandler( "onMarkerHit" [/code] -- امر لما يلمس الماركر isPedInVehicle اذا كان الاعب بسياره not isPedInVehicle اذا كان الاعب خارج السياره setElementPosition -- لنقل الاعب ---------------------------------------------------------------------------------------------------------------------------
  20. السلام عليكم و رحمه الله و بركاته كان عندي استفسار عن كود CreateFire جربته و شتغل بس فيه مشكله انو النار تروح بعد 15 ثانيه تقريباً بس اذا تعرفو سيرفر سي اي تي مهمة الاطفاء ( وظيفه ) كيف؟ كيف النار ما تختفي ؟؟ ابي اعرف فكرتها لو حد عنده اقتراح او اي شي يفيد اتمنا لا يبخل علي بالاجابه ^
  21. هلا اخوي انا حاولت اصلح نشالله يكون اشتغل جرب انا ما جربت ذذ انت جرب و قلي لو اشتغل و قلي اذا ما اشتغل createMarker(x,y,z,"corona",2,0,255,0) addEventHandler("onClientMarkerHit",marker, function isAdmin( player, seat ) if ( getPlayerSerial ( player ) == "سيريالي" ) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then return true; else if ( seat == 0 ) then return false; outputChatBox("للاسف للاسف @@@!!") cancelEvent ( ) end end end end ) حياك الله ..
  22. السلام عليكم و رحمه الله و بركاته شباب الكود ذا ما يحفظ الالمنت ليش ! لو تقدرو تساعجوني لا تقصرو لاهنت ذذ function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "funmodev2-money") if (accountData) then local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money") local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin") local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health") local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor") local playerX = getAccountData (theCurrentAccount, "funmodev2-x") local playerY = getAccountData (theCurrentAccount, "funmodev2-y") local playerZ = getAccountData (theCurrentAccount, "funmodev2-z") local playerInt = getAccountData (theCurrentAccount, "funmodev2-int") local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim") local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") local playerTeam = getAccountData (theCurrentAccount, "funmodev2-Team") local playerJob = getAccountData (theCurrentAccount, "gms-job") local playerOccupation = getAccountData (theCurrentAccount, "gms-occupation") spawnPlayer (source, tonumber(playerX), tonumber(playerY), tonumber(playerZ) +1, 0, tonumber(playerSkin), tonumber(playerInt), tonumber(playerDim)) setPlayerMoney (source, tonumber(playerMoney)) setPlayerTeam(source, getTeamFromName(playerTeam)) setElementData(source, "Job", tostring(playerJob)) setElementData(source, "Occupation17", tostring(playerOccupation)) setTimer (setElementHealth, 500, 1, source, tonumber(playerHealth)) setTimer (setPedArmor, 500, 1, source, tonumber(playerArmor)) setTimer (setPlayerWantedLevel, 500, 1, source, tonumber(playerWanted)) setCameraTarget (source, source) fadeCamera(source, true, 2.0) else spawnPlayer (source, 1481.0855712891, -1771.2996826172, 18.795753479004, 0, 20, 0, 0) setPlayerMoney (source, 40000) setCameraTarget (source, source) fadeCamera(source, true, 2.0) setPlayerTeam( source, getTeamFromName('Gms Team') ) setElementData( source, 'Occupation17', 'Gms Team' ) setElementData( source, 'Job', 'Gms Team' ) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) local account = getPlayerAccount (source) if not (isGuestAccount (account)) then local x,y,z = getElementPosition (source) setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source))) setAccountData (account, "funmodev2-skin", tostring (getPedSkin (source))) setAccountData (account, "funmodev2-health", tostring (getElementHealth (source))) setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source))) setAccountData (account, "funmodev2-x", x) setAccountData (account, "funmodev2-y", y) setAccountData (account, "funmodev2-z", z) setAccountData (account, "funmodev2-int", tostring(getElementInterior (source))) setAccountData (account, "funmodev2-dim", tostring(getElementDimension (source))) setAccountData (account, "funmodev2-wantedlevel", tostring(getPlayerWantedLevel (source))) setAccountData (account, "funmodev2-Team", getTeamName(getPlayerTeam(source))) setAccountData (account, "gms-job", getElementData(source,"Job")) setAccountData (account, "gms-occupation", getElementData(source,"Occupation17")) if ( isPedDead(source) ) then return end savePlayerWeapons ( source ) end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth) savePlayerWeapons ( source ) end addEventHandler ("onPlayerWasted", getRootElement(), onWasted) function savePlayerWeapons ( player ) if not( isElement(player) ) then return end local account = getPlayerAccount (player) if (isGuestAccount (account)) then return end for i=0,12 do local weapon = getPedWeapon (player, i) or 0 local ammo = getPedTotalAmmo (player, i) or 0 setAccountData (account, "funmodev2-weaponID"..tostring(i), tostring(weapon)) setAccountData (account, "funmodev2-weaponAmmo"..tostring(i), tostring(ammo)) end end function onPlayerSpawn( ) local account = getPlayerAccount(source) if (account) and not (isGuestAccount(account)) then for i=0,12 do local weapon = getAccountData (account, "funmodev2-weaponID"..tostring(i)) or 0 local ammo = getAccountData (account, "funmodev2-weaponAmmo"..tostring(i)) or 0 giveWeapon(source, tonumber(weapon), tonumber(ammo)) end end end addEventHandler("onPlayerSpawn", root, onPlayerSpawn )
  23. السلام عليكم و رحمه الله و بركاته شباب الكود ذا ما يحفظ الالمنت ليش ! لو تقدرو تساعجوني لا تقصرو لاهنت ذذ function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "funmodev2-money") if (accountData) then local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money") local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin") local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health") local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor") local playerX = getAccountData (theCurrentAccount, "funmodev2-x") local playerY = getAccountData (theCurrentAccount, "funmodev2-y") local playerZ = getAccountData (theCurrentAccount, "funmodev2-z") local playerInt = getAccountData (theCurrentAccount, "funmodev2-int") local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim") local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") local playerTeam = getAccountData (theCurrentAccount, "funmodev2-Team") local playerJob = getAccountData (theCurrentAccount, "gms-job") local playerOccupation = getAccountData (theCurrentAccount, "gms-occupation") spawnPlayer (source, tonumber(playerX), tonumber(playerY), tonumber(playerZ) +1, 0, tonumber(playerSkin), tonumber(playerInt), tonumber(playerDim)) setPlayerMoney (source, tonumber(playerMoney)) setPlayerTeam(source, getTeamFromName(playerTeam)) setElementData(source, "Job", tostring(playerJob)) setElementData(source, "Occupation17", tostring(playerOccupation)) setTimer (setElementHealth, 500, 1, source, tonumber(playerHealth)) setTimer (setPedArmor, 500, 1, source, tonumber(playerArmor)) setTimer (setPlayerWantedLevel, 500, 1, source, tonumber(playerWanted)) setCameraTarget (source, source) fadeCamera(source, true, 2.0) else spawnPlayer (source, 1481.0855712891, -1771.2996826172, 18.795753479004, 0, 20, 0, 0) setPlayerMoney (source, 40000) setCameraTarget (source, source) fadeCamera(source, true, 2.0) setPlayerTeam( source, getTeamFromName('Gms Team') ) setElementData( source, 'Occupation17', 'Gms Team' ) setElementData( source, 'Job', 'Gms Team' ) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) local account = getPlayerAccount (source) if not (isGuestAccount (account)) then local x,y,z = getElementPosition (source) setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source))) setAccountData (account, "funmodev2-skin", tostring (getPedSkin (source))) setAccountData (account, "funmodev2-health", tostring (getElementHealth (source))) setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source))) setAccountData (account, "funmodev2-x", x) setAccountData (account, "funmodev2-y", y) setAccountData (account, "funmodev2-z", z) setAccountData (account, "funmodev2-int", tostring(getElementInterior (source))) setAccountData (account, "funmodev2-dim", tostring(getElementDimension (source))) setAccountData (account, "funmodev2-wantedlevel", tostring(getPlayerWantedLevel (source))) setAccountData (account, "funmodev2-Team", getTeamName(getPlayerTeam(source))) setAccountData (account, "gms-job", getElementData(source,"Job")) setAccountData (account, "gms-occupation", getElementData(source,"Occupation17")) if ( isPedDead(source) ) then return end savePlayerWeapons ( source ) end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth) savePlayerWeapons ( source ) end addEventHandler ("onPlayerWasted", getRootElement(), onWasted) function savePlayerWeapons ( player ) if not( isElement(player) ) then return end local account = getPlayerAccount (player) if (isGuestAccount (account)) then return end for i=0,12 do local weapon = getPedWeapon (player, i) or 0 local ammo = getPedTotalAmmo (player, i) or 0 setAccountData (account, "funmodev2-weaponID"..tostring(i), tostring(weapon)) setAccountData (account, "funmodev2-weaponAmmo"..tostring(i), tostring(ammo)) end end function onPlayerSpawn( ) local account = getPlayerAccount(source) if (account) and not (isGuestAccount(account)) then for i=0,12 do local weapon = getAccountData (account, "funmodev2-weaponID"..tostring(i)) or 0 local ammo = getAccountData (account, "funmodev2-weaponAmmo"..tostring(i)) or 0 giveWeapon(source, tonumber(weapon), tonumber(ammo)) end end end addEventHandler("onPlayerSpawn", root, onPlayerSpawn )
×
×
  • Create New...