I know it's very simple to make this but how would I make it so every like 5 mins the player gets a certain amount of money?
Here's my code
[PHP]function GM:AddNotify() -- I'm not sure what i'm doing wrong here.
GAMEMODE:AddNotify("You have been given"..ply:GetMoney().." );
timer.Simple(500, function()
pl:GiveMoney( 5 ) --I know i'm doing something wrong here..
end
end[/PHP]
Is this for a specific gamemode? because GiveMoney isn't just there you know.
You also need to make the timer call a function that gives out money, not the opposite way round.
[QUOTE=PropGamer123;41024551]I know it's very simple to make this but how would I make it so every like 5 mins the player gets a certain amount of money?
Here's my code
[PHP]function GM:AddNotify() -- I'm not sure what i'm doing wrong here.
GAMEMODE:AddNotify("You have been given"..ply:GetMoney().." );
timer.Simple(500, function()
pl:GiveMoney( 5 ) --I know i'm doing something wrong here..
end
end[/PHP][/QUOTE]
A. You are calling the same function inside of the function.
B. What gamemode are you using? Is GiveMoney defined?
C. ply:GetMoney() is probably not defined. You'd probably want a make a variable to give a random amount of cash/or just replace it with "5"
[QUOTE=PropGamer123;41024551]
[PHP]function GM:AddNotify() --used GM
GAMEMODE:AddNotify("You have been given"..ply:GetMoney().." ); --USED ply, used GAMEMODE
timer.Simple(500, function() -- 500/60 is 8.3 seconds but (5*60sec) = 300
pl:GiveMoney( 5 ) --USED pl
end
end[/PHP][/QUOTE]
Also why is this in PHP tags instead of code/lua? :P
Used GM and GAMEMODE
Used ply and pl
Wrong time, should be 300
[QUOTE=Pandaman09;41025625]Also why is this in PHP tags instead of code/lua? :P
Used GM and GAMEMODE
Used ply and pl
Wrong time, should be 300[/QUOTE]
It works now.
Sorry, you need to Log In to post a reply to this thread.