Search the Community
Showing results for tags 'block chat private'.
-
Hello, I'm making a private chat system and this almost everything just want to do that if that chat detects an IP for example: (mtasa://, 22003, 22005) If that chat has this is the player is kicked or banned, any suggestions? I will pass my code of how this and I must do or add. (Thank you very much for your attention) client.lua function ChatPrivadoSystem(ply) local x,y = guiGetScreenSize() local width,height = 350,250 x = x*.5 y = y*.5 chat[ply] = {} chat[ply].wnd = guiCreateWindow(0.30, 0.26, 0.19, 0.44, getPlayerName(ply), true) chat[ply].memo = guiCreateMemo(0.04, 0.22, 0.92, 0.47, "", true, chat[ply].wnd) labelinfo = guiCreateLabel(0.02, 0.07, 0.94, 0.12,"Puedes Escribir Cualquier Mensaje De Texto que quieras enviar en Privado.", true, chat[ply].wnd) guiSetFont(labelinfo, "default-bold-small") guiLabelSetColor(labelinfo, 41, 251, 0) guiLabelSetHorizontalAlign(labelinfo, "center", true) chat[ply].edit = guiCreateEdit(0.04, 0.72, 0.92, 0.08, "", true, chat[ply].wnd) chat[ply].btnClose = guiCreateButton(0.51, 0.82, 0.45, 0.08,"Cerrar", true, chat[ply].wnd) guiSetFont(chat[ply].btnClose, "default-bold-small") guiSetProperty(chat[ply].btnClose, "NormalTextColour", "FFFA0000") Zukir = guiCreateLabel(0.54, 0.93, 0.46, 0.38, "Copyrigth ZuKi|R", true, chat[ply].wnd) guiSetFont(Zukir, "default-bold-small") guiLabelSetColor(Zukir, 250, 0, 0) guiLabelSetHorizontalAlign(Zukir, "center", false) chat[ply].btnSend = guiCreateButton(0.05, 0.82, 0.45, 0.08, "Enviar Mensaje", true, chat[ply].wnd) guiSetFont(chat[ply].btnSend, "default-bold-small") guiSetProperty(chat[ply].btnSend, "NormalTextColour", "FFFA0000") guiMemoSetReadOnly(chat[ply].memo, true) guiWindowSetSizable(chat[ply].wnd, false) guiSetProperty(chat[ply].wnd, "RollUpEnabled", "true") guiSetProperty(chat[ply].wnd, "Dragable", "true") if anims.plfadein:isPlaying() then guiSetVisible(chat[ply].wnd, true) elseif anims.plfadeout:isPlaying() then guiSetVisible(chat[ply].wnd, false) else if guiGetAlpha(PanelChat) > .1 then guiSetVisible(chat[ply].wnd, true) guiSetVisible(newmsg.img,false) else guiSetVisible(chat[ply].wnd, false) end end end function destroyChatWindow(ply) if chat[ply] and isElement(chat[ply].wnd) then destroyElement(chat[ply].wnd) chat[ply] = nil end end function sendChatMessage(ply) local oldText = guiGetText(chat[ply].memo) local newText = guiGetText(chat[ply].edit) if chat[ply] and isElement(chat[ply].wnd) then if newText and string.len(newText) > 0 then if not oldText then oldText = "" end oldText = oldText .. getPlayerName(g_LocalPlayer) .. ": " .. newText .. "\n" guiSetText(chat[ply].memo, oldText) guiSetText(chat[ply].edit, "") guiMemoSetCaretIndex(chat[ply].memo, string.len(oldText)) triggerServerEvent("onGUIPrivateMessage", g_LocalPlayer, ply,newText)