Jump to content

( طلب مساعده )


Recommended Posts

ججرب كذا

addEventHandler ( "onClientGUIClick",root, 
        function ( ) 
            if source == buton then 
               local Chat = guiGetText ( edit ) 
                if Chat ~= "" then 
                triggerServerEvent( "Pm", localPlayer, Chat ) 
            end 
        end 
    end 
) 
             
addEvent ( "pm1", true ) 
addEventHandler ( "pm1",root, 
function ( Chat, Player ) 
guiSetText ( GUIEditor.memo[2]," "..Chat.." " ) 
end 
) 
  
-- Server 
addEvent( "Pm", true ) 
addEventHandler( "pm",root , 
   function ( player, chat ) 
    triggerClientEvent ( root, "pm1",getPlayerFromName( chat )) 
end 
) 

ممكن تقولي من وين إخترعت

player

بالسيرفر سايد؟, عموماً صاحب الموضوع جرب كذا

كلنت :

addEventHandler ( "onClientGUIClick", root, 
function() 
    if ( source == GUIEditor.button[2] ) then             
        local selceted = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
        local player = guiGridListGetItemText(GUIEditor.gridlist[1], selceted, 1) 
        local message = guiGetText(GUIEditor.edit[2]) 
        if ( message ~= "" and player and player ~= "" ) then 
            triggerServerEvent("chat", localPlayer, message, player)  
        end 
     end 
end ) 
  
addEvent("chat1", true) 
addEventHandler("chat1", root, 
function (message , name) 
    guiSetText(GUIEditor.memo[2], name..": "..message.."/n" ) 
end ) 

سيرفر :

addEvent("chat", true) 
addEventHandler("chat", root,  
function (message, player) 
    local playerName = getPlayerFromName(player) 
    local sourceName = getPlayerName(source) 
    triggerServerEvent(playerName,"chat1",playerName, message, sourceName) 
end ) 
Link to comment

Client

function trim(s) -- from [url=http://lua-users.org/wiki/StringTrim]http://lua-users.org/wiki/StringTrim[/url] 
    return s:match "^%s*(.-)%s*$" 
end 
  
addEventHandler("onClientGUIClick", resourceRoot, function( ) 
    if source == button then 
        local text = guiGetText(edit) 
        if trim(text) ~= "" then 
            triggerServerEvent("onPlayerSendMessage", localPlayer, text) 
        else 
            outputChatBox("Please Fill out the message field", 255, 0, 0) 
        end 
    end 
end) 
  
addEvent("onClientSendMessage", true) 
addEventHandler("onClientSendMessage", root, function(name, message) 
    guiSetText(memo, guiGetText(memo).."\n"..name:gsub("#%x%x%x%x%x%x", "").." : "..message) 
end) 

Server

addEvent("onPlayerSendMessage", true) 
addEventHandler("onPlayerSendMessage", root, function(message) 
    if client == source then 
        triggerServerEvent("onClientSendMessage", root, getPlayerName(client), message) 
    end 
end) 
Link to comment
^ يب عشان كذا أنا مستغرب, لأن صاحب الموضوع يبيها بين شخصين مب للكل

اذا يبي بين شخصين يحدد من القريد ليست ويرسل ترايقر باسم اللي حدده ويحط اول ارقمنت للترايقر بالسيرفر الاعب الي جبناه مع اسمها وكذا صار خاص :)

Link to comment
  
  
------------------------------ 
  
function aa() 
    guiGridListClear(GUIEditor.gridlist[1]) 
    
   for i,v in ipairs(getElementsByType("player")) do 
  
    local row = guiGridListAddRow(GUIEditor.gridlist[1]) 
    
    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,getPlayerName(v),false,false) 
    
    end 
end 
addEventHandler ("onClientResourceStart",resourceRoot,aa) 
addEventHandler ("onClientPlayerJoin",root,aa) 
addEventHandler ("onClientPlayerChangeNick",root,aa) 
addEventHandler ("onClientPlayerQuit",root,aa) 
  
 addEventHandler ( "onClientGUIClick", root, 
function() 
    if ( source == GUIEditor.gridlist[1] ) then   
   local selceted1 = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
  
   guiSetVisible ( GUIEditor.window[2], true ) 
   end 
   end 
   ) 
  
 addEventHandler ( "onClientGUIClick", root, 
function() 
    if ( source == GUIEditor.button[2] ) then             
        local selceted = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
        local player = guiGridListGetItemText(GUIEditor.gridlist[1], selceted, 1) 
        local message = guiGetText(GUIEditor.edit[2]) 
        if ( message ~= "" and player and player ~= "" ) then 
            triggerServerEvent("chat", localPlayer, message, player) 
        end 
     end 
end ) 
  
addEvent("chat1", true) 
addEventHandler("chat1", root, 
function (message , name) 
    guiSetText(GUIEditor.memo[2], name..": "..message.."/n" ) 
end ) 
  

سيرفر

addEvent("chat", true) 
addEventHandler("chat", root, 
function (message, player) 
    local playerName = getPlayerFromName(player) 
    local sourceName = getPlayerName(source) 
    triggerServerEvent(playerName,"chat1",playerName, message, sourceName) 
end ) 

Link to comment

بدل بس ذي :

  
function trim(s) -- from [url=http://lua-users.org/wiki/StringTrim]http://lua-users.org/wiki/StringTrim[/url] 
    return s:match "^%s*(.-)%s*$" 
end 
  
 addEventHandler ( "onClientGUIClick", root, 
function() 
    if ( source == GUIEditor.button[2] ) then             
        if guiGridListGetSelectedItem(GUIEditor.gridlist[1]) ~= -1 then 
        local player = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), 1) 
        local message = guiGetText(GUIEditor.edit[2]) 
        if trim(message) ~= "" then 
            triggerServerEvent("chat", localPlayer, message, player) 
            end 
        end 
     end 
end ) 
  
addEvent("chat1", true) 
addEventHandler("chat1", root, 
    function (message , name) 
        guiSetText(GUIEditor.memo[2], guiGetText(GUIEditor.memo[2]).."\n"..name:gsub("#%x%x%x%x%x%x", "").." : "..message) 
end ) 
Link to comment

كلنت

  
  
  
  
  
  
  
  
  
  
----------------------------------- 
  
  
  
  
  
------------------------------- 
  
function aa() 
    guiGridListClear(GUIEditor.gridlist[1]) 
    
   for i,v in ipairs(getElementsByType("player")) do 
  
    local row = guiGridListAddRow(GUIEditor.gridlist[1]) 
    
    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,getPlayerName(v),false,false) 
    
    end 
end 
addEventHandler ("onClientResourceStart",resourceRoot,aa) 
addEventHandler ("onClientPlayerJoin",root,aa) 
addEventHandler ("onClientPlayerChangeNick",root,aa) 
addEventHandler ("onClientPlayerQuit",root,aa) 
  
 addEventHandler ( "onClientGUIClick", root, 
function() 
    if ( source == GUIEditor.gridlist[1] ) then   
   local selceted1 = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
  
   guiSetVisible ( GUIEditor.window[2], true ) 
   end 
   end 
   ) 
  
function trim(s) -- from [url=http://lua-users.org/wiki/StringTrim]http://lua-users.org/wiki/StringTrim[/url] 
    return s:match "^%s*(.-)%s*$" 
end 
  
 addEventHandler ( "onClientGUIClick", root, 
function() 
    if ( source == GUIEditor.button[2] ) then             
        if guiGridListGetSelectedItem(GUIEditor.gridlist[1]) ~= -1 then 
        local player = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), 1) 
        local message = guiGetText(GUIEditor.edit[2]) 
        if trim(message) ~= "" then 
            triggerServerEvent("chat", localPlayer, message, player) 
            end 
        end 
     end 
end ) 
  
addEvent("chat1", true) 
addEventHandler("chat1", root, 
    function (message , name) 
        guiSetText(GUIEditor.memo[2], guiGetText(GUIEditor.memo[2]).."\n"..name:gsub("#%x%x%x%x%x%x", "").." : "..message) 
end ) 
  
addCommandHandler('q1',function() 
        guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
        showCursor(guiGetVisible(GUIEditor.window[1])) 
    end 
) 

سيرفر

  
addEvent("chat", true) 
addEventHandler("chat", root, 
function (message, player) 
    local playerName = getPlayerFromName(player) 
    local sourceName = getPlayerName(source) 
    triggerServerEvent(playerName,"chat1",playerName, message, sourceName) 
end ) 

debugscript 3 :- attempt to call global " triggerServerEvent" ( a nil value )

مايرسل و فوق الاكواد كامله

Link to comment

addEvent("chat", true) 
addEventHandler("chat", root, 
function (message, player) 
    local playerName = getPlayerFromName(player) 
    local sourceName = getPlayerName(source) 
    triggerClientEvent(playerName,"chat1",playerName, message, sourceName) 
end ) 
Link to comment
addEvent("chat", true) 
addEventHandler("chat", root, 
function (message, player) 
    local playerName = getPlayerFromName(player) 
    local sourceName = getPlayerName(source) 
    triggerClientEvent(playerName,"chat1",playerName, message, sourceName) 
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...