Raised This Month: $32 Target: $400
 8% 

Give money to everyone in server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-07-2021 , 14:19   Give money to everyone in server
Reply With Quote #1

Hello i wanted to ask if someone has a free time, could you help me make a plugin which donates your money to everyone in server? It splits it to everyone...
HowToRuski is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-07-2021 , 16:38   Re: Give money to everyone in server
Reply With Quote #2

PHP Code:
/* Sublime AMXX Editor v2.2 */

#pragma semicolon 1

#include <amxmodx>
// #include <amxmisc>
#include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "DonateMoney in pieces"
#define VERSION "1.0"
#define AUTHOR  "NapoleoN#"

#if !defined MAX_PLAYERS
    
const MAX_PLAYERS 32;
#endif

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say /donatemoney""DonateMoney");
}

public 
DonateMoney(id)
{
    new 
iPlayers[MAX_PLAYERS], iNum;
    
get_players(iPlayersiNum"ch"); 

    new 
iMoney cs_get_user_money(id);
    new 
Float:fEndAmount float(iMoney) / float(iNum);
    new 
iEndAmount floatround(fEndAmountfloatround_floor); // Round down since you can't donate money you don't own.

    
if(iMoney 0)
    {
        new 
iPlayer;
        
cs_set_user_money(id0);

        for(new 
iiNumi++)
        {
            
iPlayer iPlayers[i];
            
cs_set_user_money(iPlayercs_get_user_money(iPlayer) + iEndAmount);
        }
    }

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-08-2021 , 10:40   Re: Give money to everyone in server
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
PHP Code:
/* Sublime AMXX Editor v2.2 */

#pragma semicolon 1

#include <amxmodx>
// #include <amxmisc>
#include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "DonateMoney in pieces"
#define VERSION "1.0"
#define AUTHOR  "NapoleoN#"

#if !defined MAX_PLAYERS
    
const MAX_PLAYERS 32;
#endif

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say /donatemoney""DonateMoney");
}

public 
DonateMoney(id)
{
    new 
iPlayers[MAX_PLAYERS], iNum;
    
get_players(iPlayersiNum"ch"); 

    new 
iMoney cs_get_user_money(id);
    new 
Float:fEndAmount float(iMoney) / float(iNum);
    new 
iEndAmount floatround(fEndAmountfloatround_floor); // Round down since you can't donate money you don't own.

    
if(iMoney 0)
    {
        new 
iPlayer;
        
cs_set_user_money(id0);

        for(new 
iiNumi++)
        {
            
iPlayer iPlayers[i];
            
cs_set_user_money(iPlayercs_get_user_money(iPlayer) + iEndAmount);
        }
    }

I don't get it. it wont work for me. I just edited your code a little bit for my needs. But it wont work :/ It just shows a client_print i added

PHP Code:
/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
#include <cstrike>
#include <zombieplague>

#define PLUGIN  "DonateMoney in pieces"
#define VERSION "1.0"
#define AUTHOR  "NapoleoN#"

#if !defined MAX_PLAYERS
    
const MAX_PLAYERS 32;
#endif

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say /donatemoney""DonateMoney");
}

public 
DonateMoney(id)
{
    new 
iPlayers[MAX_PLAYERS], iNum;
    
get_players(iPlayersiNum"ch"); 

    new 
iMoney zp_get_user_ammo_packs(id);
    new 
Float:fEndAmount float(iMoney) / float(iNum);
    new 
iEndAmount floatround(fEndAmountfloatround_floor); // Round down since you can't donate money you don't own.

    
if(iMoney 0)
    {
        new 
iPlayer;
        
zp_set_user_ammo_packs(id0);
                
client_print(idprint_chat"You donated all your ammo packs to everyone in server!")

        for(new 
iiNumi++)
        {
            
iPlayer iPlayers[i];
            
zp_set_user_ammo_packs(iPlayerzp_get_user_ammo_packs(iPlayer) + iEndAmount);
        }
    }


Last edited by HowToRuski; 04-08-2021 at 11:00.
HowToRuski is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-08-2021 , 19:26   Re: Give money to everyone in server
Reply With Quote #4

what exactly isn't working? have you tried using my original plugin in the first place?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-09-2021 , 00:02   Re: Give money to everyone in server
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
what exactly isn't working? have you tried using my original plugin in the first place?
Well im using zombie plague... I edited yours for my needs and as i write /donate nothing happens but my client print just shows

Last edited by HowToRuski; 04-09-2021 at 00:03.
HowToRuski is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-09-2021 , 00:25   Re: Give money to everyone in server
Reply With Quote #6

Quote:
Originally Posted by HowToRuski View Post
Well im using zombie plague... I edited yours for my needs and as i write /donate nothing happens but my client print just shows
You should try the original plugin and see if that works if you are unable to debug your own version yourself.
__________________
fysiks 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 04:13.


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