Jump to content

Script with no sense help


Recommended Posts

Posted

client side

win1 = guiCreateWindow(356,254,683,358,"|~>[Help Panel]<~|",false) 
guiSetAlpha(win1,1) 
guiWindowSetSizable(win1,false) 
mem1 = guiCreateMemo(11,23,663,283,"",false,win1) 
guiMemoSetReadOnly(mem1,true) 
edi1 = guiCreateEdit(109,-421,5,296,"",false,win1) 
butt1 = guiCreateButton(605,310,69,38,"send",false,win1) 
guiSetProperty(butt1,"Alpha","10") 
guiSetProperty(butt1,"Font","3") 
edi2 = guiCreateEdit(9,312,590,31,"",false,win1) 
guiSetVisible ( win1 ,false ) 
     
    function sendmessages() 
    if isElement(win1) then 
        local newText = guiGetText(edi2) 
        if newText and string.len(newText) > 0 then 
            local oldText = guiGetText(mem1) 
            if not oldText then oldText = "" end 
            oldText = oldText .. getPlayerName(getLocalPlayer()) .. ":" .. newText .. "\n" 
            guiSetText(mem1, oldText) 
            guiSetText(edi2, "") 
            guiMemoSetCaretIndex(mem1, string.len(oldText)) 
  
            triggerServerEvent("onSendMessages", getLocalPlayer(), ply,newText) 
        end  
    end 
end 
  
bindKey('f2','down',function() 
    guiSetVisible(mem1,not guiGetVisible(mem1)) 
    showCursor(guiGetVisible(mem1)) 
end) 

server side

addEvent("onSendMessages", true) 
addEventHandler("onSendMessages", getRootElement(),  
    function(noise, text) 
        triggerClientEvent(toplayer, "onSendMessages", source, source, text) 
    end 
) 

mm i see no problem with server side

but,.. i want when i type in edi2 my text show up in mem1 ..

F4MZM4.gif

Posted

There's no event handler to execute: "sendmessages" function?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

like that ?

    function sendmessages() 
    if isElement(win1) then 
        local newText = guiGetText(edi2) 
        if newText and string.len(newText) > 0 then 
            local oldText = guiGetText(mem1) 
            if not oldText then oldText = "" end 
            oldText = oldText .. getPlayerName(getLocalPlayer()) .. ":" .. newText .. "\n" 
            guiSetText(mem1, oldText) 
            guiSetText(edi2, "") 
            guiMemoSetCaretIndex(mem1, string.len(oldText)) 
  
            triggerServerEvent("onSendMessages", getLocalPlayer(), ply,newText) 
        end  
    end 
end 
addEventHandler("onSendMessages", getRootElement(), sendmessages) 

F4MZM4.gif

Posted

I've just read it again, and I see that it makes no sense the script itself, I recommend you to start again.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ok if no way out, then i have an other, request : )

When the player abuse at main chat, then get him auto mute, can you please give me codes and i 'll fix the code with my self thank you ^_^

F4MZM4.gif

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