Raised This Month: $ Target: $400
 0% 

give money at some interval


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 10-23-2010 , 02:13   give money at some interval
Reply With Quote #1

hi
in my server every round is for 2.0 minutes, i don't want to give money at round begin instead once every 7-8 mins .how can i modify this

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

new MONEY;

public 
plugin_init()
{
    
register_plugin("round_money","0.7","SweatyBanana")
    
    
MONEY register_cvar("round_money","16000")
    
    
/* Register LANG file */
    
register_dictionary("rmlang.txt")
    
    
register_logevent("new_round"2"1=Round_Start")
}
public 
new_round()
{
    new 
players[32], playerCountiplayerpMoney;
    
pMoney get_pcvar_num(MONEY)
    
    
get_players(players,playerCount);
    
    for(
i=0;i<playerCount;i++)
    {
        
player players[i];
        if(
cs_get_user_money(player) < pMoney)
        {
            
cs_set_user_money(playerpMoney);
            
client_print(player,print_chat,"%L",LANG_PLAYER,"MONEY_AMOUNT",pMoney)
        }
    } 
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
am_amx is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-23-2010 , 03:12   Re: give money at some interval
Reply With Quote #2

Did you try using set_task?
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 10-23-2010 , 03:32   Re: give money at some interval
Reply With Quote #3

Quote:
Originally Posted by SaM.ThE.MaN View Post
Did you try using set_task?
thanx will try it

i'm getting money only once why?

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

new MONEY

public 
plugin_init() 

    
register_plugin("round_money","0.7","SweatyBanana"
     
    
MONEY register_cvar("round_money","16000"
     
    
/* Register LANG file */ 
    //register_dictionary("rmlang.txt") 
     //register_logevent("new_round", 2, "1=Round_Start") 
     
set_task(40.0,"new_round",2,"b");

public 
new_round() 

    new 
players[32], playerCountiplayerpMoney
    
pMoney get_pcvar_num(MONEY
     
    
get_players(players,playerCount); 
     
    for(
i=0;i<playerCount;i++) 
    { 
        
player players[i]; 
        if(
cs_get_user_money(player) < pMoney
        { 
            
cs_set_user_money(playerpMoney); 
            
//client_print(player,print_chat,"%L",LANG_PLAYER,"MONEY_AMOUNT",pMoney) 
        

    }  


Last edited by am_amx; 10-23-2010 at 05:08.
am_amx is offline
Moe
Member
Join Date: Dec 2009
Location: GTA
Old 10-23-2010 , 22:24   Re: give money at some interval
Reply With Quote #4

The task is only done once. So once the plugin iniciates and finishes that one time then it assumes its done. Loop it.
Moe is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-23-2010 , 22:28   Re: give money at some interval
Reply With Quote #5

See set_task()
__________________
fysiks is offline
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 10-24-2010 , 00:23   Re: give money at some interval
Reply With Quote #6

Quote:
Originally Posted by Moe View Post
The task is only done once. So once the plugin iniciates and finishes that one time then it assumes its done. Loop it.
set_task(40.0,"new_round",2,"b");

b=loop task infinitely .

but players get money once
am_amx is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-24-2010 , 01:23   Re: give money at some interval
Reply With Quote #7

Quote:
Originally Posted by am_amx View Post
set_task(40.0,"new_round",2,"b");

b=loop task infinitely .

but players get money once
Did you happen to notice my post?

Hint: Counter your arguments.
__________________
fysiks is offline
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 10-24-2010 , 02:00   Re: give money at some interval
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
Did you happen to notice my post?
no,
@hint :you mean this?
set_task(180.0,"new_round",2,"",0,"b");

after this i'm able to get money every3 mins





thank you for your replies SaM.ThE.MaN ,Moefysiks

Last edited by am_amx; 10-25-2010 at 11:03.
am_amx is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-24-2010 , 17:23   Re: give money at some interval
Reply With Quote #9

What do you think the 2 is for?
__________________

Last edited by fysiks; 10-24-2010 at 17:26.
fysiks is offline
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 10-25-2010 , 07:03   Re: give money at some interval
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
What do you think the 2 is for?
id - A unique id to assign to the task.

without that i couldn't compile the sma got some errors
am_amx 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 10:26.


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