 |
|
Senior Member
Join Date: May 2014
Location: singapore
|

01-02-2019
, 11:27
Re: Why this not working ?
|
#9
|
Quote:
Originally Posted by eat1k
Please, don't do operations in the same line...
Code:
new iPlayers[MAX_PLAYERS], iNum; get_players( iPlayers, iNum, "bh", "T" );
->
Code:
new iPlayers[MAX_PLAYERS], iNum;
get_players( iPlayers, iNum, "bh", "TERRORIST" );
It's not working due to @OciXCrom said.
Also, if(!is_user_alive(iNum)) should be if(!is_user_alive(iPlayers[i])) and change return PLUGIN_HANDLED to continue;
In AMXX >= 1.8.3 you don't need to use get_user_name() because you can use that thing:
Code:
client_print(0, print_chat, "%n revived T'S", iIndex);
Anyways, it'll give errors because in your code you don't use "%s" in client_print().
|
PHP Code:
public Cmd_r( iIndex, iLevel, iCid )
{
if( !cmd_access( iIndex, iLevel, iCid, 0 ) )
return PLUGIN_HANDLED;
new iPlayers[MAX_PLAYERS], iNum;
get_players( iPlayers, iNum, "bh", "TERRORIST" );
for( new i = 0; i < iNum; i++ ) ExecuteHamB( Ham_CS_RoundRespawn, iPlayers[i] );
{
if(!is_user_alive(iPlayers[i]))
{
return PLUGIN_CONTINUE;
}
new sName[32]; get_user_name( iIndex, sName, charsmax(sName) );
client_print( 0, print_chat, "admin revived T'S");
return PLUGIN_HANDLED;
}
}
Show this error
PHP Code:
Error: Undefined symbol "i" on line 58
|
|
|
|