Raised This Month: $ Target: $400
 0% 

Maximum amount of money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-15-2009 , 07:38   Re: Money
Reply With Quote #1

Code:
new MaxMoney = 16000; new BonusMoney = get_cvar_num("amx_money_num"); // Should use PCVAR new TotalMoney = cs_get_user_money(id) + BonusMoney;   if (BonusMoney >= MaxMoney)         cs_set_user_money(id, MaxMoney); else         cs_set_user_money(id, TotalMoney);
EDIT: Too late.
__________________
hleV is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-15-2009 , 07:39   Re: Money
Reply With Quote #2

Quote:
Originally Posted by hleV View Post
Code:
new MaxMoney = 16000; new BonusMoney = get_cvar_num("amx_money_num"); // Should use PCVAR new TotalMoney = cs_get_user_money(id) + BonusMoney;   if (TotalMoney >= MaxMoney)         cs_set_user_money(id, MaxMoney); else         cs_set_user_money(id, TotalMoney);
EDIT: Too late.
Fixed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 04-15-2009 , 08:04   Re: Money
Reply With Quote #3

Its a small bit of code from a plugin. Everything works fine, I just want to make the maximum ammount of money given to be 16,000.
When I added the code, you gave me, I started getting an error saying something about iPlayerMoney not being used...

PHP Code:
public money(id)
{
    if(
money_active[id] == 1)
    {    
        new 
iMoneyToGive min(16000 iPlayerMoneyget_pcvar_num(amx_money_num))
        
cs_set_user_money(id,  cs_get_user_money(id) + iMoneyToGive)
        
client_print(idprint_chat"%L"LANG_PLAYER"MONEY"iMoneyToGive)  
    }

Debesėlis is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-15-2009 , 08:50   Re: Money
Reply With Quote #4

Edited and should be fixed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 04-15-2009 , 09:07   Re: Money
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Edited and should be fixed.
How do I get text that says money has been given to you or, if you've got 16,000, that your account is full.

PHP Code:
        new MaxMoney 16000;
        new 
BonusMoney get_cvar_num("amx_money_num");
        new 
TotalMoney cs_get_user_money(id) + BonusMoney;

        if (
TotalMoney >= MaxMoney)
                
cs_set_user_money(idMaxMoney);
        else
                
cs_set_user_money(idTotalMoney);
            
client_print(idprint_chat"%L"LANG_PLAYER"MONEY"get_cvar_num("amx_money_num"));
        
        if(
MaxMoney)
        {
            
client_print(idprint_chat"%L"LANG_PLAYER"MONEY_MAX"get_cvar_num("amx_money_num"));
        } 

Last edited by Debesėlis; 04-15-2009 at 11:05.
Debesėlis is offline
Reply



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 02:21.


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