Raised This Month: $ Target: $400
 0% 

Give money to everyone in server


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 19:50.


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