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

RoundStart() bug or not?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 10-12-2017 , 15:29   RoundStart() bug or not?
Reply With Quote #1

Little explanation for what happens.

If a player dies on last round the RoundStart() event treats him as dead.

Here's my code:

PHP Code:
public RoundStart() {
    new 
iPlayers[32], iNum;
    
get_playersiPlayersiNum"a"); //This do not include dead players
    
for( new i<= iNumi++ ) {
        new 
iPid iPlayers[i]
        
Rounds[iPid]++;
        
SaveKills(iPid); //This saves rounds to SQL database, if a player was dead on last round it doesn't. It works for everyone who was alive last round.
    
}
    return 
PLUGIN_CONTINUE;

So when I do with set_task it works fine:

PHP Code:
public RoundStart() {
    
set_task(1.0"SaveRounds");
    return 
PLUGIN_CONTINUE;
}

public 
SaveRounds() {
    new 
iPlayers[32], iNum;
    
get_playersiPlayersiNum"a");
    for( new 
i<= iNumi++ ) {
        new 
iPid iPlayers[i]
        
Rounds[iPid]++;
        
SaveKills(iPid);
    }
    return 
PLUGIN_CONTINUE;

Bug or I am doing something wrong here?
__________________
Airkish is offline
 



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 20:36.


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