AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Why this not working ? (https://forums.alliedmods.net/showthread.php?t=313218)

Awesome_man 01-01-2019 01:10

Why this not working ?
 
Why this code it not working ?

PHP Code:

public Cmd_riIndexiLeveliCid 

if( !
cmd_accessiIndexiLeveliCid) ) 
    return 
PLUGIN_HANDLED
    
    new 
iPlayers[MAX_PLAYERS], iNumget_playersiPlayersiNum"bh""T" ); 
    
    for( new 
0iNumi++ ) ExecuteHamBHam_CS_RoundRespawniPlayers[i] ); 
    
{
    if(!
is_user_alive(iNum))
    {
        return 
PLUGIN_HANDLED;
    }
    
    
    new 
sName[32]; get_user_nameiIndexsNamecharsmax(sName) ); 
    
client_print0print_chat"admin revived T'S"sName ); 
    
    return 
PLUGIN_HANDLED
}




OciXCrom 01-01-2019 08:21

Re: Why this not working ?
 
Align your brackets and you'll notice what's going on.

Also, this doesn't make any sense:

PHP Code:

if(!is_user_alive(iNum)) 

You're checking if the total number of matched players is alive?

eat1k 01-01-2019 08:42

Re: Why this not working ?
 
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().

fysiks 01-01-2019 14:29

Re: Why this not working ?
 
Quote:

Originally Posted by eat1k (Post 2632171)
In AMXX >= 1.8.3 you don't need to use get_user_name() because you can use that thing:

Stop talking about AMX Mod X 1.8.3 because it doesn't exist. It is now called AMX Mod X 1.9 and is officially being tested for release soon.

eat1k 01-01-2019 14:46

Re: Why this not working ?
 
Quote:

Originally Posted by fysiks (Post 2632240)
Stop talking about AMX Mod X 1.8.3 because it doesn't exist. It is now called AMX Mod X 1.9 and is officially being tested for release soon.

Yeah, it exists and many people use it. If you don't want to read this, you don't have to. I think AMX Mod X 1.9.0 will never be released, in any case, AMX Mod X 1.10.0. But, anyways, it's almost the same (AMX Mod X 1.8.3 and AMX Mod X 1.9.0, there are only few changes).

iceeedr 01-01-2019 18:48

Re: Why this not working ?
 
Quote:

Originally Posted by eat1k (Post 2632244)
Yeah, it exists and many people use it. If you don't want to read this, you don't have to. I think AMX Mod X 1.9.0 will never be released, in any case, AMX Mod X 1.10.0. But, anyways, it's almost the same (AMX Mod X 1.8.3 and AMX Mod X 1.9.0, there are only few changes).

Is it difficult to understand that amx 1.9 is amx 1.8.3? Just changed the nomenclature because of the amount of changes!

eat1k 01-01-2019 20:49

Re: Why this not working ?
 
Quote:

Originally Posted by iceeedr (Post 2632287)
Is it difficult to understand that amx 1.9 is amx 1.8.3? Just changed the nomenclature because of the amount of changes!

And what do you want from me? I'm just saying the reality, there a lot of people who use 1.8.3 and it's NOT 1.9.0. I'm talking about the build, nothing more.

fysiks 01-02-2019 10:08

Re: Why this not working ?
 
Quote:

Originally Posted by eat1k (Post 2632244)
Yeah, it exists and many people use it. If you don't want to read this, you don't have to. I think AMX Mod X 1.9.0 will never be released, in any case, AMX Mod X 1.10.0. But, anyways, it's almost the same (AMX Mod X 1.8.3 and AMX Mod X 1.9.0, there are only few changes).

The original dev release was called 1.8.3-dev. It was renamed to 1.9.0 (when it was "feature frozen"). Anybody using any version of 1.8.3-dev should upgrade to 1.9.0 immediately. The more people running AMX Mod X 1.9.0, the sooner it will be released (because it needs durability testing).

Awesome_man 01-02-2019 11:27

Re: Why this not working ?
 
Quote:

Originally Posted by eat1k (Post 2632171)
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_riIndexiLeveliCid 

if( !
cmd_accessiIndexiLeveliCid) ) 
    return 
PLUGIN_HANDLED
    
    new 
iPlayers[MAX_PLAYERS], iNum;
    
get_playersiPlayersiNum"bh""TERRORIST" ); 
    
    for( new 
0iNumi++ ) ExecuteHamBHam_CS_RoundRespawniPlayers[i] ); 
    
{
    if(!
is_user_alive(iPlayers[i]))
    {
        
        return 
PLUGIN_CONTINUE;
    }
    
    
    new 
sName[32]; get_user_nameiIndexsNamecharsmax(sName) ); 
    
client_print0print_chat"admin revived T'S");
    
    return 
PLUGIN_HANDLED
}



Show this error

PHP Code:

ErrorUndefined symbol "i" on line 58 


eat1k 01-02-2019 11:39

Re: Why this not working ?
 
Because you didn't fix that @OciXCrom said you. You need to fix the brackets.
Code:
ExecuteHamB( Ham_CS_RoundRespawn, iPlayers[i] );
should be inside of for().


All times are GMT -4. The time now is 07:37.

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