Jump to content

فاّرس

Members
  • Posts

    4,805
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by فاّرس

  1. مو شرط يكون السورس سيرفر .
  2. getPlayerSerial Server-only function Note: The client side version of getPlayerSerial has been deprecated as it can return the wrong value for some players, and is potentially insecure. The following article assumes that the function is serverside only.
  3. أخطاء مطبعيه شكرا .
  4. It doesn't works in client side.
  5. لأن ما يمديك تحطها بالكلينت, انا حطيتها بالتريقر ف السيرفر وارسلتها للكلينت triggerClientEvent ( client, 'setAccount', client, getAccountName ( getPlayerAccount ( client ) ) ) addEventHandler ( 'setAccount', root, function( acc ) acc اذا ارسلت شي من السيرفر للكلينت او العكس, يجي زي البرامتر داخل الفنكشن مثل
  6. function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then guiSetVisible(window, true) showCursor(true) setElementData( localPlayer, 'm', { source_ = source, pos = {getElementPosition (source) } } ) end end addEventHandler ( "onClientMarkerHit", resourceRoot, MarkerHit ) addEventHandler("onClientGUIClick",button,function() if ( source == button) then guiSetVisible(window,false) showCursor(false) destroyElement(getElementData(localPlayer, 'm').source_ ) end end ) addEventHandler("onClientElementDestroy", resourceRoot,function () if getElementType(source) == "marker" and getElementData( localPlayer, 'm' ).source_ == source then local x,y,z = unpack (getElementData( localPlayer, 'm' ).pos) setTimer ( function() local bankmarker = createMarker( x, y, z, "cylinder", 1.5, 255, 0, 0, 255 ) end,3000,1) end end ) Note: resourceRoot for all markers in the script!
  7. ^ كودك خطأ . -- Client Side # addEventHandler( 'onClientResourceStart', resourceRoot, function ( ) triggerServerEvent ( 'getAccount', localPlayer ) end) addEvent ( 'setAccount', true ) addEventHandler ( 'setAccount', root, function( acc ) guiSetText ( Account, acc ) end) -- Server Side # addEvent ( 'getAccount', true ) addEventHandler ( 'getAccount', root, function ( ) if getPlayerAccount ( client ) and not isGuestAccount ( getPlayerAccount ( client ) ) then triggerClientEvent ( client, 'setAccount', client, getAccountName ( getPlayerAccount ( client ) ) ) end end )
  8. ..اتوقع كذا اسمه م اذكر اللعبه مو عندي broph.lua قيم مود بلي ملف
  9. onClientPlayerJoin : This event is triggered when a player joins a server. It is triggered for all players except the local player, as the local player joins the server before their client-side resources are started. It would also be possible for two players to join within a few seconds of each other and for the two players' scripts may not receive onClientPlayerJoin events as their scripts wouldn't have started yet. onPlayerLogin : ما يمديك تستخدمه باقي الكلينت ما تحمل .. @ صاحب الموضوع : سوي اللوحه وكل شي بدون زر وهي بتظهر اول ما يخلص تحميل اللاعب وخلصنا
  10. من الأساس كودك خطأ الصحيح تسوي كذا : addCommandHandler( "playsound", function ( command, ... ) local args = { ... } playSound( args[1] .. ".mp3") end ) Client string commandName, [string arg1, string arg2, ...]
  11. اذا بيستخدم الكود كذا غلط . شوف الأمثله بالويكي triggerServerEvent - triggerClientEvent تربط بين السيرفر والكلينت ب استخدام اما التحقق من الاسل تستخدم getPlayerAccount isGuestAccount getAccountName isObjectInACLGroup ناقصك تحقق من انه عنده تيم, لو اللاعب م عنده تيم؟ بيطلع خطأ. if getPlayerTeam (source) and getPlayerTeam (source) == getTeamFromName ("asf") then قيم مود بلي يسوي ريسباون, لازم تعدله اصلاً, + ضيف تايمر عشان يسوي ريسباون بعد ما يموت مثلا بعشر ثواني, والأفضل تعدل القيم مود.
  12. Try with resourceRoot and element data like this : local spots = { { 2490.173828125, -1670.1630859375, 12.3 }, { 2492.6298828125, -1675.1650390625, 12.3 } } GUIEditor = { button = {}, window = {} } window = guiCreateWindow(0.38, 0.28, 0.26, 0.48, "Loot Point", true) guiWindowSetSizable(window, false) guiSetVisible(window, false) button = guiCreateButton(0.25, 0.22, 0.49, 0.20, "M4", true, window) guiSetFont(button, "default-bold-small") cancel = guiCreateButton(0.25, 0.60, 0.49, 0.20, "Cancel", true, window) guiSetFont(cancel, "default-bold-small") for k,v in ipairs( spots ) do marker = createMarker ( v[1],v[2],v[3], "Cylinder", 1, 255, 255, 255, 100 ) end function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then guiSetVisible(window, true) showCursor(true) setElementData( localPlayer, 'm', source) end end addEventHandler ( "onClientMarkerHit", resourceRoot, MarkerHit ) addEventHandler("onClientGUIClick",button,function() if ( source == button) then guiSetVisible(window,false) showCursor(false) destroyElement(getElementData(localPlayer, 'm') ) end end )
  13. اطرح سطر 118 < لأنك حاط سترنق بدل التيم ف الارقومنت الثاني. اذا كنت تبي تضيف لاعب لتيم محدد سو كذا بدل الارقمونت الثاني .. getTeamFromName('asf') ^ طبعا سو تحقق اذا التيم موجود او لا .
  14. كلينت وبرامتر سيرفر؟؟, وما اشوف له داعي الجدول لأنك بتاخذ القيمه الأولى م فرقت
  15. كنت أقصد الالمنت داتا , تأثير السهر
  16. انت تقصد اذا كان من لفل1 الى الكونسل وضغط ع الزر يفتح له لوحه ويكتب له بالشات , واذا ماكان من الرتب ذي تفتح له لوحه ثانيه؟ الرتب ذي قروبات ادمن ولا كيف؟ اذا قروبات تفضل .. "onClientGUIClick" -- اذا ضغط ع الزر triggerServerEvent -- ترسل تريقر للسيرفر عشان تتحقق من القروب addEvent - addEventHandler -- عشان تعرٌف التريقر ^ getPlayerAccount - getAccountName - isGuestAccount -- تجيب حساب اللاعب واسم الحساب وتتحقق انه مسجل الدخول isObjectInACLGroup -- تتحقق اذا موجود بالاسل او لا triggerClientEvent -- ترسل تريقر للكلنت addEvent - addEventHandler -- تعرف التريقر ^ -- تسوي وظيفتك مثلاً تظهر النافذه تطلع كلام الخ ..
  17. ..وبعدها تكتب الكلام وبيظهر للكل root عشان تخلي الرساله بالجريد تظهر للكل ترسل تريقر للسيرفر ثم ترسل تريقر من السيرفر للكلنت ويكون ولما يجي يرسل رساله انت تسوي تحقق, سو المنت داتا او اكاونت داتا ...الخ, وسوي تحقق اذا كان عنده داتا مايقدر يرسل وكذا , سهله .. onClientKey بالنسبه للطلب الثاني استخدم
  18. -- #Client Side local screenW, screenH = guiGetScreenSize() dx = function() dxDrawLine(746 - 1, 299 - 1, 746 - 1, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 299 - 1, 746 - 1, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 782, 1175, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 782, 1175, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle((screenW - 429) / 2, (screenH - 483) / 2, 429, 483, tocolor(240, 32, 32, 255), false) dxDrawLine(746 - 1, 245 - 1, 746 - 1, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 245 - 1, 746 - 1, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 294, 1175, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 294, 1175, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle(746, 245, 429, 49, tocolor(240, 32, 32, 255), false) dxDrawText("[ F4 ] | Top Killers | [ F4 ]", 744, 244, 1175, 294, tocolor(0, 0, 0, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawRectangle(797, 333, 322, 388, tocolor(255, 255, 255, 255), false) end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end TopKill = guiCreateGridList(0.42, 0.31, 0.17, 0.36, true) guiSetVisible(TopKill,false) col = guiGridListAddColumn(TopKill,"Num :",0.30) col2 = guiGridListAddColumn(TopKill,"Name :",0.60) col3 = guiGridListAddColumn(TopKill,"Kills :",0.85) bindKey('f4','down', function() guiSetVisible (TopKill, not guiGetVisible(TopKill)) showCursor ( guiGetVisible ( TopKill ) ) if isEventHandlerAdded ("onClientRender", root,dx) then removeEventHandler("onClientRender", root,dx) else triggerServerEvent( 'getData', localPlayer ) addEventHandler("onClientRender", root,dx) end end) addEvent( 'setData', true ) addEventHandler ( 'setData', root, function(data) guiGridListClear ( TopKill ) table.sort ( data, function (a,b) return ( tonumber(a.Kills) or 0 ) > ( tonumber(b.Kills) or 0 )end) for k,v in ipairs ( data ) do local Row = guiGridListAddRow(TopKill) guiGridListSetItemText(TopKill,Row,1,k,false,false) guiGridListSetItemText(TopKill,Row,2,v.Name,false,false) guiGridListSetItemText(TopKill,Row,3,v.Kills,false,false) if k == 10 then break end -- هذا بس 10 ويوقف تقدر تعدله او تحذف السطر . end end) -- #Server Side .. Kills_ = {} addEventHandler('onResourceStart',resourceRoot,function () executeSQLQuery("CREATE TABLE IF NOT EXISTS `Killer` ( Serial, Name, Kills )") end ) addEventHandler("onPlayerWasted",root,function ( _,Killer ) if ( Killer and Killer ~= source and getElementType(Killer) == "player" ) then local playerSerial = getPlayerSerial( Killer ) local playerName = getPlayerName( Killer ) if not Kills_[Killer] then Kills_[Killer] = 0; end Kills_[Killer] = Kills_[Killer] + 1 local Sel = executeSQLQuery("SELECT * FROM `Killer` WHERE Serial=?", playerSerial) if ( type ( Sel ) == "table" and #Sel == 0 or not Sel ) then executeSQLQuery(" INSERT INTO `Killer` (Serial, Name, Kills) VALUES(?,?,?)",playerSerial,playerName,Kills_[Killer]) else executeSQLQuery(" UPDATE `Killer` SET Name =?, Kills =? WHERE Serial=?",playerName,Kills_[Killer],playerSerial) end end end) addEvent ( 'getData', true) addEventHandler ( 'getData', root, function() local db = executeSQLQuery("SELECT * FROM `Killer` ") if ( type ( db ) == "table" and #db == 0 or not db ) then return end triggerClientEvent ( source, 'setData', source, db ) end ) سطر 67 بالكلينت, هذا يجيب لك اعلى عشره تقدر تعدله, وللمعلوميه اذا كنت فاتح النافذه ما راح يحدث, يعني هو م بيحدث الا اذا فتحت النافذه
  19. toJSON - fromJSON : حسب معرفتي انها اذا سويت ريستارت للسكربت تروح .. استخدم السكل افضل, ومب صعبه, لها شروحات بالقسم .
  20. تحفظه ف سكل او اي وسيلة حفظ تكتب اسم الجدول داخلها وخلاص
  21. تقصد اذا ضغط ع الزر يضيف القيمه اللي بالاديت للجدول والجريد ليست تاخذ القيم من الجدول؟ اذا نقصد كذا م اشوف انك سويت شي صح, لازم تحفظ الجدول مو القيمه.
×
×
  • Create New...