1LoL1 Posted June 7, 2014 Share Posted June 7, 2014 (edited) Could please someone give all hexes away? local sWidth, sHeight = guiGetScreenSize() local px = sWidth/800 local py = sHeight/600 function Messenger_On_Render () dxDrawImage(298.0*px,76.0*py,370.0*px,469.0*py,"messenger_bg.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawImage(209.0*px,76.0*py,184.0*px,469.0*py,"messenger_bg.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText("Chat History",415.0*px,144.0*py,565.0*px,168.0*py,tocolor(10,10,10,255),1.0*py,"default-bold","center","center",false,false,false) end addEventHandler("onClientResourceStart",resourceRoot, function() Messanger_Gridlist = guiCreateGridList(241*px,157*py,119*px,311*py,false) guiGridListSetSelectionMode(Messanger_Gridlist,1) Messanger_Spieler_Column = guiGridListAddColumn(Messanger_Gridlist,"online players",0.-- s8) --> Messanger_edit = guiCreateEdit(387*px,400*py,165*px,33*py,"",false) Messanger_button_send = guiCreateButton(558*px,401*py,41*px,31*py,"send",false) Messanger_button_abbrechen = guiCreateButton(580*px,149*py,19*px,21*py,"X",false) --Messenger_button_block = guiCreateButton(387*px,440*py,165*px,23*py,"block player",false) Messanger_memo = guiCreateMemo(387*px,174*py,212*px,216*py,"",false) guiMemoSetReadOnly(Messanger_memo, true) end ) function Messanger_Resourcestart () guiSetVisible (Messanger_Gridlist, false) guiSetVisible (Messanger_edit, false) guiSetVisible (Messanger_button_send, false) guiSetVisible (Messanger_button_abbrechen, false) guiSetVisible (Messenger_button_block, false) guiSetVisible (Messanger_memo, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), Messanger_Resourcestart) function Messanger_Open_or_Close () local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then guiSetInputEnabled(false) guiSetVisible (Messanger_Gridlist, false) guiSetVisible (Messanger_edit, false) guiSetVisible (Messanger_button_send, false) guiSetVisible (Messanger_button_abbrechen, false) guiSetVisible (Messenger_button_block, false) guiSetVisible (Messanger_memo, false) showCursor (false) removeEventHandler("onClientKey", root, Messanger_Text_Send_On_Enter) removeEventHandler("onClientRender",getRootElement(), Messenger_On_Render) end if (getVisible == false) then guiSetInputEnabled(true) guiSetVisible (Messanger_Gridlist, true) guiSetVisible (Messanger_edit, true) guiSetVisible (Messanger_button_send, true) guiSetVisible (Messanger_button_abbrechen, true) guiSetVisible (Messenger_button_block, true) guiSetVisible (Messanger_memo, true) showCursor (true) Messanger_Gridlist_refresh() guiSetText(Messanger_memo, "") addEventHandler("onClientKey", root, Messanger_Text_Send_On_Enter) addEventHandler("onClientRender",getRootElement(), Messenger_On_Render) end end bindKey( "F3", "down", Messanger_Open_or_Close ) function Messanger_Gridlist_refresh () guiGridListClear ( Messanger_Gridlist ) for index, cPlayer in pairs(getElementsByType( "player" )) do local player = getLocalPlayer() local cPName = getPlayerName(cPlayer) local row = guiGridListAddRow ( Messanger_Gridlist ) if cPlayer ~= player then guiGridListSetItemText ( Messanger_Gridlist, row, Messanger_Spieler_Column, getPlayerName(cPlayer), false, false ) if getElementData(player, cPName.."New_Message_Count") then local Message_Abgerufen = getElementData(player, cPName.."Message_Abgerufen_Count") if Message_Abgerufen > 0 then guiGridListSetItemColor ( Messanger_Gridlist, row, Messanger_Spieler_Column, 0, 255, 0, 255 ) else guiGridListSetItemColor ( Messanger_Gridlist, row, Messanger_Spieler_Column, 255, 255, 255, 255 ) end end end end end addEventHandler("onClientGUIClick", getRootElement(), function ( player ) if player == "left" then if source == Messanger_button_abbrechen then Messanger_Open_or_Close() end end end ) function Messanger_Text_Send_On_Enter (button, press) if button == "enter" then if press then local player = getLocalPlayer() local target = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if target~= "" and target ~= " " then local message = guiGetText(Messanger_edit) if message ~= "" and message ~= " " then triggerServerEvent ( "Messanger_send_message_serverside", getLocalPlayer(), player, target, message) guiSetText(Messanger_edit, "") else outputChatBox("You haven't entered a message!", 255, 0 , 0) end else outputChatBox("You haven't selected a player!", 255, 0, 0) end end end end addEventHandler("onClientGUIClick", getRootElement(), function ( player ) if player == "left" then if source == Messanger_button_send then local player = getLocalPlayer() local target = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if target~= "" and target ~= " " then local message = guiGetText(Messanger_edit) if message ~= "" and message ~= " " then triggerServerEvent ( "Messanger_send_message_serverside", getLocalPlayer(), player, target, message) guiSetText(Messanger_edit, "") else outputChatBox("You haven't entered a message!", 255, 0 , 0) end else outputChatBox("You haven't selected a player!", 255, 0, 0) end end end end ) function refresh_messange_playerlist () local Selected_Item = guiGridListGetSelectedItem(Messanger_Gridlist) Messanger_Gridlist_refresh() guiGridListSetSelectedItem ( Messanger_Gridlist, Selected_Item, Messanger_Spieler_Column) end addEvent( "refresh_messange_playerlist", true ) addEventHandler( "refresh_messange_playerlist", getRootElement(), refresh_messange_playerlist ) function refresh_messange_chatverlauf (message, Pname) local player = getLocalPlayer() local Lname = getPlayerName(player) if Pname then local selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if selected_player == Pname then guiSetText(Messanger_memo, message) local Msg_Char_Count = tonumber(getElementData(player, Pname.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) end else local selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) guiSetText(Messanger_memo, message) local Msg_Char_Count = tonumber(getElementData(player, selected_player.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) end local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then if Pname then local getMessageSound = playSound ( "messanger_bling.mp3", false ) setSoundVolume(getMessageSound, 0.5) end else if Pname then outputChatBox("You have a new message from #FFFFFF"..Pname, 255, 40, 0, true) local getMessageSound = playSound ( "messanger_bling.mp3", false ) setSoundVolume(getMessageSound, 0.5) end end end addEvent( "refresh_messange_chatverlauf", true ) addEventHandler( "refresh_messange_chatverlauf", getRootElement(), refresh_messange_chatverlauf ) function set_Message_Text_on_Gridklick () local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then local player = getLocalPlayer() local Text_selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if Text_selected_player ~= "" then if getElementData(player, Text_selected_player.."Player_Message") then local Message_Abgerufen = tonumber(getElementData(player, Text_selected_player.."Message_Abgerufen_Count")) local Trigger_Currendt_Messages = getElementData(player, Text_selected_player.."Player_Message") guiSetText(Messanger_memo, Trigger_Currendt_Messages) local Msg_Char_Count = tonumber(getElementData(player, Text_selected_player.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) if Message_Abgerufen == 1 then setElementData(player, Text_selected_player.."Message_Abgerufen_Count", 0 ) refresh_messange_playerlist() end else guiSetText(Messanger_memo, "There are no messages!") end else guiSetText(Messanger_memo, "No player selected!") end end end setTimer(set_Message_Text_on_Gridklick, 200, 0 ) function Messanger_send_message_serverside ( player, target, message ) local tarP = getPlayerFromName(target) local Pname = getPlayerName(player) local tarName = getPlayerName(tarP) local time = getRealTime() local stunde = time.hour local minute = time.minute --TarPlayer-- if getElementData(tarP, Pname.."New_Message_Count") then local NewTarMessageCount = getElementData(tarP, Pname.."New_Message_Count") if NewTarMessageCount > 0 then setElementData(tarP, Pname.."New_Message_Count", 1) setElementData(tarP, Pname.."Message_Abgerufen_Count", 1 ) local Currendt_Messages = getElementData(tarP, Pname.."Player_Message") if stunde > 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end triggerClientEvent ( tarP, "refresh_messange_playerlist", getRootElement()) local Trigger_Currendt_Messages = getElementData(tarP, Pname.."Player_Message") triggerClientEvent ( tarP, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages, Pname) outputDebugString ( "[Messanger-Message] from "..Pname.." to "..tarName..": "..message ) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(tarP, Pname.."Msg_Char_Count", Msg_Char_Count) else return end else setElementData(tarP, Pname.."New_Message_Count", 1) setElementData(tarP, Pname.."Message_Abgerufen_Count", 1 ) if stunde > 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", "["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", "["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", "[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", "[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end triggerClientEvent ( tarP, "refresh_messange_playerlist", getRootElement()) local Trigger_Currendt_Messages = getElementData(tarP, Pname.."Player_Message") triggerClientEvent ( tarP, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages, Pname) outputDebugString ( "[Messanger-Message] from "..Pname.." to "..tarName..": "..message ) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(tarP, Pname.."Msg_Char_Count", Msg_Char_Count) end --localPlayer-- if getElementData(player, tarName.."New_Message_Count") then local NewTarMessageCount = getElementData(player, tarName.."New_Message_Count") if NewTarMessageCount > 0 then setElementData(player, tarName.."New_Message_Count", 1) local Currendt_Messages = getElementData(player, tarName.."Player_Message") if stunde > 10 and minute > 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end local Trigger_Currendt_Messages = getElementData(player, tarName.."Player_Message") triggerClientEvent ( player, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(player, tarName.."Msg_Char_Count", Msg_Char_Count) else return end else setElementData(player, tarName.."New_Message_Count", 1) if stunde > 10 and minute > 10 then setElementData(player, tarName.."Player_Message", "["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(player, tarName.."Player_Message", "["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(player, tarName.."Player_Message", "[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(player, tarName.."Player_Message", "[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end local Trigger_Currendt_Messages = getElementData(player, tarName.."Player_Message") triggerClientEvent ( player, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(player, tarName.."Msg_Char_Count", Msg_Char_Count) end end addEvent( "Messanger_send_message_serverside", true ) addEventHandler( "Messanger_send_message_serverside", getRootElement(), Messanger_send_message_serverside ) Edited June 11, 2014 by Guest Link to comment
.:HyPeX:. Posted June 7, 2014 Share Posted June 7, 2014 What do you mean? you want to remove them? local variable = string.gsub(stringToRemove, "#%x%x%x%x%x%x", "") Link to comment
1LoL1 Posted June 7, 2014 Author Share Posted June 7, 2014 What do you mean? you want to remove them? local variable = string.gsub(stringToRemove, "#%x%x%x%x%x%x", "") But it will not show #FFFF00LoL but LoL Link to comment
Max+ Posted June 7, 2014 Share Posted June 7, 2014 if you want remove the color Hex, Code Use, what Hypex post , ... Link to comment
1LoL1 Posted June 7, 2014 Author Share Posted June 7, 2014 if you want remove the color Hex, Code Use, what Hypex post , ... But there is this .. I just wanted to write that when in private messages so that the message is sent to it without hex Link to comment
Max+ Posted June 7, 2014 Share Posted June 7, 2014 you can Start From Here , https://wiki.multitheftauto.com/wiki/On ... ateMessage Example - -- # Server Side addEventHandler ( "onPlayerPrivateMessage",root, function ( ) --- Code Here , end ) Link to comment
.:HyPeX:. Posted June 7, 2014 Share Posted June 7, 2014 Explain better what you want do do, so we can help you. Link to comment
1LoL1 Posted June 7, 2014 Author Share Posted June 7, 2014 Explain better what you want do do, so we can help you. But I want to remove hexes .. in those spoilers .. that's all .. Link to comment
xXMADEXx Posted June 7, 2014 Share Posted June 7, 2014 I think you are trying to use these: ------------------------------ --#Copyright by StylezZ 2012-- ------------------------------ function Messanger_send_message_serverside ( player, target, message ) local message = message:gsub ( "#%x%x%x%x%x%x", "" ) local tarP = getPlayerFromName(target) local Pname = getPlayerName(player) local tarName = getPlayerName(tarP) local time = getRealTime() local stunde = time.hour local minute = time.minute --TarPlayer-- if getElementData(tarP, Pname.."New_Message_Count") then local NewTarMessageCount = getElementData(tarP, Pname.."New_Message_Count") if NewTarMessageCount > 0 then setElementData(tarP, Pname.."New_Message_Count", 1) setElementData(tarP, Pname.."Message_Abgerufen_Count", 1 ) local Currendt_Messages = getElementData(tarP, Pname.."Player_Message") if stunde > 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end triggerClientEvent ( tarP, "refresh_messange_playerlist", getRootElement()) local Trigger_Currendt_Messages = getElementData(tarP, Pname.."Player_Message") triggerClientEvent ( tarP, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages, Pname) outputDebugString ( "[Messanger-Message] from "..Pname.." to "..tarName..": "..message ) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(tarP, Pname.."Msg_Char_Count", Msg_Char_Count) else return end else setElementData(tarP, Pname.."New_Message_Count", 1) setElementData(tarP, Pname.."Message_Abgerufen_Count", 1 ) if stunde > 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", "["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", "["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", "[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", "[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end triggerClientEvent ( tarP, "refresh_messange_playerlist", getRootElement()) local Trigger_Currendt_Messages = getElementData(tarP, Pname.."Player_Message") triggerClientEvent ( tarP, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages, Pname) outputDebugString ( "[Messanger-Message] from "..Pname.." to "..tarName..": "..message ) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(tarP, Pname.."Msg_Char_Count", Msg_Char_Count) end --localPlayer-- if getElementData(player, tarName.."New_Message_Count") then local NewTarMessageCount = getElementData(player, tarName.."New_Message_Count") if NewTarMessageCount > 0 then setElementData(player, tarName.."New_Message_Count", 1) local Currendt_Messages = getElementData(player, tarName.."Player_Message") if stunde > 10 and minute > 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end local Trigger_Currendt_Messages = getElementData(player, tarName.."Player_Message") triggerClientEvent ( player, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(player, tarName.."Msg_Char_Count", Msg_Char_Count) else return end else setElementData(player, tarName.."New_Message_Count", 1) if stunde > 10 and minute > 10 then setElementData(player, tarName.."Player_Message", "["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(player, tarName.."Player_Message", "["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(player, tarName.."Player_Message", "[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(player, tarName.."Player_Message", "[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end local Trigger_Currendt_Messages = getElementData(player, tarName.."Player_Message") triggerClientEvent ( player, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(player, tarName.."Msg_Char_Count", Msg_Char_Count) end end addEvent( "Messanger_send_message_serverside", true ) addEventHandler( "Messanger_send_message_serverside", getRootElement(), Messanger_send_message_serverside ) local sWidth, sHeight = guiGetScreenSize() local px = sWidth/800 local py = sHeight/600 function Messenger_On_Render () dxDrawImage(298.0*px,76.0*py,370.0*px,469.0*py,"messenger_bg.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawImage(209.0*px,76.0*py,184.0*px,469.0*py,"messenger_bg.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText("Chat History",415.0*px,144.0*py,565.0*px,168.0*py,tocolor(10,10,10,255),1.0*py,"default-bold","center","center",false,false,false) end addEventHandler("onClientResourceStart",resourceRoot, function() Messanger_Gridlist = guiCreateGridList(241*px,157*py,119*px,311*py,false) guiGridListSetSelectionMode(Messanger_Gridlist,1) Messanger_Spieler_Column = guiGridListAddColumn(Messanger_Gridlist,"online players",0.-- s8) --> Messanger_edit = guiCreateEdit(387*px,400*py,165*px,33*py,"",false) Messanger_button_send = guiCreateButton(558*px,401*py,41*px,31*py,"send",false) Messanger_button_abbrechen = guiCreateButton(580*px,149*py,19*px,21*py,"X",false) --Messenger_button_block = guiCreateButton(387*px,440*py,165*px,23*py,"block player",false) Messanger_memo = guiCreateMemo(387*px,174*py,212*px,216*py,"",false) guiMemoSetReadOnly(Messanger_memo, true) end ) function Messanger_Resourcestart () guiSetVisible (Messanger_Gridlist, false) guiSetVisible (Messanger_edit, false) guiSetVisible (Messanger_button_send, false) guiSetVisible (Messanger_button_abbrechen, false) guiSetVisible (Messenger_button_block, false) guiSetVisible (Messanger_memo, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), Messanger_Resourcestart) function Messanger_Open_or_Close () local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then guiSetInputEnabled(false) guiSetVisible (Messanger_Gridlist, false) guiSetVisible (Messanger_edit, false) guiSetVisible (Messanger_button_send, false) guiSetVisible (Messanger_button_abbrechen, false) guiSetVisible (Messenger_button_block, false) guiSetVisible (Messanger_memo, false) showCursor (false) removeEventHandler("onClientKey", root, Messanger_Text_Send_On_Enter) removeEventHandler("onClientRender",getRootElement(), Messenger_On_Render) end if (getVisible == false) then guiSetInputEnabled(true) guiSetVisible (Messanger_Gridlist, true) guiSetVisible (Messanger_edit, true) guiSetVisible (Messanger_button_send, true) guiSetVisible (Messanger_button_abbrechen, true) guiSetVisible (Messenger_button_block, true) guiSetVisible (Messanger_memo, true) showCursor (true) Messanger_Gridlist_refresh() guiSetText(Messanger_memo, "") addEventHandler("onClientKey", root, Messanger_Text_Send_On_Enter) addEventHandler("onClientRender",getRootElement(), Messenger_On_Render) end end bindKey( "F3", "down", Messanger_Open_or_Close ) function Messanger_Gridlist_refresh () guiGridListClear ( Messanger_Gridlist ) for index, cPlayer in pairs(getElementsByType( "player" )) do local player = getLocalPlayer() local cPName = getPlayerName(cPlayer) local row = guiGridListAddRow ( Messanger_Gridlist ) if cPlayer ~= player then guiGridListSetItemText ( Messanger_Gridlist, row, Messanger_Spieler_Column, getPlayerName(cPlayer), false, false ) if getElementData(player, cPName.."New_Message_Count") then local Message_Abgerufen = getElementData(player, cPName.."Message_Abgerufen_Count") if Message_Abgerufen > 0 then guiGridListSetItemColor ( Messanger_Gridlist, row, Messanger_Spieler_Column, 0, 255, 0, 255 ) else guiGridListSetItemColor ( Messanger_Gridlist, row, Messanger_Spieler_Column, 255, 255, 255, 255 ) end end end end end addEventHandler("onClientGUIClick", getRootElement(), function ( player ) if player == "left" then if source == Messanger_button_abbrechen then Messanger_Open_or_Close() end end end ) function Messanger_Text_Send_On_Enter (button, press) if button == "enter" then if press then local player = getLocalPlayer() local target = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if target~= "" and target ~= " " then local message = guiGetText(Messanger_edit):gsub ( "#%x%x%x%x%x%x", "" ) if message ~= "" and message ~= " " then triggerServerEvent ( "Messanger_send_message_serverside", getLocalPlayer(), player, target, message) guiSetText(Messanger_edit, "") else outputChatBox("You haven't entered a message!", 255, 0 , 0) end else outputChatBox("You haven't selected a player!", 255, 0, 0) end end end end addEventHandler("onClientGUIClick", getRootElement(), function ( player ) if player == "left" then if source == Messanger_button_send then local player = getLocalPlayer() local target = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if target~= "" and target ~= " " then local message = guiGetText(Messanger_edit):gsub ( "#%x%x%x%x%x%x", "" ) if message ~= "" and message ~= " " then triggerServerEvent ( "Messanger_send_message_serverside", getLocalPlayer(), player, target, message) guiSetText(Messanger_edit, "") else outputChatBox("You haven't entered a message!", 255, 0 , 0) end else outputChatBox("You haven't selected a player!", 255, 0, 0) end end end end ) function refresh_messange_playerlist () local Selected_Item = guiGridListGetSelectedItem(Messanger_Gridlist) Messanger_Gridlist_refresh() guiGridListSetSelectedItem ( Messanger_Gridlist, Selected_Item, Messanger_Spieler_Column) end addEvent( "refresh_messange_playerlist", true ) addEventHandler( "refresh_messange_playerlist", getRootElement(), refresh_messange_playerlist ) function refresh_messange_chatverlauf (message, Pname) local player = getLocalPlayer() local Lname = getPlayerName(player) if Pname then local selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if selected_player == Pname then guiSetText(Messanger_memo, message) local Msg_Char_Count = tonumber(getElementData(player, Pname.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) end else local selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) guiSetText(Messanger_memo, message) local Msg_Char_Count = tonumber(getElementData(player, selected_player.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) end local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then if Pname then local getMessageSound = playSound ( "messanger_bling.mp3", false ) setSoundVolume(getMessageSound, 0.5) end else if Pname then outputChatBox("You have a new message from #FFFFFF"..Pname, 255, 40, 0, true) local getMessageSound = playSound ( "messanger_bling.mp3", false ) setSoundVolume(getMessageSound, 0.5) end end end addEvent( "refresh_messange_chatverlauf", true ) addEventHandler( "refresh_messange_chatverlauf", getRootElement(), refresh_messange_chatverlauf ) function set_Message_Text_on_Gridklick () local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then local player = getLocalPlayer() local Text_selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if Text_selected_player ~= "" then if getElementData(player, Text_selected_player.."Player_Message") then local Message_Abgerufen = tonumber(getElementData(player, Text_selected_player.."Message_Abgerufen_Count")) local Trigger_Currendt_Messages = getElementData(player, Text_selected_player.."Player_Message") guiSetText(Messanger_memo, Trigger_Currendt_Messages) local Msg_Char_Count = tonumber(getElementData(player, Text_selected_player.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) if Message_Abgerufen == 1 then setElementData(player, Text_selected_player.."Message_Abgerufen_Count", 0 ) refresh_messange_playerlist() end else guiSetText(Messanger_memo, "There are no messages!") end else guiSetText(Messanger_memo, "No player selected!") end end end setTimer(set_Message_Text_on_Gridklick, 200, 0 ) Link to comment
1LoL1 Posted June 7, 2014 Author Share Posted June 7, 2014 I think you are trying to use these: ------------------------------ --#Copyright by StylezZ 2012-- ------------------------------ function Messanger_send_message_serverside ( player, target, message ) local message = message:gsub ( "#%x%x%x%x%x%x", "" ) local tarP = getPlayerFromName(target) local Pname = getPlayerName(player) local tarName = getPlayerName(tarP) local time = getRealTime() local stunde = time.hour local minute = time.minute --TarPlayer-- if getElementData(tarP, Pname.."New_Message_Count") then local NewTarMessageCount = getElementData(tarP, Pname.."New_Message_Count") if NewTarMessageCount > 0 then setElementData(tarP, Pname.."New_Message_Count", 1) setElementData(tarP, Pname.."Message_Abgerufen_Count", 1 ) local Currendt_Messages = getElementData(tarP, Pname.."Player_Message") if stunde > 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", Currendt_Messages.."[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end triggerClientEvent ( tarP, "refresh_messange_playerlist", getRootElement()) local Trigger_Currendt_Messages = getElementData(tarP, Pname.."Player_Message") triggerClientEvent ( tarP, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages, Pname) outputDebugString ( "[Messanger-Message] from "..Pname.." to "..tarName..": "..message ) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(tarP, Pname.."Msg_Char_Count", Msg_Char_Count) else return end else setElementData(tarP, Pname.."New_Message_Count", 1) setElementData(tarP, Pname.."Message_Abgerufen_Count", 1 ) if stunde > 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", "["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", "["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(tarP, Pname.."Player_Message", "[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(tarP, Pname.."Player_Message", "[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end triggerClientEvent ( tarP, "refresh_messange_playerlist", getRootElement()) local Trigger_Currendt_Messages = getElementData(tarP, Pname.."Player_Message") triggerClientEvent ( tarP, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages, Pname) outputDebugString ( "[Messanger-Message] from "..Pname.." to "..tarName..": "..message ) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(tarP, Pname.."Msg_Char_Count", Msg_Char_Count) end --localPlayer-- if getElementData(player, tarName.."New_Message_Count") then local NewTarMessageCount = getElementData(player, tarName.."New_Message_Count") if NewTarMessageCount > 0 then setElementData(player, tarName.."New_Message_Count", 1) local Currendt_Messages = getElementData(player, tarName.."Player_Message") if stunde > 10 and minute > 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(player, tarName.."Player_Message", Currendt_Messages.."[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end local Trigger_Currendt_Messages = getElementData(player, tarName.."Player_Message") triggerClientEvent ( player, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(player, tarName.."Msg_Char_Count", Msg_Char_Count) else return end else setElementData(player, tarName.."New_Message_Count", 1) if stunde > 10 and minute > 10 then setElementData(player, tarName.."Player_Message", "["..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde > 10 and minute < 10 then setElementData(player, tarName.."Player_Message", "["..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute > 10 then setElementData(player, tarName.."Player_Message", "[0"..stunde..":"..minute.."]"..Pname..": "..message.."\n") end if stunde < 10 and minute < 10 then setElementData(player, tarName.."Player_Message", "[0"..stunde..":0"..minute.."]"..Pname..": "..message.."\n") end local Trigger_Currendt_Messages = getElementData(player, tarName.."Player_Message") triggerClientEvent ( player, "refresh_messange_chatverlauf", getRootElement(), Trigger_Currendt_Messages) local Msg_Char_Count = #Trigger_Currendt_Messages setElementData(player, tarName.."Msg_Char_Count", Msg_Char_Count) end end addEvent( "Messanger_send_message_serverside", true ) addEventHandler( "Messanger_send_message_serverside", getRootElement(), Messanger_send_message_serverside ) local sWidth, sHeight = guiGetScreenSize() local px = sWidth/800 local py = sHeight/600 function Messenger_On_Render () dxDrawImage(298.0*px,76.0*py,370.0*px,469.0*py,"messenger_bg.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawImage(209.0*px,76.0*py,184.0*px,469.0*py,"messenger_bg.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawText("Chat History",415.0*px,144.0*py,565.0*px,168.0*py,tocolor(10,10,10,255),1.0*py,"default-bold","center","center",false,false,false) end addEventHandler("onClientResourceStart",resourceRoot, function() Messanger_Gridlist = guiCreateGridList(241*px,157*py,119*px,311*py,false) guiGridListSetSelectionMode(Messanger_Gridlist,1) Messanger_Spieler_Column = guiGridListAddColumn(Messanger_Gridlist,"online players",0.-- s8) --> Messanger_edit = guiCreateEdit(387*px,400*py,165*px,33*py,"",false) Messanger_button_send = guiCreateButton(558*px,401*py,41*px,31*py,"send",false) Messanger_button_abbrechen = guiCreateButton(580*px,149*py,19*px,21*py,"X",false) --Messenger_button_block = guiCreateButton(387*px,440*py,165*px,23*py,"block player",false) Messanger_memo = guiCreateMemo(387*px,174*py,212*px,216*py,"",false) guiMemoSetReadOnly(Messanger_memo, true) end ) function Messanger_Resourcestart () guiSetVisible (Messanger_Gridlist, false) guiSetVisible (Messanger_edit, false) guiSetVisible (Messanger_button_send, false) guiSetVisible (Messanger_button_abbrechen, false) guiSetVisible (Messenger_button_block, false) guiSetVisible (Messanger_memo, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), Messanger_Resourcestart) function Messanger_Open_or_Close () local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then guiSetInputEnabled(false) guiSetVisible (Messanger_Gridlist, false) guiSetVisible (Messanger_edit, false) guiSetVisible (Messanger_button_send, false) guiSetVisible (Messanger_button_abbrechen, false) guiSetVisible (Messenger_button_block, false) guiSetVisible (Messanger_memo, false) showCursor (false) removeEventHandler("onClientKey", root, Messanger_Text_Send_On_Enter) removeEventHandler("onClientRender",getRootElement(), Messenger_On_Render) end if (getVisible == false) then guiSetInputEnabled(true) guiSetVisible (Messanger_Gridlist, true) guiSetVisible (Messanger_edit, true) guiSetVisible (Messanger_button_send, true) guiSetVisible (Messanger_button_abbrechen, true) guiSetVisible (Messenger_button_block, true) guiSetVisible (Messanger_memo, true) showCursor (true) Messanger_Gridlist_refresh() guiSetText(Messanger_memo, "") addEventHandler("onClientKey", root, Messanger_Text_Send_On_Enter) addEventHandler("onClientRender",getRootElement(), Messenger_On_Render) end end bindKey( "F3", "down", Messanger_Open_or_Close ) function Messanger_Gridlist_refresh () guiGridListClear ( Messanger_Gridlist ) for index, cPlayer in pairs(getElementsByType( "player" )) do local player = getLocalPlayer() local cPName = getPlayerName(cPlayer) local row = guiGridListAddRow ( Messanger_Gridlist ) if cPlayer ~= player then guiGridListSetItemText ( Messanger_Gridlist, row, Messanger_Spieler_Column, getPlayerName(cPlayer), false, false ) if getElementData(player, cPName.."New_Message_Count") then local Message_Abgerufen = getElementData(player, cPName.."Message_Abgerufen_Count") if Message_Abgerufen > 0 then guiGridListSetItemColor ( Messanger_Gridlist, row, Messanger_Spieler_Column, 0, 255, 0, 255 ) else guiGridListSetItemColor ( Messanger_Gridlist, row, Messanger_Spieler_Column, 255, 255, 255, 255 ) end end end end end addEventHandler("onClientGUIClick", getRootElement(), function ( player ) if player == "left" then if source == Messanger_button_abbrechen then Messanger_Open_or_Close() end end end ) function Messanger_Text_Send_On_Enter (button, press) if button == "enter" then if press then local player = getLocalPlayer() local target = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if target~= "" and target ~= " " then local message = guiGetText(Messanger_edit):gsub ( "#%x%x%x%x%x%x", "" ) if message ~= "" and message ~= " " then triggerServerEvent ( "Messanger_send_message_serverside", getLocalPlayer(), player, target, message) guiSetText(Messanger_edit, "") else outputChatBox("You haven't entered a message!", 255, 0 , 0) end else outputChatBox("You haven't selected a player!", 255, 0, 0) end end end end addEventHandler("onClientGUIClick", getRootElement(), function ( player ) if player == "left" then if source == Messanger_button_send then local player = getLocalPlayer() local target = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if target~= "" and target ~= " " then local message = guiGetText(Messanger_edit):gsub ( "#%x%x%x%x%x%x", "" ) if message ~= "" and message ~= " " then triggerServerEvent ( "Messanger_send_message_serverside", getLocalPlayer(), player, target, message) guiSetText(Messanger_edit, "") else outputChatBox("You haven't entered a message!", 255, 0 , 0) end else outputChatBox("You haven't selected a player!", 255, 0, 0) end end end end ) function refresh_messange_playerlist () local Selected_Item = guiGridListGetSelectedItem(Messanger_Gridlist) Messanger_Gridlist_refresh() guiGridListSetSelectedItem ( Messanger_Gridlist, Selected_Item, Messanger_Spieler_Column) end addEvent( "refresh_messange_playerlist", true ) addEventHandler( "refresh_messange_playerlist", getRootElement(), refresh_messange_playerlist ) function refresh_messange_chatverlauf (message, Pname) local player = getLocalPlayer() local Lname = getPlayerName(player) if Pname then local selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if selected_player == Pname then guiSetText(Messanger_memo, message) local Msg_Char_Count = tonumber(getElementData(player, Pname.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) end else local selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) guiSetText(Messanger_memo, message) local Msg_Char_Count = tonumber(getElementData(player, selected_player.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) end local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then if Pname then local getMessageSound = playSound ( "messanger_bling.mp3", false ) setSoundVolume(getMessageSound, 0.5) end else if Pname then outputChatBox("You have a new message from #FFFFFF"..Pname, 255, 40, 0, true) local getMessageSound = playSound ( "messanger_bling.mp3", false ) setSoundVolume(getMessageSound, 0.5) end end end addEvent( "refresh_messange_chatverlauf", true ) addEventHandler( "refresh_messange_chatverlauf", getRootElement(), refresh_messange_chatverlauf ) function set_Message_Text_on_Gridklick () local getVisible = guiGetVisible (Messanger_Gridlist) if (getVisible == true) then local player = getLocalPlayer() local Text_selected_player = guiGridListGetItemText ( Messanger_Gridlist, guiGridListGetSelectedItem(Messanger_Gridlist), 1 ) if Text_selected_player ~= "" then if getElementData(player, Text_selected_player.."Player_Message") then local Message_Abgerufen = tonumber(getElementData(player, Text_selected_player.."Message_Abgerufen_Count")) local Trigger_Currendt_Messages = getElementData(player, Text_selected_player.."Player_Message") guiSetText(Messanger_memo, Trigger_Currendt_Messages) local Msg_Char_Count = tonumber(getElementData(player, Text_selected_player.."Msg_Char_Count")) guiMemoSetCaretIndex(Messanger_memo, Msg_Char_Count) if Message_Abgerufen == 1 then setElementData(player, Text_selected_player.."Message_Abgerufen_Count", 0 ) refresh_messange_playerlist() end else guiSetText(Messanger_memo, "There are no messages!") end else guiSetText(Messanger_memo, "No player selected!") end end end setTimer(set_Message_Text_on_Gridklick, 200, 0 ) now it does not work:( Link to comment
Cadell Posted June 11, 2014 Share Posted June 11, 2014 function convertRGBToHEX(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end i think u need this it convert rbg to hex color else explain in detail Link to comment
1LoL1 Posted June 11, 2014 Author Share Posted June 11, 2014 function convertRGBToHEX(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end i think u need this it convert rbg to hex color else explain in detail however I wanted to edit what is in the spoilers .. Link to comment
Moderators IIYAMA Posted June 11, 2014 Moderators Share Posted June 11, 2014 Don't be sad. They just gave you everything you need and it is still not good enough for you, what a shame. Anyway there is copyright on that script, you should not post copyright scripts on this forum. Or didn't you noticed that? Link to comment
1LoL1 Posted June 11, 2014 Author Share Posted June 11, 2014 Don't be sad. They just gave you everything you need and it is still not good enough for you, what a shame.Anyway there is copyright on that script, you should not post copyright scripts on this forum. Or didn't you noticed that? But I do not know what to do I do what you wrote .. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now