Jump to content

Gridlist


Recommended Posts

السلآم عليكم ورحمة الله وبركاته :D

اتس مي, نيكلز بو الاسئلة ض1

الزبدة تكفون ساعدوني, عندي جريد لست قروش اممي

القصة كـ التالي :

هذا المود هو اعلانات, يعني عندك سلاح بتبيعه, او عندك قروب وتبي اعضاء, تقدر تحط عرضك في هذا النافذ (ads)

المشكلة ان المود هذا, اذا جيت انا كتبت شي وارسلته, يطلع كل شي اوكي, بس لو جا خويي تطلع المشاكل

1. انه مايطلع له الاعلان, وهذا اتوقع اني احتاج احدث الجريد لست, وطبعاً ماشاء الله علي ماعرف ض1

2. ان لو خويي كتب شي, يطلع له الاعلانين, بس يطلع اللي كتبه مرتين, مثلآ

انا : هلا

خويي : اهلين

يطلع لي كذا

انا : هلا

انا : هلا

ولخويي نفس الشي, يعني يطلع لكل واحد, اللي كتبه هو

الزبدة هذا الكود

--#Client 
function setit(thePlayer) 
  if source == GUIEditor.button[1] then 
    gText = guiGetText(GUIEditor.edit[1]) 
    if gText ~= "" then 
    row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
    triggerServerEvent("onSendMsg", localPlayer, guiGetText ( GUIEditor.edit[1] )) 
  end  
end  
end 
addEventHandler ( "onClientGUIClick", root, setit) 
  
addEvent("onAddMsg", true) 
addEventHandler("onAddMsg", root, function ( source ) 
local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
guiGridListSetItemText( GUIEditor.gridlist[1], Row, msgC,  tostring(gText), false, false ) --msgC = Msg's columen 
guiGridListSetItemText( GUIEditor.gridlist[1], Row, plrC,  getPlayerName( source ), false, false ) -- plrC = Player's columen 
end) 

--#Server 
addEvent("onSendMsg", true) 
addEventHandler("onSendMsg", root, function ( msg ) 
triggerClientEvent( root, "onAddMsg", root, msg ) 
end) 

طبعا الهريسة مسوينها انا وبوشنب, بس بوشنب كان مشغول ولا كمل معي لبى قلبه <3

Link to comment

function setit() 
    if source == GUIEditor.button[1] then 
        gText = guiGetText(GUIEditor.edit[1]) 
    if gText ~= "" then 
        row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
        triggerServerEvent("onSendMsg", localPlayer, gText) 
        end 
    end 
end 
addEventHandler ( "onClientGUIClick", root, setit) 
     
addEvent("onAddMsg", true) 
addEventHandler("onAddMsg", root, 
function() 
    for i, player in ipairs (getElementsByType ("player")) do 
        local Name = string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "") 
        local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
        guiGridListSetItemText( GUIEditor.gridlist[1], Row,tostring(gText), false, false ) 
        guiGridListSetItemText( GUIEditor.gridlist[1], Row,Name, false, false ) 
    end 
end 
) 

+

الكود ناقص.

Edited by Guest
Link to comment
شوف انت زبطت مشكلة انا ماقلتها, اللي هي الاسم ض1

بس مشكلة التكرار مازالت

Halp

الكود الي تشوفه مافيه شي

انا قلتلك فوق

الكود ناقص يمكن

الخطأ من الكود الي ماطرحته

بعدين انا دام اني بصلح

بصلح الي بشوفة قدامي حتى لو ماقلت لانه ممكن منه الخطأ وانت منت داري

Edited by Guest
Link to comment
شوف انت زبطت مشكلة انا ماقلتها, اللي هي الاسم ض1

بس مشكلة التكرار مازالت

Halp

لول الخطأ بالايتم

function setit() 
    if source == GUIEditor.button[1] then 
       Text = guiGetText(GUIEditor.edit[1]) 
    if gText ~= "" then 
       row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
       triggerServerEvent("onSendMsg", localPlayer,gText) 
        end 
    end 
end 
addEventHandler ("onClientGUIClick",root,setit) 
        
addEvent("onAddMsg", true) 
addEventHandler("onAddMsg", root, 
function() 
    for i, player in ipairs (getElementsByType ("player")) do 
      local Name = string.gsub(getPlayerName(player),"#%x%x%x%x%x%x","") 
      local Row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText(GUIEditor.gridlist[1],Row,1,tostring(gText),false,false) 
      guiGridListSetItemText(GUIEditor.gridlist[1],Row,1,Name,false,false)  
    end 
end 
) 

Edited by Guest
Link to comment

انا عدلت الايتم قبل لا تعدله انت, بس في مشكلة, اللي هي صار يطلع كلامي بأسمي وأسم خويي, يعني لو كتبت شي بيطلع ان انا كتبت هـ الشي, وخويي كتب نفس الشي

Link to comment

addEventHandler( "onClientGUIClick", GUIEditor.button[1], 
function() 
    if ( source == GUIEditor.button[1] ) then 
       gText = guiGetText(GUIEditor.edit[1]) 
    if gText ~= "" then 
       row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
       triggerServerEvent("onSendMsg", localPlayer,gText) 
        end 
    end 
end,false) 
   
addEvent("onAddMsg",true) 
addEventHandler("onAddMsg",root, 
function(gText) 
    for i, player in ipairs (getElementsByType ("player")) do 
      local Name = string.gsub(getPlayerName(player),"#%x%x%x%x%x%x","") 
      local Row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText(GUIEditor.gridlist[1],Row,msgC,1,tostring(gText),false,false) 
      guiGridListSetItemText(GUIEditor.gridlist[1],Row,plrC,2,Name,false,false)  
    end 
end 
) 

addEvent("onSendMsg", true) 
addEventHandler("onSendMsg", root, 
function (gText) 
    triggerClientEvent("onAddMsg",source,gText) 
end 
) 
Edited by Guest
Link to comment

جرب

    addEventHandler( "onClientGUIClick", root, 
    function() 
        if ( source == GUIEditor.button[1] ) then 
           gText = guiGetText(GUIEditor.edit[1]) 
        if gText ~= "" then 
           row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
           triggerServerEvent("onSendMsg", localPlayer,gText) 
            end 
        end 
    end 
   ) 
      
    addEvent("onAddMsg",true) 
    addEventHandler("onAddMsg",root, 
    function(gText) 
        for i, player in ipairs (getElementsByType ("player")) do 
          local Name = string.gsub(getPlayerName(player),"#%x%x%x%x%x%x","") 
          local Row = guiGridListAddRow (GUIEditor.gridlist[1]) 
          guiGridListSetItemText(GUIEditor.gridlist[1],Row,msgC,1,tostring(gText),false,false) 
          guiGridListSetItemText(GUIEditor.gridlist[1],Row,plrC,2,Name,false,false) 
        end 
    end 
    ) 

Link to comment
جرب
    addEventHandler( "onClientGUIClick", root, 
    function() 
           gText = guiGetText(GUIEditor.edit[1]) 
        if gText ~= "" then 
           row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
           triggerServerEvent("onSendMsg", localPlayer,gText) 
            end 
   ) 
      
    addEvent("onAddMsg",true) 
    addEventHandler("onAddMsg",root, 
    function(gText) 
        for i, player in ipairs (getElementsByType ("player")) do 
          local Name = string.gsub(getPlayerName(player),"#%x%x%x%x%x%x","") 
          local Row = guiGridListAddRow (GUIEditor.gridlist[1]) 
          guiGridListSetItemText(GUIEditor.gridlist[1],Row,msgC,1,tostring(gText),false,false) 
          guiGridListSetItemText(GUIEditor.gridlist[1],Row,plrC,2,Name,false,false) 
        end 
    end 
    ) 

  
addEventHandler( "onClientGUIClick", GUIEditor.button[1], 
    function() 
       gText = guiGetText(GUIEditor.edit[1]) 
       if gText ~= "" then 
        triggerServerEvent("onSendMsg",localPlayer,gText) 
    end 
end,false) 
          
addEvent("onAddMsg",true) 
addEventHandler("onAddMsg",root, 
function(gText) 
    for i, player in ipairs (getElementsByType ("player")) do 
      local Name = string.gsub(getPlayerName(player),"#%x%x%x%x%x%x","") 
      local Row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText(GUIEditor.gridlist[1],Row,1,tostring(gText),false,false) 
      guiGridListSetItemText(GUIEditor.gridlist[1],Row,2,Name,false,false) 
    end 
end 
) 

Edited by Guest
Link to comment
  • Other Languages Moderators
guiGridListSetItemText(GUIEditor.gridlist[1],Row,msgC,1,tostring(gText),false,false) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,plrC,2,Name,false,false) 

استبدل بهذا

guiGridListSetItemText(GUIEditor.gridlist[1],Row,msgC,tostring(gText),false,false) 
guiGridListSetItemText(GUIEditor.gridlist[1],Row,plrC,Name,false,false) 

Link to comment

هذا اخر شي حطيته, ومايشتغل

function sets() 
        gText = guiGetText(GUIEditor.edit[1]) 
        if gText ~= "" then 
        for i, player in ipairs (getElementsByType ("player")) do 
        local Name = string.gsub(getPlayerName(player),"#%x%x%x%x%x%x","") 
        local Row = guiGridListAddRow (GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1],Row,1,Name,false,false) 
        guiGridListSetItemText(GUIEditor.gridlist[1],Row,2,tostring(gText),false,false) 
        end 
    end 
    end 
    addEventHandler( "onClientGUIClick", root, sets) 

Link to comment

Client side #

addEventHandler ("onClientGUIClick", root, function () 
if (source == GUIEditor.button[1]) then 
tx = guiGetText (GUIEditor.edit[1]) 
if tx == "" then return end 
triggerServerEvent ("onSendMsg", localPlayer, guiGetText (GUIEditor.edit[1])) 
end 
end 
) 
  
addEvent ("onAddMsg", true) 
addEventHandler ("onAddMsg", root, function (whoSend, text) 
Row = guiGridListAddRow (GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, msgC, text, false, false) 
guiGridListSetItemText( GUIEditor.gridlist[1], Row, plrC, getPlayerName (whoSend), false, false ) 
end) 

Server side #

addEvent ("onSendMsg", true) 
addEventHandler ("onSendMsg", root, function (text) 
for k,v in ipairs (getElementsByType ("player")) do 
triggerClientEvent (v, "onAddMsg", v, source, text) 
end 
end) 
Link to comment
Client side #

addEventHandler ("onClientGUIClick", root, function () 
if (source == GUIEditor.button[1]) then 
tx = guiGetText (GUIEditor.edit[1]) 
if tx == "" then return end 
triggerServerEvent ("onSendMsg", localPlayer, guiGetText (GUIEditor.edit[1])) 
end 
end 
) 
  
addEvent ("onAddMsg", true) 
addEventHandler ("onAddMsg", root, function (whoSend, text) 
Row = guiGridListAddRow (GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, msgC, text, false, false) 
guiGridListSetItemText( GUIEditor.gridlist[1], Row, plrC, getPlayerName (whoSend), false, false ) 
end) 

Server side #

addEvent ("onSendMsg", true) 
addEventHandler ("onSendMsg", root, function (text) 
for k,v in ipairs (getElementsByType ("player")) do 
triggerClientEvent (v, "onAddMsg", v, source, text) 
end 
end) 

ورربي انكك شنب لبى قلبك , تم حل المشكلة

يغلق :mrgreen:

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...