Raised This Month: $12 Target: $400
 3% 

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 , 19: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.
__________________
CS:CZ > CS 1.6
Ace67 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 04-09-2021 , 19: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 , 14: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 ?
?
__________________
CS:CZ > CS 1.6
Ace67 is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 04-13-2021 , 23: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 03:22.
Celena Luna is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-14-2021 , 12:38   Re: Money Every 5 Minutes
Reply With Quote #5

Thanks works
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 04-14-2021 at 13:00.
Ace67 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-14-2021 , 23: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-14-2021 at 23:59.
Bugsy is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 04-15-2021 , 03: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 , 10:52   Re: Money Every 5 Minutes
Reply With Quote #8

Edited
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 04-15-2021 at 10:53.
Ace67 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-18-2021 , 00: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 ?
__________________
CS:CZ > CS 1.6
Ace67 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-18-2021 , 00: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 00: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 05:29.


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