SoMoRay Posted March 24, 2013 Share Posted March 24, 2013 Hi All .... how to send money to all when I put in edit box the money I know I wil use givePlayerMoney triggerServerEvent getElementsByType how to do it when I write 999 then he send 999 when I ........ 888 send 888 Link to comment
Castillo Posted March 24, 2013 Share Posted March 24, 2013 You don't need to use getElementsByType, since givePlayerMoney can be used with "root/getRootElement ( )", like this: givePlayerMoney ( root, 9999 ) Link to comment
SoMoRay Posted March 24, 2013 Author Share Posted March 24, 2013 You don't need to use getElementsByType, since givePlayerMoney can be used with "root/getRootElement ( )", like this: givePlayerMoney ( root, 9999 ) ah thanx I wil checked now .. Link to comment
SoMoRay Posted March 24, 2013 Author Share Posted March 24, 2013 You're welcome. what the wrong ... when I write in F8 send he did't open to me the window also he did't send the money when I wrote in edit box this the codes Client Side ! triggerServerEvent("Money" , getLocalPlayer(), GUIEditor.edit[1]) triggerServerEvent("Open" , getLocalPlayer()) Server Side ! addEvent("Money", true ) addEventHandler("Money", root, function() givePlayerMoney( root , 9999 ) end) function pp() local accname if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Super.Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Big.Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then addCommandHandler("send",pp) end end addEvent("Open", true ) addEventHandler("Open", root, pp) Link to comment
Castillo Posted March 24, 2013 Share Posted March 24, 2013 That doesn't make any sense, post your entire script. Link to comment
iPrestege Posted March 24, 2013 Share Posted March 24, 2013 You should to get the text from the edit and send it to the server side : guiGetText . Link to comment
golanu21 Posted March 24, 2013 Share Posted March 24, 2013 addCommandHandler("money", function (money) local accname = getAccountName(source) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Super.Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Big.Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then elseif money then money = table.concat({...}, " ") givePlayerMoney(root, money) else outputChatBox("[syntax]: /money [Ammount]", source, 255, 255, 0) end end end end end ) Link to comment
iPrestege Posted March 24, 2013 Share Posted March 24, 2013 addCommandHandler("money", function (money) local accname = getAccountName(source) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Super.Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Big.Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then elseif money then money = table.concat({...}, " ") givePlayerMoney(root, money) else outputChatBox("[syntax]: /money [Ammount]", source, 255, 255, 0) end end end end end ) WTF? Spam end ? Link to comment
SoMoRay Posted March 25, 2013 Author Share Posted March 25, 2013 That doesn't make any sense, post your entire script. Client Side ! local sx, sy = guiGetScreenSize() function centerTheGUI( guiElement ) local width, height = guiGetSize( guiElement, false ) local x, y = sx / 2 - width / 2, sy / 2 - height / 2 guiSetPosition( guiElement, x, y, false ) end GUIEditor = { edit = {}, } wnd = guiCreateWindow(476, 302, 387, 139, "Admin Send Money To All", false) centerTheGUI( wnd ) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "C8FFFFFF") send = guiCreateButton(130, 93, 161, 36, "Send !", false, wnd) GUIEditor.edit[1] = guiCreateEdit(69, 42, 280, 36, "", false, wnd) Money_Label = guiCreateLabel(16, 52, 45, 23, "Money", false, wnd) guiSetFont(Money-Label, "default-bold-small") triggerServerEvent("Money" , getLocalPlayer(), GUIEditor.edit[1]) triggerServerEvent("Open" , getLocalPlayer()) Server Side ! addEvent("Money", true ) addEventHandler("Money", root, function() givePlayerMoney( root , 9999 ) end) function pp() local accname = getAccountName(source) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Super.Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Big.Admin" ) ) then elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then addCommandHandler("send",pp) end end addEvent("Open", true ) addEventHandler("Open", root, pp) Link to comment
iPrestege Posted March 25, 2013 Share Posted March 25, 2013 -- Server Side -- addEvent("SendMoney",true); addEventHandler("SendMoney",root, function ( Money ) for _,v in ipairs ( getElementsByType ("player") ) do if not ( tonumber ( Money )) then return outputChatBox("* Number's Only!",source,255,0,0,true); end givePlayerMoney ( v , tonumber ( Money )) ; outputChatBox("* [ "..getPlayerName(source).." ] | Has Sent ( "..Money.." $ ) To All Player's ",v,255,255,0,true); end end ); addEventHandler ( "onResourceStart", resourceRoot, function ( ) for i, player in ipairs( getElementsByType( 'player' ) ) do if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Admin" ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Super.Admin" ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Big.Admin" ) ) or isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Console" ) ) then setElementData( player, 'Show_GUI', true); else setElementData( player, 'Show_GUI', nil); end end end ); addEventHandler( 'onPlayerLogin', root, function( _, acc ) if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( "Admin" ) ) or isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( "Super.Admin" ) ) or isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( "Big.Admin" ) ) or isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( "Console" ) ) then setElementData( source, 'Show_GUI', true); else setElementData( source, 'Show_GUI', nil); end end ); addEventHandler( 'onPlayerLogout', root, function( _, acc ) triggerClientEvent( source, 'LogOutSetVisible', root); setElementData( source, 'Show_GUI', nil); end ); -- Client Side -- local sx, sy = guiGetScreenSize(); function centerTheGUI( guiElement ) local width, height = guiGetSize( guiElement, false ); local x, y = sx / 2 - width / 2, sy / 2 - height / 2 guiSetPosition( guiElement, x, y, false ); end GUIEditor = { edit = {}, } wnd = guiCreateWindow(476, 302, 387, 139, "Admin Send Money To All", false); guiSetVisible(wnd,false); centerTheGUI( wnd ); guiWindowSetSizable(wnd, false); guiSetAlpha(wnd, 1.00); guiSetProperty(wnd, "CaptionColour", "C8FFFFFF"); send = guiCreateButton(130, 93, 161, 36, "Send !", false, wnd); GUIEditor.edit[1] = guiCreateEdit(69, 42, 280, 36, "", false, wnd); Money_Label = guiCreateLabel(16, 52, 45, 23, "Money", false, wnd); guiSetFont(Money_Label, "default-bold-small"); addEventHandler("onClientGUIClick",send, function ( ) local Money = guiGetText(GUIEditor.edit[1]); triggerServerEvent("SendMoney",localPlayer,Money); end,false); addCommandHandler("send", function() if getElementData( localPlayer, 'Show_GUI') ~= nil then guiSetVisible(wnd, not guiGetVisible(wnd)); showCursor(guiGetVisible(wnd)); outputChatBox(" * Welcome To Send Money GUI To All Player's",0,255,0,true); else outputChatBox("* You do not have right permissions",255,0,0,true); end end ); addEvent( 'LogOutSetVisible', true ); addEventHandler( 'LogOutSetVisible', root, function() if guiGetVisible(wnd) then guiSetVisible( wnd, false ); showCursor( false ); outputChatBox("* You do not have right permissions",255,0,0,true); end end ); : P 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