Raised This Month: $45 Target: $400
 11% 

Money Every 5 Minutes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-09-2021 , 20:04   Money Every 5 Minutes
Reply With Quote #1

Hello, im currently searching a plugin for get money all 5 minutes ex:
You get money for every 5 minutes played.
__________________
Ace67 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Riyadh
Old 04-09-2021 , 20:15   Re: Money Every 5 Minutes
Reply With Quote #2

Look like u sharing every 1hour man, you can't wait ?
SHIFT0 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-10-2021 , 15:25   Re: Money Every 5 Minutes
Reply With Quote #3

Quote:
Originally Posted by SHIFT0 View Post
Look like u sharing every 1hour man, you can't wait ?
?
__________________
Ace67 is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 04-14-2021 , 00:55   Re: Money Every 5 Minutes
Reply With Quote #4

[Global Timer]
- Everyone get money every 5 minutes
Spoiler


[Unique Timer]
- The player have to stay in server for 5 minutes to get money.
- Disconnect = reset timer
Spoiler


P/S: Please reply if it work or not
__________________
My plugin:

Last edited by Celena Luna; 04-15-2021 at 04:22.
Celena Luna is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-14-2021 , 13:38   Re: Money Every 5 Minutes
Reply With Quote #5

Thanks works
__________________

Last edited by Ace67; 04-14-2021 at 14:00.
Ace67 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-15-2021 , 00:57   Re: Money Every 5 Minutes
Reply With Quote #6

@Celena Luna - You do not need to check is_user_connected() on players returned by get_players() as it only returns connected players. And you want to avoid calling the same native more than once when it's guaranteed to return the same value, in this case your two cs_get_user_team() calls are redundant. You should store the value in a variable and use that in your conditions, or do it as I have below. And this is more of a style thing, but IMO there's no sense in checking negative conditions to return or continue, just execute the applicable code when the condition is met, as I have below.

PHP Code:
//Global timer
if ( CS_TEAM_T <= cs_get_user_teamPlayerList] ) <= CS_TEAM_CT )
    
cs_set_user_money(PlayerList[i], cs_get_user_money(PlayerList[i]) + GIVE_AMOUNT)

//Unique timer
if ( CS_TEAM_T <= cs_get_user_teamid ) <= CS_TEAM_CT )
    
cs_set_user_money(idcs_get_user_money(id) + GIVE_AMOUNT
__________________

Last edited by Bugsy; 04-15-2021 at 00:59.
Bugsy is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 04-15-2021 , 04:11   Re: Money Every 5 Minutes
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
@Celena Luna - You do not need to check is_user_connected() on players returned by get_players() as it only returns connected players. And you want to avoid calling the same native more than once when it's guaranteed to return the same value, in this case your two cs_get_user_team() calls are redundant. You should store the value in a variable and use that in your conditions, or do it as I have below.
I was wrote in hurry so I forget about these.
__________________
My plugin:
Celena Luna is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-15-2021 , 11:52   Re: Money Every 5 Minutes
Reply With Quote #8

Edited
__________________

Last edited by Ace67; 04-15-2021 at 11:53.
Ace67 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-18-2021 , 01:17   Re: Money Every 5 Minutes
Reply With Quote #9

Quote:
Originally Posted by Celena Luna View Post
I was wrote in hurry so I forget about these.
Sup, can you edit for max money 16k ?
__________________
Ace67 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-18-2021 , 01:20   Re: Money Every 5 Minutes
Reply With Quote #10

Replace:

cs_get_user_money(id) + GIVE_AMOUNT
with
min( cs_get_user_money(id) + GIVE_AMOUNT , 16000 )

And

cs_get_user_money(PlayerList[i]) + GIVE_AMOUNT
with
min( cs_get_user_money(PlayerList[i]) + GIVE_AMOUNT , 16000 )
__________________

Last edited by Bugsy; 04-18-2021 at 01:22.
Bugsy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:22.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode