^iiEcoo'x_) Posted February 22, 2019 Posted February 22, 2019 (edited) @!#DesTroyeR_,) function getPlayerInfo ( Player , Type ) if ( isElement ( Player ) ) and ( getElementType ( Player ) == 'player' ) then local Table = { [ 'Name' ] = getPlayerName ( Player ) , [ 'Serial' ] = getPlayerSerial ( Player ) , [ 'Money' ] = getPlayerMoney ( Player ) , [ 'TeamName' ] = getPlayerTeam ( Player ) and getTeamName ( getPlayerTeam ( Player ) ) or '' } if ( not Table [ Type ] ) then return false end return Table [ Type ] end end Edited February 22, 2019 by #_iMr,[E]coo 2 1
Doffy Posted February 22, 2019 Posted February 22, 2019 @#_iMr,[E]coo مع احترامي لك صحيح الكود كويس ولاكن معلوماته قليلة جدا وينفع لحرب العصابات وإلخ
Rakan# Posted February 22, 2019 Posted February 22, 2019 39 minutes ago, !#DesTroyeR_,) said: @#_iMr,[E]coo مع احترامي لك صحيح الكود كويس ولاكن معلوماته قليلة جدا وينفع لحرب العصابات وإلخ هو يبي يوصلك ان بإمكانك اختصاره كذا وتزود المعلومات زي ماتبي انت هو يبي يوضح لك الفكره 1
KillerX Posted March 7, 2019 Posted March 7, 2019 السلام عليكم ورحمه الله وبركاتة جا في بالي اسوي وظيفة setPedShootOn عبارة عن يخلي البيد يصوب ويضرب علي المنت معين Client Side الوظيفة Source Code : function setPedShootOn( ped , element ) local available_types = { [ 'vehicle' ] = true , [ 'ped' ] = true , [ 'player' ] = true , }; if( isTimer( renderTimer ) ) then killTimer( renderTimer ); end if( isElement( element ) and available_types[ getElementType( element ) ] ) then renderTimer = setTimer( function( ) local px , py , pz = getElementPosition( ped ); local posX , posY , posZ = getElementPosition( element ); local rotZ = -math.deg( math.atan2( posX - px , posY - py ) ); if( rotZ < 0 ) then rotZ = rotZ + 360; end setElementRotation( ped , 0 , 0 , rotZ , "default" , true ); setPedAimTarget( ped , posX , posY , posZ ); setPedControlState( ped , "fire" , not getPedControlState( ped , "fire" ) ); end , 50 , 0 ); end return false end : مثال local myPed = createPed( 0 , getElementPosition( localPlayer ) ); setPedShootOn( myPed , localPlayer ); givePedWeapon( myPed , 31 , 5000 , true ); -- طبعا متنساش تحط السورس كود الاول :) -- 2
KillerX Posted March 7, 2019 Posted March 7, 2019 1 hour ago, KillerX said: if( isElement( element ) and available_types[ getElementType( element ) ] ) then تعديل بسيط علي هذا السطر if( isElement( ped ) and getElementType( ped ) == "ped" and isElement( element ) and available_types[ getElementType( element ) ] ) then ************************* function setPedShootOn( ped , element ) local available_types = { [ 'vehicle' ] = true , [ 'ped' ] = true , [ 'player' ] = true , }; if( isTimer( renderTimer ) ) then killTimer( renderTimer ); end if( isElement( ped ) and getElementType( ped ) == "ped" and isElement( element ) and available_types[ getElementType( element ) ] ) then renderTimer = setTimer( function( ) local px , py , pz = getElementPosition( ped ); local posX , posY , posZ = getElementPosition( element ); local rotZ = -math.deg( math.atan2( posX - px , posY - py ) ); if( rotZ < 0 ) then rotZ = rotZ + 360; end setElementRotation( ped , 0 , 0 , rotZ , "default" , true ); setPedAimTarget( ped , posX , posY , posZ ); setPedControlState( ped , "fire" , not getPedControlState( ped , "fire" ) ); end , 50 , 0 ); end return false end
Master_MTA Posted March 8, 2019 Posted March 8, 2019 16 hours ago, KillerX said: if( isElement( ped ) and getElementType( ped ) == "ped" and isElement( element ) and available_types[ getElementType( element ) ] ) then 1-استخدم or وليس and +استتخدم الاقواس للتحقق 2-التايمر يجب ان يكون له تيبل عشان ما يجي تايمر يلغي اللي قبله بالتوفيق On 22/02/2019 at 02:48, #_iMr,[E]coo said: , [ 'TeamName' ] = getPlayerTeam ( Player ) and getTeamName ( getPlayerTeam ( Player ) ) or '' استخدم الاقواس لهذا التحقق لتجنب المشاكل 16 hours ago, KillerX said: function( ) مرر البيد من خلال ارقيمنتات التايمر افضل
Master_MTA Posted March 8, 2019 Posted March 8, 2019 4 minutes ago, #_iMr,[E]coo said: جرب شكرا لتفهمك يرجى الاتصصال في وقت لاحق هههه بالتوفيق 1
Master_MTA Posted March 8, 2019 Posted March 8, 2019 40 minutes ago, #_iMr,[E]coo said: الكود مهو انته لو بتاخد logical design هترف انك عملت كارثه كبيره باخطاءك لاستخدام بوابة or عالعموم ابحث شوية في or في الانترنت وهتفهم قصدي استخدم الاقواس لتجنب المشاكل بالتوفيق 1
Master_MTA Posted March 9, 2019 Posted March 9, 2019 (edited) function getAccountAcls(acc) local acls=aclGroupList() local ta={} for k,v in ipairs(acls)do if isObjectInACLGroup('user.'..acc,v) then ta[aclGroupGetName(v)]=aclGroupListACL(v) end end return ta end function hasAccountPermissionTo(acc,role) local accacls=getAccountAcls(acc) local types={'general', 'function', 'resource ',' command'} for a,b in ipairs(accacls)do for m=1,3 do for k,v in ipairs(aclListRights(b,types[m]))do if string.find(string.upper(v),string.upper(role)) then return true end end end end return false end ههذول 2 فنكشن بستخدمهم مع لوحة الادمن اللي بسويها php باذن الله بس ما جربتهم للاسف اللي يقدر يجربهم يفيدنا اكون شاكر بالتوفيق Edited March 9, 2019 by Master_MTA 1
^iiEcoo'x_) Posted March 9, 2019 Posted March 9, 2019 types={'general', 'function', 'resource ',' command'} -- types={'general', 'function', 'resource','command'}
Master_MTA Posted March 10, 2019 Posted March 10, 2019 (edited) 18 hours ago, #_iMr,[E]coo said: command كويس انك لاحظتها والله لو سنه ما كنت بلاحظها عالعموم مشكور يعسل يشباب بالتيبل في مسافه زياده قبل 'command' شيلوها تصدق عطاني امس ايرور ومخي وقف سكرتها ههه طلع المشكلة من هنا Edited March 10, 2019 by Master_MTA 1
Guest Posted March 10, 2019 Posted March 10, 2019 22 hours ago, #_iMr,[E]coo said: 'resource ',' command'} .-. الريسورس والكوماند مسوي مسافات .. تأثر ؟ On 07/03/2019 at 21:42, KillerX said: setPedShootOn مشكور والله يعسل .
KillerX Posted March 10, 2019 Posted March 10, 2019 1 minute ago, DABL said: .-. الريسورس والكوماند مسوي مسافات .. تأثر ؟ مشكور والله يعسل . العفو يا قمر يب تاثر لان التحقق يبيلوا دقة مثل انتا تبي تجيب لاعب من اسموا لازم يكون الاسم بالظبط ____________________________________________________________ واستنادا لكلام الاخ ماستر يعطية العافية تم تصليح الاخطاء function setPedShootOn( ped , element ) if( not renderTimer ) then renderTimer = { }; end local available_types = { [ 'vehicle' ] = true , [ 'ped' ] = true , [ 'player' ] = true , }; if( ( isElement( ped ) and getElementType( ped ) == "ped" ) and ( isElement( element ) and available_types[ getElementType( element ) ] ) ) then if( renderTimer[ ped ] and isTimer( renderTimer[ ped ] ) ) then killTimer( renderTimer[ ped ] ); renderTimer[ ped ] = nil; end renderTimer[ ped ] = setTimer( function( myPed ) local px , py , pz = getElementPosition( myPed ); local posX , posY , posZ = getElementPosition( element ); local rotZ = -math.deg( math.atan2( posX - px , posY - py ) ); if( rotZ < 0 ) then rotZ = rotZ + 360; end setElementRotation( myPed , 0 , 0 , rotZ , "default" , true ); setPedAimTarget( myPed , posX , posY , posZ ); setPedControlState( myPed , "fire" , not getPedControlState( ped , "fire" ) ); end , 50 , 0 , ped ); end return false end 2 1
Popular Post KillerX Posted March 29, 2019 Popular Post Posted March 29, 2019 السلام عليكم ورحمه الله وبركاتة امس في القسم الاجنبي عضو سال ازاي يجيب اقرب بيد بالنسبة لنقطة عطيتو الفنكشن بس حبيت اطوروا اكثر getNearsetElmFromXYZ الفنكشن عبارة عن يجيبلك اقرب اليمنت بالنسبة لنقطة معينة ( الساينتكس / syntax ) : function getNearsetElmFromXYZ( etype , x , y , z ) etype : نوع الاليمنت x , y , z : احداثيات النقطة ( السورس كود / Source Code ) : function getNearsetElmFromXYZ( etype , x , y , z ) local elements , positions , element = getElementsByType( etype ) , { } , { } if( ( not elements ) or ( #elements == 0 ) ) then return false end for index = 1 , #elements do positions[ index ] = getDistanceBetweenPoints3D( x , y , z , getElementPosition( elements[ index ] ) ); element[ positions[ index ] ] = elements[ index ]; end return element[ math.min( unpack( positions ) ) ]; end ودا مثال يجيب معلومات اقرب سيارة بالنسبة لمكان الاعب addCommandHandler( "getNearsetVeh" , function( plr ) local nearstVehicle = getNearsetElmFromXYZ( "vehicle" , getElementPosition( plr ) ); if( not nearstVehicle ) then return outputChatBox( "There\'s not vehicles" ); end outputChatBox( "Name : " .. getVehicleName( nearstVehicle ) ); outputChatBox( "Model : " .. getElementModel( nearstVehicle ) ); end ) @Master_MTA --> معلش علي اللون الاخضر ما اقدر اقاوم لوول 1 2 1
</Mr.Tn6eL> Posted April 8, 2019 Posted April 8, 2019 On 22/02/2019 at 03:48, #_iMr,[E]coo said: @!#DesTroyeR_,) function getPlayerInfo ( Player , Type ) if ( isElement ( Player ) ) and ( getElementType ( Player ) == 'player' ) then local Table = { [ 'Name' ] = getPlayerName ( Player ) , [ 'Serial' ] = getPlayerSerial ( Player ) , [ 'Money' ] = getPlayerMoney ( Player ) , [ 'TeamName' ] = getPlayerTeam ( Player ) and getTeamName ( getPlayerTeam ( Player ) ) or '' } if ( not Table [ Type ] ) then return false end return Table [ Type ] end end أعدت كتابة الفنشكن وخليته يقبل عدد لامحدود من البيانات ويقبل الالمنت داتا PLAYER_DATA = { "serial", "money", "team" = function(player) local team = getPlayerTeam(player) return team and getTeamName(team) end, "&level", "&clan", "name", "wantedLevel", "&kills", tag = function(player) return getPlayerName(player):match "^%b[]" end, -- u cann add more... -- x = getPlayerX -- &x = getElementData(player, x) -- x() = custom function } function getPlayerInfo(player) if isElement(player) and getElementType(player) == "player" then local data = [] for k, v in pairs(PLAYER_DATA) do local pre = v:sub(1, 1) == "&" if pre then data[v:sub(2)] = getElementData(player, v) elseif type(v) == "function" then data[k] = v(player) else data[v] = _G["getPlayer"..v:gsub("^%a", string.upper)](player) end end return data end end On 29/03/2019 at 17:01, KillerX said: السلام عليكم ورحمه الله وبركاتة امس في القسم الاجنبي عضو سال ازاي يجيب اقرب بيد بالنسبة لنقطة عطيتو الفنكشن بس حبيت اطوروا اكثر getNearsetElmFromXYZ الفنكشن عبارة عن يجيبلك اقرب اليمنت بالنسبة لنقطة معينة ( الساينتكس / syntax ) : function getNearsetElmFromXYZ( etype , x , y , z ) etype : نوع الاليمنت x , y , z : احداثيات النقطة ( السورس كود / Source Code ) : function getNearsetElmFromXYZ( etype , x , y , z ) local elements , positions , element = getElementsByType( etype ) , { } , { } if( ( not elements ) or ( #elements == 0 ) ) then return false end for index = 1 , #elements do positions[ index ] = getDistanceBetweenPoints3D( x , y , z , getElementPosition( elements[ index ] ) ); element[ positions[ index ] ] = elements[ index ]; end return element[ math.min( unpack( positions ) ) ]; end ودا مثال يجيب معلومات اقرب سيارة بالنسبة لمكان الاعب addCommandHandler( "getNearsetVeh" , function( plr ) local nearstVehicle = getNearsetElmFromXYZ( "vehicle" , getElementPosition( plr ) ); if( not nearstVehicle ) then return outputChatBox( "There\'s not vehicles" ); end outputChatBox( "Name : " .. getVehicleName( nearstVehicle ) ); outputChatBox( "Model : " .. getElementModel( nearstVehicle ) ); end ) @Master_MTA --> معلش علي اللون الاخضر ما اقدر اقاوم لوول اختصرها بtable.sort for index = 1 , #elements do table.insert(element, getDistanceBetweenPoints3D( x , y , z , getElementPosition( elements[ index ] ) ) end table.sort(element) return element[1]; 2 1
iMr.WiFi..! Posted April 8, 2019 Posted April 8, 2019 10 hours ago, </Mr.Tn6eL> said: أعدت كتابة الفنشكن وخليته يقبل عدد لامحدود من البيانات ويقبل الالمنت داتا PLAYER_DATA = { "serial", "money", "team" = function(player) local team = getPlayerTeam(player) return team and getTeamName(team) end, "&level", "&clan", "name", "wantedLevel", "&kills", tag = function(player) return getPlayerName(player):match "^%b[]" end, -- u cann add more... -- x = getPlayerX -- &x = getElementData(player, x) -- x() = custom function } function getPlayerInfo(player) if isElement(player) and getElementType(player) == "player" then local data = [] for k, v in pairs(PLAYER_DATA) do local pre = v:sub(1, 1) == "&" if pre then data[v:sub(2)] = getElementData(player, v) elseif type(v) == "function" then data[k] = v(player) else data[v] = _G["getPlayer"..v:gsub("^%a", string.upper)](player) end end return data end end اختصرها بtable.sort for index = 1 , #elements do table.insert(element, getDistanceBetweenPoints3D( x , y , z , getElementPosition( elements[ index ] ) ) end table.sort(element) return element[1]; عندك سطر ٢٥ حاط مصفوفة بدل جدول..
Master_MTA Posted May 16, 2019 Posted May 16, 2019 (edited) On 09/04/2019 at 10:08, said: تعودت ? وش هيي هذي اللغه php? c++ c# java Edited May 16, 2019 by Master_MTA
salh Posted June 7, 2019 Posted June 7, 2019 (edited) guiSetProgressBarRun واضح من الاسم Syntax guiSetProgressBarRun(progressBar theProgressbar, float ProgressBarCount, float ProgressBarCountPlus) theprogrssbar = البار ProgressBarCount = البار يبداء عند رقم ProgressBarCountPlus = كم يزيد البار في الثانيه (الكود) function guiSetProgressBarRun ( guiElement, ProgressBarCount, ProgressBarCountPlus ) if not guiElement == "gui-progressbar" or not ProgressBarCount or not ProgressBarCountPlus then outputDebugString("Bad arugment @ guiSetProgressBarRun ",0,255,0,0) return end guiProgressBarSetProgress ( guiElement ,tonumber( ProgressBarCount ) ) setTimer( function ( ) if not tonumber ( ProgressBarCount ) then return false end ProgressBarCount = ProgressBarCount + ProgressBarCountPlus guiProgressBarSetProgress ( guiElement ,tonumber( ProgressBarCount ) ) end , 1000 , ProgressBarCount ) end (مثال) addEventHandler("onClientResourceStart", resourceRoot, function() salh = guiCreateProgressBar(393, 533, 438, 65, false) guiSetProgressBarRun(salh, 0, 10) end ) اذا كان عندي اي خطاء علموني ابي اتعلم من اخطائي (: Edited June 7, 2019 by salh
Master_MTA Posted June 10, 2019 Posted June 10, 2019 On 07/06/2019 at 09:20, salh said: عندي انا عندي لك اقتراح بدال ما تستخدم التايمر استخدم الريكرشن ميثود بالتوفيق 1
Master_MTA Posted June 10, 2019 Posted June 10, 2019 2 minutes ago, salh said: (: function guiSetProgressBarRun ( guiElement, ProgressBarCount, ProgressBarCountPlus,isdone ) if not guiElement == "gui-progressbar" or not ProgressBarCount or not ProgressBarCountPlus then outputDebugString("Bad arugment @ guiSetProgressBarRun ",0,255,0,0) return end if not isdone then guiProgressBarSetProgress ( guiElement ,tonumber( ProgressBarCount ) ) end if guiProgressBarGetProgress(guiElement)<100 then guiProgressBarSetProgress ( guiElement ,tonumber( ProgressBarCount )+ProgressBarCountPlus ) guiSetProgressBarRun ( guiElement, ProgressBarCount, ProgressBarCountPlus,true ) end return true end اتوقع كذا طريقة الريكرشن جرب الارقمنت الاخير مالك دخل فيه استخدمه زي ما تستخدمه انت بالاول جرب وقولي ذذ
salh Posted June 10, 2019 Posted June 10, 2019 طيب الحين وش الفرق اذا استحدمت الريكاشون ميثود او التايمر.؟
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