Jump to content

' A F .

Members
  • Posts

    2,156
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by ' A F .

  1. 1- القسم خطأ 2 - إستخدم الداتا او الجدأول
  2. بالسيرفر انت مسوي تحقق ان البلأير موجود المفروض تحطه تحت وظيفة getPlayerFromName
  3. ' A F .

    طلب

    حأول ونساعدك .
  4. ' A F .

    طلب

    'onClientGUIClick' triggerServerEvent -- الطريقة الي انت مسويها عشان تفتح او تقفل الشات outputChatBox
  5. ماراح اعطيك الفنكنشات كلها لأنها كثيرة بس أغلب الشغل على ذا السكربت بالفنكنشن ذا executeSQLQuery or db database .
  6. مافهمت عليك كيف ماتحفظ اللامنت داتا بس تطلع وتدخل تروح . #Edit: تم إضافة وظيفة جديدة : getGroupDatas بإختصار ترجع لك جدول فيه الداتا الي مخزنها على القروب function getGroupDatas ( group ) if ( group and aclGetGroup ( group ) and GroupsData [ group ] ) then local datas = { } for k,v in pairs ( GroupsData [ group ] ) do table["insert"] ( datas , k ) ; end return datas end return { } end @!#NssoR_) عدل الرد لآهنت .
  7. addCommandHandler getPlayerSerial triggerClientEvent guiSetVisible showCursor getElementsByType -- 'player' getPlayerName 'onClientGUIClick' guiGridListGetSelectedItem guiGridListGetItemText triggerServerEvent tables -- save timer or executeSQLQuery or db functions or account data setTimer -- هنا تحط الكود الي تعطيه فيب سوأ كانت رتبه او اكاونت داتا انت وطريقتك
  8. سلآم عليكم .. جبت لكم وظائف جديدة وتفيد نوعاً ما . setGroupData - getGroupData - removeGroupData - getGroupDatas كلها بجأنب سيرفر . Server side . بأختصار الوظيفة تحط لك قيمة على قروب معين من الاسل . نفس نظام المنت داتا و اكاونت داتا getGroupDatas = بإختصار ترجع لك جدول فيه الداتا الي مخزنها على القروب Useful functions : local GroupsData = { } ; function setGroupData ( group , data , value ) if ( group and data and aclGetGroup ( group ) ) then if not GroupsData[group] then GroupsData[group] = {} end GroupsData[group][data] = value end end function getGroupData ( group , data ) if ( group and data and aclGetGroup ( group ) and GroupsData[group] and GroupsData[group][data]) then return GroupsData[group][data] end return "false" end function getGroupDatas ( group ) if ( group and aclGetGroup ( group ) and GroupsData [ group ] ) then local datas = { } for k,v in pairs ( GroupsData [ group ] ) do table["insert"] ( datas , k ) ; end return datas end return { } end function removeGroupData ( group , data ) if ( group and data and aclGetGroup ( group ) and GroupsData[group] and GroupsData[group][data] ) then GroupsData[group][data] = nil end return "false" end أمثله . addCommandHandler("act",function(player) -- act = Add Console Tag ; setGroupData ( "Console" , "Tag","* [ #00cc00Console #ffffff]" ) ; outputChatBox ( "* Done ",player,0,255,0,true ) ; end ) ; addCommandHandler ( "gct" , function ( player ) -- gct = Get Console Tag local tag = getGroupData ( "Console" , "Tag" ) ; if ( tag ~= "false" ) then outputChatBox(tag,player,255,255,255,true); end end ) ; addCommandHandler("rct" , function ( player ) -- rct = Remove Console Tag removeGroupData ( "Console" , "Tag" ) ; outputChatBox("* Done",player,0,255,0,true) end ) ; وبالتوفيق للجميع
  9. بالنسبة للدوس اتاك كلم صآحب الخآدم هو الي يقدر يفيدك , بالنسبة للطلب الثاني ركب لوحة ادمنية محمية من كتأبة الاكواد وبس . واحذف سكربت اسمه runcode .
  10. تحقق ان اللاعب موجود عشان يتجنب الاخطاء . وتحقق ان فيه شيء مكتوب بالايديت ويكون رقم . فقط لتجنب الاخطاء ^ .
  11. addEventHandler("onPlayerLogin",root,function (_,acc) local accountName = getAccountName(acc) local team = getPlayerTeam (source) if ( team and getTeamName ( team ) == "Staff Team" ) then if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if getElementData(source,"invincible") then setElementData(source,"invincible",true) else setElementData(source,"invincible",false) end end end end ); try .
  12. addEventHandler("onClientPlayerChoke",root,function() if ( source == localPlayer and getPlayerTeam ( localPlayer ) and getPlayerTeam ( localPlayer ) == getTeamFromName("Police") ) then cancelEvent ( ) end end ) ;
  13. حياك الله , كفوك
  14. addEvent("onZombieWasted") addEventHandler( "onZombieWasted", getRootElement(), function (killer) killerName = getPlayerName(killer) weapon = getPedWeapon(killer) wr, wg, wb = getPlayerNametagColor(killer) exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) end) ذا من مود زومبي .
  15. 6/10 الفكرة نوعاً ما قديمة , والتنسيق مو متنآسق
  16. addEventHandler ( "onClientGUIClick" , root , function ( ) if ( source == GUIEditor.button[6] ) then if guiGetVisible ( GUIEditor.window[77] ) then guiSetVisible ( GUIEditor.window[77], false ) guiSetInputEnabled(false) else guiSetVisible ( GUIEditor.window[77], true ) guiSetInputEnabled(true) end end end );
  17. Client : GUIEditor = { edit = {}, button = {}, window = {}, label = {}, gridlist = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 431) / 2, (screenH - 402) / 2, 431, 402, "Tag Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFEFE") GUIEditor.gridlist[1] = guiCreateGridList(9, 22, 230, 370, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Players", 0.9) GUIEditor.edit[1] = guiCreateEdit(250, 32, 171, 31, "التاج", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(250, 70, 171, 32, "#FFFFFF", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(246, 325, 75, 29, "حذف", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFEFE") GUIEditor.button[2] = guiCreateButton(346, 325, 75, 29, "تفعيل", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFFFEFE") GUIEditor.label[1] = guiCreateLabel(316, 373, 99, 19, "Created By #S3eeD", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 225, 0, 0) guiSetVisible( GUIEditor.window[1], false) end ) addEvent ( 'open', true ) addEventHandler ( 'open', root, function ( ) if guiGetVisible (GUIEditor.window[1]) then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) guiSetInputEnabled ( false ) else guiSetVisible (GUIEditor.window[1], true ) showCursor ( true ) guiSetInputEnabled ( true ) end end ) ---------- function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) -------------- addEventHandler("onClientGUIClick",root,function () if( source == GUIEditor.button[2] ) then local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ; if ( sel ~= 0 and guiGetText ( GUIEditor.edit[1] ) ~= "" ) then triggerServerEvent ( "AddTag" , localPlayer , guiGridListGetItemText ( GUIEditor.gridlist[1] , sel , 1 ) , guiGetText ( GUIEditor.edit[1] ) ); end elseif( source == GUIEditor.button[1] ) then triggerServerEvent("DelTag",localPlayer) outputChatBox('# [TagSystem]: تم ارجاع التاج كما كان ',255,0,0,true ) end end ) outputChatBox('# [TagSystem]: Created By #S3eeD',0,255,0,true ) Server : addCommandHandler ( 'open', function ( thePlayer ) accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ('user.'..accName, aclGetGroup ( "Console" ) ) then triggerClientEvent( thePlayer, 'open', thePlayer ) else outputChatBox ( "* You Don't Have Permissions !!", thePlayer, 255, 0, 0, true ) end end ) executeSQLQuery("CREATE TABLE IF NOT EXISTS PlayersTag (player, serial, tag, colour)") addEventHandler("onPlayerChat",root,function (msg) local tag = getElementData(source,"tag") or 'player' local colour = getElementData(source,"colour") or '#FFFFFF' outputChatBox("#FF0000 # #FFFFFF[ #CD0000"..tag .."#FFFFFF ]x #A5A5A5".. getPlayerName(source) .. ""..colour.." : ".. msg.."",root, 255, 255, 255, true) return cancelEvent() end) ------------ function getPlayerTag ( player ) local playerSerial = player and getPlayerSerial ( player ) local playerResult = executeSQLQuery("SELECT * FROM PlayersTag WHERE serial = ? ", playerSerial ) if ( #playerResult ~= 0 and type ( playerResult ) == "table" ) then return playerResult [ 1 ] [ "tag" ] , playerResult [ 1 ] [ "colour" ] end return false end function savePlayerTag ( player ) local playerSerial = player and getPlayerSerial ( player ) local playerTag = getElementData ( player , "tag" ) or false local playerColor = getElementData ( player , "colour" ) or false local playerName = getPlayerName ( player ) if ( not playerTag or not playerColor ) then return false end if ( getPlayerTag ( player ) ~= false ) then executeSQLQuery("UPDATE PlayersTag SET player=?,tag=?,colour=? WHERE serial=?", playerName, playerTag, playerColor,playerSerial) else executeSQLQuery("INSERT INTO PlayersTag(player, serial, tag, colour) VALUES(?,?,?,?)", playerName, playerSerial, playerTag, playerColor) return true end return false end addEventHandler("onPlayerQuit", root, function ( ) savePlayerTag ( source ) end ) addEventHandler("onPlayerLogin", root, function ( ) local playerTag , playerColor = getPlayerTag ( source ) if ( playerTag and playerColor ) then setElementData ( source , "tag" , playerTag ) setElementData ( source , "colour" , playerColor ) end end ) ------------- function DeletePlayerTag ( player ) if ( getPlayerTag ( player ) == false ) then return false end local playerSerial = getPlayerSerial ( player ) executeSQLQuery("DELETE FROM PlayersTag WHERE serial=?", playerSerial ) setElementData ( player , "tag" , false ) setElementData ( player , "colour" , false ) return true end addEvent("DelTag",true) addEventHandler("DelTag", root, function ( ) DeletePlayerTag ( source ) end ) addEvent("AddTag",true) addEventHandler("AddTag", root , function ( plr , value ) if ( getPlayerFromName ( plr ) ) then setElementData ( getPlayerFromName ( plr ) , "tag" , value ) ; savePlayerTag ( getPlayerFromName ( plr ) ) end end );
  18. addEvent("AddTag",true) addEventHandler("AddTag", root , function ( plr , value ) if ( getPlayerFromName ( plr ) ) then setElementData ( getPlayerFromName ( plr ) , "tag" , value ) ; savePlayerTag ( getPlayerFromName ( plr ) ) outputChatBox("Right!",source,100,100,100,true) end end) شوف يجيك بالشات ولا
  19. -- # Client addEventHandler ( "onClientGUIClick" , root , function ( ) if ( source == GUIEditor.button[1] ) then local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ; if ( sel ~= 0 and guiGetText ( GUIEditor.edit[1] ) ~= "" ) then triggerServerEvent ( "AddTag" , localPlayer , guiGridListGetItemText ( GUIEditor.gridlist[1] , sel , 1 ) , guiGetText ( GUIEditor.edit[1] ) ); end end end ); -- # Server addEvent("AddTag",true) addEventHandler("AddTag", root , function ( plr , value ) if ( getPlayerFromName ( plr ) ) then setElementData ( getPlayerFromName ( plr ) , "tag" , value ) ; savePlayerTag ( getPlayerFromName ( plr ) ) end end)
  20. اذا حطيته اطلع وأدخل شوف يجيك ولا ؟
  21. مشكور على التعديل مأنتبهت
×
×
  • Create New...