khaledmhammed Posted August 31, 2015 Share Posted August 31, 2015 السسلام عليكم اخوي سفاح ذا كود عدلته لي قبل وتمام انحلت مشكله السكن لكن الان صار لا سويت سباون مايحفظ الاسلحة السباون ذا صار يكنسل الاسلحة : ( hospitalsTable = { { 1179.22803,-1323.52087,14.15908}, { 1606.85559,1822.30957,10.82031}, { -2659.85767,632.98505,14.45313}, } function spawn() local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(source) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end spawnPlayer ( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3] ) end addEventHandler("onPlayerWasted", getRootElement(),spawn) addEventHandler("onPlayerLogin", root, function(_, account) if not getAccountData(account, "FirstTime") then outputChatBox("You're playing for the first time!", source, 0, 255, 0) setAccountData(account, "FirstTime", true) else outputChatBox("This is not the first time for you!", source, 255, 0, 0) end end) addEventHandler( "onPlayerQuit", root, function( ) local PlayerAcc = getPlayerAccount ( source ) if ( PlayerAcc and not isGuestAccount ( PlayerAcc ) and getPlayerTeam ( source ) ) then setAccountData ( PlayerAcc, "PlayerTeam", getTeamName ( getPlayerTeam ( source ) )) setAccountData ( PlayerAcc, "skin", getElementModel ( source ) ) end end ) اتمنى الحل Link to comment
0m4r Posted August 31, 2015 Share Posted August 31, 2015 انت موب مسوي داتا للاسلحة اصلا Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 انت موب مسوي داتا للاسلحة اصلا حفظ السلاح موجود بس السباون ذا يكنسل السلاح Link to comment
0m4r Posted August 31, 2015 Share Posted August 31, 2015 انت موب مسوي داتا للاسلحة اصلا حفظ السلاح موجود بس السباون ذا يكنسل السلاح انت مسوي حفظ للسكين والتيم بس Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 انت موب مسوي داتا للاسلحة اصلا حفظ السلاح موجود بس السباون ذا يكنسل السلاح انت مسوي حفظ للسكين والتيم بس ياخخخي ادري لكن السباون يحذف السلاح لا رسبنت يختفي السلااااااااااح من الاعب Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 اوة مانتبهت ل ردك كلاسيك تبع الاخ ذا كيلير addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) end ) addEventHandler("onPlayerSpawn", root, function () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) end end ) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end Link to comment
0m4r Posted August 31, 2015 Share Posted August 31, 2015 استخدم setAccountData getAccountData Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 استخدم setAccountData getAccountData لاحول ولا قوة الا بالله انا عندي الاسلحة ذا يحفظ و معي كذالك سيف سيستم للاسلحة وظحفظ تمام لكن لو رسبنت ب الرسباون اللي فوق يلغي السلاح المشكله من السباون مو من الحفظ Link to comment
0m4r Posted August 31, 2015 Share Posted August 31, 2015 استخدم setAccountData getAccountData لاحول ولا قوة الا بالله انا عندي الاسلحة ذا يحفظ و معي كذالك سيف سيستم للاسلحة وظحفظ تمام لكن لو رسبنت ب الرسباون اللي فوق يلغي السلاح المشكله من السباون مو من الحفظ طيب مدام عندك سيف سيستم وش تبي بالكود اللي فوق Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 استخدم setAccountData getAccountData لاحول ولا قوة الا بالله انا عندي الاسلحة ذا يحفظ و معي كذالك سيف سيستم للاسلحة وظحفظ تمام لكن لو رسبنت ب الرسباون اللي فوق يلغي السلاح المشكله من السباون مو من الحفظ طيب مدام عندك سيف سيستم وش تبي بالكود اللي فوق المشكله وانا اخوك السباون اللي فوق اللي طرحته بالموضوع ذا لو ترسبن فيه يلغي الاسلحة ليه مادري Link to comment
0m4r Posted August 31, 2015 Share Posted August 31, 2015 طيب توني استوعب معليش انت الحين تبي لما يموت يرسبن في الأماكن اللي حاطه صح ويرجع له الاسلحة اللي كانت معه ؟ Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 لا الرسباون تمام لكن لو الاعب معه سلاح ومات لو رسبن ب السباون اللي فوق تختفي اسلحته هو كان تمام بس المبرمج سفاح عدل لي عليه حفظ تيم و سكن و الخ وحصلت لي ذي المشكه ان الاعب لو رسبن تختفي اسلحتة لكن لو طلع من سيرفر ودخل بدون مايرسبن ماتختفي ذي الاكواد حفظ سلاح 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 R = getAccountData (theCurrentAccount, "funmodev2-R") local G = getAccountData (theCurrentAccount, "funmodev2-G") local B = getAccountData (theCurrentAccount, "funmodev2-B") 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") spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) setPlayerMoney (source, playerMoney) setTimer (setElementHealth, 500, 1, source, playerHealth) setTimer (setPedArmor, 500, 1, source, playerArmor) setTimer (setPlayerWantedLevel, 500, 1, source, playerWanted) setCameraTarget (source, source) fadeCamera(source, true, 2.0) setPlayerNametagColor (source, R, G, B) else setPlayerMoney (source, 200) setCameraTarget (source, source) fadeCamera(source, true, 2.0) setPlayerNametagColor (source, 255, 255, 255) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onLogout () kickPlayer (source, nil, "Logging out is disallowed.") end addEventHandler ("onPlayerLogout", getRootElement(), onLogout) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then local x,y,z = getElementPosition (source) local r,g,b = getPlayerNametagColor (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-R", r) setAccountData (account, "funmodev2-G", g) setAccountData (account, "funmodev2-B", b) setAccountData (account, "funmodev2-x", x) setAccountData (account, "funmodev2-y", y) setAccountData (account, "funmodev2-z", z) setAccountData (account, "funmodev2-int", getElementInterior (source)) setAccountData (account, "funmodev2-dim", getElementDimension (source)) setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) addEventHandler ("onPlayerWasted", getRootElement(), onWasted) Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 طيب توني استوعب معليش انت الحين تبي لما يموت يرسبن في الأماكن اللي حاطه صح ويرجع له الاسلحة اللي كانت معه ؟ اي بالضبط ماتختفي لو رسبن Link to comment
0m4r Posted August 31, 2015 Share Posted August 31, 2015 جرب hospitalsTable = { { 1179.22803,-1323.52087,14.15908}, { 1606.85559,1822.30957,10.82031}, { -2659.85767,632.98505,14.45313}, } addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) minHospital = math.random ( #hospitalsTable ) spawnPlayer ( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3] ) end ) addEventHandler("onPlayerSpawn", root, function () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) end end ) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 لا متت اول مره يحفظ ولا موتت نفسي ثاني تختفي Link to comment
iMr.SFA7 Posted August 31, 2015 Share Posted August 31, 2015 hospitalsTable = { { 1179.22803,-1323.52087,14.15908}, { 1606.85559,1822.30957,10.82031}, { -2659.85767,632.98505,14.45313}, } addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) minHospital = math.random ( #hospitalsTable ) spawnPlayer ( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3] ) end ) addEventHandler("onPlayerSpawn", root, function () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) end end ) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 hospitalsTable = { { 1179.22803,-1323.52087,14.15908}, { 1606.85559,1822.30957,10.82031}, { -2659.85767,632.98505,14.45313}, } addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) minHospital = math.random ( #hospitalsTable ) spawnPlayer ( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3] ) end ) addEventHandler("onPlayerSpawn", root, function () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) end end ) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end سفاح يحفظ اول مرة لا متت ولا متت ثاني مايحفظ + السباون صار متلخبط مايودي لقرب مشفىى صار عشوائي كل شوي مكان Link to comment
iMr.SFA7 Posted August 31, 2015 Share Posted August 31, 2015 شغآل عندي سويت مليون آنتحآر يحفظ الأسلحة ذذذذ Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 شغآل عندي سويت مليون آنتحآر يحفظ الأسلحة ذذذذ اوما بجرب ثاني وردلكك Link to comment
0m4r Posted August 31, 2015 Share Posted August 31, 2015 + السباون صار متلخبط مايودي لقرب مشفىى صار عشوائي كل شوي مكان استخدم getDistanceBetweenPoints3D Link to comment
khaledmhammed Posted August 31, 2015 Author Share Posted August 31, 2015 تممم الافادة من سفاح اشكرك يعطيك العافية بعد اذنك وش المشكله هنا Ped = createPed(7, 2447.8935546875, -1962.7099609375, 13.546875, 180) setElementFrozen ( Ped, true ) addEventHandler('onClientPedDamage',Ped,cancelEvent) local skins = { "(skin Dealer Weapon: 7)" } GUIEditor = { label = {}, button = {}, window = {}, memo = {}, gridlist = {} } GUIEditor.window = guiCreateWindow(345, 90, 379, 544, "Dealer Weapon Job", false) guiWindowSetSizable(GUIEditor.window, false) --GUIEditor.label = guiCreateLabel(9, 27, 275, 219, "", false, GUIEditor.window) --guiSetFont(GUIEditor.label, "default-bold-small") GUIEditor.memo = guiCreateMemo(13, 30, 356, 166, "يجب اخذ الوظيفة وايصال الطلبات لربح المال", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(54, 487, 94, 41, "Take Job", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(244, 487, 88, 41, "الغاء", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(10, 236, 357, 227, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "Personal selection", 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 Dealer Weapon: 7)" ) then triggerServerEvent ( "setBarcoWeapon", localPlayer, 7 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "Error: press Enter To your Skin Or press Exit", 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 ("MinerWeapon", true) addEventHandler ("MinerWeapon",root, pe) addEvent ( "barco_set_locationWeapon", true ) addEventHandler ( "barco_set_locationWeapon", 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" ) then triggerServerEvent ( "pizza_finishWeapon", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end function destroy ( ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end addEventHandler ("onClientPlayerVehicleExit",localPlayer,destroy) addEventHandler ( "onClientPlayerWasted", localPlayer,destroy) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {559}--1279.17859 -805.24109 86.12299 GUIEditor_Marker[1] = createMarker(2454.3662109375, -1973.693359375, 13.546875-1,"cylinder",2,245,0,0) -- السيارة GUIEditor_Marker[2] = createMarker(2447.8935546875, -1962.7099609375, 13.546875,"cylinder",3,245,0,0,0) -- الكلام فوق البيد local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(432, 152, 211, 297,"Dealer Weapon Job",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9, 22, 192, 228,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(9, 255, 81, 33,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(127, 255, 74, 33,"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 ) ) == 'Dealer Weapon' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( player ) setElementFrozen ( player, 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('gvoaWeapon', 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("Dealer Weapon Job", sx, sy, sx, sy, tocolor(245,0,0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("Dealer Weapon Job", sx, sy, sx, sy, tocolor(245,0,0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) addEventHandler("onClientResourceStart", resourceRoot, function() lvlpn = guiCreateWindow(373, 142, 286, 414, "", false) guiWindowSetSizable(lvlpn, false) guiWindowSetSizable(lvlpn,false) guiSetVisible(lvlpn,false) memo = guiCreateMemo(11, 228, 261, 176, "Leve-1 - 100\nLeve-2 - 200\nLeve-3 - 300\nLeve-4 - 400\nLeve-5 - 500\nLeve-6 - 600\nLeve-7 - 700\nLeve-8 - 800", false, lvlpn) label1 = guiCreateLabel(20, 57, 97, 15, "الـــمستوى الاول", false, lvlpn) guiLabelSetColor(label1, 227, 97, 51) label2 = guiCreateLabel(14, 82, 36, 15, "", false, lvlpn) guiLabelSetColor(label2, 253, 245, 24) levellabaln = guiCreateLabel(54, 81, 84, 16, "", false, lvlpn) label3 = guiCreateLabel(20, 111, 87, 15, "الــمستوى الثاني", false, lvlpn) guiLabelSetColor(label3, 227, 97, 51) label4 = guiCreateLabel(14, 136, 36, 16, "Level :", false, lvlpn) guiLabelSetColor(label4, 253, 245, 24) label5 = guiCreateLabel(57, 136, 84, 16, "", false, lvlpn) label6 = guiCreateLabel(193, 183, 69, 15, "تبقى :", false, lvlpn) guiLabelSetColor(label6, 254, 23, 23) label7 = guiCreateLabel(20, 32, 65, 25, "", false, lvlpn) label8 = guiCreateLabel(91, 32, 100, 25, "", false, lvlpn) label9 = guiCreateLabel(20, 183, 121, 15, "للوصول للمستوى الاخر", false, lvlpn) guiLabelSetColor(label8, 41, 175, 0) label11 = guiCreateLabel(145, 185, 48, 13, "0", false, lvlpn) end ) bindKey ( "F4", "down", function ( ) local player = getLocalPlayer () local playerTeam = getPlayerTeam ( player ) local getplayernameDiverjob = getPlayerName (player) local TeamName = getTeamName ( playerTeam ) local level = getElementData(localPlayer, "TotalpointDiverjob") or 0 if ( TeamName == "Dealer Weapon" ) then guiSetVisible ( lvlpn, not guiGetVisible ( lvlpn ) ) showCursor ( not isCursorShowing( ) ) guiSetText(label2, level) guiSetText(label7 , getplayernameDiverjob) if level >= 200 then guiSetText(levellabal11, "1") end if level >= 200 then guiSetText(levellabal11, "2") end if level >= 300 then guiSetText(levellabal11, "3") end if level >= 400 then guiSetText(levellabal11, "4") end if level >= 500 then guiSetText(levellabal11, "5") end if level >= 600 then guiSetText(levellabal11, "6") end if level >= 700 then guiSetText(levellabal11, "7") end if level >= 800 then guiSetText(levellabal11, "8") end end end ) function presskeystats(player) local player = getLocalPlayer() local playerTeam = getPlayerTeam ( player ) local TeamName = getTeamName ( playerTeam ) if ( TeamName == "Dealer Weapon" ) then guiSetVisible ( Diverstatswindow, not guiGetVisible ( Diverstatswindow ) ) showCursor ( not isCursorShowing( ) ) local TotalDiverjobpoint = getElementData(localPlayer, "TotalpointDiverjob") or 0 guiSetText(pointlabaln, TotalDiverjobpoint) local getplayernameDiverjob = getPlayerName (player) guiSetText(namelabaln, getplayernameDiverjob) if TotalDiverjobpoint >= 20 then Link to comment
iMr.SFA7 Posted August 31, 2015 Share Posted August 31, 2015 Ped = createPed(7, 2447.8935546875, -1962.7099609375, 13.546875, 180) setElementFrozen ( Ped, true ) addEventHandler('onClientPedDamage',Ped,cancelEvent) local skins = { "(skin Dealer Weapon: 7)" } GUIEditor = { label = {}, button = {}, window = {}, memo = {}, gridlist = {} } GUIEditor.window = guiCreateWindow(345, 90, 379, 544, "Dealer Weapon Job", false) guiWindowSetSizable(GUIEditor.window, false) --GUIEditor.label = guiCreateLabel(9, 27, 275, 219, "", false, GUIEditor.window) --guiSetFont(GUIEditor.label, "default-bold-small") GUIEditor.memo = guiCreateMemo(13, 30, 356, 166, "يجب اخذ الوظيفة وايصال الطلبات لربح المال", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(54, 487, 94, 41, "Take Job", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(244, 487, 88, 41, "الغاء", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(10, 236, 357, 227, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "Personal selection", 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 Dealer Weapon: 7)" ) then triggerServerEvent ( "setBarcoWeapon", localPlayer, 7 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "Error: press Enter To your Skin Or press Exit", 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 ("MinerWeapon", true) addEventHandler ("MinerWeapon",root, pe) addEvent ( "barco_set_locationWeapon", true ) addEventHandler ( "barco_set_locationWeapon", 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" ) then triggerServerEvent ( "pizza_finishWeapon", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end function destroy ( ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end addEventHandler ("onClientPlayerVehicleExit",localPlayer,destroy) addEventHandler ( "onClientPlayerWasted", localPlayer,destroy) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {559}--1279.17859 -805.24109 86.12299 GUIEditor_Marker[1] = createMarker(2454.3662109375, -1973.693359375, 13.546875-1,"cylinder",2,245,0,0) -- السيارة GUIEditor_Marker[2] = createMarker(2447.8935546875, -1962.7099609375, 13.546875,"cylinder",3,245,0,0,0) -- الكلام فوق البيد local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(432, 152, 211, 297,"Dealer Weapon Job",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9, 22, 192, 228,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(9, 255, 81, 33,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(127, 255, 74, 33,"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 ) ) == 'Dealer Weapon' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( player ) setElementFrozen ( player, 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('gvoaWeapon', 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("Dealer Weapon Job", sx, sy, sx, sy, tocolor(245,0,0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("Dealer Weapon Job", sx, sy, sx, sy, tocolor(245,0,0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) addEventHandler("onClientResourceStart", resourceRoot, function() lvlpn = guiCreateWindow(373, 142, 286, 414, "", false) guiWindowSetSizable(lvlpn, false) guiWindowSetSizable(lvlpn,false) guiSetVisible(lvlpn,false) memo = guiCreateMemo(11, 228, 261, 176, "Leve-1 - 100\nLeve-2 - 200\nLeve-3 - 300\nLeve-4 - 400\nLeve-5 - 500\nLeve-6 - 600\nLeve-7 - 700\nLeve-8 - 800", false, lvlpn) label1 = guiCreateLabel(20, 57, 97, 15, "الـــمستوى الاول", false, lvlpn) guiLabelSetColor(label1, 227, 97, 51) label2 = guiCreateLabel(14, 82, 36, 15, "", false, lvlpn) guiLabelSetColor(label2, 253, 245, 24) levellabaln = guiCreateLabel(54, 81, 84, 16, "", false, lvlpn) label3 = guiCreateLabel(20, 111, 87, 15, "الــمستوى الثاني", false, lvlpn) guiLabelSetColor(label3, 227, 97, 51) label4 = guiCreateLabel(14, 136, 36, 16, "Level :", false, lvlpn) guiLabelSetColor(label4, 253, 245, 24) label5 = guiCreateLabel(57, 136, 84, 16, "", false, lvlpn) label6 = guiCreateLabel(193, 183, 69, 15, "تبقى :", false, lvlpn) guiLabelSetColor(label6, 254, 23, 23) label7 = guiCreateLabel(20, 32, 65, 25, "", false, lvlpn) label8 = guiCreateLabel(91, 32, 100, 25, "", false, lvlpn) label9 = guiCreateLabel(20, 183, 121, 15, "للوصول للمستوى الاخر", false, lvlpn) guiLabelSetColor(label8, 41, 175, 0) label11 = guiCreateLabel(145, 185, 48, 13, "0", false, lvlpn) end ) bindKey ( "F4", "down", function ( ) local player = getLocalPlayer () local playerTeam = getPlayerTeam ( player ) local getplayernameDiverjob = getPlayerName (player) local TeamName = getTeamName ( playerTeam ) if ( TeamName == "Dealer Weapon" ) then guiSetVisible ( lvlpn, not guiGetVisible ( lvlpn ) ) showCursor ( not isCursorShowing( ) ) local level = getElementData(localPlayer, "TotalpointDiverjob") or 0 if ( level ) then guiSetText(label2, level) guiSetText(label7 , getplayernameDiverjob) if level >= 100 then guiSetText(label2, "1") end if level >= 200 then guiSetText(label2, "2") end if level >= 300 then guiSetText(label2, "3") end if level >= 400 then guiSetText(label2, "4") end if level >= 500 then guiSetText(label2, "5") end if level >= 600 then guiSetText(label2, "6") end if level >= 700 then guiSetText(label2, "7") end if level >= 800 then guiSetText(label2, "8") end end end end ) 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