Raised This Month: $10 Target: $400
 2% 

Money Every 5 Minutes


Post New Thread Reply   
 
Thread Tools Display Modes
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-18-2021 , 02:03   Re: Money Every 5 Minutes
Reply With Quote #11

Quote:
Originally Posted by Bugsy View Post
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 )
the min give error, so i have do this

Code:
public Give_Money()
{
    static PlayerList[32], PlayerNum; PlayerNum = 0
    static id
    static CsTeams:iTeam;
    get_players(PlayerList, PlayerNum, "h")
    for(new i=0; i<PlayerNum;i++)
    {
        id = PlayerList[i];
        iTeam = cs_get_user_team(id)
        if(iTeam == CS_TEAM_SPECTATOR || iTeam == CS_TEAM_UNASSIGNED)
            continue

        cs_set_user_money(id, cs_get_user_money(id) + GIVE_AMOUNT , 16000 )
    }
}
__________________

Last edited by Ace67; 04-18-2021 at 02:03.
Ace67 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-18-2021 , 02:50   Re: Money Every 5 Minutes
Reply With Quote #12

I thought you were using the code I posted here. I showed you what you had to replace in each of these 2 snips.
__________________
Bugsy is offline
Old 04-18-2021, 07:37
Ace67
This message has been deleted by Ace67.
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-18-2021 , 15:07   Re: Money Every 5 Minutes
Reply With Quote #13

Quote:
Originally Posted by Bugsy View Post
I thought you were using the code I posted here. I showed you what you had to replace in each of these 2 snips.

Code:
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmodx\scripting\money5min.sma(67 -- 69) : error 001: expected token: ",", but found "}"
Code:
public Give_Money()
{
    static PlayerList[32], PlayerNum; PlayerNum = 0
    static id
    static CsTeams:iTeam;
    get_players(PlayerList, PlayerNum, "h")
    for(new i=0; i<PlayerNum;i++)
    {
        id = PlayerList[i];
        iTeam = cs_get_user_team(id)
        if(iTeam == CS_TEAM_SPECTATOR || iTeam == CS_TEAM_UNASSIGNED)
            continue

        cs_set_user_money(id, min (cs_get_user_money (id) + GIVE_AMOUNT, 16000)
    }
}
__________________
Ace67 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-18-2021 , 18:41   Re: Money Every 5 Minutes
Reply With Quote #14

PHP Code:
public Give_Money()
{
    new 
PlayerList32 ], id PlayerNum

    
get_playersPlayerList PlayerNum "h" );

    for ( new 
PlayerNum i++ )
    {
        
id PlayerList];

        if ( 
CS_TEAM_T <= cs_get_user_teamid ) <= CS_TEAM_CT )
        {
                
cs_set_user_moneyid mincs_get_user_moneyid ) + GIVE_AMOUNT16000 ) );
        }
    }

__________________
Bugsy is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-18-2021 , 19:50   Re: Money Every 5 Minutes
Reply With Quote #15

Quote:
Originally Posted by Bugsy View Post
PHP Code:
public Give_Money()
{
    new 
PlayerList32 ], id PlayerNum

    
get_playersPlayerList PlayerNum "h" );

    for ( new 
PlayerNum i++ )
    {
        
id PlayerList];

        if ( 
CS_TEAM_T <= cs_get_user_teamid ) <= CS_TEAM_CT )
        {
                
cs_set_user_moneyid mincs_get_user_moneyid ) + GIVE_AMOUNT16000 ) );
        }
    }

Thanks works.
__________________
Ace67 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 05-16-2021 , 11:01   Re: Money Every 5 Minutes
Reply With Quote #16

Quote:
Originally Posted by Bugsy View Post
PHP Code:
public Give_Money()
{
    new 
PlayerList32 ], id PlayerNum

    
get_playersPlayerList PlayerNum "h" );

    for ( new 
PlayerNum i++ )
    {
        
id PlayerList];

        if ( 
CS_TEAM_T <= cs_get_user_teamid ) <= CS_TEAM_CT )
        {
                
cs_set_user_moneyid mincs_get_user_moneyid ) + GIVE_AMOUNT16000 ) );
        }
    }



Hey @Bugsy, can you edit for this lines 16k max money, thx.

Code:
public client_disconnect(id) remove_task(id+TASK_GETMONEY)

public Give_Money(taskid)
{
    new id = taskid -TASK_GETMONEY;
    static CsTeams:iTeam;

    if(iTeam == CS_TEAM_SPECTATOR || iTeam == CS_TEAM_UNASSIGNED)
            return

    cs_set_user_money(id, cs_get_user_money(id) + GIVE_AMOUNT)
}
__________________

Last edited by Ace67; 05-16-2021 at 11:03.
Ace67 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-16-2021 , 12:12   Re: Money Every 5 Minutes
Reply With Quote #17

cs_set_user_money(id, min( cs_get_user_money(id) + GIVE_AMOUNT , 16000 ) )
__________________
Bugsy is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 05-16-2021 , 12:24   Re: Money Every 5 Minutes
Reply With Quote #18

Quote:
Originally Posted by Bugsy View Post
cs_set_user_money(id, min( cs_get_user_money(id) + GIVE_AMOUNT , 16000 ) )
i don't get the money after 5mins.
__________________
Ace67 is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 05-17-2021 , 04:53   Re: Money Every 5 Minutes
Reply With Quote #19

[Global Timer]
Spoiler


[Unique Timer]
Spoiler

I edited based on my post

P/S: Please reply if it work or not

@Bugsy: Sorry, I got infected by Dias's style who usually check the negative condition.
Though, I would use positive condition if the positive condition is less than negative
__________________
My plugin:

Last edited by Celena Luna; 05-17-2021 at 04:54.
Celena Luna is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 05-17-2021 , 14:35   Re: Money Every 5 Minutes
Reply With Quote #20

Quote:
Originally Posted by Celena Luna View Post
[Global Timer]
Spoiler


[Unique Timer]
Spoiler

I edited based on my post

P/S: Please reply if it work or not

@Bugsy: Sorry, I got infected by Dias's style who usually check the negative condition.
Though, I would use positive condition if the positive condition is less than negative
With unique timer, we don't get the money.
__________________
Ace67 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 11:26.


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