Jump to content

кιηg-αвα∂у

Members
  • Posts

    396
  • Joined

  • Last visited

Everything posted by кιηg-αвα∂у

  1. طيب فينهي مهي موجوده في الكود حطيت الكود ناقص شوف احين
  2. السلام عليكم ___________________________________- السؤال الثاني عن outputChatBox كيف احدد الكلام يطلع للكل او للاعب اليي شراء او اخذ الشي المحدد __________________________________- السؤال الثالث عندي بوابة ماتفتح الى لقروب معين كيف اخلي البوابة تفتح من القريب انا ادري اني اسوي ماركر مخفي وسويت وحطيت onMarkerHit و onMarkerLeave بس ماضبط ممكن تشوفون الكود marker = createMarker ( 226.4, 1873.5, 15.4, "cylinder", 5, 0, 0, 0 ) local doorState = true local x1,y1,z1 = 226.4, 1873.5, 15.4 local x2,y2,z2 = 226.4, 1871.5, 15.4 chinaTgate = createObject ( 2930, x1,y1,z1) function op() moveObject ( chinaTgate, 2000, x2,y2,z2) end function cl() moveObject ( chinaTgate, 800, x1,y1,z1 ) end function checkAdmin(player,key,state) if ( state == "down" ) then local accName = getAccountName(getPlayerAccount(player)) local isAdmin = isObjectInACLGroup ("user."..accName, aclGetGroup ( "King-abady" ) ) if ( isAdmin ) then if ( doorState ) then op() else cl() end doorState = not doorState end end end function onStart ( ) for i,v in ipairs(getElementsByType( "player" )) do bindKey(v,"X","down",checkAdmin) end end addEventHandler ( "onResourceStart", getResourceRootElement(), onStart ) function onJoin() bindKey(source,"X","down",checkAdmin) end addEventHandler ( "onPlayerJoin", getRootElement(), onJoin) addEventHandler("onClientMarkerHit", marker, function ( ) bindKey(v,"X","down",checkAdmin) end ) addEventHandler("onClientMarkerLeave", marker, function ( ) unbindKey(v,"X","down",checkAdmin) end )
  3. كودك مو شغال وش الخطأ في هاذه x,y,z = 1520.0999755859,2754,10.60000038147 rx,ry,rz = 0,0,90 serial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" MyCar = createVehicle(562,x,y,z,rx,ry,rz) addEventHandler("onVehicleEnter",root, function (player,seat) if ( source == MyCar ) then if ( seat == 0 ) then if ( getPlayerSerial(player) == serial ) then outputChatBox("Welcome Back",player,0,255,0) else cancelEvent ( ) outputChatBox("This Car is Not Your",player,255,0,0) end else outputChatBox("This Car is Not Your",player,255,0,0) end end end )
  4. في كنسل https://wiki.multitheftauto.com/wiki/CancelEvent حاولت اسويه بس ماضبط ممكن تسويه لي
  5. الكود شغال مشكور بس المشكلة يمدي اي احد يركب وينزلني بعدين الكود يطلعه من السيارة يعني لما تركب ويكون سريالك غير يطلعك انا ابيه يشيك على سريالك اذا غير يكنسل الوضيفة ممكن تعدله x,y,z = 1520.0999755859,2754,10.60000038147 rx,ry,rz = 0,0,90 serial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" MyCar = createVehicle(562,x,y,z,rx,ry,rz) addEventHandler("onVehicleEnter",root, function (player,seat) if ( source == MyCar ) then if ( getPlayerSerial(player) == serial ) then outputChatBox("Welcome Back",player,0,255,0) else removePedFromVehicle(player) outputChatBox("This Car is Not Your",player,255,0,0) end end end )
  6. كنت حاطه قبل true بس ماضبط بجرب كودك اغير شي في car = createVehicle( ... ) ?
  7. السلام عليكم ممكن تشوفون وش الخطأ في الكود ؟؟ myVehicles = { [470]=false,[560]=false,[562]=false,[487]=false } mySkins = { [115]=true } function enterVehicle ( thePlayer, seat, jacked ) if ( myVehicles[getElementModel ( source )] ) and ( not mySkins[getElementModel ( thePlayer )] ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "ممتلكات خاصة لايمكنك ركوب السيارة", thePlayer ) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle )
  8. ممكن تشوفون وش الخطأ المود مايشتغل كلينت GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} windowVehicleSelection = guiCreateWindow(471,269,150,208,"vehicles by king-abady",false) gridlistVehicleSelection = guiCreateGridList(9,23,132,150,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) close = guiCreateButton(14,177,61,22,"أغلاق",false,GUIEditor_Window[1]) buttonCreate = guiCreateButton(79,177,59,22,"أختيار",false,GUIEditor_Window[1]) addEvent("onShow",true) addEventHandler("onShow",root, function() guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end) function populateGridlist() local rootnode = xmlLoadFile("vehicles.xml") if rootnode then for _,group in ipairs(xmlNodeGetChildren(rootnode)) do local row = guiGridListAddRow(gridlistVehicleSelection) local name = xmlNodeGetAttribute(group,"type") guiGridListSetItemText(gridlistVehicleSelection,row,1,name,true,false) for _,vehicle in ipairs(xmlNodeGetChildren(group)) do row = guiGridListAddRow(gridlistVehicleSelection) name = xmlNodeGetAttribute(vehicle,"name") local id = xmlNodeGetAttribute(vehicle,"id") guiGridListSetItemText(gridlistVehicleSelection,row,1,name,false,false) guiGridListSetItemText(gridlistVehicleSelection,row,2,getVehicleType(tonumber(id)),false,false) guiGridListSetItemData(gridlistVehicleSelection,row,1,tostring(id)) end end xmlUnloadFile(rootnode) end end addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == close ) then setTimer(guiSetVisible,100,1,windowVehicleSelection,false) showCursor(false)-- end end) function createVehicleHandler(button,state) if button == "left" and state == "up" then local row,col = guiGridListGetSelectedItem(gridlistVehicleSelection) if row and col and row ~= -1 and col ~= -1 then local selected = guiGridListGetItemData(gridlistVehicleSelection,row,col) selected = tonumber(selected) local rotz = getPedRotation(getLocalPlayer()) local x,y,z = getElementPosition(getLocalPlayer()) x = x + ( math.cos ( math.rad ( rotz+90 ) ) * 3) y = y + ( math.sin ( math.rad ( rotz+90 ) ) * 3) if selected and x and y and z then triggerServerEvent("createVehicleFromGUI",getRootElement(),selected,x,y,z) guiSetVisible(windowVehicleSelection,false) showCursor(false,false) else outputChatBox("Invalid arguments.") end else -- otherwise, output a message to the player outputChatBox("Please select a vehicle.") end end end سيرفر local mark = createMarker (1472.6,2754.0,10.6, "cylinder", 0.5, 0, 255, 0, 0 ) addEventHandler("onMarkerHit",root, function (plr) if source == mark then triggerClientEvent(plr,"onShow",plr) end end ) فيشلي اكس ام ال <root> <group type="Emergency"> <vehicle id="416" name="Ambulance"/> <vehicle id="599" name="Police ranger"/> </group> <group type="Sports"> <vehicle id="562" name="Elegy" /> <vehicle id="560" name="Sultan" /> <vehicle id="559" name="Jester" /> <vehicle id="565" name="Flash" /> <vehicle id="477" name="ZR-350" /> </group> </root>
  9. السلام عليكم انا سويت لوحة فيها Gridlist قائمة Button وبايتون فيه قائمة سيارات xml وسويت ملف xml كيف اخلي السيرات الي في ملف يطلعون في القائمة واخلي البايتون لما نضغط عليه يعطي الاعب السيارة مثل الوحة الي في الفري روم هاذه ملف كلينت GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(471,269,150,208,"vehicles",false) GUIEditor_Grid[1] = guiCreateGridList(9,23,132,150,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Button[1] = guiCreateButton(14,177,61,22,"أغلاق",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(79,177,59,22,"أختيار",false,GUIEditor_Window[1]) addEvent("onShow",true) addEventHandler("onShow",root, function() guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == GUIEditor_Button[1] ) then setTimer(guiSetVisible,100,1,GUIEditor_Window[1],false) showCursor(false)-- end end) ملف vehicles.xml <catalog type="vehicle"> <vehicle id="562" name="Elegy" /> <vehicle id="560" name="Sultan" /> <vehicle id="559" name="Jester" /> <vehicle id="565" name="Flash" /> <vehicle id="477" name="ZR-350" /> </catalog>
  10. كفووووووووووووووووو والله تابل مشكور والله يعطيك الف عافيه
  11. عدلت الميتا الخطأ بين ربط ملف سيرفر معه كلينت بس مو عارف وين
  12. تابل ممكن تضيفني عشان نتواصل اسرع [email protected] او كلمني هنا http://sync.in/YGRyMG2iKl
  13. <meta> <info name="Weapon Shop" author="Ninguem , Stanley Sathler" description="" version="2.0.1" type="script"></info> <script src="client.lua" type="client"></script> <file src="images/1.png" /> <file src="images/2.png" /> <file src="images/3.png" /> <file src="images/4.png" /> <file src="images/5.png" /> <file src="images/20.png" /> <file src="images/25.png" /> <file src="images/26.png" /> <file src="images/27.png" /> <file src="images/28.png" /> <file src="images/29.png" /> <file src="images/30.png" /> <file src="images/31.png" /> <file src="images/32.png" /> <file src="images/33.png" /> <file src="images/H.png" /> <file src="images/A.png" /> <file src="images/S.png" /> <file src="images/J.png" /> <file src="images/M.png" /> </meta> وش دخل الميتا اتوقع الخطأ في ربط سيرفر معه كلينت
  14. تابل حطيت الأكواد حقتك ولما اضغط على شي ابي اشتريه مايصير شي ويطلع كذا [2012-10-12 23:07:09] ERROR: Client triggered serverside event onClientBuyWeapon, but event is not added serverside
  15. السلام عليكم ممكن تشوفون المشكلة وتحلونها الأكواد خذتها من هنا https://forum.multitheftauto.com/viewtopic.php?f=119&t=47731 هاذه مللف كلينت ---Client--- GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(119,119,815,504,"ShopWeapon By KING-ABADY {Saudi}~{Zombie}",false) -- Below, not original price. It's just strings to the buttons. If you must change the weapon price, go to server-side script. -- Abaixo, as variáveis não são o preço real das armas. É apenas as strings para serem escritas nos botões. Se quer mudar o preço, mude no arquivo server-side. local price_chainsaw = "400" local price_m4 = "250" local price_ak = "200" local price_tec9 = "450" local price_mp5 = "150" local price_knife = "500" local price_uzi = "400" local price_sniper = "250" local price_shotgun = "200" local price_spaz12 = "650" local price_deserteagle = "150" local price_molotovcocktails= "1.000" local price_rifle = "100" local price_satchel = "1.800" local price_grenade = "1.500" GUIEditor_Image[1] = guiCreateStaticImage(203,162,85,78,"images/1.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(28,167,106,68,"images/2.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(505,390,117,61,"images/3.png",false,GUIEditor_Window[1]) GUIEditor_Image[4] = guiCreateStaticImage(684,368,95,87,"images/4.png",false,GUIEditor_Window[1]) GUIEditor_Image[5] = guiCreateStaticImage(60,269,88,78,"images/5.png",false,GUIEditor_Window[1]) GUIEditor_Image[6] = guiCreateStaticImage(199,270,86,81,"images/20.png",false,GUIEditor_Window[1]) GUIEditor_Image[7] = guiCreateStaticImage(320,282,135,59,"images/25.png",false,GUIEditor_Window[1]) GUIEditor_Image[8] = guiCreateStaticImage(541,266,70,84,"images/26.png",false,GUIEditor_Window[1]) GUIEditor_Image[9] = guiCreateStaticImage(32,403,125,66,"images/28.png",false,GUIEditor_Window[1]) GUIEditor_Image[10] = guiCreateStaticImage(189,377,129,87,"images/29.png",false,GUIEditor_Window[1]) GUIEditor_Image[11] = guiCreateStaticImage(336,400,117,63,"images/27.png",false,GUIEditor_Window[1]) GUIEditor_Image[12] = guiCreateStaticImage(326,172,136,62,"images/30.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(9,149,803,15,"___________________________________________________________________________________________________________________",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0,0,255) GUIEditor_Label[2] = guiCreateLabel(9,258,803,15,"___________________________________________________________________________________________________________________",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],0,255,0) GUIEditor_Image[13] = guiCreateStaticImage(493,171,153,56,"images/31.png",false,GUIEditor_Window[1]) GUIEditor_Image[14] = guiCreateStaticImage(652,273,127,70,"images/32.png",false,GUIEditor_Window[1]) GUIEditor_Image[15] = guiCreateStaticImage(683,166,113,70,"images/33.png",false,GUIEditor_Window[1]) btn_buy_deserteagle = guiCreateButton(61,240,83,23,"150$",false,GUIEditor_Window[1]) btn_buy_knife = guiCreateButton(200,239,83,23,"500$",false,GUIEditor_Window[1]) btn_buy_ak = guiCreateButton(359,239,83,23,"200$",false,GUIEditor_Window[1]) btn_buy_m4 = guiCreateButton(546,239,83,23,"250$",false,GUIEditor_Window[1]) btn_buy_mb5 = guiCreateButton(707,239,83,23,"150$",false,GUIEditor_Window[1]) btn_buy_grenade = guiCreateButton(58,352,83,23,"1500$",false,GUIEditor_Window[1]) btn_buy_uzi = guiCreateButton(200,352,83,23,"400$",false,GUIEditor_Window[1]) btn_buy_rifle = guiCreateButton(360,352,83,23,"100$",false,GUIEditor_Window[1]) btn_buy_molotovcocktails = guiCreateButton(546,351,83,23,"1000$",false,GUIEditor_Window[1]) btn_buy_tec9 = guiCreateButton(709,350,70,23,"450$",false,GUIEditor_Window[1]) btn_buy_spaz12 = guiCreateButton(61,467,83,23,"650$",false,GUIEditor_Window[1]) btn_buy_sniper = guiCreateButton(200,464,83,23,"250$",false,GUIEditor_Window[1]) btn_buy_shotgun = guiCreateButton(361,461,83,23,"200$",false,GUIEditor_Window[1]) btn_buy_chainsaw = guiCreateButton(547,460,83,23,"400$",false,GUIEditor_Window[1]) btn_buy_satchel = guiCreateButton(708,460,83,23,"1800$",false,GUIEditor_Window[1]) addEventHandler("onClientGUIClick", btn_buy_chainsaw, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_m4, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_ak, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_tec9, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_mp5, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_knife, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_uzi, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_sniper, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_shotgun, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_spaz12, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_deserteagle, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_molotovcocktails, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_rifle, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_satchel, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_grenade, BuyWeapon) guiWindowSetSizable(ShopWindow,false) guiSetVisible(ShopWindow,false) end addEventHandler("onClientResourceStart", getRootElement(), CreateShopWindow) function BuyWeapon(button, state) if (button == "left") then if(source == btn_buy_chainsaw) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_chainsaw") elseif(source == btn_buy_m4) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_m4") elseif(source == btn_buy_ak) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_ak") elseif(source == btn_buy_tec9) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_tec9") elseif(source == btn_buy_mp5) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_mp5") elseif(source == btn_buy_knife) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_knife") elseif(source == btn_buy_uzi) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_uzi") elseif(source == btn_buy_sniper) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_sniper") elseif(source == btn_buy_shotgun) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_shotgun") elseif(source == btn_buy_spaz12) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_spaz12") elseif(source == btn_buy_deserteagle) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_deserteagle") elseif(source == btn_buy_molotovcocktails) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_molotovcocktails") elseif(source == btn_buy_rifle) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_rifle") elseif(source == btn_buy_satchel) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_satchel") elseif(source == btn_buy_grenade) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_grenade") end end end GUIEditor_Image[16] = guiCreateStaticImage(45,19,122,110,"images/H.png",false,GUIEditor_Window[1]) GUIEditor_Image[17] = guiCreateStaticImage(330,16,123,119,"images/A.png",false,GUIEditor_Window[1]) GUIEditor_Image[18] = guiCreateStaticImage(486,15,131,121,"images/J.png",false,GUIEditor_Window[1]) GUIEditor_Image[19] = guiCreateStaticImage(187,17,124,117,"images/M.png",false,GUIEditor_Window[1]) GUIEditor_Image[20] = guiCreateStaticImage(653,13,129,127,"images/S.png",false,GUIEditor_Window[1]) GUIEditor_Button[16] = guiCreateButton(63,125,82,27,"1000$",false,GUIEditor_Window[1]) GUIEditor_Button[17] = guiCreateButton(209,126,82,27,"2000$",false,GUIEditor_Window[1]) GUIEditor_Button[18] = guiCreateButton(355,125,82,27,"1500$",false,GUIEditor_Window[1]) GUIEditor_Button[19] = guiCreateButton(514,125,82,27,"2000$",false,GUIEditor_Window[1]) GUIEditor_Button[20] = guiCreateButton(677,125,82,27,"3000$",false,GUIEditor_Window[1]) GUIEditor_Label[3] = guiCreateLabel(10,371,804,22,"___________________________________________________________________________________________________________________",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],255,0,0) ---Server--- function BuyWeaponOnServer(weapon_name) player_money = getPlayerMoney(source) player_account = getPlayerAccount(source) local price_chainsaw = "400" local price_m4 = "250" local price_ak = "200" local price_tec9 = "450" local price_mp5 = "150" local price_knife = "500" local price_uzi = "400" local price_sniper = "250" local price_shotgun = "200" local price_spaz12 = "650" local price_deserteagle = "150" local price_molotovcocktails= "1.000" local price_rifle = "100" local price_satchel = "1.800" local price_grenade = "1.500" if(getAccountData(player_account, "GunLicense") == true) then if(weapon_name == "weapon_chainsaw") then if(player_money >= tonumber(price_chainsaw)) then giveWeapon(source, 9) takePlayerMoney(source, tonumber(price_chainsaw)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_m4") then if(player_money >= tonumber(price_m4)) then giveWeapon(source, 31, 450) takePlayerMoney(source, tonumber(price_m4)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_ak") then if(player_money >= tonumber(price_ak)) then giveWeapon(source, 30, 450) takePlayerMoney(source, tonumber(price_ak)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_tec9") then if(player_money >= tonumber(price_tec9)) then giveWeapon(source, 32, 450) takePlayerMoney(source, tonumber(price_tec9)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_mp5") then if(player_money >= tonumber(price_mp5)) then giveWeapon(source, 29, 450) takePlayerMoney(source, tonumber(price_mp5)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_knife") then if(player_money >= tonumber(price_knife)) then giveWeapon(source, 4) takePlayerMoney(source, tonumber(price_knife)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_uzi") then if(player_money >= tonumber(price_uzi)) then giveWeapon(source, 28, 450) takePlayerMoney(source, tonumber(price_uzi)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_sniper") then if(player_money >= tonumber(price_sniper)) then giveWeapon(source, 34, 450) takePlayerMoney(source, tonumber(price_sniper)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_shotgun") then if(player_money >= tonumber(price_shotgun)) then giveWeapon(source, 25, 450) takePlayerMoney(source, tonumber(price_shotgun)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_spaz12") then if(player_money >= tonumber(price_spaz12)) then giveWeapon(source, 27, 450) takePlayerMoney(source, tonumber(price_spaz12)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_deserteagle") then if(player_money >= tonumber(price_deserteagle)) then giveWeapon(source, 24, 450) takePlayerMoney(source, tonumber(price_deserteagle)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_molotovcocktails") then if(player_money >= tonumber(price_molotovcocktails)) then giveWeapon(source, 18, 10) takePlayerMoney(source, tonumber(price_molotovcocktails)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_rifle") then if(player_money >= tonumber(price_rifle)) then giveWeapon(source, 33, 200) takePlayerMoney(source, tonumber(price_rifle)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_satchel") then if(player_money >= tonumber(price_satchel)) then giveWeapon(source, 39, 10) takePlayerMoney(source, tonumber(price_satchel)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_grenade") then if(player_money >= tonumber(price_grenade)) then giveWeapon(source, 16, 10) takePlayerMoney(source, tonumber(price_grenade)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end end end end addEvent("onClientBuyWeapon", true) addEventHandler("onClientBuyWeapon", getRootElement(), BuyWeaponOnServer)
  16. كلنت احطها تتحت البل ولا وين ؟ مكتوب في ردي الي فوق كل شي ماضبط الكود
  17. getClientServerName ( ) بس لازم تحط الاكواد الي فوق في محلها الصحيح كلنت احطها تتحت البل ولا وين ؟
  18. جرب طريقتي يمكن تنفع انا سويتهم على كل شي وضبط بس بجرب طريقتك في اسم السيرفر بس ابي اعرف اسم السيرفر شو نكتب مثلا الي يجيب الأسم PlayerName الي يجيب الدرع PedArmor بس اسم السيرفر شو نكتب عشان يضبط ؟
  19. خلاص ضبط معي كود حسن في كل شي الى اسم التيم + اسم السيرفر
  20. جاري التجربة + طيب مافي كود لملف سيرفر ؟
  21. السلام عليكم عندي اكواد 1-الي يجيب الأسم 2-الي يجيب المال 3-الي يجيب الصحة 4-الي يجيب الدرع 5-الي يجيب السريال 6-الي يجيب البنج مشكلت الكودات انهم يجيبونهم لما تكتب في اف8 انا ابقاهم على ليبل Label ممكن تحطونهم هنا وشكراً
  22. السلام عليكم انا سويت شوب بي الأكواد حقتك بس ماضبط ممكن تعلمني شو المشكلة ؟ ملف كلينت function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "imagens/logo.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) guiSetFont ( mainBackgroundLabel, newFont ) guiSetEnabled ( mainBackgroundLabel, true ) return mainBackground end GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} ShopWindow = guiCreateWindow(220,147,817,500,"ShopWeapon By KING-ABADY",false) GUIEditor_Label[1] = guiCreateLabel(134,27,665,23,"Server Name ( ) اسم السيرفر",false,ShopWindow) GUIEditor_Label[2] = guiCreateLabel(297,58,409,20,"Nick Name ( ) اسمك المستعار",false,ShopWindow) GUIEditor_Label[3] = guiCreateLabel(306,96,327,25,"Your Money ( ) اموالك",false,ShopWindow) btn_buy_license = guiCreateButton(291,122,269,24,"ترخيص شراء اسلحة",false,ShopWindow) -- Below, not original price. It's just strings to the buttons. If you must change the weapon price, go to server-side script. -- Abaixo, as vari?veis n?o s?o o preço real das armas. E apenas as strings para serem escritas nos bot?es. Se quer mudar o preço, mude no arquivo server-side. local price_chainsaw = "2.500" local price_m4 = "2.500" local price_ak = "2.500" local price_tec9 = "2.500" local price_mp5 = "2.500" local price_knife = "2.500" local price_uzi = "2.500" local price_sniper = "2.500" local price_shotgun = "2.500" local price_spaz12 = "2.500" local price_deserteagle = "150" local price_molotovcocktails= "2.500" local price_rifle = "2.500" local price_satchel = "2.500" local price_grenade = "2.500" btn_buy_deserteagle = guiCreateButton(61,240,83,23,"150$",false,ShopWindow) btn_buy_knife = guiCreateButton(200,239,83,23,"500$",false,ShopWindow) btn_buy_ak = guiCreateButton(359,239,83,23,"200$",false,ShopWindow) btn_buy_m4 = guiCreateButton(546,239,83,23,"250$",false,ShopWindow) btn_buy_mp5 = guiCreateButton(707,239,83,23,"150$",false,ShopWindow) btn_buy_grenade = guiCreateButton(58,352,83,23,"1500$",false,ShopWindow) btn_buy_chainsaw = guiCreateButton(200,352,83,23,"400$",false,ShopWindow) btn_buy_shotgun = guiCreateButton(360,352,83,23,"200$",false,ShopWindow) btn_buy_molotovcocktails = guiCreateButton(546,351,83,23,"1000$",false,ShopWindow) btn_buy_tec9 = guiCreateButton(709,350,70,23,"450$",false,ShopWindow) btn_buy_spaz12 = guiCreateButton(61,467,83,23,"650$",false,ShopWindow) btn_buy_sniper = guiCreateButton(200,464,83,23,"250$",false,ShopWindow) btn_buy_rifle = guiCreateButton(361,461,83,23,"100$",false,ShopWindow) btn_buy_uzi = guiCreateButton(547,460,83,23,"400$",false,ShopWindow) btn_buy_satchel = guiCreateButton(708,460,83,23,"1800$",false,ShopWindow) addEventHandler("onClientGUIClick", btn_buy_chainsaw, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_m4, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_ak, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_tec9, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_mp5, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_knife, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_uzi, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_sniper, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_shotgun, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_spaz12, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_deserteagle, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_molotovcocktails, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_rifle, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_satchel, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_grenade, BuyWeapon) addEventHandler("onClientGUIClick", btn_buy_license, BuyLicense) GUIEditor_Image[1] = guiCreateStaticImage(203,162,85,78,"imagens/1.png",false,ShopWindow) GUIEditor_Image[2] = guiCreateStaticImage(28,167,106,68,"imagens/2.png",false,ShopWindow) GUIEditor_Image[3] = guiCreateStaticImage(505,390,117,61,"imagens/3.png",false,ShopWindow) GUIEditor_Image[4] = guiCreateStaticImage(684,368,95,87,"imagens/4.png",false,ShopWindow) GUIEditor_Image[5] = guiCreateStaticImage(60,269,88,78,"imagens/5.png",false,ShopWindow) GUIEditor_Image[6] = guiCreateStaticImage(199,270,86,81,"imagens/20.png",false,ShopWindow) GUIEditor_Image[7] = guiCreateStaticImage(320,282,135,59,"imagens/25.png",false,ShopWindow) GUIEditor_Image[8] = guiCreateStaticImage(541,266,70,84,"imagens/26.png",false,ShopWindow) GUIEditor_Image[9] = guiCreateStaticImage(32,403,125,66,"imagens/28.png",false,ShopWindow) GUIEditor_Image[10] = guiCreateStaticImage(189,377,129,87,"imagens/29.png",false,ShopWindow) GUIEditor_Image[11] = guiCreateStaticImage(336,400,117,63,"imagens/27.png",false,ShopWindow) GUIEditor_Image[12] = guiCreateStaticImage(326,172,136,62,"imagens/30.png",false,ShopWindow) GUIEditor_Image[13] = guiCreateStaticImage(493,171,153,56,"imagens/31.png",false,ShopWindow) GUIEditor_Image[14] = guiCreateStaticImage(652,273,127,70,"imagens/32.png",false,ShopWindow) GUIEditor_Image[15] = guiCreateStaticImage(683,166,113,70,"imagens/33.png",false,ShopWindow) GUIEditor_Label[4] = guiCreateLabel(9,149,803,15,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",false,ShopWindow) GUIEditor_Label[5] = guiCreateLabel(9,258,803,15,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",false,ShopWindow) GUIEditor_Label[6] = guiCreateLabel(10,374,803,15,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",false,ShopWindow) guiWindowSetSizable(ShopWindow,false) guiSetVisible(ShopWindow,false) end addEventHandler("onClientResourceStart", getRootElement(), CreateShopWindow) function BuyWeapon(button, state) if (button == "left") then if(source == btn_buy_chainsaw) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_chainsaw") elseif(source == btn_buy_m4) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_m4") elseif(source == btn_buy_ak) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_ak") elseif(source == btn_buy_tec9) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_tec9") elseif(source == btn_buy_mp5) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_mp5") elseif(source == btn_buy_knife) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_knife") elseif(source == btn_buy_uzi) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_uzi") elseif(source == btn_buy_sniper) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_sniper") elseif(source == btn_buy_shotgun) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_shotgun") elseif(source == btn_buy_spaz12) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_spaz12") elseif(source == btn_buy_deserteagle) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_deserteagle") elseif(source == btn_buy_molotovcocktails) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_molotovcocktails") elseif(source == btn_buy_rifle) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_rifle") elseif(source == btn_buy_satchel) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_satchel") elseif(source == btn_buy_grenade) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_grenade") end end end function BuyLicense(button) if(button == "left" and source == btn_buy_license) then triggerServerEvent("onClientBuyLicense", localPlayer) end end function ShowGUI ( ) guiSetVisible ( ShopWindow, not guiGetVisible ( ShopWindow ) ) showCursor ( not isCursorShowing( ) ) end bindKey ( "F2","down", ShowGUI ) ملف سيررفر function BuyWeaponOnServer(weapon_name) player_money = getPlayerMoney(source) player_account = getPlayerAccount(source) local price_chainsaw = "2500" local price_m4 = "2500" local price_ak = "2500" local price_tec9 = "2500" local price_mp5 = "2500" local price_knife = "2500" local price_uzi = "2500" local price_sniper = "2500" local price_shotgun = "2500" local price_spaz12 = "2500" local price_deserteagle = "150" local price_molotovcocktails = "2500" local price_rifle = "2500" local price_satchel = "2500" local price_grenade = "2500" if(getAccountData(player_account, "GunLicense") == true) then if(weapon_name == "weapon_chainsaw") then if(player_money >= tonumber(price_chainsaw)) then giveWeapon(source, 9) takePlayerMoney(source, tonumber(price_chainsaw)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_m4") then if(player_money >= tonumber(price_m4)) then giveWeapon(source, 31, 450) takePlayerMoney(source, tonumber(price_m4)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_ak") then if(player_money >= tonumber(price_ak)) then giveWeapon(source, 30, 450) takePlayerMoney(source, tonumber(price_ak)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_tec9") then if(player_money >= tonumber(price_tec9)) then giveWeapon(source, 32, 450) takePlayerMoney(source, tonumber(price_tec9)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_mp5") then if(player_money >= tonumber(price_mp5)) then giveWeapon(source, 29, 450) takePlayerMoney(source, tonumber(price_mp5)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_knife") then if(player_money >= tonumber(price_knife)) then giveWeapon(source, 4) takePlayerMoney(source, tonumber(price_knife)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_uzi") then if(player_money >= tonumber(price_uzi)) then giveWeapon(source, 28, 450) takePlayerMoney(source, tonumber(price_uzi)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_sniper") then if(player_money >= tonumber(price_sniper)) then giveWeapon(source, 34, 450) takePlayerMoney(source, tonumber(price_sniper)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_shotgun") then if(player_money >= tonumber(price_shotgun)) then giveWeapon(source, 25, 450) takePlayerMoney(source, tonumber(price_shotgun)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_spaz12") then if(player_money >= tonumber(price_spaz12)) then giveWeapon(source, 27, 450) takePlayerMoney(source, tonumber(price_spaz12)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_deserteagle") then if(player_money >= tonumber(price_deserteagle)) then giveWeapon(source, 24, 450) takePlayerMoney(source, tonumber(price_deserteagle)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_molotovcocktails") then if(player_money >= tonumber(price_molotovcocktails)) then giveWeapon(source, 18, 10) takePlayerMoney(source, tonumber(price_molotovcocktails)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_rifle") then if(player_money >= tonumber(price_rifle)) then giveWeapon(source, 33, 200) takePlayerMoney(source, tonumber(price_rifle)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_satchel") then if(player_money >= tonumber(price_satchel)) then giveWeapon(source, 39, 10) takePlayerMoney(source, tonumber(price_satchel)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end elseif(weapon_name == "weapon_grenade") then if(player_money >= tonumber(price_grenade)) then giveWeapon(source, 16, 10) takePlayerMoney(source, tonumber(price_grenade)) outputChatBox("لقد اشتريت السلاح.", source, 0, 255, 0) else outputChatBox("لاتملك المال الكافي للشراء.", source, 255, 0, 0) end end else outputChatBox("لشراء اسلحة تحتاج لترخيص , يمكنك اخذه من الشوب.", source, 255, 0, 0) end end addEvent("onClientBuyWeapon", true) addEventHandler("onClientBuyWeapon", getRootElement(), BuyWeaponOnServer) function BuyWeaponLicense() player_money = getPlayerMoney(source) player_account = getPlayerAccount(source) local license_price = "0" if(getAccountData(player_account, "GunLicense") == false) then if(player_money >= tonumber(license_price)) then setAccountData(player_account, "GunLicense", true) takePlayerMoney(source, tonumber(license_price)) outputChatBox("لديك الآن ترخيص لحمل السلاح.", source, 0, 255, 0) else outputChatBox("لم يكن لديك ما يكفي من المال لشراء ترخيص لحمل السلاح.", source, 255, 0, 0) end else outputChatBox("لديك ترخيص لحمل السلاح.", source, 255, 0, 0) end end addEvent("onClientBuyLicense", true) addEventHandler("onClientBuyLicense", getRootElement(), BuyWeaponLicense)
×
×
  • Create New...