Raised This Month: $ Target: $400
 0% 

Get something of all players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-01-2009 , 02:29   Get something of all players
Reply With Quote #1

Hi...

Well, i don't understand how to do this.. i think is a rly easy and small code but i don't catch how to do it o.O

I need to get for EXAMPLE... the money of ALL players but not separated... so i want to show all the money in a hud...

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

#define PLUGIN    "Get Money Test"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

new HudSync
new g_MaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task(1.0"ShowMoney"0""0"b")
    
    
g_MaxPlayers get_maxplayers()
    
HudSync CreateHudSyncObj()
}

public 
ShowMoney()
{
    new 
moneyi
    
    
for(0<= g_MaxPlayersi++)
    {
        if(
is_user_alive(i) )
        
money cs_get_user_money(i)
    }
    
set_hudmessage(2552552550.010.1501.01.00.10.2, -1)
    
ShowSyncHudMsg(0HudSync"Money: %i"money)

This not work and i understand why is not working... is becouse the cs_get_user_money(i) doesn't get the total amount of all money.. just get the money for every index (i). Now i ask... how to get the total amount of money from all players.

Thx and sry if my english suck.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 09-01-2009 at 09:47.
Alucard^ is offline
Send a message via Skype™ to Alucard^
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-01-2009 , 02:49   Re: Get something of all players
Reply With Quote #2

You want to get all the money? Put together? Will come with an edit.

Code:
#include <amxmodx> #include <cstrike> #define PLUGIN    "Get Money Test" #define AUTHOR    "Alucard" #define VERSION    "1.0" new HudSync new g_MaxPlayers public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         set_task(1.0, "ShowMoney", 0, "", 0, "b")         g_MaxPlayers = get_maxplayers()     HudSync = CreateHudSyncObj() } public ShowMoney() {     new money, i         for(i = 1; i <= g_MaxPlayers; i++)     {         if(is_user_connected(i) )         money += cs_get_user_money(i)     }     set_hudmessage(255, 255, 255, 0.01, 0.15, 0, 1.0, 1.0, 0.1, 0.2, -1)     ShowSyncHudMsg(0, HudSync, "Money: %i", money) }
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 09-01-2009 at 02:56.
ot_207 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-01-2009 , 08:49   Re: Get something of all players
Reply With Quote #3

Thx very much ot_207. Work perfect.

Also i have a question... how you add "background lines" into the PHP BBCODE?

I know the porpuse is to show the difference, but how you did it? I used vbulletin system a lot of time but never notice that o.o
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-01-2009 , 08:59   Re: Get something of all players
Reply With Quote #4

[pawn] + @@ hi
__________________
xPaw is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-01-2009 , 09:47   Re: Get something of all players
Reply With Quote #5

Sry xPaw but i didn't understand what you said o.O
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-01-2009 , 10:50   Re: Get something of all players
Reply With Quote #6

Code:
 hello i am yellow line

[pawn]@@ hello i am yellow line[/pawn]
__________________

Last edited by xPaw; 09-01-2009 at 13:40.
xPaw is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-01-2009 , 11:03   Re: Get something of all players
Reply With Quote #7

Ohhh.. sry i tried to use [pawn] bbcode into the [php] bbcode... Now i understand, sry... and thx
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 15:09.


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