Jump to content

فاّرس

Members
  • Posts

    4,805
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by فاّرس

  1. هذا مثال على زر, -- # Client Side : button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Rhino", true ) -- نسوي زر addEventHandler("onClientGUIClick",root, -- اذا ضغط على الزر function() -- نسوي وظيفه if (source == button ) -- نحدد العنصر الي هو الزر triggerServerEvent("Rhino",localPlayer) -- نرسل الزر للسيرفر end -- اغلاق end) -- اغلاق -- # Server Side : addEvent("Rhino",true) -- نجيب الترايقر من الكلنت addEventHandler("Rhino",root, -- نجيب الترايقر من الكنت function() -- وظيفه local x,y,z = getElementPosition ( source ) -- نحدد احداثيات اللاعب local Get = getPlayerMoney(source) -- نجيب فلوس اللاعب if Get >= 200 then -- اذا كانت الفلوس 200 واكثر takePlayerMoney (source,100) -- نسحب من اللاعب 100 rhino = createVehicle ( 432, x, y, z ) -- ونعطيه سيارة warpPedIntoVehicle(source, rhino) -- ننقله للسيارة outputChatBox("* Buy was successful !",source,255,255,0,true) -- مخرج نصي للشات elseif playerMoney <= 50 then -- اما اذا كان اللاعب عنده 50 واقل outputChatBox("* Not enough money !"source,0,0,0,true) -- يطلع له خطأ (مخرج نصي في الشات) end -- اغلاق end) -- اغلاق اتمنى تستفيد...~ بالتوفيق,
  2. الوظيفه الي لونها احمر يعني كلنت والي اصفر او برتقالي تقريبا يعني سيرفر والي ازرق كلنت وسيرفر , امثله, givePlayerMoney -- كلنت وسيرفر guiCreateButton -- كلنت فقط logIn -- سيرفر فقط
  3. ولكن الافضل تسويه كذآ, function spawn (player) if getElementType(player) == 'player' then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end end addEventHandler("onPlayerSpawn",root,spawn)
  4. function spawn (player) if getPlayerTeam (player) == "SWAT" then spawnPlayer (player,1859,552,321 ) else spawnPlayer (player,1835,551,321 ) end end addEventHandler("onPlayerSpawn",root,spawn) حبيت اوضح لك انه يسوي سباون اول ما اللاعب يسوي سباون يعني بعد ما يدخل تقريبا
  5. viewtopic.php?f=160&t=56158&p=543195&hilit=%D8%A7%D9%84%D9%8A+%D9%8A%D9%82%D8%B1%D8%A8+%D9%8A%D9%85%D9%88%D8%AA#p543195
  6. You can use SQL or Xml or Account Data
  7. والي يقولك انه مجرب وشغال ؟ اكتب في الكونسل اف8 Name
  8. Sorry i am not understand you ! what " hospital " ? and post your code and tell me what's the problem.
  9. g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_PlayerData = {} g_VehicleData = {} local chatTime = {} local lastChatMessage = {} g_ArmedVehicles = { [425] = true, [447] = true, [520] = true, [430] = true, [464] = true, [432] = true } g_Trailers = { [606] = true, [607] = true, [610] = true, [590] = true, [569] = true, [611] = true, [584] = true, [608] = true, [435] = true, [450] = true, [591] = true } g_RPCFunctions = { addPedClothes = { option = 'clothes', descr = 'Modifying clothes' }, addVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, fadeVehiclePassengersCamera = true, fixVehicle = { option = 'repair', descr = 'Repairing vehicles' }, giveMeVehicles = { option = 'createvehicle', descr = 'Creating vehicles' }, giveMeWeapon = { option = 'weapons.enabled', descr = 'Getting weapons' }, givePedJetPack = { option = 'jetpack', descr = 'Getting a jetpack' }, killPed = { option = 'kill', descr = 'Killing yourself' }, removePedClothes = { option = 'clothes', descr = 'Modifying clothes' }, removePedFromVehicle = true, removePedJetPack = { option = 'jetpack', descr = 'Removing a jetpack' }, removeVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, setElementAlpha = { option = 'alpha', descr = 'Changing your alpha' }, setElementPosition = true, setElementInterior = true, setMyGameSpeed = { option = 'gamespeed.enabled', descr = 'Setting game speed' }, setMySkin = { option = 'setskin', descr = 'Setting skin' }, setPedAnimation = { option = 'anim', descr = 'Setting an animation' }, setPedFightingStyle = { option = 'setstyle', descr = 'Setting fighting style' }, setPedGravity = { option = 'gravity.enabled', descr = 'Setting gravity' }, setPedStat = { option = 'stats', descr = 'Changing stats' }, setTime = { option = 'time.set', descr = 'Changing time' }, setTimeFrozen = { option = 'time.freeze', descr = 'Freezing time' }, setVehicleColor = true, setVehicleHeadLightColor = true, setVehicleOverrideLights = { option = 'lights', descr = 'Forcing lights' }, setVehiclePaintjob = { option = 'paintjob', descr = 'Applying paintjobs' }, setVehicleRotation = true, setWeather = { option = 'weather', descr = 'Setting weather' }, spawnMe = true, warpMe = { option = 'warp', descr = 'Warping' } } g_OptionDefaults = { alpha = true, anim = true, clothes = true, createvehicle = true, gamespeed = { enabled = true, min = 0.0, max = 3 }, gravity = { enabled = true, min = 0, max = 0.1 }, jetpack = true, kill = true, lights = true, paintjob = true, repair = true, setskin = true, setstyle = true, spawnmaponstart = true, spawnmapondeath = true, stats = true, time = { set = true, freeze = true }, upgrades = true, warp = true, weapons = { enabled = true, vehiclesenabled = true, disallowed = {} }, weather = true, welcometextonstart = true, vehicles = { maxidletime = 60000, idleexplode = true, maxperplayer = 2, disallowed = {} } } function getOption(optionName) local option = get(optionName:gsub('%.', '/')) if option then if option == 'true' then option = true elseif option == 'false' then option = false end return option end option = g_OptionDefaults for i,part in ipairs(optionName:split('.')) do option = option[part] end return option end addEventHandler('onResourceStart', g_ResRoot, function() table.each(getElementsByType('player'), joinHandler) end ) function joinHandler(player) if not player then player = source end local r, g, b = math.random(50, 255), math.random(50, 255), math.random(50, 255) setPlayerNametagColor(player, r, g, b) g_PlayerData[player] = { vehicles = {} } g_PlayerData[player].blip = createBlipAttachedTo(player, 0, 2, r, g, b) if g_FrozenTime then clientCall(player, 'setTimeFrozen', true, g_FrozenTime[1], g_FrozenTime[2], g_FrozenWeather) end if getOption('welcometextonstart') then outputChatBox('Welcome to Freeroam', player, 0, 255, 0) outputChatBox('Press F1 to show/hide controls', player, 0, 255, 0) end end addEventHandler('onPlayerJoin', g_Root, joinHandler) addEvent('onLoadedAtClient', true) addEventHandler('onLoadedAtClient', g_ResRoot, function(player) if getOption('spawnmaponstart') and isPedDead(player) then clientCall(player, 'showWelcomeMap') end end, false ) addEventHandler('onPlayerWasted', g_Root, function() if not getOption('spawnmapondeath') then return end local player = source setTimer( function() if isPedDead(player) then clientCall(player, 'showMap') end end, 2000, 1 ) end ) addEvent('onClothesInit', true) addEventHandler('onClothesInit', g_Root, function() local result = {} local texture, model -- get all clothes result.allClothes = {} local typeGroup, index for type=0,17 do typeGroup = {'group', type = type, name = getClothesTypeName(type), children = {}} table.insert(result.allClothes, typeGroup) index = 0 texture, model = getClothesByTypeIndex(type, index) while texture do table.insert(typeGroup.children, {id = index, texture = texture, model = model}) index = index + 1 texture, model = getClothesByTypeIndex(type, index) end end -- get current player clothes { type = {texture=texture, model=model} } result.playerClothes = {} for type=0,17 do texture, model = getPedClothes(source, type) if texture then result.playerClothes[type] = {texture = texture, model = model} end end triggerClientEvent(source, 'onClientClothesInit', source, result) end ) addEvent('onPlayerGravInit', true) addEventHandler('onPlayerGravInit', g_Root, function() triggerClientEvent('onClientPlayerGravInit', source, getPedGravity(source)) end ) function setMySkin(skinid) if isPedDead(source) then local x, y, z = getElementPosition(source) if isPedTerminated(source) then x = 0 y = 0 z = 3 end local r = getPedRotation(source) local interior = getElementInterior(source) spawnPlayer(source, x, y, z, r, skinid) setElementInterior(source, interior) setCameraInterior(source, interior) else setElementModel(source, skinid) setElementHealth(source, 100) end setCameraTarget(source, source) setCameraInterior(source, getElementInterior(source)) end function spawnMe(x, y, z) if not x then x, y, z = getElementPosition(source) end if isPedTerminated(source) then repeat until spawnPlayer(source, x, y, z, 0, math.random(9, 288)) else spawnPlayer(source, x, y, z, 0, getPedSkin(source)) end setCameraTarget(source, source) setCameraInterior(source, getElementInterior(source)) end function warpMe(targetPlayer)
  10. مافيها فرق , + حقي يوضح له احسن ويستوعب اكثر, وبالتوفيق,
  11. اتوقع ان الادمنيه فيها وقت, يوم تصك باند حط Custom : ... : Mins or Hours or Days
  12. آي صح نسيت ان السورس هو الحدث, دائما انسى اقرأ الويكي حق الحدث , المهم جرب كذآ , addCommandHandler("Name", function(player) local Name = getPlayerName(player):gsub('#%x%x%x%x%x%x', '') outputChatBox("Your name : "..Name.." is good") end)
  13. بس تتفجر وتصير اجزاء ههه انا حاط الكود فوق لاهنت صححه وحط التحقق من اللالمنت لاني انا ماعندي خبرة كثيرة بالبرمجة بس بسيطة وشكرا
  14. server ? addEventHandler("onResourceStart",resourceRoot, function() local Name = getPlayerName(source):gsub('#%x%x%x%x%x%x', '') outputChatBox("Your name : "..Name.." is good") end)
  15. مم ما احب ازود على اكواد الناس, هو عطاني كود محدد اعطيه الكود مصحح بدون زيادات, وشكرآ للتنبيه, +1 if isPedInVehicle ( player ) then return end
  16. marker = createMarker(1925,484,61,"cylinder",2,255,0,255,255) addEventHandler("onMarkerHit",marker, function (player) if (getElementType(player) == 'player' ) then if ( getPlayerTeam ( player ) ) and ( getPlayerTeam ( player ) == getTeamFromName ( "SWAT" ) ) then setPedStat(player,24,989) setElementHealth ( player, 200 ) setPedArmor ( player, 100 ) setPedSkin ( player, 115 ) else outputChatBox("* You most be 'SWAT'",player,0,0,255,true) end end end)
  17. اي عارفف , هذا مثآل, ما جربته, addEventHandler("onResourceStart",resourceRoot, function() outputChatBox("Your name : "..getPlayerName(source):gsub('#%x%x%x%x%x%x', '')"") end)
  18. قلنا ذكي قالوا عرفنا مع الخيل يا شقرا مايقصد قروب ACL (يعني مثل قروباآت حرب العصابات)
×
×
  • Create New...