Jump to content

طلب فنكشت قريد ليست


Recommended Posts

وش المشكله ب ذا الكود؟

--Client

addEventHandler("onClientGUIClick",root,function () 
if ( source == ButtonSendMsgOnSupport ) then 
local Text = guiGetText(EditMessage) 
if ( Text and Text ~= "" and Text ~= " " ) then 
triggerServerEvent("onSendMsg",localPlayer,Text) 
guiSetText(EditMessage,"") 
else 
outputChatBox("* Please Write Text",255,0,0,true) 
end 
elseif ( source == ButtonSendMsgOnSupport) then 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
guiSetInputEnabled(false) 
end 
end) 

--Server

addEvent("onSendMsg",true) 
addEventHandler("onSendMsg", root, 
function(Text) 
    local Text = getPlayerName(client):gsub("#%x%x%x%x%x%x","").." : "..Text 
    local support1 = isObjectInACLGroup("user."..getAccountName(getPlayerAccount(client)),aclGetGroup("Support")) 
    for i,v in ipairs (getElementsByType("player")) do 
        local support2 = isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)),aclGetGroup("Support")) 
        if support1 then 
            triggerClientEvent(v, "onGotMsg", client, Text) 
        elseif support2 or v == client then 
            triggerClientEvent(v, "onGotMsg", client, Text, support2) 
        end 
    end 
end) 

Link to comment

# By The Best Edit EH10 .

#Client .

addEventHandler('onClientGUIClick',root,function () 
    local row, col = guiGridListGetSelectedItem(GridList) 
    local name = guiGridListGetItemText(GridList,row,1) 
    local EH10 = guiGridListGetItemText(GridList,row,2) 
    if ( source == Button ) then 
        local plr = guiGetText(GridList) 
        local add = guiGetText(GridList) 
            triggerServerEvent('Save',localPlayer, plr,add) 
       end 
   end 
) 
  
addEvent ( 'AddDataName', true ) 
addEventHandler ( 'AddDataName', root,function (plr,add) 
    local row = guiGridListAddRow ( GridList ) 
        guiGridListSetItemText ( , row, 1,tostring ( plr ), false, false ) 
        guiGridListSetItemText ( GridList, row, 2,tostring ( add ), false, false ) 
    end 
) 
  
addEvent ( 'AddName', true ) 
addEventHandler ( 'AddName', root,function ( onClientSqlList ) 
        guiGridListClear ( GridList ) 
        for _, v in ipairs ( onClientSqlList ) do 
        local row = guiGridListAddRow ( GridList ) 
            guiGridListSetItemText (GridList, row, 1, tostring ( v.plr ), false, false ) 
            guiGridListSetItemText (GridList, row, 2, tostring ( v.add ), false, false ) 
        end 
    end 
) 

#Server .

addEventHandler ( 'onResourceStart', resourceRoot,function ( ) 
    executeSQLQuery ( "CREATE TABLE IF NOT EXISTS `AddSystem` (add,plr)" ) 
          outputDebugString("SQL Data Base Started!",0,0,255,0,0) 
   end 
) 
  
function setSQL_Data ( add , plr) 
    return executeSQLQuery ( "INSERT INTO `AddSystem` ( `add`, `plr` ) VALUES ( ?,? )", tostring(add),tostring(plr) ) 
end 
  
  
function SelectFromSql ( ) 
    local data = executeSQLQuery ( "SELECT * FROM `AddSystem`" ) 
    if ( type ( data ) == "table" and #data == 0) or not data then 
        return { } 
    else 
        return data; 
    end 
end 
  
function UpDateListInSql ( element ) 
    if ( not isElement ( element ) ) then 
        return; 
    end 
  
    local Upsql = SelectFromSql ( ) 
    triggerClientEvent ( element, "AddName", element, Upsql ) 
end 
  
addEvent ( 'Save', true ) 
addEventHandler ( 'Save', root,function (add,plr)       
    setSQL_Data (add,plr) 
        triggerClientEvent ( root, "AddDataName", root,add,plr ) 
    end 
) 
  
addEvent ( 'Refresh', true ) 
addEventHandler ( 'Refresh', root,function ( ) 
    UpDateListInSql ( source ) 
    end 
) 
Link to comment
وش المشكله ب ذا الكود؟

--Client

addEventHandler("onClientGUIClick",root,function () 
if ( source == ButtonSendMsgOnSupport ) then 
local Text = guiGetText(EditMessage) 
if ( Text and Text ~= "" and Text ~= " " ) then 
triggerServerEvent("onSendMsg",localPlayer,Text) 
guiSetText(EditMessage,"") 
else 
outputChatBox("* Please Write Text",255,0,0,true) 
end 
elseif ( source == ButtonSendMsgOnSupport) then 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
guiSetInputEnabled(false) 
end 
end) 

--Server

addEvent("onSendMsg",true) 
addEventHandler("onSendMsg", root, 
function(Text) 
    local Text = getPlayerName(client):gsub("#%x%x%x%x%x%x","").." : "..Text 
    local support1 = isObjectInACLGroup("user."..getAccountName(getPlayerAccount(client)),aclGetGroup("Support")) 
    for i,v in ipairs (getElementsByType("player")) do 
        local support2 = isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)),aclGetGroup("Support")) 
        if support1 then 
            triggerClientEvent(v, "onGotMsg", client, Text) 
        elseif support2 or v == client then 
            triggerClientEvent(v, "onGotMsg", client, Text, support2) 
        end 
    end 
end) 

انا طارحه من الاول

Link to comment
وين باقي الكلينت؟
addEvent("onAddPlayers",true) 
addEventHandler("onAddPlayers",root,function (name) 
guiGridListClear(GUIEditor.gridlist[1]) 
local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
guiGridListSetItemText ( GUIEditor.gridlist[1], Row, 1, name, false, false ) 
guiSetEnabled(GUIEditor.button[1], true) 
end) 
  
addEvent("onGotMsg",true) 
addEventHandler("onGotMsg", root, 
function (Text, support) 
    local Row = guiGridListAddRow(GUIEditor.gridlist[2]) 
    guiGridListSetItemText(GUIEditor.gridlist[2], Row, 1, Text, false, false) 
    if source ~= localPlayer and support then 
        outputChatBox("* Support - System : You Got a New Message",255,255,0,true) 
    end 
end) 

Link to comment

جرب كذا

Client side #

addEventHandler("onClientGUIClick", root, function () 
if ( source == ButtonSendMsgOnSupport ) then 
local Text = guiGetText(EditMessage) 
if ( Text and Text ~= "" and Text ~= " " ) then 
triggerServerEvent("onSendMsg",localPlayer,Text) 
guiSetText(EditMessage,"") 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
guiSetInputEnabled(false) 
else 
outputChatBox("* Please Write Text", 255, 0, 0, true) 
end 
end 
end 
) 
  
addEvent("onGotMsg", true) 
addEventHandler("onGotMsg", root, function (Name, Text) 
local Row = guiGridListAddRow(GUIEditor.gridlist[2]) 
guiGridListSetItemText(GUIEditor.gridlist[2], Row, 1, Name .. ": " .. Text, false, false) 
outputChatBox("* Support - System : You Got a New Message", 255, 255, 0, true) 
end 
) 

Server side #

addEvent ("onSendMsg", true) 
addEventHandler ("onSendMsg", root, function (text) 
local name = getPlayerName(client):gsub("#%x%x%x%x%x%x","") 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(client)), aclGetGroup("Support")) then 
for _,v in ipairs (getElementsByType ("player")) do 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)), aclGetGroup("Support")) then 
triggerClientEvent(v, "onGotMsg", v, name, text) 
end 
end 
end 
end 
) 
Link to comment

ما زبط

--Client

addEventHandler("onClientGUIClick",root,function () 
if ( source == GUIEditor.button[1] ) then 
guiGridListSetItemColor (  GUIEditor.gridlist[2], row, column, 255, 0, 255 ) 
triggerServerEvent("ss",localPlayer,column) 
end 
end 
) 

--Server

addEvent("ss",true) 
addEventHandler("ss",root,function () 
if ( isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)),aclGetGroup("Support")) ) then 
end 
end) 

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...