-
Posts
10,056 -
Joined
-
Last visited
-
Days Won
27
Everything posted by iPrestege
-
يعطيك العافية دلوع ذذ
-
ضيف المود للادمنية resource.name
-
انا مو مرة خبير بالبرمجة بس root تفتح لكل الاعبين Client = للاعب نفسة ذذ
-
-- Server -- addEvent("on",true) addEventHandler("on",root, function () addEventHandler("onPlayerChat", root, mute) end) addEvent("off",true) addEventHandler("off",root, function () removeEventHandler("onPlayerChat", root, mute) end ) time = 30 timer = {} function mute(msg,type) local find = string.find(msg,getPlayerName(source)) if ( type == 0 and find ) then setPlayerMuted(source,true) outputChatBox("* You Are Muted For " .. time .. " " ,source,255,0,0) timer[source] = setTimer(endMute,time * 1000,1,source) end end function endMute(player) setPlayerMuted(player,false) outputChatBox("* You Can Talk Now",player,0,255,0) end addEventHandler("onPlayerQuit",root, function () if ( isTimer(timer[source]) ) then killTimer(timer[source]) end end ) -- Client -- Wnd = guiCreateWindow(241,515,317,120,"No Subject",false) On = guiCreateButton(70,30,50,50,"On",false,Wnd) Off = guiCreateButton(10,30,50,50,"Off",false,Wnd) -- client side addEventHandler("onClientGUIClick",root, function() PlayerName = getPlayerName(localPlayer) if source == On then outputChatBox(" "..PlayerName.." is busy",root,255,255,0,true) triggerServerEvent("on",getLocalPlayer()) elseif source == Off then outputChatBox(" "..PlayerName.." is is Available ",root,255,255,0,true) triggerServerEvent("off",getLocalPlayer()) end end)
-
حياك الله ذذ | ur welcome .
-
-- Server -- addEvent("on",true) addEventHandler("on",root, function () addEventHandler("onPlayerChat", root, mute) end) addEvent("off",true) addEventHandler("off",root, function () removeEventHandler("onPlayerChat", root, mute) end ) name = "اسمك" time = 30 timer = {} function mute(msg,type) local find = string.find(msg,name) if ( type == 0 and find ) then setPlayerMuted(source,true) outputChatBox("* You Are Muted For " .. time .. " " ,source,255,0,0) timer[source] = setTimer(endMute,time * 1000,1,source) end end function endMute(player) setPlayerMuted(player,false) outputChatBox("* You Can Talk Now",player,0,255,0) end addEventHandler("onPlayerQuit",root, function () if ( isTimer(timer[source]) ) then killTimer(timer[source]) end end ) -- Client -- Wnd = guiCreateWindow(241,515,317,120,"No Subject",false) On = guiCreateButton(70,30,50,50,"On",false,Wnd) Off = guiCreateButton(10,30,50,50,"Off",false,Wnd) addEventHandler("onClientGUIClick",root, function(player) if source == On then outputChatBox(" Name is busy",root,255,255,0,true) triggerServerEvent("on",getLocalPlayer()) elseif source == Off then outputChatBox(" Name is is Available ",root,255,255,0,true) triggerServerEvent("off",getLocalPlayer()) end end)
-
local Miners = {} local blip = {} locations = { {459.93146, 888.78650, -27.64281}, {507.28488, 971.90436, -24.47141}, {664.53302, 721.46564, -4.02670}, } function create() local x, y, z = unpack ( locations [ math.random ( #locations ) ] ) marker = createMarker (x, y, z, "cylinder", 2, 255, 255, 0, 255) blip[marker] = createBlipAttachedTo( marker, 0, 2, 0, 250, 0, 170 ) setElementVisibleTo ( marker, getRootElement ( ), false ) setElementVisibleTo ( blip[marker], getRootElement ( ), false ) end create() setTimer( function( ) if not getTeamFromName ( "Miners" ) then return end local players = getPlayersInTeam (getTeamFromName ( "Miners" )) for k, v in ipairs ( players ) do if (not Miners[ v ]) then Miners[v] = true if isElement(marker) and blip[marker] and isElement(blip[marker]) then setElementVisibleTo ( marker, v, true ) setElementVisibleTo ( blip[marker], v, true ) end end end end, 1000, 0 ) function onHit(hitElement) if getElementType(hitElement) =="player" and Miners[ hitElement ] and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "Miners" then cash = math.random (500, 1000) givePlayerMoney (hitElement, cash) outputChatBox ( "You have just received $ " ..cash , hitElement, 0, 255, 0, true) fadeCamera (hitElement, false, 0.8, 0, 0, 0) setTimer ( fadeCamera, 3000, 1, hitElement, true, 1 ) removeEventHandler ("onMarkerHit", marker, onHit) destroyElement(source) if blip[marker] and isElement(blip[marker]) then destroyElement(blip[marker]) blip[marker] = nil end setTimer( function( player ) local x, y, z = unpack ( locations [ math.random ( #locations ) ] ) marker = createMarker (x, y, z, "cylinder", 2, 255, 255, 0, 255) blip[marker] = createBlipAttachedTo( marker, 0, 2, 0, 250, 0, 170 ) setElementVisibleTo ( marker, getRootElement ( ), false ) setElementVisibleTo ( blip[marker], getRootElement ( ), false ) if not getTeamFromName ( "Miners" ) then return end local players = getPlayersInTeam ( getTeamFromName ( "Miners" ) ) for k, v in ipairs ( players ) do if (Miners[ v ]) then Miners[ v ] = nil end end addEventHandler ("onMarkerHit", marker, onHit) end, 1200, 1, hitElement); end end addEventHandler ("onMarkerHit", marker, onHit)
-
onClientResourceStart guiSetVisible showCursor
-
ياحسافة دايمم اساعد هنا وتروح المواضيع للمهملات للاسف حط موضوعك للبرمجة عارف اني خاش عرض بس ياناس اتعب وحنا نكتب وفي الاخير مشرف يطيرة
-
مثال كامل ملف fr_client.lua : CONTROL_MARGIN_RIGHT = 5 LINE_MARGIN = 5 LINE_HEIGHT = 16 g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() server = createServerCallInterface() guiSetInputMode("no_binds_when_editing") function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "1.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end --------------------------- -- Set skin window --------------------------- function skinInit() setControlNumber(wndSkin, 'skinid', getElementModel(g_Me)) end function showSkinID(leaf) if leaf.id then setControlNumber(wndSkin, 'skinid', leaf.id) end end function applySkin() local skinID = getControlNumber(wndSkin, 'skinid') if skinID then server.setMySkin(skinID) fadeCamera(true) end end wndSkin = { 'wnd', text = 'Set skin', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='skinlist', width=230, height=290, columns={ {text='Skin', attr='name'} }, rows={xml='skins.xml', attrs={'id', 'name'}}, onitemclick=showSkinID, onitemdoubleclick=applySkin }, {'txt', id='skinid', text='', width=50}, {'btn', id='set', onclick=applySkin}, {'btn', id='close', closeswindow=true} }, oncreate = skinInit } function setSkinCommand(cmd, skin) skin = skin and tonumber(skin) if skin then server.setMySkin(skin) fadeCamera(true) closeWindow(wndSpawnMap) closeWindow(wndSetPos) end end addCommandHandler('setskin', setSkinCommand) addCommandHandler('ss', setSkinCommand) --------------------------- --- Set animation window --------------------------- function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end wndAnim = { 'wnd', text = 'Set animation', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='animlist', width=230, height=290, columns={ {text='Animation', attr='name'} }, rows={xml='animations.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyAnimation }, {'btn', id='set', onclick=applyAnimation}, {'btn', id='stop', onclick=stopAnimation}, {'btn', id='close', closeswindow=true} } } addCommandHandler('anim', function(command, lib, name) server.setPedAnimation(g_Me, lib, name, true, true) end ) --------------------------- -- Weapon window --------------------------- function addWeapon(leaf, amount) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndWeapon, 'weaplist') amount = getControlNumber(wndWeapon, 'amount') if not amount or not leaf then return end end server.giveMeWeapon(leaf.id, amount) end wndWeapon = { 'wnd', text = 'Give weapon', width = 250, controls = { { 'lst', id='weaplist', width=230, height=280, columns={ {text='Weapon', attr='name'} }, rows={xml='weapons.xml', attrs={'id', 'name'}}, onitemdoubleclick=function(leaf) addWeapon(leaf, 500) end }, {'br'}, {'txt', id='amount', text='500', width=60}, {'btn', id='add', onclick=addWeapon}, {'btn', id='close', closeswindow=true} } } function giveWeaponCommand(cmd, weapon, amount) weapon = tonumber(weapon) or getWeaponIDFromName(weapon) if not weapon then return end amount = amount and tonumber(amount) or 500 server.giveMeWeapon(math.floor(weapon), amount) end addCommandHandler('give', giveWeaponCommand) addCommandHandler('wp', giveWeaponCommand) --------------------------- -- Fighting style --------------------------- addCommandHandler('setstyle', function(cmd, style) style = style and tonumber(style) if style then server.setPedFightingStyle(g_Me, style) end end ) --------------------------- -- Clothes window --------------------------- function clothesInit() if getElementModel(g_Me) ~= 0 then errMsg('You must have the CJ skin set in order to apply clothes.') closeWindow(wndClothes) return end if not g_Clothes then triggerServerEvent('onClothesInit', g_Me) end end addEvent('onClientClothesInit', true) addEventHandler('onClientClothesInit', g_Root, function(clothes) g_Clothes = clothes.allClothes for i,typeGroup in ipairs(g_Clothes) do for j,cloth in ipairs(typeGroup.children) do if not cloth.name then cloth.name = cloth.model .. ' - ' .. cloth.texture end cloth.wearing = clothes.playerClothes[typeGroup.type] and clothes.playerClothes[typeGroup.type].texture == cloth.texture and clothes.playerClothes[typeGroup.type].model == cloth.model or false end table.sort(typeGroup.children, function(a, b) return a.name < b.name end) end bindGridListToTable(wndClothes, 'clothes', g_Clothes, false) end ) function clothListClick(cloth) setControlText(wndClothes, 'addremove', cloth.wearing and 'remove' or 'add') end function applyClothes(cloth) if not cloth then cloth = getSelectedGridListLeaf(wndClothes, 'clothes') if not cloth then return end end if cloth.wearing then cloth.wearing = false setControlText(wndClothes, 'addremove', 'add') server.removePlayerClothes(g_Me, cloth.parent.type) else local prevClothIndex = table.find(cloth.siblings, 'wearing', true) if prevClothIndex then cloth.siblings[prevClothIndex].wearing = false end cloth.wearing = true setControlText(wndClothes, 'addremove', 'remove') server.addPedClothes(g_Me, cloth.texture, cloth.model, cloth.parent.type) end end wndClothes = { 'wnd', text = 'Clothes', x =
-
سمي الفنكشن يب وسوية عند الزر من الماين اسم الفنكشن ( = .
-
Try this : locations = { {459.93146, 888.78650, -27.64281}, {507.28488, 971.90436, -24.47141}, {664.53302, 721.46564, -4.02670}, } function create() local x, y, z = unpack ( locations [ math.random ( #locations ) ] ) marker = createMarker (x, y, z, "cylinder", 2, 255, 255, 0, 255) blip = createBlipAttachedTo( marker, 0, 2, 0, 250, 0, 170 ) setElementVisibleTo ( marker, getRootElement ( ), false ) setElementVisibleTo ( blip, getRootElement ( ), false ) local players = getPlayersInTeam ( getTeamFromName ( "Miners" ) ) for k, v in ipairs ( players ) do setElementVisibleTo ( marker, v, true ) setElementVisibleTo ( blip, v, true ) end end setTimer(create,1000,0) create() function onHit(hitElement) if getElementType(hitElement) =="player" and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "Miners" then cash = math.random (500, 1000) givePlayerMoney (hitElement, cash) outputChatBox ( "You have just received $ " ..cash , hitElement, 0, 255, 0, true) fadeCamera (hitElement, false, 0.8, 0, 0, 0) setTimer ( fadeCamera, 3000, 1, hitElement, true, 1 ) if isElement(bilp) then destroyElement (blip) end removeEventHandler ("onMarkerHit", marker, onHit) destroyElement(source) setTimer( function( player ) local x, y, z = unpack ( locations [ math.random ( #locations ) ] ) marker = createMarker (x, y, z, "cylinder", 2, 255, 255, 0, 255) blip = createBlipAttachedTo( marker, 0, 2, 0, 250, 0, 170 ) setElementVisibleTo ( marker, getRootElement ( ), false ) setElementVisibleTo ( blip, getRootElement ( ), false ) local players = getPlayersInTeam ( getTeamFromName ( "Miners" ) ) for k, v in ipairs ( players ) do setElementVisibleTo ( marker, v, true ) setElementVisibleTo ( blip, v, true ) end addEventHandler ("onMarkerHit", marker, onHit) end, 1200, 1, hitElement); end end addEventHandler ("onMarkerHit", marker, onHit)
-
Am going to fix it and test it again wait!
-
Lol? it work's with me make sure you are @ the team to see the blip and marker and show you're meta!
-
Hmmm. i think you can do it with "Shader" only .
-
bla bla i don't know how to do it with tactics "Scoreboard" .
-
Yes work's with me server side!
-
تقدر تسوية كذا : addEventHandler("onPlayerChat",root, function (msg) if ( msg == "msg" ) then -- Func end end ) or string.find
-
Are sure you are enter the Miners team or you can't see the blip and marker .
-
حاول؟ بس حاول عشان اقدر انك سويت معي ذذ
-
onPlayerChat setPlayerMuted setTimer outputChatBox
-
Am,Back try this : locations = { {459.93146, 888.78650, -27.64281}, {507.28488, 971.90436, -24.47141}, {664.53302, 721.46564, -4.02670}, } function create() local x, y, z = unpack ( locations [ math.random ( #locations ) ] ) marker = createMarker (x, y, z, "cylinder", 2, 255, 255, 0, 255) blip = createBlipAttachedTo( marker, 0, 2, 0, 250, 0, 170 ) setElementVisibleTo ( marker, getRootElement ( ), false ) setElementVisibleTo ( blip, getRootElement ( ), false ) local players = getPlayersInTeam ( getTeamFromName ( "Miners" ) ) for k, v in ipairs ( players ) do setElementVisibleTo ( marker, v, true ) setElementVisibleTo ( blip, v, true ) end end create() function onHit(hitElement) if getElementType(hitElement) =="player" and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "Miners" then cash = math.random (500, 1000) givePlayerMoney (hitElement, cash) outputChatBox ( "You have just received $ " ..cash , hitElement, 0, 255, 0, true) fadeCamera (hitElement, false, 0.8, 0, 0, 0) setTimer ( fadeCamera, 3000, 1, hitElement, true, 1 ) if isElement(bilp) then destroyElement (blip) end removeEventHandler ("onMarkerHit", marker, onHit) destroyElement(source) setTimer( function( player ) local x, y, z = unpack ( locations [ math.random ( #locations ) ] ) marker = createMarker (x, y, z, "cylinder", 2, 255, 255, 0, 255) blip = createBlipAttachedTo( marker, 0, 2, 0, 250, 0, 170 ) setElementVisibleTo ( marker, getRootElement ( ), false ) setElementVisibleTo ( blip, getRootElement ( ), false ) local players = getPlayersInTeam ( getTeamFromName ( "Miners" ) ) for k, v in ipairs ( players ) do setElementVisibleTo ( marker, v, true ) setElementVisibleTo ( blip, v, true ) end addEventHandler ("onMarkerHit", marker, onHit) end, 1200, 1, hitElement); end end addEventHandler ("onMarkerHit", marker, onHit)