AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Teammates money display (https://forums.alliedmods.net/showthread.php?t=295077)

^SmileY 03-15-2017 16:02

Teammates money display
 
Hi, i already know that has already posted i guess.
But this plugin have two small features:

- Display only in freezetime and according freezetime value;
- Also values are updated according players buy items.


PHP Code:

#include <amxmodx>
#include <cstrike>

#pragma semicolon 1

new g_pMoney;
new 
g_pFreezeTime;

new 
bool:g_bDisplay;

public 
plugin_init()
{
    
register_plugin("Team Money Display","0.0.3","SmileY");

    
g_pMoney     create_cvar("amx_display_money","1",FCVAR_NONE,"Display Teammate money");
    
g_pFreezeTime     get_cvar_pointer("mp_freezetime");

    
register_logevent("fnRoundStart",2,"1=Round_Start");
    
register_logevent("fnRoundEnd",2,"1=Round_End");
}

public 
fnRoundstart()
{
    
g_bDisplay false;
}

public 
fnRoundEnd()
{
    
g_bDisplay = (get_pcvar_num(g_pMoney) ? true false;
}

public 
CS_OnBuy(id,iWeapon)
{
    if(
g_bDisplay)
    {
        new 
szTeam[13];
        
get_user_team(id,szTeam,charsmax(szTeam));

        new 
iPlayers[MAX_PLAYERS],iNum,iPlayer;
        
get_players(iPlayers,iNum,"aeh",szTeam);

        new 
szName[MAX_NAME_LENGTH],szHud[512];

        for(new 
i;iNum;i++)
        {
            
iPlayer iPlayers[i];

            
get_user_name(iPlayer,szName,charsmax(szName));

            
format
            
(
                
szHud,
                
charsmax(szHud),
                
"%s%s $ %d^n",
                
szHud,
                
szName,
                
cs_get_user_money(iPlayer)
            );
        }

        new 
Float:fTime get_pcvar_float(g_pFreezeTime);

        if(
fTime 2.0)
        {
            
fTime 2.0;
        }

        
set_hudmessage(0,255,0,0.58,0.02,0,0.0,fTime,0.0,0.0,1);
        
show_hudmessage(id,(szTeam[0] == 'C') ? "Counter-Terrorist:" "Terrorists:");
    
        
set_hudmessage(255,255,225,0.58,0.05,0,0.0,fTime,0.0,0.0,2);
        
show_hudmessage(id,szHud);
    }


Ps. Also is needed the last hg dev (Or some that supports CS_OnBuy and create_cvar func.

Thanks

Blizzard_87 03-17-2017 06:22

Re: Teammates money display
 
does this plugin allow you to point to other team mates and see a hud above them showing there money?

cos thats what the title of this thread translates to me.. but i dont see that in the code.... ?

you should also Cache "get_pcvar_num(g_pMoney)" in round start or end. so it doesnt call to many times every time someone buys something..?

OciXCrom 03-17-2017 07:29

Re: Teammates money display
 
Quite different actually.

^SmileY 03-17-2017 10:30

Re: Teammates money display
 
Quote:

Originally Posted by Blizzard_87 (Post 2504341)
does this plugin allow you to point to other team mates and see a hud above them showing there money?

cos thats what the title of this thread translates to me.. but i dont see that in the code.... ?

you should also Cache "get_pcvar_num(g_pMoney)" in round start or end. so it doesnt call to many times every time someone buys something..?

good tip, i do not tested plugin, since a friend requested it.

Ps. Updated

sekac 05-18-2018 14:01

Re: Teammates money display
 
PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "create_cvar" on line 15
Error
Expected token")"but found ";" on line 29
Error
Undefined symbol "MAX_PLAYERS" on line 39
Error
Invalid expressionassumed zero on line 39
Error
Undefined symbol "iNum" on line 39
Error
Too many error messages on one line on line 39

Compilation aborted
.
6 Errors.
Could not locate output file I:\Documents\AMXX Compiler\yadando\show_teammates_money.amx (compile failed). 


iceeedr 05-18-2018 15:24

Re: Teammates money display
 
Quote:

Originally Posted by sekac (Post 2592688)
PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "create_cvar" on line 15
Error
Expected token")"but found ";" on line 29
Error
Undefined symbol "MAX_PLAYERS" on line 39
Error
Invalid expressionassumed zero on line 39
Error
Undefined symbol "iNum" on line 39
Error
Too many error messages on one line on line 39

Compilation aborted
.
6 Errors.
Could not locate output file I:\Documents\AMXX Compiler\yadando\show_teammates_money.amx (compile failed). 



Ps. Also is needed the last hg dev (Or some that supports CS_OnBuy and create_cvar func.

OciXCrom 05-18-2018 16:01

Re: Teammates money display
 
Translation: the latest AMXX 1.8.3 version is required.
You can easily make it compatible for 1.8.2 too.

^SmileY 05-21-2018 08:26

Re: Teammates money display
 
Quote:

Originally Posted by sekac (Post 2592688)
PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "create_cvar" on line 15
Error
Expected token")"but found ";" on line 29
Error
Undefined symbol "MAX_PLAYERS" on line 39
Error
Invalid expressionassumed zero on line 39
Error
Undefined symbol "iNum" on line 39
Error
Too many error messages on one line on line 39

Compilation aborted
.
6 Errors.
Could not locate output file I:\Documents\AMXX Compiler\yadando\show_teammates_money.amx (compile failed). 


a bit non steammer here :D

OciXCrom 05-21-2018 10:25

Re: Teammates money display
 
Which part of the compile log says "non-steam"?!

sekac 05-21-2018 14:24

Re: Teammates money display
 
Quote:

Originally Posted by OciXCrom (Post 2593103)
Which part of the compile log says "non-steam"?!

Maybe a reference to one of my recent posts where I busted a no-steamer.


All times are GMT -4. The time now is 15:42.

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