Raised This Month: $ Target: $400
 0% 

2 team together


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
omgdpcwtf
Member
Join Date: Apr 2011
Old 11-15-2014 , 14:36   2 team together
Reply With Quote #1

Hi, I have little problem this code works wierd. If CTs wins and Im CT message showed, but if Im T and CTs wins message wont show me why?

Code:
public CounterTerrorists_win()
{
    new iPlayers[32], iNum, id
    get_players(iPlayers, iNum, "aceh", "CT")
    for(new i=0;i<iNum;i++) {
    set_dhudmessage(0, 255, 0, -1.0, 0.4, 2, 6.0, 2.0)
    show_dhudmessage(iPlayers[i], "WIN")
    client_cmd(iPlayers[i], "mp3 play ^"sound/mix/win.mp3^"")
    client_print(iPlayers[i], print_chat, "win!")
    }
    
    new iPlayers2[32], iNum2, id2
    get_players(iPlayers2, iNum2, "aceh", "TERRORIST")
    for(new i2=0;i2<iNum2;i2++) {
    set_dhudmessage(0, 255, 0, -1.0, 0.4, 2, 6.0, 2.0)
    show_dhudmessage(iPlayers[i2], "Loose!")
    client_cmd(iPlayers[i2], "mp3 play ^"sound/mix/loose.mp3^"")
    client_print(iPlayers[i2], print_chat, "LOOSE!")
    }
}

Last edited by omgdpcwtf; 11-15-2014 at 14:37.
omgdpcwtf is offline
felipemilralze
Senior Member
Join Date: Jul 2011
Location: Brazil
Old 11-15-2014 , 15:30   Re: 2 team together
Reply With Quote #2

I can not really understand
felipemilralze is offline
Send a message via MSN to felipemilralze Send a message via Skype™ to felipemilralze
omgdpcwtf
Member
Join Date: Apr 2011
Old 11-15-2014 , 15:57   Re: 2 team together
Reply With Quote #3

If CTs wins and I play as CT I see hud message "You win" (this works)
If CTs wins and I play as T I dont see message "You lose" why? (this dont work)

Last edited by omgdpcwtf; 11-15-2014 at 15:58.
omgdpcwtf is offline
Old 11-16-2014, 04:39
Kazalu
This message has been deleted by Kazalu. Reason: I am so sloppy
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-16-2014 , 04:57   Re: 2 team together
Reply With Quote #5

Quote:
Change "new id2" to "new i2".Bam! Code working!
Please don't give bad advices. Look into the for, he already do <new i2>

Code:
public CounterTerrorists_win() {     new iPlayers[32], iNum, id, i     get_players(iPlayers, iNum, "aceh", "CT")     for(i=0;i<iNum;i++)     {         id = iPlayers[i]         set_dhudmessage(0, 255, 0, -1.0, 0.4, 2, 6.0, 2.0)         show_dhudmessage(id, "WIN")         client_cmd(id, "mp3 play ^"sound/mix/win.mp3^"")         client_print(id, print_chat, "win!")     }     get_players(iPlayers, iNum, "aceh", "TERRORIST")     for(i=0;i<iNum;i++)     {         id = iPlayers[i]         set_dhudmessage(id, 255, 0, -1.0, 0.4, 2, 6.0, 2.0)         show_dhudmessage(id, "Loose!")         client_cmd(id, "mp3 play ^"sound/mix/loose.mp3^"")         client_print(id, print_chat, "LOOSE!")     } }
__________________

Last edited by HamletEagle; 11-16-2014 at 04:57.
HamletEagle is offline
omgdpcwtf
Member
Join Date: Apr 2011
Old 11-16-2014 , 05:10   Re: 2 team together
Reply With Quote #6

it doesnt work...If Im T and CTs win I still dont see message..., I think problem will be maybe in flags "aceh"?

Last edited by omgdpcwtf; 11-16-2014 at 05:10.
omgdpcwtf is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-16-2014 , 05:17   Re: 2 team together
Reply With Quote #7

AFAIK the flag h doesn't exists on get_players. Try the flags <ce>
__________________
HamletEagle is offline
omgdpcwtf
Member
Join Date: Apr 2011
Old 11-16-2014 , 05:24   Re: 2 team together
Reply With Quote #8

Boom works thanks bro, flags are not as easy as they seems, thank you
omgdpcwtf is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-16-2014 , 05:59   Re: 2 team together
Reply With Quote #9

Look into the wiki, you have the full explanation there.
__________________
HamletEagle 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 17:34.


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