AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_players and IF function problem (https://forums.alliedmods.net/showthread.php?t=101728)

MasterKy 08-26-2009 13:52

get_players and IF function problem
 
hello, i want to do this "IF" read if the terrorist player count is 1 :|
the terrorist team, in the game, have more of 1 player but this print the message!
plz help me =/

PHP Code:

public Players(){
new 
iPlayers32 ];
new 
iPlayerCount;

get_players iPlayers iPlayerCount "a" "TERRORIST" );
if(
iPlayerCount 1){
client_printprint_chat "Only 1 for finish!" iPlayerCount );
}


i have entered it with == but dont work too:
PHP Code:

if(iPlayerCount == 1){ 


MasterKy 08-26-2009 14:59

Re: get_players and IF function problem
 
anyone? :shock:

|PJ| Shorty 08-26-2009 18:18

Re: get_players and IF function problem
 
PHP Code:

get_players iPlayers iPlayerCount "ae" "TERRORIST" ); 

but as you can see here: http://www.amxmodx.org/funcwiki.php?go=func&id=174

Quote:

Note: "e" flag can return incorrect results (for cstrike/czero at least).
and this is correct:
PHP Code:

if(iPlayerCount == 1


Alucard^ 08-26-2009 18:35

Re: get_players and IF function problem
 
http://forums.alliedmods.net/showpos...72&postcount=7

MasterKy 08-27-2009 17:03

Re: get_players and IF function problem
 
thanks but my function dont have the flag "e"
this do not read the if
it print the message wich any value =/
plz help me !:|

This is the warning in the compiler:
possibly unintended assignment

Exolent[jNr] 08-27-2009 17:14

Re: get_players and IF function problem
 
PHP Code:

public Players(){
    new 
iPlayers32 ];
    new 
iPlayerCount;
    
    
get_players iPlayers iPlayerCount "ae" "TERRORIST" );
    if(
iPlayerCount == 1){
        
client_printprint_chat "Only 1 for finish!" );
    }




All times are GMT -4. The time now is 14:59.

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