Raised This Month: $ Target: $400
 0% 

zp solve plugin


Post New Thread Reply   
 
Thread Tools Display Modes
abood alnjjar
Member
Join Date: Oct 2015
Location: palestine
Old 06-02-2016 , 04:56   Re: zp solve plugin
Reply With Quote #21

How make it only for vip please
__________________
abood alnjjar is offline
B7PK
Member
Join Date: Apr 2016
Location: palestine
Old 06-03-2016 , 12:13   Re: zp solve plugin
Reply With Quote #22

i think u can take wait time form here is easy for coders please...i try but no benefit i'm noob

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

#define PLUGIN "ResetScore"
#define VERSION "0.2.0"
#define AUTHOR "aNNakin"

new const gs_Commands[ ][ ] =
{
    
"say /resetscore",
    
"say /restartscore"
};

new 
ToggleMaxToggleIntervalToggleMoneyg_Pointer;
new 
gi_Reset33 ], gi_CanReset33 ];

public 
plugin_init ( )
{
    
register_plugin PLUGINVERSIONAUTHOR );
    
register_dictionary "resetscore.txt" );
    
    
register_concmd "amx_resetscore""resetscore_concmd"ADMIN_KICK"- <target>" );
    
    for ( new 
i_Indexi_Index sizeof gs_Commandsi_Index++ )
        
register_clcmd gs_Commandsi_Index ], "resetscore_clcmd" );
    
    
// how many times players can reset their score
    
ToggleMax register_cvar "resetscore_max""5" );
    
    
// how many minutes must pass before players can reset theirs score again
    
ToggleInterval register_cvar "resetscore_interval""3" );
    
    
// -2 don't set, -1 set at mp_startmoney value, another number will set to that value (e.g 0)
    
ToggleMoney register_cvar "resetscore_money""-1" );
    
    
g_Pointer get_cvar_pointer "mp_startmoney" );
    
}

public 
client_putinserver e_Index gi_Resete_Index ] = get_pcvar_num ToggleMax );

public 
resetscore_clcmd e_Index )
{
    new 
i_TimeCvari_Freei_GameTimeFloat:f_GameTime;
            
    if ( 
ScoreReseted e_Index ) )
    {
        
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_ALREADY_RESETED" );
        return 
PLUGIN_HANDLED;
    }
    
    
f_GameTime get_gametime ( );
    
i_GameTime floatround f_GameTime );
    
i_TimeCvar get_pcvar_num ToggleInterval );
    
    if ( ! 
get_pcvar_num ToggleMax ) )
    {
        
i_Free 1;
        goto 
CheckLimit;
        
FreeReset:
        
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_SUCCES_FREE_RESET" );
        
ResetScore e_Index );
        
gi_CanResete_Index ] = i_GameTime;
    }
    else
    {
        if ( 
gi_Resete_Index ] > )
        {
            
CheckLimit:
            if ( 
gi_CanResete_Index ] && ( i_GameTime gi_CanResete_Index ] < ( i_TimeCvar 60 ) ) )
            {
                
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_WAIT_BEFORE_RESET"i_TimeCvar );
                return 
PLUGIN_HANDLED;
            }
            else    
                if ( 
i_Free )
                    goto 
FreeReset;
                
            
gi_Resete_Index ]--;
            
gi_CanResete_Index ] = i_GameTime;
            
ResetScore e_Index );
                    
            if ( 
gi_Resete_Index ] > )
            {
                if ( 
gi_Resete_Index ] == )
                    
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_SUCCESS_ONE_REMAIN" );
                else    
                    
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_SUCCESS_MORE_RAMAIN"gi_Resete_Index ] );
            }
            else
                
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_SUCCESS_NOT_REMAIN" );
            
            return 
PLUGIN_CONTINUE;
        }
        else
        {
            
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_CANT_USE_NOT_REMAIN" );
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
resetscore_concmd idlevelcid )
{
    if ( ! 
cmd_access idlevelcid) )
        return 
PLUGIN_HANDLED;
        
    new 
s_Arg32 ];
    
read_argv 1s_Arg31 );
    
    new 
e_Target cmd_target ids_Arg);
    if ( ! 
e_Target )
        return 
PLUGIN_HANDLED;
        
    if ( 
ScoreReseted e_Target ) )
    {
        
console_print id"%L"id"RESETSCORE_ADMIN_ALREADY_RESETED" );
        return 
PLUGIN_HANDLED;
    }
    
    
ResetScore e_Target );
    
    
client_print e_Targetprint_chat"%L"e_Target"RESETSCORE_PLAYER_ADMIN_HAS_RESETSCORE" );
    
console_print id"%L"id"RESETSCORE_ADMIN_SUCCESS_RESETED" );
    return 
PLUGIN_HANDLED;
}
    
ResetScore e_Index )
{
    
set_user_frags e_Index);
    
cs_set_user_deaths e_Index);
    
set_user_frags e_Index);
    
cs_set_user_deaths e_Index);
    
    new 
i_MoneyCvar get_pcvar_num ToggleMoney );
    new 
i_Value;
    
    
// make sure he won't get more money
    
if ( i_MoneyCvar >= && cs_get_user_money e_Index ) <= i_MoneyCvar )
        return 
1;
        
    switch ( 
i_MoneyCvar )
    {
        case -
2: return 1;
        case -
1i_Value get_pcvar_num g_Pointer );
        default: 
i_Value i_MoneyCvar;
    }
    
    
cs_set_user_money e_Indexi_Value );
    return 
1;
}

ScoreReseted e_Index )
    return  ( !
get_user_frags e_Index ) && !get_user_deaths e_Index ) ) ? 0
__________________
B7PK is offline
abood alnjjar
Member
Join Date: Oct 2015
Location: palestine
Old 06-03-2016 , 12:44   Re: zp solve plugin
Reply With Quote #23

Quote:
Originally Posted by B7PK View Post
i think u can take wait time form here is easy for coders please...i try but no benefit i'm noob

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

#define PLUGIN "ResetScore"
#define VERSION "0.2.0"
#define AUTHOR "aNNakin"

new const gs_Commands[ ][ ] =
{
    
"say /resetscore",
    
"say /restartscore"
};

new 
ToggleMaxToggleIntervalToggleMoneyg_Pointer;
new 
gi_Reset33 ], gi_CanReset33 ];

public 
plugin_init ( )
{
    
register_plugin PLUGINVERSIONAUTHOR );
    
register_dictionary "resetscore.txt" );
    
    
register_concmd "amx_resetscore""resetscore_concmd"ADMIN_KICK"- <target>" );
    
    for ( new 
i_Indexi_Index sizeof gs_Commandsi_Index++ )
        
register_clcmd gs_Commandsi_Index ], "resetscore_clcmd" );
    
    
// how many times players can reset their score
    
ToggleMax register_cvar "resetscore_max""5" );
    
    
// how many minutes must pass before players can reset theirs score again
    
ToggleInterval register_cvar "resetscore_interval""3" );
    
    
// -2 don't set, -1 set at mp_startmoney value, another number will set to that value (e.g 0)
    
ToggleMoney register_cvar "resetscore_money""-1" );
    
    
g_Pointer get_cvar_pointer "mp_startmoney" );
    
}

public 
client_putinserver e_Index gi_Resete_Index ] = get_pcvar_num ToggleMax );

public 
resetscore_clcmd e_Index )
{
    new 
i_TimeCvari_Freei_GameTimeFloat:f_GameTime;
            
    if ( 
ScoreReseted e_Index ) )
    {
        
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_ALREADY_RESETED" );
        return 
PLUGIN_HANDLED;
    }
    
    
f_GameTime get_gametime ( );
    
i_GameTime floatround f_GameTime );
    
i_TimeCvar get_pcvar_num ToggleInterval );
    
    if ( ! 
get_pcvar_num ToggleMax ) )
    {
        
i_Free 1;
        goto 
CheckLimit;
        
FreeReset:
        
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_SUCCES_FREE_RESET" );
        
ResetScore e_Index );
        
gi_CanResete_Index ] = i_GameTime;
    }
    else
    {
        if ( 
gi_Resete_Index ] > )
        {
            
CheckLimit:
            if ( 
gi_CanResete_Index ] && ( i_GameTime gi_CanResete_Index ] < ( i_TimeCvar 60 ) ) )
            {
                
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_WAIT_BEFORE_RESET"i_TimeCvar );
                return 
PLUGIN_HANDLED;
            }
            else    
                if ( 
i_Free )
                    goto 
FreeReset;
                
            
gi_Resete_Index ]--;
            
gi_CanResete_Index ] = i_GameTime;
            
ResetScore e_Index );
                    
            if ( 
gi_Resete_Index ] > )
            {
                if ( 
gi_Resete_Index ] == )
                    
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_SUCCESS_ONE_REMAIN" );
                else    
                    
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_SUCCESS_MORE_RAMAIN"gi_Resete_Index ] );
            }
            else
                
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_SUCCESS_NOT_REMAIN" );
            
            return 
PLUGIN_CONTINUE;
        }
        else
        {
            
client_print e_Indexprint_chat"%L"e_Index"RESETSCORE_PLAYER_CANT_USE_NOT_REMAIN" );
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
resetscore_concmd idlevelcid )
{
    if ( ! 
cmd_access idlevelcid) )
        return 
PLUGIN_HANDLED;
        
    new 
s_Arg32 ];
    
read_argv 1s_Arg31 );
    
    new 
e_Target cmd_target ids_Arg);
    if ( ! 
e_Target )
        return 
PLUGIN_HANDLED;
        
    if ( 
ScoreReseted e_Target ) )
    {
        
console_print id"%L"id"RESETSCORE_ADMIN_ALREADY_RESETED" );
        return 
PLUGIN_HANDLED;
    }
    
    
ResetScore e_Target );
    
    
client_print e_Targetprint_chat"%L"e_Target"RESETSCORE_PLAYER_ADMIN_HAS_RESETSCORE" );
    
console_print id"%L"id"RESETSCORE_ADMIN_SUCCESS_RESETED" );
    return 
PLUGIN_HANDLED;
}
    
ResetScore e_Index )
{
    
set_user_frags e_Index);
    
cs_set_user_deaths e_Index);
    
set_user_frags e_Index);
    
cs_set_user_deaths e_Index);
    
    new 
i_MoneyCvar get_pcvar_num ToggleMoney );
    new 
i_Value;
    
    
// make sure he won't get more money
    
if ( i_MoneyCvar >= && cs_get_user_money e_Index ) <= i_MoneyCvar )
        return 
1;
        
    switch ( 
i_MoneyCvar )
    {
        case -
2: return 1;
        case -
1i_Value get_pcvar_num g_Pointer );
        default: 
i_Value i_MoneyCvar;
    }
    
    
cs_set_user_money e_Indexi_Value );
    return 
1;
}

ScoreReseted e_Index )
    return  ( !
get_user_frags e_Index ) && !get_user_deaths e_Index ) ) ? 0
The true take it form here https://forums.alliedmods.net/showpo...2&postcount=53
Take this...and i not know what take more
PHP Code:

public questionTimeout()
{
    if(!
solved)
        
client_print(0print_chat"[MG] You all were too slow - Learn more Math - The Solution was %i"solution);
    
    
solved true;
    
    
set_task(get_pcvar_float(mg_frequency) / 2.0"buildQuestion");

__________________
abood alnjjar is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 06-03-2016 , 13:34   Re: zp solve plugin
Reply With Quote #24

for VIP?
Which flag? ADMIN_LEVEL_H ?
siriusmd99 is offline
abood alnjjar
Member
Join Date: Oct 2015
Location: palestine
Old 06-03-2016 , 14:12   Re: zp solve plugin
Reply With Quote #25

Yes level H
__________________
abood alnjjar 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 00:28.


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