Raised This Month: $32 Target: $400
 8% 

Why this not working ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 01-01-2019 , 01:10   Why this not working ?
Reply With Quote #1

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
}



Last edited by Awesome_man; 01-01-2019 at 01:10.
Awesome_man is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-01-2019 , 08:21   Re: Why this not working ?
Reply With Quote #2

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?
__________________

Last edited by OciXCrom; 01-02-2019 at 08:30.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
eat1k
Senior Member
Join Date: Apr 2018
Old 01-01-2019 , 08:42   Re: Why this not working ?
Reply With Quote #3

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().
__________________

Last edited by eat1k; 01-01-2019 at 08:45.
eat1k is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-01-2019 , 14:29   Re: Why this not working ?
Reply With Quote #4

Quote:
Originally Posted by eat1k View Post
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.
__________________
fysiks is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 01-01-2019 , 14:46   Re: Why this not working ?
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
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).
__________________

Last edited by eat1k; 01-01-2019 at 14:49.
eat1k is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-01-2019 , 18:48   Re: Why this not working ?
Reply With Quote #6

Quote:
Originally Posted by eat1k View Post
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!
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
eat1k
Senior Member
Join Date: Apr 2018
Old 01-01-2019 , 20:49   Re: Why this not working ?
Reply With Quote #7

Quote:
Originally Posted by iceeedr View Post
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.
__________________

Last edited by eat1k; 01-01-2019 at 20:50.
eat1k is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2019 , 10:08   Re: Why this not working ?
Reply With Quote #8

Quote:
Originally Posted by eat1k View Post
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).
__________________
fysiks is offline
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 01-02-2019 , 11:27   Re: Why this not working ?
Reply With Quote #9

Quote:
Originally Posted by eat1k View Post
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 
Awesome_man is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 01-02-2019 , 11:39   Re: Why this not working ?
Reply With Quote #10

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().
__________________
eat1k is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:11.


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