Raised This Month: $ Target: $400
 0% 

Displaying HUD msg to a group...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 11-07-2007 , 07:30   Displaying HUD msg to a group...
Reply With Quote #1

I'm trying to display this...
[img]http://img136.**************/img136/5194/csassault0023nu7.jpg[/img]
But this is displaying for the whole CT team and my team mates stats.

What I'm trying to do is make it display for the squad you are in.
For eg...
I'm in squad alpha and I type /stats.
I want it to show the stats of everyone in squad alpha.
Not any other squads, just the CT side of squad alpha.

I know its somewhere in these lines...
PHP Code:
new infoTable[256], pdata[32][playerData], pnum
    format
(infoTable255"HP - AP^t^tWEAPON^t^tAMMO^t^tNAME^n")

    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum"ae""CT")
    for (new 
iNum ;  x++)
    {
        new 
iPlayers[x

        new 
line[MAX_ROW_SIZE], name[32], ihphp[4], iapap[4], weapon[8], iclipclip[4], iammoammo[4], weap get_user_weapon(iiclipiammo

The next thing is that I realized that all the squads are all linked to both teams.
For eg...
I'm in CT and I join squad delta.
Delta - 1/5
And someone in T joins squad delta too.
Delta - 2/5

How can I make it so both teams have their own group of squads so when you join one. It won't effect the other teams squad member count.

Thanks for the help!
Attached Files
File Type: sma Get Plugin or Get Source (squad_mod.sma - 669 views - 11.5 KB)
__________________
It's a mystery.

Last edited by Mini_Midget; 11-07-2007 at 07:35.
Mini_Midget is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-07-2007 , 07:57   Re: Displaying HUD msg to a group...
Reply With Quote #2

May be like this ?
Code:
showRes(id) { //  if ( cs_get_user_team(id) != CS_TEAM_CT) return     new infoTable[256], pdata[32][playerData], pnum     format(infoTable, 255, "HP - AP^t^tWEAPON^t^tAMMO^t^tNAME^n")     new iPlayers[32], iNum     get_players(iPlayers, iNum/*, "ae", "CT"*/)     for (new x = 0 ; x < iNum ;  x++)     {         new i = iPlayers[x]         if(PlayerSquad[i] != PlayerSquad[id])             continue         new line[MAX_ROW_SIZE], name[32], ihp, hp[4], iap, ap[4], weapon[8], iclip, clip[4], iammo, ammo[4], weap = get_user_weapon(i, iclip, iammo)
ConnorMcLeod is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-07-2007 , 08:16   Re: Displaying HUD msg to a group...
Reply With Quote #3

I changed it a bit...

Last edited by [ --<-@ ] Black Rose; 11-12-2007 at 12:54.
[ --<-@ ] Black Rose is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 11-08-2007 , 05:44   Re: Displaying HUD msg to a group...
Reply With Quote #4

Whoa...
Thanks [ --<-@ ] Black Rose!

I'm just going through your code and learning from it.
Btw, why did you include fakemeta when you didn't use any functions from it?

Hmm...
When I test it with your version. There seems to be a runtime error when someone spawns.
Code:
L 11/08/2007 - 23:29:34: [AMXX] Run time error 4: index out of bounds 
L 11/08/2007 - 23:29:34: [AMXX]    [0] squad_mod(2).sma::ChooseSquad (line 164)
L 11/08/2007 - 23:29:34: [AMXX]    [1] squad_mod(2).sma::event_player_spawn (line 127)
L 11/08/2007 - 23:29:34: [AMXX]    [2] squad_mod(2).sma::event_hud_reset (line 110)
I can't find the error myself... o.0
__________________
It's a mystery.

Last edited by Mini_Midget; 11-08-2007 at 19:52.
Mini_Midget is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-08-2007 , 10:15   Re: Displaying HUD msg to a group...
Reply With Quote #5

Wich line is 164?

I never got that error...
[ --<-@ ] Black Rose is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 11-08-2007 , 20:29   Re: Displaying HUD msg to a group...
Reply With Quote #6

164:
PHP Code:
    len += format(menu[len], 511-len"\y1. \wAlpha   (\y%d/\r%d)^n"squad_alpha[get_user_team(id) - 1], limit
127:
PHP Code:
case SQUAD_NONE: {
            
ChooseSquad(id)
            return 
PLUGIN_HANDLED 
110:
PHP Code:
public event_hud_reset(id) {
    if (
g_restart_attempt[id]) {
        
g_restart_attempt[id] = false;
        return;
    }
    
event_player_spawn(id// <---
    
ShowTeam()

__________________
It's a mystery.
Mini_Midget is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-09-2007 , 00:32   Re: Displaying HUD msg to a group...
Reply With Quote #7

The error is when the function "ChooseSquad(id)" is called, then line 164. Try to make the "squad_alpha" array with 5 cells ("squad_alpha[5]").
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-09-2007 , 07:40   Re: Displaying HUD msg to a group...
Reply With Quote #8

Why would you need 5 when there's only 2 teams?

Try this then.

Last edited by [ --<-@ ] Black Rose; 11-12-2007 at 12:54.
[ --<-@ ] Black Rose is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-09-2007 , 07:45   Re: Displaying HUD msg to a group...
Reply With Quote #9

Yeah, you'r right, but i don't see the problem, was a suggestion.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 11-10-2007 , 08:45   Re: Displaying HUD msg to a group...
Reply With Quote #10

Thanks a bundle [ --<-@ ] Black Rose!!!

I was gonna make it do all that but just needed help with this part.
No more run time errors now so thats a good sign.

Oh btw, is there a better way to update the stats?
Or is CurWeapon properly the best choice though it only updates if YOU do something like...
- Shoot
- Change weapons
- Reload
- Action2 (Scope and stuff)
__________________
It's a mystery.
Mini_Midget is offline
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 01:14.


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