AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   2 terroist alive (https://forums.alliedmods.net/showthread.php?t=225965)

ironskillz1 09-11-2013 13:35

2 terroist alive
 
I need to check if its 2 or more terroist alive

Im using this code but it doesnt seem to work.. :/?

Even if its like 15 terroist alive the message prints

Code:

        new players[32], num;
        get_players( players, num, "ae", "TERRORIST" );               
        if( num <= 1 )
        {
                ColorChat( 0, GREY, "%s Hello!", g_szPrefix );
                return PLUGIN_HANDLED;
        }


~Ice*shOt 09-11-2013 13:55

Re: 2 terroist alive
 
PHP Code:

new Players[32], Num
get_players
(PlayersNum"ae""TERRORIST")

if (
Num >= 2)
        
client_print(03"There's two or more terrorists alive!"


^SmileY 09-11-2013 14:38

Re: 2 terroist alive
 
(Num >= 2)

>>

(Num > 1)

:)

~Ice*shOt 09-11-2013 14:51

Re: 2 terroist alive
 
could be too

~Ice*shOt 09-12-2013 08:22

Re: 2 terroist alive
 
Quote:

Originally Posted by ironskillz1 (Post 2032829)
I need to check if its 2 or more terroist alive

What are you doing?

Btw, why you're checking is player alive or not, if you are 'a' flag in get players?

ironskillz1 09-12-2013 09:11

Re: 2 terroist alive
 
You guys didnt understand my question but anyways i think another plugin fucked get_players up

So you dont need to post in this topic anymore

jimaway 09-12-2013 10:54

Re: 2 terroist alive
 
Quote:

Originally Posted by LordOfNothing (Post 2033175)
PHP Code:

new Players[32], Num 
get_players
(PlayersNum"ae""TERRORIST"
 
if (
Num 2
   if(
is_user_alive(Num)
   {
 
client_print(0print_chat"There's two terrorists alive!"
   } 

only 2

Num is the amount of players returned by get_players, not an player id. also you need double = in if statements

mottzi 09-13-2013 02:18

Re: 2 terroist alive
 
Ive had this issue, when get_players using ae flag returning wrong data, too. I dont know what could cause such a 'bug'. Ive solved it in simply looping with get_maxplayers...

Does anybody have additional information?

Decompiler 09-13-2013 02:40

Re: 2 terroist alive
 
The flag "e" in get_players is bugged. This is supposed to fix it, but I had no luck with it when I tried it a while ago.


All times are GMT -4. The time now is 19:03.

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