Raised This Month: $51 Target: $400
 12% 

Why do I get "Reliable channel overflowed"?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
question
Junior Member
Join Date: Aug 2016
Old 08-25-2016 , 13:58   Why do I get "Reliable channel overflowed"?
Reply With Quote #1

I'm trying to check whether the users' money is more than one. If so, change it to 1. But, when the the checking initializes, I get kicked for the reason "Reliable channel overflowed". Why's that?
Any and all help will be appreciated.

PHP Code:
new players[32];
new 
player;

public 
event_round_start(id)
{
    new 
params[1];
    
params[0] = id;

    
set_task(0.5"take_money"0params0"a"1);
}

public 
take_money() 
{
    new 
g_Maxplayers get_maxplayers();

    for (new 
1<= g_Maxplayersi++) {
        
player players[i];
    
        if (
cs_get_user_money(player) > 1) {
            
cs_set_user_money(player1);
        }
    }


Last edited by question; 08-25-2016 at 14:01.
question is offline
Send a message via Skype™ to question
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-25-2016 , 14:50   Re: Why do I get "Reliable channel overflowed"?
Reply With Quote #2

The way you try to set money for all players is totally wrong. It looks like you are mixing two ways of doing it - looping all 32 slots and get_players() way. Do either one or another.
You are unnecessarily passing params to set_task(), you don't need it in this case. Also there's no reason to set flag "a" and tell it to execute once - it does that by default.

This should work:
PHP Code:
public event_round_start()
{
    
set_task(0.5"take_money");
}

public 
take_money()
{
    new 
players[32], playerNumid;
    
get_players(playersplayerNum);
    for(new 
0playerNumi++)
    {
        
id players[i];
        if(
cs_get_user_money(id) > 1)
            
cs_set_user_money(id1);
    }

klippy 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:12.


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