TheIceman1 Posted March 19, 2013 Posted March 19, 2013 Why i didnt get money and message?No errors. Server side: bankTimer = setTimer ( function() givePlayerMoney ( source, 50000 ) removeElementData( source, "bankrobber" ) exports ["guimessages"] : outputServer ( source, "You succesfully robbed the bank and get $50000!" , 255, 255, 0) end ,10000, 1 ) Need paid scripter just pm me i will accept every job!
-ffs-Sniper Posted March 19, 2013 Posted March 19, 2013 Are you sure source is defined? (source is only used as pre-defined variable in event handlers) The timer itself is correct.
TheIceman1 Posted March 19, 2013 Author Posted March 19, 2013 Nothing happens bankTimer = setTimer ( function(player) givePlayerMoney ( player, 50000 ) removeElementData( player, "bankrobber" ) exports ["guimessages"] : outputServer ( player, "You succesfully robbed the bank and get $50000!" , 255, 255, 0) end,10000,1) Need paid scripter just pm me i will accept every job!
Anderl Posted March 19, 2013 Posted March 19, 2013 You didn't pass any argument to the timer's function. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
TheIceman1 Posted March 19, 2013 Author Posted March 19, 2013 Its full code: function startbank () setElementData ( source, "bankrobber", "true" ) exports ["guimessages"] : outputServer ( source, "You start bank rob!" , 255, 255, 0) exports ["guimessages"] : outputServer ( source, "You must stay in bank 5 minutes to get money!" , 255, 255, 0) setElementInterior ( source, 3, 387.6708, 173.8050, 1008.3893 ) setPlayerWantedLevel ( source, 6 ) bankTimer = setTimer ( function(player) givePlayerMoney ( player, 50000 ) removeElementData( player, "bankrobber" ) exports ["guimessages"] : outputServer ( player, "You successfully robbed the bank and get $50000!" , 255, 255, 0) end ,10000,1) end addEvent ( "start", true ) addEventHandler ( "start", root, startbank ) Need paid scripter just pm me i will accept every job!
iPrestege Posted March 19, 2013 Posted March 19, 2013 Hmm.. Try This : function startbank () setElementData ( source, "bankrobber", true ) exports ["guimessages"] : outputServer ( source, "You start bank rob!" , 255, 255, 0) exports ["guimessages"] : outputServer ( source, "You must stay in bank 5 minutes to get money!" , 255, 255, 0) setElementInterior ( source, 3, 387.6708, 173.8050, 1008.3893 ) setPlayerWantedLevel ( source, 6 ) bankTimer = setTimer ( function(player) givePlayerMoney ( player, 50000 ) removeElementData( player, "bankrobber" ) exports ["guimessages"] : outputServer ( player, "You successfully robbed the bank and get $50000!" , 255, 255, 0) end end ,10000,1) addEvent ( "start", true ) addEventHandler ( "start", root, startbank )
Anderl Posted March 19, 2013 Posted March 19, 2013 And why do we need the full code? I already told you the problem, just fix it. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
TheIceman1 Posted March 19, 2013 Author Posted March 19, 2013 Hmm.. Try This : function startbank () setElementData ( source, "bankrobber", true ) exports ["guimessages"] : outputServer ( source, "You start bank rob!" , 255, 255, 0) exports ["guimessages"] : outputServer ( source, "You must stay in bank 5 minutes to get money!" , 255, 255, 0) setElementInterior ( source, 3, 387.6708, 173.8050, 1008.3893 ) setPlayerWantedLevel ( source, 6 ) bankTimer = setTimer ( function(player) givePlayerMoney ( player, 50000 ) removeElementData( player, "bankrobber" ) exports ["guimessages"] : outputServer ( player, "You successfully robbed the bank and get $50000!" , 255, 255, 0) end end ,10000,1) addEvent ( "start", true ) addEventHandler ( "start", root, startbank ) Nothing Need paid scripter just pm me i will accept every job!
TheIceman1 Posted March 19, 2013 Author Posted March 19, 2013 And why do we need the full code? I already told you the problem, just fix it. I dont understand... Need paid scripter just pm me i will accept every job!
Anderl Posted March 19, 2013 Posted March 19, 2013 setTimer - Take a look at the syntax, and your timer's function arguments. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
iPrestege Posted March 19, 2013 Posted March 19, 2013 Try : function startbank () setElementData ( source, "bankrobber", true ) exports ["guimessages"] : outputServer ( source, "You start bank rob!" , 255, 255, 0) exports ["guimessages"] : outputServer ( source, "You must stay in bank 5 minutes to get money!" , 255, 255, 0) setElementInterior ( source, 3, 387.6708, 173.8050, 1008.3893 ) setPlayerWantedLevel ( source, 6 ) bankTimer = setTimer (function(player) if not isElement(player) then return end givePlayerMoney ( player, 50000 ) removeElementData( player, "bankrobber" ) exports ["guimessages"] : outputServer ( player, "You successfully robbed the bank and get $50000!" , 255, 255, 0) end ,10000,1,source) end addEvent ( "start", true ) addEventHandler ( "start", root, startbank )
TheIceman1 Posted March 19, 2013 Author Posted March 19, 2013 setTimer - Take a look at the syntax, and your timer's function arguments. Fixed,thanks! Need paid scripter just pm me i will accept every job!
Anderl Posted March 19, 2013 Posted March 19, 2013 You're welcome. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
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