Raised This Month: $ Target: $400
 0% 

Old problem: no points from bomb explode/defuse


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 11-13-2022 , 19:15   Old problem: no points from bomb explode/defuse
Reply With Quote #1

The topic has been discussed but as far as I can find it has not been properly solved:
https://forums.alliedmods.net/showth...t=15962&page=2
If a CT is killed by the bomb, planter gets points.

If it is not possible to solve this for the common usage, maybe someone can get a solution that fits my needs:
On my server the bomb is planted straight away and the bomb is stripped from players, so who actually gets the + 3 points is not always the planter / defuser.

Because of this I'm trying to think of a way to strip 3 points from whoever gained 3 points from the last round.

I KNOW this is very very bad code but it explains what I'm trying to do so maybe someone could do it better:

PHP Code:
new g_playersWithFrags[33][2]

//This is called when bomb explodes:
public GetAllPlayersWithFrags()
{
    new 
iPlayers32 ] , iNum id iFrags;
    
get_players(iPlayers iNum);
    for (new 
iNum i++)
    {
        
id iPlayers[i];
        
iFrags get_user_frags(id);
        
g_playerWithFrags[id][0] = id;
        
g_playerWithFrags[id][1] = iFrags;
    }
    
set_task(6.0"RemoveThreeFrags");
}

//This is triggered by delay so someone got +3 points, who? Remove three points from whoever.
public RemoveThreeFrags()
{
    new 
iPlayers32 ] , iNum id iFrags;
    
get_players(iPlayers iNum);
    for (new 
iNum i++)
    {
        
id iPlayers[i];
        if (
get_user_frags(id) == (g_playerWithFrags[id][1] + 3)) // This only works if I remove the "+ 3"
        
{
            
ExecuteHam(Ham_AddPointsid, -3true);
        }
    }

Sorry for this abomination and thanks for any help.
If someone could tell me why the comparison does not work that would atleast give me something that "works".

Last edited by GoldNux; 11-13-2022 at 19:38.
GoldNux 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 15:37.


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