Jump to content

PM Window GUI based


proracer

Recommended Posts

So have started making it.Only thing is it won't output the message in chatbox.

---- Clientsided 
function cgui() 
  
local sWidth, sHeight = guiGetScreenSize() 
local Width,Height = 629,451 
local X = (sWidth/2) - (Width/2) 
local Y = (sHeight/2) - (Height/2) 
GUIEditor_Button = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
showCursor(true,true) 
PM_Main_Window = guiCreateWindow(X,Y,Width,Height,"PM System by Pr0RaC3R v0.1 Alpha",false) 
guiWindowSetSizable(PM_Main_Window,false) 
GUIEditor_Grid[1] = guiCreateGridList(9,20,611,206,false,PM_Main_Window) 
GUIEditor_Edit[1] = guiCreateEdit(9,226,611,141,"",false,PM_Main_Window) 
guiEditSetMaxLength(GUIEditor_Edit[1],100) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
GUIEditor_Button[1] = guiCreateButton(181,379,240,56,"Send message",false,PM_Main_Window) 
local column = guiGridListAddColumn(GUIEditor_Grid[1],"Player Name",0.2) 
if (column) then 
for id,player in ipairs (getElementsByType("player")) do 
local row = guiGridListAddRow(GUIEditor_Grid[1]) 
guiGridListSetItemText(GUIEditor_Grid[1],row,column,getPlayerName(player),false,false) 
end 
end 
end 
function playerPressButton (button,state,AbsoluteX,AbsoluteY) 
if (source == GUIEditor_Button[1]) then 
local text = guiGetText (GUIEditor_Edit[1]) 
outputChatBox(text) 
end 
end 
addCommandHandler("pm",cgui) 

I think the error should be between lines 27-33.

Link to comment

try this o_o,

  
---- Clientsided 
function cgui() 
local sWidth, sHeight = guiGetScreenSize() 
local Width,Height = 629,451 
local X = (sWidth/2) - (Width/2) 
local Y = (sHeight/2) - (Height/2) 
GUIEditor_Button = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
showCursor(true,true) 
PM_Main_Window = guiCreateWindow(X,Y,Width,Height,"PM System by Pr0RaC3R v0.1 Alpha",false) 
guiWindowSetSizable(PM_Main_Window,false) 
GUIEditor_Grid[1] = guiCreateGridList(9,20,611,206,false,PM_Main_Window) 
GUIEditor_Edit[1] = guiCreateEdit(9,226,611,141,"",false,PM_Main_Window) 
guiEditSetMaxLength(GUIEditor_Edit[1],100) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
GUIEditor_Button[1] = guiCreateButton(181,379,240,56,"Send message",false,PM_Main_Window) 
local column = guiGridListAddColumn(GUIEditor_Grid[1],"Player Name",0.2) 
if (column) then 
for id,player in ipairs (getElementsByType("player")) do 
local row = guiGridListAddRow(GUIEditor_Grid[1]) 
guiGridListSetItemText(GUIEditor_Grid[1],row,column,getPlayerName(player),false,false) 
end 
end 
end 
  
function playerPressButton (button,state,AbsoluteX,AbsoluteY) 
if (source == GUIEditor_Button[1]) then 
local text = guiGetText (GUIEditor_Edit[1]) 
outputChatBox(tostring(text)) 
end 
end 
addCommandHandler("pm",cgui) 

Link to comment

Yeah lol... forgot it when I was changing something in code.The new code says that I have bad argument in the onClientGUIClick event.

---- Clientsided 
function cgui() 
local sWidth, sHeight = guiGetScreenSize() 
local Width,Height = 629,451 
local X = (sWidth/2) - (Width/2) 
local Y = (sHeight/2) - (Height/2) 
GUIEditor_Button = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
showCursor(true,true) 
PM_Main_Window = guiCreateWindow(X,Y,Width,Height,"PM System by Pr0RaC3R v0.1 Alpha",false) 
guiWindowSetSizable(PM_Main_Window,false) 
GUIEditor_Grid[1] = guiCreateGridList(9,20,611,206,false,PM_Main_Window) 
GUIEditor_Edit[1] = guiCreateEdit(9,226,611,141,"",false,PM_Main_Window) 
guiEditSetMaxLength(GUIEditor_Edit[1],100) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
GUIEditor_Button[1] = guiCreateButton(181,379,240,56,"Send message",false,PM_Main_Window) 
local column = guiGridListAddColumn(GUIEditor_Grid[1],"Player Name",0.2) 
if (column) then 
for id,player in ipairs (getElementsByType("player")) do 
local row = guiGridListAddRow(GUIEditor_Grid[1]) 
guiGridListSetItemText(GUIEditor_Grid[1],row,column,getPlayerName(player),false,false) 
addEventHandler("onClientGUIClick", GUIEditor_Button[1], playerPressButon) -- here is the event handler now 
end 
end 
end 
function playerPressButton (button,state,AbsoluteX,AbsoluteY) 
if (source == GUIEditor_Button[1]) then 
local text = guiGetText (GUIEditor_Edit[1]) 
outputChatBox(tostring(text)) 
end 
end 
addCommandHandler("pm",cgui) 

Link to comment

Can you guys give me any hint that when player selects specific player and types in edit box and presses the 'send message' button it outputs message to him.I have tried searching some resources and looking into admin panel of how "shout" function works but it's too complicated for me. :roll:

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