Raised This Month: $ Target: $400
 0% 

Admin flag problem or coding plugin bad?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oFF
Member
Join Date: Oct 2012
Old 05-20-2013 , 11:23   Admin flag problem or coding plugin bad?
Reply With Quote #1

Can someone please change this clcmd to an ADMIN_KICK level ?

I've tried everything , idk why not work , added define acces , registered clcmd's but normal clients could use it . Steam only .


i keep getting invalid symbol , when i fix that , loose indentation .... no return value...damn


http://forums.alliedmods.net/showpos...8&postcount=10

Last edited by oFF; 05-20-2013 at 19:38. Reason: title mismatch
oFF is offline
oFF
Member
Join Date: Oct 2012
Old 05-20-2013 , 17:32   Re: Edit admin access asap
Reply With Quote #2

tried about 4 hours every little things ... to add commands to concmd ... flag it ....

added every posibility to read user_flag if admin_kick or every flag... but no success , i think is a code problem here , so im not that good in coding just editing minor things....please help .

Last edited by oFF; 05-20-2013 at 19:38. Reason: sorry for double posting ...
oFF is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-20-2013 , 22:46   Re: Admin flag problem or coding plugin bad?
Reply With Quote #3

try this

UnTested
__________________
Blizzard_87 is offline
oFF
Member
Join Date: Oct 2012
Old 05-21-2013 , 06:46   Re: Admin flag problem or coding plugin bad?
Reply With Quote #4

not working .... i already did that thing , is a problem when reading admin flags i think .... because if you put ,

public ClientCommand_Warmup( Client, lvl, cid ) {
if( !cmd_access( Client, lvl, cid, 2 ) )
return;
// switch state to warmup
state warmup;
Reset( ); }
then no one can use this command but if you put after" reset "a return PLUGIN_CONTINUE; will work for everyone admins and players ....


im not good in coding but i can change few things by my head .... and i cannot figure out why all seems good in this code but cannot read access . idk ... i tried even with concmd ...

Last edited by oFF; 05-21-2013 at 06:47.
oFF is offline
zi443r
Senior Member
Join Date: Mar 2009
Location: Braila,Romania
Old 05-22-2013 , 12:23   Re: Admin flag problem or coding plugin bad?
Reply With Quote #5

maybe this will help you:

PHP Code:
#include < amxmodx >
#include < cstrike >

// team names
// CS_TEAM_UNASSIGNED
// CS_TEAM_T
// CS_TEAM_CT
// CS_TEAM_SPECTATOR
new const TeamNamesCsTeams ][ ] =
{
    
"",
    
"Terrorist",
    
"Counter-Terrorist",
    
""
};

// variable holding the current round
new CurrentRound;

// bool whether it's the 15th round or not
new bool:LastRound;

// current team round count
new RoundsWonCsTeams ];

// holding get_maxplayers( ) value
new MaxPlayers;

public 
plugin_init( )
{
    
register_clcmd"say /score""ClientCommand_Score" );
    
    
register_clcmd"live","ClientCommand_Live",ADMIN_KICK"ClientCommand_Live" );
    
register_clcmd"warmup","ClientCommand_Warmup",ADMIN_KICK"ClientCommand_Warmup" );
    
    
// hook round start
    
register_logevent"LogEvent_RoundStart"2"1=Round_Start" );
    
    
// hook round win
    
register_event"SendAudio""Event_SendAudio_TWin""a""2&%!MRAD_terwin" );
    
register_event"SendAudio""Event_SendAudio_CTWin""a""2&%!MRAD_ctwin" );

    
// assign MaxPlayers the value of get_maxplayers( )
    
MaxPlayers get_maxplayers( );

    
state warmup;
}

public 
ClientCommand_ScoreClient ) <warmup>
{
    
// print score (in this case warmup doesn't have any scores.. so print a message)
    
client_printClientprint_chat"Game mode is currently in Warmup mode - no scores available!" );
}

public 
ClientCommand_ScoreClient ) <live>
{
    
// print score
    
client_printClientprint_chat"CT Score: %i T Score: %i"RoundsWonCS_TEAM_CT ], RoundsWonCS_TEAM_T ] );
}

public 
ClientCommand_LiveClient,level )
{
    if(!(
get_user_flags(Client) & level))
    {
        
console_print(Client"You have no access to that command!")
        return ;
    }        
    else {
    
// switch state to live
    
state live;
    
    
RoundsWonCS_TEAM_CT ] = 0;
    
RoundsWonCS_TEAM_T ] = 0;
    
    
Reset( );}
}

public 
ClientCommand_WarmupClient,level )
{
    if(!(
get_user_flags(Client) & level))
    {
        
console_print(Client"You have no access to that command!")
        return ;
    }    
    else {
    
// switch state to warmup
    
state warmup;
    
    
Reset( );}
}

public 
LogEvent_RoundStart( ) <warmup>
{
    
// print every warmup round
    
client_print0print_chat"Warmup Round"RoundsWonCS_TEAM_CT ], RoundsWonCS_TEAM_T ] );
}

public 
LogEvent_RoundStart( ) <live>
{
    
// increment round counter
    
CurrentRound++;

    
client_print0print_chat"CT Score: %i T Score: %i"RoundsWonCS_TEAM_CT ], RoundsWonCS_TEAM_T ] );

    
// check if rounds == 15, if so, set last true (will be handled when round is won by a team)
    
if( CurrentRound == 15 )
    {
        
client_print0print_chat"This is the last round before switching teams!" );
        
        
LastRound true;
    }
}

public 
Event_SendAudio_TWin( ) <warmup> { }
public 
Event_SendAudio_TWin( ) <live>
{
    
// increment the team round counter for T team
    
RoundsWonCS_TEAM_T ]++;
    
    
// check if they have 16 rounds in the bag
    
CheckWinnerCS_TEAM_T );
    
    
// if it's the 15th round, reset the round counter, and swap team scores
    
if( LastRound )
    {
        
Reset( );
        
        
Swap( );
    }
}

public 
Event_SendAudio_CTWin( ) <warmup> { }
public 
Event_SendAudio_CTWin( ) <live>
{
    
// increment the team round counter for CT team
    
RoundsWonCS_TEAM_CT ]++;
    
    
// check if they have 16 rounds in the bag
    
CheckWinnerCS_TEAM_CT );
    
    
// if it's the 15th round, reset the round counter, and swap team scores
    
if( LastRound )
    {
        
Reset( );
        
        
Swap( );
    }
}

CheckWinnerCsTeams:Team )
{
    
// check if team has won 15 rounds
    
if( RoundsWonTeam ] == 15 )
    {
        
client_print0print_chat"%s team has won 15 rounds now - they're only one away from winning!"TeamNamesTeam ] );
    }
    
// check if team has won 16 rounds
    
else if( RoundsWonTeam ] == 16 )
    {
        
client_print0print_chat"%s team has won 16 rounds now, resetting!"TeamNamesTeam ] );
        
        
// reset
        
Resettrue );
    }
}

Resetbool:TeamWon false )
{
    
// check if a teamwon is true (false by default), if so (see comment below)
    
if( TeamWon )
    {
        
// reset rounds for terrorists and cts
        
for( new CsTeams:Team CS_TEAM_TTeam <= CS_TEAM_CTTeam++ )
        {
            
RoundsWonTeam ] = 0;
        }
    }
    
    
// set round counter to 0
    
CurrentRound 0;
    
    
// restart round
    
server_cmd"sv_restartround 1" );
    
    
// set last round false
    
LastRound false;
}

Swap( )
{
    
// iterate through all players
    
for( new PlayerIndex 1PlayerIndex <= MaxPlayersPlayerIndex++ )
    {
        
// check if connected
        
if( is_user_connectedPlayerIndex ) )
        {
            
// swap team
            
switch( cs_get_user_teamPlayerIndex ) )
            {
                case 
CS_TEAM_Tcs_set_user_teamPlayerIndexCS_TEAM_CT );
                case 
CS_TEAM_CTcs_set_user_teamPlayerIndexCS_TEAM_T );
            }
        }
    }
    
    
// swap scores
    
new TempScore RoundsWonCS_TEAM_T ];
    
RoundsWonCS_TEAM_T ] = RoundsWonCS_TEAM_CT ];
    
RoundsWonCS_TEAM_CT ] = TempScore;

__________________
zi443r is offline
oFF
Member
Join Date: Oct 2012
Old 05-22-2013 , 20:09   Re: Admin flag problem or coding plugin bad?
Reply With Quote #6

seems like this working perfect....what was the problem ? thank you and god bless you
oFF is offline
oFF
Member
Join Date: Oct 2012
Old 05-23-2013 , 15:46   Re: Admin flag problem or coding plugin bad?
Reply With Quote #7

btw....i have sometimes problems with plugin because it does not count good ... sometimes when score 11 - 2 it announce that next round swap teams...what could it be wrong ?
oFF is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 05-24-2013 , 10:15   Re: Admin flag problem or coding plugin bad?
Reply With Quote #8

Quote:
Originally Posted by oFF
btw....i have sometimes problems with plugin because it does not count good ... sometimes when score 11 - 2 it announce that next round swap teams...what could it be wrong ?
i'm just curious what does this plugin do?
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
oFF
Member
Join Date: Oct 2012
Old 05-24-2013 , 10:47   Re: Admin flag problem or coding plugin bad?
Reply With Quote #9

i use it for pcw ... mix 5 on 5 .... it counts rounds....switch teams and switch scores too.... . A mix ends at score 16 ... so if ct have 10 and T 5 ... it will swap teams ... and then T have 10 and ct 5 ... then when T reach score 16 the plugin will end match hope u understand
oFF is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 05-24-2013 , 15:18   Re: Admin flag problem or coding plugin bad?
Reply With Quote #10

Quote:
Originally Posted by oFF
i use it for pcw ... mix 5 on 5 .... it counts rounds....switch teams and switch scores too.... . A mix ends at score 16 ... so if ct have 10 and T 5 ... it will swap teams ... and then T have 10 and ct 5 ... then when T reach score 16 the plugin will end match hope u understand
OK i understand. but i think stats plugin has already had /score function
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
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:35.


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