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

10.000$ To random player every 10 minutes.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
InteX01
Senior Member
Join Date: Jan 2017
Old 06-09-2017 , 18:38   10.000$ To random player every 10 minutes.
Reply With Quote #1

As the title says...
Every 10 minutes, random player gets 10k $.
Thanks in advance
InteX01 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-09-2017 , 21:01   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #2

Try

PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#if AMXX_VERSION_NUM < 183
#define MAX_PLAYERS 32
#endif

new pCvarMoneyValuepCvarDelayInMinutes

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pCvarDelayInMinutes =  register_cvar("randomplayer_delay_minutes""10")
    
pCvarMoneyValue register_cvar("randomplayer_money""10000")
    
    
set_task(float(get_pcvar_num(pCvarDelayInMinutes) * 60), "getRandomPlayer", .flags "b")
}

public 
getRandomPlayer()
{
    new 
iPlayers[MAX_PLAYERS], iPlayersNum
    get_players
(iPlayersiPlayersNum"a")

    if(!
iPlayersNum)
        return

    new 
iRandomPlayer iPlayers[random(iPlayersNum)]
    
    new 
szRandomPlayerName[MAX_PLAYERS]
    
get_user_name(iRandomPlayerszRandomPlayerNamecharsmax(szRandomPlayerName))
    
    new 
iCvarMoney get_pcvar_num(pCvarMoneyValue)
    
cs_set_user_money(iRandomPlayeriCvarMoney1)
    
client_print(0print_chat"[AMXX]: Random player '%s' got %d$ of money bonus!"szRandomPlayerNameiCvarMoney)

If you'd change the 'randomplayer_delay_minutes', you must change/restart the map for it really change 'cuz the plugin_init() only runs after map's start.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 06-09-2017 at 21:16.
EFFx is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-09-2017 , 21:02   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #3

Try This One :

PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
set_task(600.0"money_delay"___"b"); /* 600 seconds = 10 munites */
}

public 
money_delay()
{
    new 
pid Random_players();
    
    
cs_set_user_money(pidcs_get_user_money(pid) + 10000);
}  

/* Its role is to choose a Player from random players. */
Random_players()
{
    new 
players[32], pnum;
    
get_players(playerspnum);
    
    if( !
pnum ) return -1;
    
    return 
players[random(pnum)];


Last edited by Houssam Benmouna; 06-09-2017 at 21:15.
Houssam Benmouna is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-09-2017 , 21:09   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #4

Your code gives 10k for every single player. He said a random one.

Quote:
I Can Help You With Giving You Some Codes Ps: I'm not a fixer of :v plugins
Do this when you really get a bit more experience.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 06-09-2017 at 21:10.
EFFx is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-09-2017 , 21:11   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #5

I will fix it
Houssam Benmouna is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-09-2017 , 21:14   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #6

Fixed
Houssam Benmouna is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-09-2017 , 21:15   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #7

If you meant the 10k plugin, I already sent a good one. But if you meant your assinagture, I agree with you.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-09-2017 , 21:18   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #8

I do not really, excited for your saying. ;)

Last edited by Houssam Benmouna; 06-09-2017 at 21:18.
Houssam Benmouna is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-10-2017 , 13:56   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #9

EFFx.

set_task((get_pcvar_float(pCvarDelayInMinutes ) * 60.0), "getRandomPlayer", _, _, _,"b")
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-10-2017 at 13:56.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-10-2017 , 14:08   Re: 10.000$ To random player every 10 minutes.
Reply With Quote #10

Both formats are correct.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 23:33.


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