-- Client Side #
addEventHandler('onClientResourceStart', resourceRoot,
function()
wnd = guiCreateWindow(271, 227, 476, 395, '', false)
guiWindowSetSizable(wnd, false)
naim = guiCreateButton(32, 40, 409, 158, 'Set Your Name', false, wnd )
button = guiCreateButton(124, 260, 218, 60, '', false, wnd )
edbox = guiCreateEdit(93, 203, 299, 43, '', false, wnd )
showCursor( true )
end
)
addEventHandler('onClientGUIClick', root,
function ( )
if source == naim then
Ebox = guiGetText ( edbox )
triggerServerEvent('SetName', localPlayer, Ebox, getPlayerName( source ) )
playSoundFrontEnd(38)
guiSetVisible(wnd, false)
showCursor(false)
end
end
)
-- Server Side #
addEvent('SetName',true)
addEventHandler('SetName',root, function ( Ebox, new )
setPlayerName ( source , tostring(Ebox) )
outputChatBox ( new.. ' Has Changed His Nick To ' .. tostring(Ebox))
end
)