will briggs Posted June 14, 2011 Share Posted June 14, 2011 (edited) Good... Edit : Making my point, im not intensionally doing it... Edited June 14, 2011 by Guest Link to comment
JR10 Posted June 14, 2011 Share Posted June 14, 2011 Good... I really didn't want to post this but, What make's you diffrent when you just post "Good..."? That's the same. Link to comment
Jaysds1 Posted June 14, 2011 Author Share Posted June 14, 2011 ok, Now can you guyz get on Topic, I need help with this update gui thing. Link to comment
Jaysds1 Posted June 15, 2011 Author Share Posted June 15, 2011 how do you show the gui to the client when triggering a Client Event? Link to comment
Jaysds1 Posted June 15, 2011 Author Share Posted June 15, 2011 No, I meant only showing the gui to the person not to others. Sorry about the first question. Link to comment
Castillo Posted June 15, 2011 Share Posted June 15, 2011 triggerClientEvent(playerElement,"eventName",playerElement) Link to comment
Jaysds1 Posted June 15, 2011 Author Share Posted June 15, 2011 so, the playerElement could be "source" or "client"? Link to comment
Castillo Posted June 15, 2011 Share Posted June 15, 2011 playerElement = your player element, is that hard to understand? Link to comment
Jaysds1 Posted June 15, 2011 Author Share Posted June 15, 2011 attitude.... I'm just trying to learn like everybody else.... GOOOSH! Link to comment
JR10 Posted June 15, 2011 Share Posted June 15, 2011 You want to show a gui for 1 player only just like castillo you trigger a client event for the player like this: --server side triggerClientEvent(player, 'showGUI', player) --client side addEvent('showGUI', true) addEventHandler('showGUI', root, function() guiSetVisible(gui, true) end ) player is the player you want to show him the gui Link to comment
Jaysds1 Posted June 15, 2011 Author Share Posted June 15, 2011 ok, thanks THAT'S SOOOO BETTER! Link to comment
Jaysds1 Posted June 16, 2011 Author Share Posted June 16, 2011 How do you make a script on, when a admin login and automatically adds "{SERVERNAME}" at the beginning of the admin name? My server-side script: function iamAdmin(player) local account = getPlayerAccount(player) if not account then return end local accountName = getAccountName(account) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then local tag = "{JWORLD}" local oldName = getPlayerName ( client ) local newName = tag .. oldName setPlayerName (source, newName) setPlayerTeam" class="kw6">setPlayerTeam (source, teamA) ouputChatBox ("ADMIN ON LINE") end if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) then local tag = "{JWORLD MODERATOR}" local oldName = getPlayerName ( client ) local newName = tag .. oldName setPlayerName (source, newName) setPlayerTeam" class="kw6">setPlayerTeam (source, teamM) ouputChatBox ("MODERATOR ON LINE") end end addEventHandler("onPlyerLogin", getRootElement(), iamAdmin) Link to comment
CowTurbo Posted June 16, 2011 Share Posted June 16, 2011 [/lua] function iamAdmin() local account = getPlayerAccount(source) if not account then return end local accountName = getAccountName(source) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then setPlayerNametagText (source, "{JWORLD}..getPlayerName(source)) setPlayerTeam (source, teamA) ouputChatBox ("* INFO: Admin have logged in!") end if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) then setPlayerNametagText (source, "{JWORLDMOD}..getPlayerName(source)) setPlayerTeam (source, teamM) ouputChatBox ("" INFO: Moderator have logged in!") end end addEventHandler("onPlyerLogin", getRootElement(), iamAdmin)[/lua] when you chat, then you will see the tag, Link to comment
Castillo Posted June 16, 2011 Share Posted June 16, 2011 What's that TurboCow? getAccountName(source) o,O? also.. when you chat your nametag text is not shown in the chat without the script to do that. You have a lot of mistakes in this script. Here's what Jaysd1 wanted: function iamAdmin() local account = getPlayerAccount(source) local accountName = getAccountName(account) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Sr.Admin" ) ) then setPlayerTeam (source, teamA) setPlayerName(source, "{JWORLD}"..getPlayerName(source)) ouputChatBox ("* INFO: Admin have logged in!") elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) then setPlayerName(source, "{JWORLD}"..getPlayerName(source)) setPlayerTeam (source, teamM) ouputChatBox ("INFO: Moderator have logged in!") end end addEventHandler("onPlayerLogin", getRootElement(), iamAdmin) Link to comment
CowTurbo Posted June 16, 2011 Share Posted June 16, 2011 sorry, dont have good day today... Link to comment
Jaysds1 Posted June 16, 2011 Author Share Posted June 16, 2011 It's ok CowTurbo, We all have bad days Link to comment
Jaysds1 Posted June 20, 2011 Author Share Posted June 20, 2011 I made this script, when a person change there nick to our beginning nick (ex. {SANL}....) it cancels the event but when an admin logs in it tries to cancel the Event but still goes through. Here is my script: client-side only function removeHEX(oldNick,newNick) if (string.find(newNick,"{JWORLD}")) then local account = getPlayerAccount(source) local accountName = getAccountName(account) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then triggerEvent() end else outputChatBox("You can't have our beginning nick.", source, 255, 0, 0) cancelEvent() end end addEventHandler("onPlayerChangeNick",getRootElement(),removeHEX) Link to comment
JR10 Posted June 20, 2011 Share Posted June 20, 2011 function removeHEX(oldNick,newNick) if (string.find(newNick,"{JWORLD}")) then local account = getPlayerAccount(source) local accountName = getAccountName(account) if not isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then outputChatBox("You can't have our beginning nick.", source, 255, 0, 0) cancelEvent() end end end addEventHandler("onPlayerChangeNick",getRootElement(),removeHEX) Link to comment
Jaysds1 Posted June 23, 2011 Author Share Posted June 23, 2011 I have a problem with my rule/help gui. When I press f2 the window is not in the center, all the gui elements/buttons and memo are in the left corner then when i press f2 again, it opens up more windows. I want the window to be in the center, same with the elements and the button to close the gui. Here is my script: Server-side addEventHandler("onPlayerJoin", getRootElement(), function() bindKey (source, "f2", "down", serverWin ) end ) addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), function() for index, player in pairs(getElementsByType("player")) do unbindKey ( source, "f2", "down", serverWin ) end end ) function serverWin() triggerClientEvent ( "server", getRootElement()) end Client-side function CreateRule() GUIEditor_Window = {} GUIEditor_Button = {} rules = guiCreateWindow(194,108,426,400,"J World: Freeroam Service Window",false) --Buttons chg_pss = guiCreateButton(15,33,70,40,"change password",false,GUIEditor_Window[1]) chg_nick = guiCreateButton(95,35,70,40,"change nick",false,GUIEditor_Window[1]) lout = guiCreateButton(178,36,70,40,"Logout",false,GUIEditor_Window[1]) --Text read_only = guiCreateMemo(17,92,398,100," Welcome to J World: Freeroam\n\n There is no rules on this server.\n\n All we ask is to be respectful to others and have FUN.",false,GUIEditor_Window[1]) guiMemoSetReadOnly(read_only,true) guiCreateLabel(20,231,371,145,"COMING SOON!!!",false,GUIEditor_Window[1]) end Link to comment
JR10 Posted June 23, 2011 Share Posted June 23, 2011 How the window variable is rules? and your parent for all the buttons and memo is GUIEditor_Window[1]?? Replace GUIEditor_Window[1] with rules. And, i don't see the event added, and you probably create the rule window each time the player press F2 create it on resource start, hide it, then show it when needed. Here: client side function CreateRule() GUIEditor_Button = {} rules = guiCreateWindow(194,108,426,400,"J World: Freeroam Service Window",false) --Buttons chg_pss = guiCreateButton(15,33,70,40,"change password",false,rules) chg_nick = guiCreateButton(95,35,70,40,"change nick",false,rules) lout = guiCreateButton(178,36,70,40,"Logout",false,rules) --Text read_only = guiCreateMemo(17,92,398,100," Welcome to J World: Freeroam\n\n There is no rules on this server.\n\n All we ask is to be respectful to others and have FUN.",false,rules) guiMemoSetReadOnly(read_only,true) guiCreateLabel(20,231,371,145,"COMING SOON!!!",false,rules) guiSetVisible(rules, false) end addEventHandler('onClientResourceStart', resourceRoot, function() CreateRule() end ) addEvent('server', true) addEventHandler('server', root, function() guiSetVisible(rules, not guiGetVisible(rules)) showCursor(not isCursorShowing()) end ) 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