Jump to content

MR.GRAND

Members
  • Posts

    854
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by MR.GRAND

  1. الإند ارفعها قبل ال else
  2. الخطأ واضح مثل عين الشمس, انت حاط 2 else وموحاط انهاء للشرط بال else الأولى ... انت سويتهم اثنينهم وماسويت ايقاف للشرط بعد ماتتحقق من عدم صحة الشرط او صحته, حط الأند بعد else الأولى .
  3. إزالة اكواد الألوان من السترنق ... كمثال #FF0000
  4. You know i used assert before in that code but i'm trying different thing . That's not a problem ... i can make it very easy and short, but i've to change it for be much better to use . عارف انه اقدر اختصرها بـ ذا,,, وانا مسويه بكم سطر من الكود بس حبيت اخلي رسائل الديبوق منظمة, الحمراء لو كان طالع خطأ بالأرقمنتات والباقي لو جاء خطأ ثاني واللي هو لو ماكان موجود القروب بالأرقمنت الأول او القروب موجود بالأرقمنت الثاني ... تلاحظ وجود ارقمنت ثاني بعد الكلام في أيرور ... نوع رسالة الخطأ وهو اللي كنت ابي احطه .
  5. انا سويتها كذا عشان اضبطها للكل , واخليها شيء محكم ومايقبل الغلط ... أدري انها شغلة سهلة وكلها سالفة 5 سطور إذا مو اقل
  6. Wow, good job brother, I hope you finish this script successfully Good luck
  7. بالنسبة لــ --#Client side getPlayerMoney( player ) or getPlayerMoney( ) نفس الشيء ^ وماراح يتغير شيء بينهم ^ الإثنين راح يجيبون فلوس اللاعب المحلي . تقدر تجرب ^
  8. If you want to check if the specified account is already registered below you just need to put if after get account like this اذا تبي تتحقق اذا الحساب المحدد موجود ومسجل مسبقا انت تحتاج فقط تسوي كذا local account = getAccount( string accountName ) if ( account ~= false ) then ... end -- complete code if the account is already exists, return otherwise -- راح يكمل الوظيفة لو ان الحساب موجود, راح يرجع ويوقف الوظيفة لو العكس
  9. يفترض بالبداية تقص الكود حقك CTRL + X + تروح تحدد الخيار UTF-8 - /2 هذي التشفيرة هي افضل تشفيرة واللي معتمدينها mta ومن ثم تلصق الكود وتسوي حفظ .
  10. player getAccountPlayer ( account theAccount ) player = اللاعب راح يرجعلك قيمة اللاعب نفسه
  11. local account = getAccount( string theText ) local player = getAccountPlayer( account ) Required Arguments theAccount: The account you wish to get the player of. /// not string
  12. aclGroupClone Useful Function This function clone a group to another group with/without ACLs and/or objects . / هذه الوظيفة تقوم بنسخ قروب معين إلى إسم قروب آخر مع\بدون الأسلات و\او الأوبجكتات Syntax bool aclGroupClone ( string groupToClone, string groupName, bool cloneACLs, bool cloneObjects ) Required Arguments groupToClone: The group name to clone / اسم القروب المراد نسخه groupName: The new group name after clone / اسم القروب الجديد المراد النسخ له cloneACLs: true to clone group ACLS, false to dismiss ACLS clone / قيمة صح او خطأ - لنسخ او ايقاف نسخ الأسلات الخاصة بالقروب cloneObjects: true to clone group objects, false to dismiss group objects / قيمة صح او خطأ لنسخ او ايقاف الأوبجكتات الخاصة بالقروب Returns Return true if success, false otherwise. Code / الكود function aclGroupClone( clonedGroup, groupName, aclsClone, objectsClone ) if ( type( clonedGroup ) ~= 'string' ) then error( "Bad argument @ 'aclGroupClone' [Expected string at argument 1, got " .. tostring( clonedGroup ) .. "]" ) return false end if ( aclsClone == true or aclsClone == false ) then if ( objectsClone == true or objectsClone == false ) then local cloned = aclGetGroup( clonedGroup ) if ( cloned == false or not cloned ) then outputDebugString( "Bad argument @ 'aclGroupClone' [Expected acl-group at argument 1, got string '" .. tostring( clonedGroup ) .. "']", 2 ) return false end local newGroup = aclCreateGroup( groupName ) if ( newGroup == false or not newGroup ) then outputDebugString( "Bad argument @ 'aclGroupClone' [Expected acl-group at argument 2, got string '" .. tostring( groupName ) .. "']", 2 ) return false end if ( aclsClone == true ) then for index, value in ipairs( aclGroupListACL( cloned ) ) do aclGroupAddACL( newGroup, value ) end end if ( objectsClone == true ) then for index, value in ipairs( aclGroupListObjects( cloned ) ) do aclGroupAddObject( newGroup, value ) end end outputDebugString( "'aclGroupClone' [The group '"..clonedGroup.."' has been cloned successfully to '"..groupName.."' .", 3 ) return true else error( "Bad argument @ 'aclGroupClone' [Expected boolean at argument 4, got " .. tostring( objectsClone ) .. "]" ) return false end else error( "Bad argument @ 'aclGroupClone' [Expected boolean at argument 3, got " .. tostring( aclsClone ) .. "]" ) return false end end Example / مثال addEventHandler( 'onResourceStart', resourceRoot, function( ) setTimer( aclGroupClone, 1000, 1, 'Console', 'OwnersGroup', true, true ) -- Clone 'Console' Group to 'OwnersGroup' and clone ACLs and objects end ) Author: MR.GRAND Hint: This function can be useful, Shortcut way to clone groups and rights and objects Wiki page: aclGroupClone
  13. I said something here ; Previous topic
  14. --#Client side addEventHandler( 'onClientGUIClick', GUIEditor.button[1], function( ) local plrMoney = getPlayerMoney( localPlayer ) if ( not plrMoney >= 5000 ) then outputChatBox( '* Error : You don\'t have enough money !', 255, 0, 0, true ) return end triggerServerEvent( 'onServerSetArmor', localPlayer ) end, false ); --#Server side addEvent( 'onServerSetArmor', true ) addEventHandler( 'onServerSetArmor', root, function( ) local isTaked = takePlayerMoney( source, 5000 ) if ( isTaked ) then setPedArmor( source, 100 ) end end );
  15. I think he said something about comboBox no checkBox ^ أعتقد هو قال عن الكومبو بوكس مو التشيك بوكس
  16. I Think this this topic must be moved in Arabic section \ البرمجة In that place you will get the answer about your topic .
  17. --#Client side serialTable = { ["D30DD1F9735A43BBD31BB15F655D5EA2"] = true, }; local screenW, screenH = guiGetScreenSize() DaamWind = guiCreateWindow((screenW - 696) / 2, (screenH - 418) / 2, 696, 418, "", false) guiWindowSetSizable(DaamWind, false) guiSetAlpha(DaamWind, 1.00) guiSetVisible(DaamWind,false) Lab = guiCreateLabel(0.35, 0.08, 0.33, 0.05, "-| لوحة اعلى 30 داعم للسيرفر |-", true, DaamWind) guiSetFont(Lab, "default-bold-small") guiLabelSetColor(Lab, 13, 254, 252) DaamWin = guiCreateGridList(0.03, 0.17, 0.95, 0.61, true, DaamWind) guiSetFont( DaamWin , "default-bold-small") Row = guiGridListAddColumn(DaamWin, "اسم اللاعب", 0.5) xRow = guiGridListAddColumn(DaamWin, "المبلغ", 0.5) BTN = guiCreateButton(0.29, 0.83, 0.39, 0.09, "close|#|اغلاق", true, DaamWind) guiSetProperty(BTN, "NormalTextColour", "FF5CFE0C") LAB2 = guiCreateLabel(0.03, 0.88, 0.14, 0.05, "By Mr.Kamaro", true, DaamWind) guiSetFont(LAB2, "default-bold-small") guiLabelSetColor(LAB2, 13, 254, 252) GUIELAB3 = guiCreateLabel(0.79, 0.90, 0.03, 0.06, "*", true, DaamWind) guiSetFont(GUIELAB3, "sa-header") guiLabelSetColor(GUIELAB3, 13, 254, 252) GUIELAB4 = guiCreateLabel(0.94, 0.90, 0.03, 0.06, "*", true, DaamWind) guiSetFont(GUIELAB4, "sa-header") guiLabelSetColor(GUIELAB4, 254, 14, 14) GUIELAB5 = guiCreateLabel(0.86, 0.90, 0.03, 0.06, "*", true, DaamWind) guiSetFont(GUIELAB5, "sa-header") guiLabelSetColor(GUIELAB5, 92, 254, 12) EdarhBTN = guiCreateButton(0.02, 0.95, 0.06, 0.03, "ادارة", true, DaamWind) EdarhWND = guiCreateWindow(0.25, 0.17, 0.24, 0.21, "ادارة اللوحة", true) guiSetVisible(EdarhWND,false) PlayerEdit = guiCreateEdit(0.03, 0.27, 0.59, 0.16, "", true, EdarhWND) PriceEdit = guiCreateEdit(0.03, 0.62, 0.59, 0.16, "", true, EdarhWND) LabPlayer = guiCreateLabel(0.02, 0.14, 0.59, 0.10, "اسم اللاعب", true, EdarhWND) guiSetFont(LabPlayer, "default-bold-small") guiLabelSetColor(LabPlayer, 0, 251, 254) guiLabelSetHorizontalAlign(LabPlayer, "center", false) guiLabelSetVerticalAlign(LabPlayer, "center") labPrice = guiCreateLabel(0.02, 0.53, 0.59, 0.10, "المبلغ", true, EdarhWND) guiSetFont(labPrice, "default-bold-small") guiLabelSetColor(labPrice, 0, 251, 254) guiLabelSetHorizontalAlign(labPrice, "center", false) guiLabelSetVerticalAlign(labPrice, "center") addData = guiCreateButton(0.63, 0.25, 0.28, 0.17, "اضافة", true, EdarhWND) --PriceSend = guiCreateButton(0.63, 0.61, 0.28, 0.17, "اضافة", true, EdarhWND) Close_Btn = guiCreateButton(0.84, 0.84, 0.13, 0.10, "X", true, EdarhWND) addCommandHandler('داعم', function() guiSetVisible(DaamWind,true) showCursor( true ) end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == addData ) then local playerText = guiGetText(PlayerEdit) local priceText = guiGetText(PriceEdit) if ( playerText == "" ) or ( priceText == "" ) then outputChatBox("يجب كتآبة التحديث",255,255,0,true) return end triggerServerEvent ( 'add:SQL:data' , localPlayer , playerText , priceText ) guiSetVisible ( EdarhWND , false ) guiSetVisible ( DaamWind , true ) showCursor ( true ) guiSetInputEnabled(false) guiSetText(PlayerEdit,"" ) guiSetText(PriceEdit,"" ) elseif ( source == BTN ) then guiSetVisible(DaamWind, false) showCursor(false) guiSetInputEnabled(false) elseif ( source == Close_Btn ) then guiSetVisible(EdarhWND,false) showCursor(false) elseif ( source == EdarhBTN ) then local serial = getPlayerSerial() if serialTable[serial] then guiSetVisible(EdarhWND,true) guiSetVisible(DaamWind,false) showCursor(true) end end end ) addEvent('refresh:my:grid' , true ) addEventHandler('refresh:my:grid' , root, function ( sqlTable ) if sqlTable then for Value1 , Value2 in ipairs ( sqlTable ) do local myRow = guiGridListAddRow ( DaamWin ) guiGridListSetItemText ( DaamWin , myRow , 1 , Value2.player , false , false ) guiGridListSetItemText ( DaamWin , myRow , 2 , Value2.price , false , false ) guiGridListSetItemColor ( DaamWin , myRow , 1 , math.random ( 255 ), math.random ( 255 ), math.random ( 255 ) ) guiGridListSetItemColor ( DaamWin , myRow , 2 , math.random ( 255 ), math.random ( 255 ), math.random ( 255 ) ) end end end ) addEventHandler("onClientRender",root, function() if guiGetVisible(DaamWind,false) then showCursor(true) end end ) --#Server side executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS donatorTable ( player, price )' ) function refreshGrids( ) setTimer( function( ) result = executeSQLQuery( 'SELECT * FROM donatorTable' ) if ( type ( result ) == "table" and #result == 0 or not result ) then return end triggerClientEvent ( root , 'refresh:my:grid' , root , result ) end, 1000, 1 ) end addEvent('EventS', true ) addEventHandler('EventS' , root, refreshGrids) addEventHandler('onResourceStart' , resourceRoot, refreshGrids) addEvent('add:SQL:data', true ) addEventHandler('add:SQL:data' , root , function ( playerText, priceText ) if playerText and priceText then result = executeSQLQuery("SELECT * FROM `donatorTable` WHERE `player` =?", playerText) if ( type ( result ) == "table" and #result == 0 ) or not result then executeSQLQuery( 'INSERT INTO donatorTable (player, price) VALUES ( ?,? )' , playerText, priceText ) refreshGrids() else local updatePrice = result[1]["price"] + priceText executeSQLQuery( 'UPDATE donatorTable SET price =? WHERE player =?', updatePrice, playerText) refreshGrids() end end end ) لو حليت المشكلة خلاص ^ ماشفت الردود لأن الموضوع مارفرشته
  18. value: The value you wish to store. Set to false to remove the data.
  19. Note: This function may cause performance issues with client and/or server.
  20. يب اتذكرك هههه تعال شوف الشات الخاص بنفس المكان ^^ أهلا وسهلا بك, شكرا للتعليق
  21. i did it right now with db, and it's working successfully but when i want to use tables instead of db can you give me example for this tables because i have a trouble with get data from tables ...
×
×
  • Create New...