Evil-Cod3r Posted March 2, 2012 Share Posted March 2, 2012 Hi all i just run my brain and Make this but is it correct ? local spam = false local Money = getPlayerMoney(source) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(470,264,608,378,"Money_System By Dev-PoinT",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(219,20,116,124,"images/money.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(37,238,129,91,"images/yes.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(421,247,129,79,"images/no.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(41,339,196,18,"Yes To Show Your Money",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(410,340,158,15,"No To Hide The Window",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,0,0) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Button[1] = guiCreateButton(195,174,173,36,"Give Me Money",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"clear-normal") addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Image[2] then if spam then outputChatBox("You have to wait 30 sec",255,0,0) return end local sound = playSound("sounds/cash.mp3") setSoundVolume(sound, 0.5) triggerServerEvent ("showMoney", localPlayer) 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
Kenix Posted March 2, 2012 Share Posted March 2, 2012 (edited) is it correct ? Nope Edited March 2, 2012 by Guest Link to comment
Evil-Cod3r Posted March 2, 2012 Author Share Posted March 2, 2012 what about this ?? local spam = false local Money = getPlayerMoney(source) local reward = math.random(10,100) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(470,264,608,378,"Money_System By Dev-PoinT",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(219,20,116,124,"images/money.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(37,238,129,91,"images/yes.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(421,247,129,79,"images/no.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(41,339,196,18,"Yes To Show Your Money",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(410,340,158,15,"No To Hide The Window",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,0,0) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Button[1] = guiCreateButton(195,174,173,36,"Give Me Money",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"clear-normal") addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Image[2] then if spam then outputChatBox("You have to wait 30 sec",255,0,0) return end local sound = playSound("sounds/cash.mp3") setSoundVolume(sound, 0.5) triggerServerEvent ("showMoney", localPlayer) spam = true setTimer(function() spam = false end,30000,1) elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) end end ) addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Button[1] then givePlayerMoney(source,reward) end end ) Link to comment
Kenix Posted March 2, 2012 Share Posted March 2, 2012 Same incorrect. Read all. local spam = false local Money = getPlayerMoney(source) -- source use only in event ( NOT OUTSIDE ) local reward = math.random(10,100) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(470,264,608,378,"Money_System By Dev-PoinT",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(219,20,116,124,"images/money.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(37,238,129,91,"images/yes.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(421,247,129,79,"images/no.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(41,339,196,18,"Yes To Show Your Money",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(410,340,158,15,"No To Hide The Window",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,0,0) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Button[1] = guiCreateButton(195,174,173,36,"Give Me Money",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"clear-normal") addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Image[2] then if spam then outputChatBox("You have to wait 30 sec",255,0,0) return end local sound = playSound("sounds/cash.mp3") setSoundVolume(sound, 0.5) triggerServerEvent ("showMoney", localPlayer) spam = true setTimer(function() spam = false end,30000,1) elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) end end ) -- you should add false to argument addEventHandler ( getPropagated = false ) addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Button[1] then givePlayerMoney(source,reward) -- you give money button ? end end ) -- some viewtopic.php?f=91&t=40807 viewtopic.php?f=91&t=39678 Tabulate code! Link to comment
Evil-Cod3r Posted March 2, 2012 Author Share Posted March 2, 2012 so i got onley 2 erros ? Link to comment
Kenix Posted March 2, 2012 Share Posted March 2, 2012 Yes. Maybe I did not see any errors. Only this. Link to comment
Evil-Cod3r Posted March 2, 2012 Author Share Posted March 2, 2012 Kenix God i love You Man Love You to the end i just fixed the server side by My Self still the client side i try Link to comment
Evil-Cod3r Posted March 2, 2012 Author Share Posted March 2, 2012 some one help me to understand my erros ? Link to comment
TAPL Posted March 2, 2012 Share Posted March 2, 2012 -- Client Side -- local spam = false GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(470,264,608,378,"Money_System By Dev-PoinT",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(219,20,116,124,"images/money.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(37,238,129,91,"images/yes.png",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(421,247,129,79,"images/no.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(41,339,196,18,"Yes To Show Your Money",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(410,340,158,15,"No To Hide The Window",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,0,0) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Button[1] = guiCreateButton(195,174,173,36,"Give Me Money",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"clear-normal") addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Image[2] then if spam then outputChatBox("You have to wait 30 sec",255,0,0) return end local sound = playSound("sounds/cash.mp3") setSoundVolume(sound, 0.5) triggerServerEvent ("showMoney", localPlayer) spam = true setTimer(function() spam = false end,30000,1) elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) end end) addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Button[1] then triggerServerEvent ("giveMoney", localPlayer) end end) -- Server Side -- addEvent("giveMoney", true ) addEventHandler("giveMoney", root, function() local reward = math.random(10,100) givePlayerMoney(source,reward) end) Link to comment
Evil-Cod3r Posted March 2, 2012 Author Share Posted March 2, 2012 both of the events say cilen triggerd server side event but event is not added to server side what is the problem so i can fix it on the later scripts ? addEvent("giveMoney", true ) addEventHandler("giveMoney", root, function() local reward = math.random(10,100) givePlayerMoney(source,reward) outputChatBox(getPlayerName(source)"Money System Has Give Him".. reward.."$", root,255,255,0) end) addEvent("showMoney", true ) addEventHandler("showMoney", root, function() outputChatBox(getPlayerName(source).." Has Money is $"..getPlayerMoney(source).."!",root,255,255,0) else outputChatBox("You Have To Wait 30 sec for Using this Command again !",source,255,0,0) end) Link to comment
TAPL Posted March 2, 2012 Share Posted March 2, 2012 addEvent("giveMoney", true ) addEventHandler("giveMoney", root, function() local reward = math.random(10,100) givePlayerMoney(source,reward) outputChatBox(getPlayerName(source).." Money System Has Give Him".. reward.."$", root,255,255,0) end) 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 March 2, 2012 Author Share Posted March 2, 2012 Thanx Tapl Work But what was the problem ?? Link to comment
TAPL Posted March 2, 2012 Share Posted March 2, 2012 Thanx Tapl Work But what was the problem ?? outputChatBox(getPlayerName(source)"Money System Has Give Him".. reward.."$", root,255,255,0) you forgot this (..) after getPlayerName(source) also you put (else) without (if) Link to comment
Evil-Cod3r Posted March 2, 2012 Author Share Posted March 2, 2012 Fixed By My Slef Thanx All For Help Me ! Topic Closed ! Link to comment
Kenix Posted March 2, 2012 Share Posted March 2, 2012 Evil-Cod3r,You lol. I say you more time source use only in event ( NOT OUTSIDE ) Link to comment
Evil-Cod3r Posted March 2, 2012 Author Share Posted March 2, 2012 yes i fixed it https://community.multitheftauto.com/index.php?p= ... ls&id=3912 Link to comment
TAPL Posted March 2, 2012 Share Posted March 2, 2012 yes i fixed it https://community.multitheftauto.com/index.php?p= ... ls&id=3912 you forgot a thing you hide the gui on click (no) but you didn't hide the cursor addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Image[2] then if spam then outputChatBox("You have to wait 30 sec.. ",255,0,0) return end local sound = playSound("sounds/cash.mp3") setSoundVolume(sound, 1.5) triggerServerEvent ("showMoney", localPlayer) spam = true setTimer(function() spam = false end,30000,1) elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) end end) Correct addEventHandler('onClientGUIClick',root, function() if source == GUIEditor_Image[2] then if spam then outputChatBox("You have to wait 30 sec.. ",255,0,0) return end local sound = playSound("sounds/cash.mp3") setSoundVolume(sound, 1.5) triggerServerEvent ("showMoney", localPlayer) spam = true setTimer(function() spam = false end,30000,1) elseif source == GUIEditor_Image[3] then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) end 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