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

Teammates money display


Post New Thread Reply   
 
Thread Tools Display Modes
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-23-2018 , 08:45   Re: Teammates money display
Reply With Quote #31

Quote:
Originally Posted by Natsheh View Post
From its name its still in dev how can you to prove its stable.


It wont work with 182 because CS_OnBuy forward is from amx v183dev and not in v182.
Using it that is the proof. I never have issues with a pure server and latest's snapshots from amxx.

Also i made a version without CS_OnBuy some posts ago, and still not working, maybe it is because get_players flags need to be changed anyway.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-30-2018 , 21:56   Re: Teammates money display
Reply With Quote #32

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

#define TASK_SHOWMONEY    9999

new g_pMoneyg_pFreezeTime

public plugin_init()
{
    
register_plugin("Team Money Display","0.0.3","SmileY");
    
    
g_pMoney     register_cvar("amx_display_money","1");
    
g_pFreezeTime     get_cvar_pointer("mp_freezetime")
    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1)
}

public 
client_disconnect(id)
    
remove_task(id TASK_SHOWMONEY)

public 
PlayerSpawn(id)
{
    if(
get_pcvar_num(g_pMoney))
        
set_task(1.0"OnBuy"id TASK_SHOWMONEY, .flags "a", .repeat 8)
}

public 
OnBuy(id)
{
    
id -= TASK_SHOWMONEY
    
    
new iPlayers[32], iNumbool:bIsTerror bool:(get_user_team(id) == 1), szMessage[192], szName[32]
    
get_players(iPlayersiNum"e"bIsTerror "TERRORIST" "CT")
    for(new 
iiPlayer;iNum;i++)
    {
        
iPlayer iPlayers[i]
            
        
get_user_name(iPlayer,szName,charsmax(szName))
            
        if(
iPlayer != id)
        {
            
formatex(szMessagecharsmax(szMessage), "%s%s - %d$^n"szMessageszNamecs_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(idbIsTerror ?  "Terrorists:" "Counter-Terrorist:")

    
set_hudmessage(255,255,225,0.58,0.05,0,0.0,fTime,0.0,0.0,2)
    
show_hudmessage(idszMessage)


Last edited by iceeedr; 05-30-2018 at 21:59.
iceeedr is offline
Send a message via Skype™ to iceeedr
jajaz
Junior Member
Join Date: Jun 2019
Old 09-16-2019 , 16:25   Re: Teammates money display
Reply With Quote #33

L 09/17/2019 - 04:21:10: Start of error session.
L 09/17/2019 - 04:21:10: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190917.log")
L 09/17/2019 - 04:21:10: Function "fnRoundStart" was not found
L 09/17/2019 - 04:21:10: [AMXX] Displaying debug trace (plugin "1.amxx", version "0.0.3")
L 09/17/2019 - 04:21:10: [AMXX] Run time error 19: function not found
L 09/17/2019 - 04:21:10: [AMXX] [0] 1.sma::plugin_init (line 1

how can i fix it?
jajaz is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-16-2019 , 17:41   Re: Teammates money display
Reply With Quote #34

Quote:
Originally Posted by jajaz View Post
L 09/17/2019 - 04:21:10: Start of error session.
L 09/17/2019 - 04:21:10: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190917.log")
L 09/17/2019 - 04:21:10: Function "fnRoundStart" was not found
L 09/17/2019 - 04:21:10: [AMXX] Displaying debug trace (plugin "1.amxx", version "0.0.3")
L 09/17/2019 - 04:21:10: [AMXX] Run time error 19: function not found
L 09/17/2019 - 04:21:10: [AMXX] [0] 1.sma::plugin_init (line 1

how can i fix it?
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);
    }

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Old 09-17-2019, 10:01
EFFx
This message has been deleted by EFFx. Reason: nvm
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-17-2019 , 12:32   Re: Teammates money display
Reply With Quote #35

That was humble of you iceeedr!

Quote:
Originally Posted by ^SmileY View Post
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.
Why not give players different amounts of money for the same work like in real life?
Also code for both versions with this much interest please.

IE
Code:
#if AMXX_VERSION_NUM < 183; public client_disconnect(id) #else public client_disconnected(id) #endif remove_task(id + TASK_SHOWMONEY);


If this was already made where are the credits or were you guessing it was made without bothering to check? Freezetime only. Did the unnamed original always display?

I have this working on AMX Mod X 1.8.2. I see the money subtract as well. This is stable with 1.9.0 also. I tested both versions personally.
Attached Images
File Type: jpg cs_7470000.jpg (94.3 KB, 308 views)
Attached Files
File Type: sma Get Plugin or Get Source (T-money2.sma - 306 views - 1.5 KB)
__________________

Last edited by DJEarthQuake; 09-17-2019 at 21:59. Reason: working 1.8.2+ version
DJEarthQuake is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-12-2019 , 01:26   Re: Teammates money display
Reply With Quote #36

Your idea is part of the official build.
Quote:
mp_scoreboard_showmoney
__________________
DJEarthQuake is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 10-13-2019 , 05:08   Re: Teammates money display
Reply With Quote #37

Quote:
Originally Posted by DJEarthQuake View Post
Your idea is part of the official build.
It is now, wasn't before, but o think on hud in freezetime is more usefull and simple for a clan match server, i will keep using this
tarsisd2 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-13-2019 , 14:27   Re: Teammates money display
Reply With Quote #38

That was meant as a compliment. This version is nice because TAB does not need to be held down on round start. Plus it's brighter text! The only time I do not like it is on Gungame. That's easy to disable on a per map group basis with ini files without touching your work.
__________________
DJEarthQuake is offline
Robbin
Junior Member
Join Date: May 2020
Location: Aveiro, Portugal
Old 05-12-2020 , 21:56   Re: Teammates money display
Reply With Quote #39

Nice plugin!

Can someone translate team names into portuguese?
example: "Terroristas:" : "Contra-Terroristas:"
Robbin is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 05-12-2020 , 22:12   Re: Teammates money display
Reply With Quote #40

Code:
        show_hudmessage(id,(szTeam[0] == 'C') ? "Counter-Terrorists" : "Terrorists:");
>
Code:
        show_hudmessage(id,(szTeam[0] == 'C') ? "Contra-Terroristas:" : "Terroristas:");

Last edited by Alber9091; 05-12-2020 at 22:22.
Alber9091 is offline
Reply


Thread Tools
Display Modes

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 04:38.


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