Raised This Month: $ Target: $400
 0% 

Please Help Admin Access


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
uzairhussain
Junior Member
Join Date: May 2016
Old 05-24-2016 , 11:43   Please Help Admin Access
Reply With Quote #1

hi all i just found a plugin from allied from here
https://forums.alliedmods.net/showth...d+system+eagle

it is a gold system
in 1500gold i can buy admin
admin access "cehuij" how can i change this access please help
i want to change access as "bit"

please help me

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <hamsandwich>
#include <fakemeta_util>
#include <engine>
#include <cstrike>
#include <fun>
#include <ColorChat>


#define ADMIN_ACCESS    ADMIN_IMMUNITY

#define PREFIX        "FraGamers"
#define FLAGS         "cehuij" 

/*-------------- Plugin Information --------------*/

#define PLUGIN "Gold System"
#define VERSION "1.0"
#define AUTHOR "EaGle07 & Freezo"

/*-------------- Stock Cvars --------------*/

new gVaultgSteamID32 ],vKey64 ],vData64 ]; 
new 
gGoldSystem;
new 
gGolds 33 ];
new 
g_iTarget [33];
new 
gAdmincost
new gShop
new gGrenades
new gSilentcost
new gHealthcost
new pHealth
new gArmorcost
new pArmor
new gGravitycost
new gSpeedcost
new gInvisiblecost
new gBhopcost
new gGlowcost
new pSpeed
new gGravity
new gGoldsbonus

new hasGrenades 33 ];
new 
hasSilent 33 ];
new 
hasHealth 33 ];
new 
hasArmor 33 ];
new 
hasGravity 33 ];
new 
hasSpeed 33 ];
new 
hasInvisible 33 ];
new 
hasBhop 33 ];
new 
hasGlow 33 ];
new 
bhopOn 33 ];


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
//-------------- Register Clcmd --------------//
    
    
register_clcmd"say /golds""gold_Menu" );
    
register_clcmd"say /showgolds""cmd_showgolds" );
    
register_clcmd"donate""CmdDonate" );
    
    
//-------------- Register Event --------------//
    
    
register_logevent"logevent_round_start"2"1=Round_Start" );
    
register_event"DeathMsg""Hook_Deathmessage""a" );
    
    
//--------- Cmd for Set / reset Golds --------//
    
    
register_concmd"set_golds""cmd_set"ADMIN_ACCESS"<name> <golds> - set golds to a player" );
    
register_concmd"reset_golds""cmd_reset"ADMIN_ACCESS"<name> <golds> - reset player golds" );
    
    
//-------------- Register Cvars --------------//
    
    
gGoldSystem  register_cvar"gold_system""1" );    /* 0 : Plugin disabled // 1 : plugin enabled */
    
gShop  register_cvar"gold_shop" "1");        /* 0 : Shop disabled  // 1 : Shop Enabled */
    
gGoldsbonus register_cvar"gold_bonus""1")        /* Bonus Golds when you kill an enemy */
    
gGrenades register_cvar"grenades_cost" "9" );    /* Grenades Pack Cost */
    
pHealth    register_cvar"health_point""100" );    /* Health Point Cvar */
    
pArmor register_cvar"armor_point""100" );        /* Armor Point Cvar */
    
gGravity register_cvar"gravity_power""0.3" );    /* Gravity Power Cvar */
    
pSpeed register_cvar"speed_power""800.0");        /* Speed Power Cvar */
    
    
    // ----------------- Cvar With cost ------------//
    
    
gAdmincost   register_cvar"admin_cost""1500" );    /* Admin Cost     */
    
gSilentcost register_cvar"silent_cost""12" );    /* Silent Walk Cost */
    
gHealthcost register_cvar"health_cost""5" );    /* Health Cost    */
    
gArmorcost register_cvar"armor_cost""6" );        /* Armor Cost     */
    
gGravitycost register_cvar"gravity_cost""15" );    /* Gravity Cost */
    
gSpeedcost register_cvar"speed_cost""19" );    /* Speed Cost */
    
gInvisiblecost register_cvar"invisible_cost","19" );    /* Invisible Cost */
    
gBhopcost register_cvar"bhop_cost""14");        /* Faster Bunny Hop Cost */
    
gGlowcost register_cvar"glow_cost""5")        /* Random Glow Cost */
    
    
    
    

}

/* ---| When client is connecting |--- */

public client_connectid )
{
    
load_goldsid );
    
bhopOn[id] = false
}

/* ---| When client has disconnected |--- */

public client_disconnectid )
{
    
save_goldsid );
    
bhopOn[id] = false
}

/* ---| Gold Menu |--- */

public gold_Menu(id)
{
    if( 
get_pcvar_numgGoldSystem ) != )
    {
        
client_printidprint_chat"[%s] Gold System is Disable!"PREFIX );
        return 
PLUGIN_HANDLED;
    }

    new 
InfoStatus[198];
    
formatexInfoStatuscharsmaxInfoStatus ), "Gold System Menu");
    new 
menu menu_createInfoStatus"gold_handler" );
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Shop Menu \y[\rYou Have %d golds\y]"gGolds[id] );
    
menu_additemmenuInfoStatus"1");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Buy Member \y[\r%d golds\y] ",get_pcvar_numgAdmincost ));
    
menu_additemmenuInfoStatus"2");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Show Players Golds");
    
menu_additemmenuInfoStatus"3");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Donate Golds");
    
menu_additemmenuInfoStatus"4");
    
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
    
    return 
PLUGIN_CONTINUE;
    
}

/* ---| Gold Menu Handler |--- */

public gold_handleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    new 
szData[6];
    new 
iAccesshCallback;        

    
menu_item_getinfomenuitemiAccessszData5__hCallback );    
    
    new 
name[32]
    
get_user_name(id,name,32)
    
    switch( 
str_to_numszData ) )
    {
    case 
1gold_shop(id)
    case 
2:
    {
        
        if( 
is_user_admin id ) )
        {
            return 
PLUGIN_HANDLED;
        }
        new 
golds gGolds[id]
            
        if( 
golds get_pcvar_numgAdmincost ) )
        {
            
ColorChat(id,GREEN"^1[^4%s^1] You need ^4%d Golds For Buy ^4ADMIN"PREFIXget_pcvar_numgAdmincost ) )
            return 
PLUGIN_HANDLED;
        }
        
        
set_user_admin(id)
        
gGolds[id] -= get_pcvar_numgAdmincost );
        
menu_displayidmenu);    
    }
    case 
3ShowPoints(id)
    case 
4Donate_Menu(id)
    
    }
    
    return 
PLUGIN_HANDLED;
}

/* ---| Gold Shop with items |--- */

public gold_shop(id)
{
    
/* ---| if shop disabled player can't open the shop|--- */
    
if( get_pcvar_numgShop ) != )
    {
        
client_printidprint_chat"[%s] Gold Shop is Disable!"PREFIX );
        return 
PLUGIN_HANDLED;
    }

    new 
InfoStatus[198];
    
formatexInfoStatuscharsmaxInfoStatus ), "Gold Shop ^n You Have %d Golds"gGolds[id] );
    
    new 
menu menu_createInfoStatus"shop_handler" );
    

    
formatex(InfoStatuscharsmax(InfoStatus),  "Grenades Pack \r[ %d golds ]"get_pcvar_numgGrenades ) );
    
menu_additemmenuInfoStatus"1");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Silent Walk \r[ %d golds ]",get_pcvar_numgSilentcost ));
    
menu_additemmenuInfoStatus"2");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "%d Health \r[ %d golds ]",get_pcvar_numpHealth ) ,get_pcvar_numgHealthcost ) );
    
menu_additemmenuInfoStatus"3");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "%d Armor \r[ %d golds ]",get_pcvar_numpArmor ) ,get_pcvar_numgArmorcost ) );
    
menu_additemmenuInfoStatus"4");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Gravity \r[ %d golds ]",get_pcvar_numgGravitycost ) );
    
menu_additemmenuInfoStatus"5");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Faster Speed \r[ %d golds ]",get_pcvar_numgSpeedcost ) );
    
menu_additemmenuInfoStatus"6");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Invisibility \r[ %d golds ]",get_pcvar_numgInvisiblecost ) );
    
menu_additemmenuInfoStatus"7");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Faster Bhop \r[ %d golds ]",get_pcvar_numgBhopcost ) );
    
menu_additemmenuInfoStatus"8");
    
    
formatex(InfoStatuscharsmax(InfoStatus),  "Random Glow \r[ %d golds ]",get_pcvar_numgGlowcost ) );
    
menu_additemmenuInfoStatus"9");
    
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
    
    return 
PLUGIN_CONTINUE;
    
}

/* ---| Gold Shop Handler |--- */

public shop_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ], accesscallback;
    
menu_item_getinfomenuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback );

    new 
key str_to_numdata );
    
    new 
golds gGoldsid ];
    
    switch( 
key )
    {

        case 
1:
        {
            if( 
hasGrenades[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Pack Grenades "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgGrenades ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4Pack Grenades"PREFIX)
                
give_itemid"weapon_hegrenade" )
                
give_itemid"weapon_flashbang" )
                
give_itemid"weapon_smokegrenade" )
                
                
gGolds[id] -= get_pcvar_numgGrenades )
                
hasGrenades [id] = true;
            }
        }

        case 
2:
        {
            if (
hasSilent[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Silent Walk "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgSilentcost ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4Silent Walk"PREFIX)
                
set_user_footstepsid);
                
                
gGolds[id] -= get_pcvar_numgSilentcost )
                
hasSilent [id] = true;
            }
        }

        case 
3:
        {
            if (
hasHealth[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Health "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgHealthcost ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4%d Health"PREFIXget_pcvar_numpHealth ))
                
set_user_healthidget_user_healthid ) + get_pcvar_numpHealth ));
                
                
gGolds[id] -= get_pcvar_numgHealthcost )
                
hasHealth [id] = true;
            }
        }

        case 
4:
        {
            if (
hasArmor[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Armor "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgArmorcost ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4%d Armor"PREFIXget_pcvar_numpArmor ))
                
set_user_armoridget_user_armorid ) + get_pcvar_numpArmor ) );
                
                
gGolds[id] -= get_pcvar_numgArmorcost )
                
hasArmor [id] = true;
            }
        }

        case 
5:
        {
            if (
hasGravity[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Gravity "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgGravitycost ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4Gravity"PREFIX)
                
set_user_gravityidget_pcvar_floatgGravity ) );
                
                
gGolds[id] -= get_pcvar_numgGravitycost )
                
hasGravity [id] = true;
            }
        }

        case 
6:
        {
            if (
hasSpeed[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Faster Speed "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgSpeedcost ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4Faster Speed"PREFIX)
                
set_user_maxspeedidget_pcvar_floatpSpeed ) );
                
                
gGolds[id] -= get_pcvar_numgSpeedcost )
                
hasSpeed [id] = true;
            }
        }

        case 
7:
        {
            if (
hasInvisible[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Invisible "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgInvisiblecost ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4Invisibility"PREFIX)
                
set_user_renderingidkRenderFxNone000kRenderTransAlpha);
                
                
gGolds[id] -= get_pcvar_numgInvisiblecost )
                
hasInvisible [id] = true;
            }
        }

        case 
8:
        {
            if (
bhopOn[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Faster Bhop "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgBhopcost ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4Faster Bhop"PREFIX)
                
                
gGolds[id] -= get_pcvar_numgBhopcost )
                
bhopOn[id] = true
            
}
        }

        case 
9:
        {
            if (
hasGlow[id])
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You already have ^4Random Glow "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            
            if( 
golds get_pcvar_numgGlowcost ))
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! "PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
ColorChat(id,GREEN"^1[^4%s^1]^1 You Have Buy ^4Random Glow"PREFIX)
                
set_user_renderingidkRenderFxGlowShellrandom256 ), random256 ), random256 ), kRenderNormalrandom256 ) );
                
                
gGolds[id] -= get_pcvar_numgGlowcost )
                
hasGlow [id] = true;
            }
        }
    }
    return 
PLUGIN_HANDLED;
}

/* ---| Show Players Golds Menu |--- */

public ShowPoints(id){
    static 
opcion[64]
   
    
formatex(opcioncharsmax(opcion),"Show Players Golds :")
    new 
iMenu menu_create(opcion"Handlegolds")
   
    new 
players[32], pnumtempid
    
new szName[32], szTempid[10]
   
    
get_players(playerspnum"ch")
   
    for( new 
ii<pnumi++ )
    {

    
tempid players[i]
      
    
get_user_name(tempidszName31)
    
num_to_str(tempidszTempid9)
      
    
formatex(opcion,127,"%s - \y[\r%i Golds\y]",szNamegGolds[tempid]);
    
menu_additem(iMenuopcionszTempid0)
    }
   
    
menu_display(idiMenu)
    return 
PLUGIN_HANDLED
}

/* ---| Show Players Golds Handler |--- */

public Handlegolds(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], name[64]
    new 
accesscallback
    
    menu_item_getinfo 
(menuitemaccessdata5name63callback)
    new 
tempid str_to_num (data)
    
    new 
szName[33], szPlayerName[33]
    
    
get_user_name(idszName32)
    
get_user_name(tempidszPlayerName32)
    
    
ColorChat(idRED"^1[^4%s^1] User ^4%s ^1Have ^4%i ^1Golds!",PREFIX ,szPlayerNamegGolds[tempid])
    
    
ShowPoints(id);
    
    return 
PLUGIN_CONTINUE
}

/* ---| Donate Golds Menu |--- */
    
public Donate_Menu(id)
{
    new 
iMenu menu_create("Donate Players Menu""handleDonate");
    
    new 
iPlayers[32], szName[32], szKey[3], iNumiPlayer;
    
get_players(iPlayersiNum,"ch");
    
    for( new 
iiNumi++ )
    {
        
iPlayer iPlayers[i];
        
        
num_to_str(iPlayerszKeycharsmax(szKey));
        
get_user_name(iPlayerszNamecharsmax(szName));
        
        
menu_additem(iMenuszNameszKey);
    }
    
    
menu_setprop(iMenuMPROP_EXITNAME"Back");
    
menu_display(idiMenu0);
    return 
0;
}

/* ---| Donate Golds Handler |--- */

public handleDonate(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
szData[6], iAccessiCallback;
    
menu_item_getinfo(menuitemiAccessszDatacharsmax(szData), __iCallback);
    
    
g_iTarget[id] = str_to_num(szData);
    new 
szName[32];
    
get_user_name(g_iTarget[id], szNamecharsmax(szName));
    
    
client_cmd(id"messagemode donate");
    return 
PLUGIN_HANDLED;
}

/* ---| Cmd Donate Golds |--- */

public CmdDonate(id)
{
    new 
szArg[5];
    
read_argv(1szArgcharsmax(szArg));
    
    
    new 
iValue str_to_num(szArg);
    
    if( 
iValue gGolds[id] )
    {
        
ColorChat(id,GREEN"^1[^4%s^1] You only have ^4%i ^1Golds"PREFIX gGolds[id]);
        return 
PLUGIN_HANDLED;
    }
    
    new 
iTarget g_iTarget[id];
    
    if( !
iTarget )
    {
        return 
PLUGIN_HANDLED;
    }
    
    if( 
iTarget == id )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
gGolds[id] -= iValue;
    
    
gGolds[iTarget] += iValue;
    
    new 
szName[2][32];
    
get_user_name(iTargetszName[0], charsmax(szName[]));
    
get_user_name(idszName[1], charsmax(szName[]));

    
ColorChat(id,GREEN"^1[^4%s^1] You donated ^4%i^1 Golds To ^4%s !"PREFIX iValueszName[0]);
    
ColorChat(iTarget,GREEN"^1[^4%s^1] ---^4%s^1--- Gives You ^4%i Golds"PREFIXszName[1], iValue);
    
    
    return 
PLUGIN_HANDLED;
}

/* ---| When Round Start |--- */

public logevent_round_start()
{
    if( 
get_pcvar_numgGoldSystem ) == )
    {
        new 
iPlayers32 ], iNumiid;
        
get_playersiPlayersiNum"c" );
        
        for( 
0iNumi++ )
        {
            
id iPlayers];
            
            
bhopOnid ] = false;
            
hasGrenades id ] = false;
            
hasSilent id ] = false;
            
hasHealth id ] = false;
            
hasArmor id ] = false;
            
hasGravity id ] = false;
            
hasSpeed id ] = false;
            
hasInvisible id ] = false;
            
hasBhop id ] = false;
            
hasGlow id ] = false;
        
            
set_user_gravityid1.0 );    
            
set_user_maxspeedid0.0 );
            
set_user_renderingid );
            
set_user_footstepsid);
        }
    }
}

/* ---| When Player Died |--- */

public Hook_Deathmessage()
{
    if( 
get_pcvar_numgGoldSystem ) == )
    {
        new 
killer read_data);
        new 
victim read_data);

        if( 
killer == victim )
        {
            return 
PLUGIN_HANDLED;
        }

        
gGoldskiller ] += get_pcvar_numgGoldsbonus );

        
bhopOnvictim ] = false;
        
hasGrenades victim ] = false;
        
hasSilent victim ] = false;
        
hasHealth victim ] = false;
        
hasArmor victim ] = false;
        
hasGravity victim ] = false;
        
hasSpeed victim ] = false;
        
hasInvisible victim ] = false;
        
hasBhop victim ] = false;
        
hasGlow victim ] = false;
    
        
set_user_gravityvictim1.0 );    
        
set_user_maxspeedvictim0.0 );
        
set_user_renderingvictim );
        
set_user_footstepsvictim);
        
    }
    
    return 
PLUGIN_CONTINUE;
}

/* ---| Cmd For Show Your Golds |--- */

public cmd_showgolds(id)
{    
    
set_hudmessage(02552550.00.8706.012.0)
    
show_hudmessage(id"You Have %d Golds"gGolds [id] )
    
    
client_printidprint_chat"You Have %d Golds"gGoldsid ] );    
}

/* ---| Cmd For Set Golds |--- */

public cmd_set(id,level,cid)
{
    if(!
cmd_access(id,level,cid,3))
    return 
PLUGIN_HANDLED
        
    
else
    {
        new 
target[32], pid
        read_argv
(1,target,31)
        
pid cmd_target(id,target,2)
        
        new 
amountstr[10], amount
        read_argv
(2,amountstr,9)
        
amount str_to_num(amountstr)
        
        new 
name[32], tname[32]
        
get_user_name(id,name,31)
        
get_user_name(pid,tname,31)
        
        
gGolds[pid] += amount
        client_print
(idprint_chat"[%s] You Give %d Golds To %s"PREFIXamounttname)
        
client_print(pidprint_chat"[%s] Admin %s Give %d Gold To You . Now You Have %d Golds"PREFIXnameamount)
    }    
    return 
PLUGIN_HANDLED
}

/* ---| Cmd For Reset Golds |--- */

public cmd_reset(id,level,cid)
{
    if(!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
    
    
else
    {
        new 
target[32], pid
        read_argv
(1,target,31)
        
pid cmd_target(id,target,2)
        
        new 
amountstr[10], amount
        read_argv
(2,amountstr,9)
        
amount str_to_num(amountstr)
        
        new 
name[32], tname[32]
        
get_user_name(id,name,31)
        
get_user_name(pid,tname,31)
        
        if((
gGolds[pid] -= amount) < 0)
        
        
amount gGolds[pid]
            
        
gGolds[pid] -= amount
        client_print
(idprint_chat"[%s] You Removed %d Points From %s"PREFIXamounttname)
        
client_print(pidprint_chat"[%s] %s Removed From You %d Points. Now You Have %d Points"PREFIXnameamount)
    }
    return 
PLUGIN_HANDLED
}
/* ---| Client Prethink |--- */
public client_PreThink(id)  

    
    if( !
bhopOn[id] ) 
        return 
PLUGIN_HANDLED
    
    
entity_set_float(idEV_FL_fuser20.0
    
    if (
entity_get_int(idEV_INT_button) & 2)  
    { 
        new 
flags entity_get_int(idEV_INT_flags
        
        if (
flags FL_WATERJUMP
            return 
PLUGIN_CONTINUE 
        
if ( entity_get_int(idEV_INT_waterlevel) >= 
            return 
PLUGIN_CONTINUE 
        
if ( !(flags FL_ONGROUND) ) 
            return 
PLUGIN_CONTINUE 
        
        
new Float:velocity[3
        
entity_get_vector(idEV_VEC_velocityvelocity
        
velocity[0] *= 1.10
        velocity
[1] *= 1.10
        velocity
[2] += 250.0 
        entity_set_vector
(idEV_VEC_velocityvelocity
        
        
entity_set_int(idEV_INT_gaitsequence9
    } 
    return 
PLUGIN_CONTINUE 
}

/* ---| Save Players Golds |--- */

stock save_goldsindex )
{
    
gVault nvault_open"GOLDS_SAVE" );
    
    
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
    
    
formatexvKeycharsmaxvKey ), "%sGOLDS"gSteamID );
    
formatexvDatacharsmaxvData ), "%d"gGoldsindex ] );
    
nvault_setgVaultvKeyvData );
    
nvault_closegVault );
}

/* ---| load Players Golds |--- */

stock load_goldsindex )
{
    
gVault nvault_open"GOLDS_SAVE" );
    
    
get_user_authidindexgSteamIDcharsmaxgSteamID ) );

    
formatexvKeycharsmaxvKey ), "%sGOLDS"gSteamID );
    
gGoldsindex ] = nvault_getgVaultvKey );
    
nvault_closegVault );
}

/* ---| For set user Admin {if player buy admin} |--- */

set_user_admin(target)
{
    new 
ident[33], pw[5], linne[150]
    
formatex(pw4"%d%d%d%d"random_num(19), random_num(19), random_num(19), random_num(19))
    
    new 
File[120]; get_configsdir(Filecharsmax(File))
    
add(Filecharsmax(File), "/users.ini")    
    
    if(!
file_exists(File))
    
set_fail_state("File configs/users.ini Not Found")
    
    
get_user_name(targetidentcharsmax(ident))
    
formatex(linnecharsmax(linne), "^r^n^"%s^" ^"%s^" ^"%s^" ^"a^""identpwFLAGS)            
    
client_print(targetprint_console"------------------- | Gold System | -------------------")
    
client_print(targetprint_console"[AMXX] You have been kiked because you have buy admin")
    
client_print(targetprint_console"[AMXX] Your password | setinfo is: %s"pw)
    
client_print(targetprint_console"[AMXX] You should put in your console: setinfo _pw %s"pw)
    
client_print(targetprint_console"-------------------------| # |-------------------------")
    
server_cmd("kick #%d ^"Buy Admin successfully your password is %s, [See More information in consol]^""get_user_userid(target), pw)
    
write_file(Filelinne)
    
    
server_cmd("amx_reloadadmins")
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/ 
uzairhussain is offline
 


Thread Tools
Display Modes

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 18:45.


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