AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help to X CTs Alives (https://forums.alliedmods.net/showthread.php?t=134721)

Xs-Chuki-Xs 08-08-2010 01:54

Help to X CTs Alives
 
Hi! Sorry for mi bad english.

I have a problem. Wanted to get Counter-Terrorist as many are alive. But at the same time I want in scrambled plural or singular if it is a CT.

Code:

PHP Code:

#include <amxmodx>

new HudsynciMaxplayers

public plugin_init() {
    
iMaxplayers get_maxplayers()
    
Hudsync CreateHudSyncObj()
}

public 
client_putinserver(id)

set_task(0.1"Players"id,_,_,"b")
}

public 
Players(id) {
    new 
Team2
    
    
for(new i=1i<=iMaxplayersi++) 
    {
       if(
get_user_team(i) == && is_user_alive(i)) 
       {
            
Team2++
        }
    }
    
    
set_hudmessage(002550.020.6306.012.0)
    
ShowSyncHudMsg(idHudsync"^nCT%s %d alive%s", (Players) >  Team2) ? "n" ""Players(), (Players() > Team2) ? "s" "")  


and errors:

PHP Code:

ErrorSyntax error in the expression, or invalid function call on line 28
Error
Invalid expressionassumed zero on line 28 


wrecked_ 08-08-2010 02:01

Re: Help to X CTs Alives
 
Code:
(Players) >  Team2)
:arrow:
Code:
(Players >  Team2)

Xs-Chuki-Xs 08-08-2010 02:49

Re: Help to X CTs Alives
 
thanks! now 1 error

in line

PHP Code:

ShowSyncHudMsg(idHudsync"^nCT%s %d alive%s", (Players >  Team2) ? "n" ""Players(), (Players() > Team2) ? "s" ""

error

PHP Code:

ErrorSyntax error in the expression, or invalid function call on line 27 


wrecked_ 08-08-2010 02:53

Re: Help to X CTs Alives
 
Code:
Players(), (Players() > Team2)
:arrow:
Code:
Players, (Players > Team2)

Xs-Chuki-Xs 08-08-2010 02:58

Re: Help to X CTs Alives
 
:(, now other error

line

PHP Code:

ShowSyncHudMsg(idHudsync"^nCT%s %d alive%s", (Players >  Team2) ? "n" ""Players, (Players Team2) ? "s" ""

error

PHP Code:

ErrorSyntax error in the expression, or invalid function call on line 27 



All times are GMT -4. The time now is 00:16.

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