Evil-Cod3r Posted February 25, 2012 Share Posted February 25, 2012 Hi all iam not good in Gui script can i get help with this ? local Money = getPlayerMoney(source) local Name = getPlayerName(source) GUIEditor_Window = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(501,267,593,287,"Show My Money By Dev-PoinT",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(239,17,97,112,"images/money.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(109,165,136,98,"images/yes.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(385,159,147,96,"images/no.png",false,GUIEditor_Window[1]) addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Image[2] then outputChatBox(Name .. "Has Money is .. Money",255,255,0) elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) end end ) Link to comment
TAPL Posted February 25, 2012 Share Posted February 25, 2012 client side GUIEditor_Window = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(501,267,593,287,"Show My Money By Dev-PoinT",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(239,17,97,112,"images/money.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(109,165,136,98,"images/yes.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(385,159,147,96,"images/no.png",false,GUIEditor_Window[1]) addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Image[2] then triggerServerEvent ("showMoney", localPlayer) elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) end end ) server side addEvent("showMoney", true ) addEventHandler("showMoney", root, function() outputChatBox(getPlayerName(source).." Has Money is $"..getPlayerMoney(source).."!",root,255,255,0) end) Link to comment
Evil-Cod3r Posted February 25, 2012 Author Share Posted February 25, 2012 Thank You Tapl now i want 1 thing i need to add anti-spam in chat for 30 sec then the Players can use it again ! addEvent("showMoney", true ) --- the event addEventHandler("showMoney", root, --- the event function() outputChatBox(getPlayerName(source).." Has Money is $"..getPlayerMoney(source).."!",root,255,255,0) --- getPlayer Name and Money then output it to the chat ! else outputChatBox("You Have To Wait 30 sec for Using this Command again !",source,255,0,0) end) local Timer = {30} GUIEditor_Window = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(501,267,593,287,"Show My Money By Dev-PoinT",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(239,17,97,112,"images/money.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(109,165,136,98,"images/yes.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(385,159,147,96,"images/no.png",false,GUIEditor_Window[1]) addEventHandler('onClientGUIClick',root, ---- the Gui event for if you click the imgaes then ... function() if source == GUIEditor_Image[2] then triggerServerEvent ("showMoney", localPlayer) --- trigger it to server side elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) end end ) Link to comment
TAPL Posted February 25, 2012 Share Posted February 25, 2012 try this (not tested) local spam = false GUIEditor_Window = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(501,267,593,287,"Show My Money By Dev-PoinT",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(239,17,97,112,"images/money.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(109,165,136,98,"images/yes.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(385,159,147,96,"images/no.png",false,GUIEditor_Window[1]) addEventHandler('onClientGUIClick',root, ---- the Gui event for if you click the imgaes then ... function() if source == GUIEditor_Image[2] then if spam then outputChatBox("You have to wait 30 sec",255,0,0) return end triggerServerEvent ("showMoney", localPlayer) --- trigger it to server side spam = true setTimer(function() spam = false end,30000,1) elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) end end ) Link to comment
Evil-Cod3r Posted February 25, 2012 Author Share Posted February 25, 2012 Thank You Tapl Now Your in the Crdits 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