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

Give and remove Credits


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zombiesucker
Member
Join Date: Sep 2015
Old 09-23-2015 , 07:16   Give and remove Credits
Reply With Quote #1

hello,, Can anybody share code that can give Credits for player and can be used only by admin,, and remove Credits from player and can be used by admins only

thanks in advance
zombiesucker is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 09-23-2015 , 11:52   Re: Give and remove Credits
Reply With Quote #2

Why would you give Credits to players when only admins can use it
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-23-2015 , 12:33   Re: Give and remove Credits
Reply With Quote #3

How are we supposed to know which plugin you are talking about? Provide a code, please.

Last edited by OciXCrom; 09-23-2015 at 12:33.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
zombiesucker
Member
Join Date: Sep 2015
Old 09-23-2015 , 15:35   Re: Give and remove Credits
Reply With Quote #4

Quote:
Originally Posted by Chihuahuax View Post
Why would you give Credits to players when only admins can use it
you are true,, put i need it to give the admins extra credits that the players can't get from killing etc,,,,
zombiesucker is offline
zombiesucker
Member
Join Date: Sep 2015
Old 09-23-2015 , 15:40   Re: Give and remove Credits
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
How are we supposed to know which plugin you are talking about? Provide a code, please.
PHP Code:
/*/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// -------  | -- > Multumiri < -- | ------------- //////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// ------- | --->   Aaron  <--- | ---------- ///////////////////////
*/

#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < fun >
#include < hamsandwich >
#include < fakemeta_util >
#include < message_const >
#include < CC_ColorChat >
#include < fcs >

#pragma tabsize 0

native set_user_pet(id);

#define PLUGIN "[ Ultimate Shop ] Ultimate Furien Shop"
#define VERSION "1.2"
#define AUTHOR "Aaron"

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

// -- | Harry Magic Wand | -- //
#define HARRY_WAND_RECOIL     0.0            // Recoil
#define HARRY_WAND_SPEED     0.35            // Click stanga
#define HARRY_WAND_SPEED2     0.75            // Click dreapta
#define HARRY_WAND_FIRE    random_num( 3, 6 )    // Animatie cand trage cu click stanga
#define HARRY_WAND_FIRE2    random_num( 5, 10 )    // Animatie cand trage cu click dreapta

#define TE_BEAMENTPOINT    1
#define TE_EXPLOSION        3
#define TE_SPRITETRAIL        15
#define TE_BEAMCYLINDER        21

// -- | Shop | -- //

new const Prefix[  ] = "^x04[Furien Shop]^x01";

// == | Super-Knife | == //

new bool:superknife2X 33 ];
new 
bool:superknife3X 33 ];

new 
v_superknife2X 66 ] = "models/furienshop/v_super_knife2X.mdl";
new 
v_superknife3X 66 ] = "models/furienshop/v_superknife3X.mdl";

// -- | Upgrade | -- //
new boolUpgrade33 ];

// -- | He Grenade | -- //
new Hegrnd_Countdown 33 ];
new 
FloatLastMessage 33 ];

// -- | Take Damage | -- //
new g_iMaxPlayers;

new 
boolHaveNoFlash 33 ];
new 
g_msgScreenFade;

// -- | Harry Magic Wand | -- //

new const Tag[  ] = "[Harry Magic Wand]";

new 
HarryFireSound[  ] = "harry_wand/harry_shoot1.wav";
new 
HarryHitSound[  ] = "harry_wand/harry_hit.wav";
new 
HarryHitSound2[  ] = "harry_wand/harry_shoot2.wav";
new 
HarryModel[  ] = "models/harry_wand/v_harry_wand.mdl";

new 
HarryBeamHarryExpHarryExp2DeathSprite;

new 
bool:g_HasHarryWand33 ];

new 
Harry_Ammo33 ];
new 
Float:HarryLastShotTime33 ];

new 
HarryDamageCvarHarryDamageCvar2HarryAmmoHarryKillMoneyHarryDistance;



public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
//Register Shop
    
register_clcmd("say /shop""FurienShop" );
    
register_clcmd("say shop""FurienShop" );
    
register_clcmd("say_team /shop""FurienShop" );
    
register_clcmd("say_team shop""FurienShop" );
    
register_clcmd("say /ultimate""FurienShop" );
    
register_clcmd("say_team ultimate""FurienShop" );
    
    
// -- | Harry Magic Wand | -- //
    
register_event"CurWeapon""CurrentWeapon""be""1=1" );
    
    
register_forwardFM_CmdStart"Harry_CmdStart" );
    
register_event("DeathMsg""eDeath""a")
    
    
HarryDamageCvar register_cvar"harry_damage""100.0" );
    
HarryDamageCvar2 register_cvar"harry_damage2""150.0" );
    
HarryAmmo register_cvar"harry_ammo""200" );
    
HarryKillMoney register_cvar"harry_money_reward""5000" );
    
HarryDistance register_cvar"harry_distance""90909" );

    
register_concmd"amx_get_harry""GiveHarry"ADMIN_RCON"< nume > < ammo >" );
    
    
//Register Arme
    
register_event "CurWeapon""CurrWeapon""be""1=1" );
    
RegisterHam Ham_TakeDamage"player""Player_TakeDamage" );
    
RegisterHam Ham_Spawn"player""Spawn"true );
    
    
register_event("ScreenFade""eventFlash""be""4=255""5=255""6=255""7>199")
    
    
    
g_iMaxPlayers get_maxplayers (     );
    
g_msgScreenFade get_user_msgid("ScreenFade")
}

public 
eDeath ( ) {
    
    if ( 
superknife2X read_data ) ] || superknife3X read_data ) ] ) {
        
        
superknife2X read_data ) ] = false;
        
superknife3X read_data ) ] = false;
    }
}

public 
plugin_precache ( ) {
    
    
//Super-Knife
    
precache_model v_superknife2X );
    
precache_model v_superknife3X );
    
    
// Harry Potter Wand
    
precache_soundHarryFireSound );
    
precache_soundHarryHitSound );
    
precache_soundHarryHitSound2 );

    
precache_modelHarryModel );

    
HarryBeam precache_model"sprites/harry_wand/harry_plasma_beam.spr" );
    
HarryExp precache_model"sprites/harry_wand/harry_plasma_exp2.spr" );
    
HarryExp2 precache_model"sprites/harry_wand/harry_plasma_exp3.spr" );
    
DeathSprite precache_model"sprites/harry_wand/harry_skull.spr" );
}

public 
client_putinserverid ) {
        
    
g_HasHarryWandid ] = false;
    
Harry_Ammoid ] = false;
}

public 
client_disconnectid ) {
    
    
g_HasHarryWandid ] = false;
    
Harry_Ammoid ] = false;
}


public 
Spawnid ) {
    
    
Hegrnd_Countdown id ] = 0;
    
strip_user_weapons(id)
    
give_item(id"weapon_knife" );
    
give_item(id"weapon_hegrenade" );
    
cs_set_user_bpammoidCSW_HEGRENADE)
    
    
g_HasHarryWandid ] = false;
    
Upgradeid ] = false;
    
HaveNoFlash id ] = false;
    
    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT )
    {
        
superknife2Xid ] = false;
        
superknife3Xid ] = false;
    }
    
}
public 
CurrWeapon id ) {
    
    if ( 
superknife2X id ] && get_user_weapon id ) == CSW_KNIFE ) {
        
        
set_pev idpev_viewmodel2v_superknife2X );
    }
    if ( 
superknife3X id ] && get_user_weapon id ) == CSW_KNIFE ) {
        
        
set_pev idpev_viewmodel2v_superknife3X );
    }
}

public 
FurienShop id ) {
    
    if ( 
cs_get_user_team(id) == CS_TEAM_T ) {
        
        
ShopFurienid )
    }
    
    if ( 
cs_get_user_team (id ) == CS_TEAM_CT ) {
        
        
ShopAntiFurien id )
    }
}

public 
ShopAntiFurien id ) {   
    
    new 
Temp[101], credits fcs_get_user_credits(id); 
    
    
    
formatex(Temp,100"\yAnti-Furien Shop \r[ v1.2 ]\y:^nCredite:\rAaron %d"credits); 
    new 
menu menu_create(Temp"AntiFurien")
    
menu_additem(menu"\yHP + AP - \r10 Credite""1"0);
    
menu_additem(menu"\yHarry Potter Wand - \r50 Credite""2"0);
    
menu_additem(menu"\yDefuse Kit - \r2 Credite""3"0);
    
menu_additem(menu"\y50 HP - \r5 Credite""4"0);
    
menu_additem(menu"\y100 AP - \r5 Credite""5"0);
    
menu_additem(menu"\yNo Flash - \r5 Credite^n""6"0);
    
menu_additem(menu"\yPet - \r20 Credite""7"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
}

public 
ShopFurienid ) {    
    
    new 
Temp[101], credits fcs_get_user_credits(id); 
    
    
    
formatex(Temp,100"\yFurien Shop \r[ v1.2 ]\y:^nCredite:\rAaron %d"credits); 
    new 
menu menu_create(Temp"Furien")
    
menu_additem(menu"\ySuperKnife \r[ 2X ]\y - \r5 Credite""1"0);
    
menu_additem(menu"\yTiger Knife \r[ 3X ]\y - \r15 Credite""2");
    
menu_additem(menu"\yHE Grenade - \r5 Credite""3");
    
menu_additem(menu"\y50 HP - \r5 Credite""4"0);
    
menu_additem(menu"\y100 AP - \r5 Credite""5"0);
    
menu_additem(menu"\yNo Flash \d( Only CT )""6"0);
    
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
}

public 
Furien(idmenuitem) {
    
    if( 
item == MENU_EXIT )
    {
        return 
1;
    }
    
    new 
data ], szName 64 ];
    new 
accesscallback;
    
menu_item_getinfo menuitemaccessdata,charsmax data ), szName,charsmax szName ), callback );
    new 
key str_to_num data );
    
    switch ( 
key )
    {  
        
        case 
1:
        {
            if( 
cs_get_user_team(id) == CS_TEAM_T)
            {
                new 
iCredits fcs_get_user_credits id ) - 5;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai suficiente credite."Prefix );
                    return 
1;
                    
                }
                else
                { 
                    
superknife2Xid ] = true;
                    
superknife3Xid ] = false;
                    
g_HasHarryWandid ] = false;
                    
                    
ColorChat(idGREEN"%s Ai cumparat Super-Knife [ 2x ]."Prefix );
                    
CurrWeaponid );
                    
                    
fcs_set_user_creditsidiCredits );
                    return 
1;
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Teroristi au acces la accest meniu."Prefix );
            }
        }
        
        case 
2:
        {
            if( 
cs_get_user_team(id) == CS_TEAM_T)
            {
                new 
iCredits fcs_get_user_credits id ) - 15;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"!%s Nu ai suficiente credite."Prefix);
                    return 
1;
                    
                }
                else
                {
                    
superknife2Xid ] = false;
                    
superknife3Xid ] = true;
                    
g_HasHarryWandid ] = false;
                    
CurrWeaponid );
                    
                    
ColorChat(idGREEN"%s Ai cumparat Tiger Knife [ 3x ]."Prefix );
                    
fcs_set_user_creditsidiCredits );
                    return 
1;
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Teroristi au acces la accest meniu."Prefix );
            }
        } 
        
        case 
3:
        {
                if(
Hegrnd_Countdown[id]) {
                    if(
LastMessage[id] < get_gametime()) {
                        
LastMessage[id] = get_gametime() + 1.0;
                        
set_hudmessage(2551700, -1.00.8706.01.0)
                        
show_hudmessage id"Vei putea cumpara grenada in %d secund%s.",Hegrnd_Countdown[id], Hegrnd_Countdown[id] > "e" "a");
                    }
                }
            
                else if ( 
buyhegrnd id ) ) {
                
                    
Hegrnd_Countdown[id] = 10;
                    
CountDown_HeGrnd(id);
                }
        }
        
        case 
4:
        {
            if( 
cs_get_user_team(id) == CS_TEAM_T)
            {
                new 
iCredits fcs_get_user_credits id ) - 5;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai suficiente credite."Prefix);
                    return 
1;
                    
                }
                else
                {
                    new 
Health get_user_health id );
                    if ( 
Health 250 ) {
                        
fm_set_user_healthidget_user_health id ) + 50 );
                        
ColorChat(idGREEN"%s Ai cumparat 50 HP."Prefix );
                        
fcs_set_user_credits idiCredits );
                        return 
1;
                    }
                    
                    if ( 
Health >= 250 ) {
                        
                        
ColorChatidGREEN"%s Nu poti cumpara mai mult de 250 HP."Prefix);
                        return 
1;
                    }
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Teroristi au acces la accest meniu."Prefix );
            }
        }
        
        case 
5:
        {
            if( 
cs_get_user_team(id) == CS_TEAM_T)
            {
                new 
iCredits fcs_get_user_credits id ) - 5;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai suficiente credite."Prefix);
                    return 
1;
                    
                }
                else
                {
                    new 
Armor get_user_armor id );
                    if ( 
Armor 300 ) {
                        
fm_set_user_armoridget_user_armor id ) + 100 );
                        
ColorChat(idGREEN"%s Ai cumparat 100 AP."Prefix );
                        
fcs_set_user_credits idiCredits );
                        return 
1;
                    }
                    
                    if ( 
Armor >= 300 ) {
                        
                        
ColorChatidGREEN"%s Nu poti cumpara mai mult de 300 AP."Prefix);
                        return 
1;
                    }
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Teroristi au acces la accest meniu."Prefix );
            }
        }
        case 
6:
        {
            if( 
cs_get_user_team(id) == CS_TEAM_CT)
            {
                new 
iCredits fcs_get_user_credits id ) - 5;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai credite suficiente."Prefix);
                    return 
1;
                    
                }
                else
                {
                    
HaveNoFlash id ] = true;
                    
                    
ColorChat(idGREEN"%s Ai cumparat No Flash."Prefix );
                    
fcs_set_user_credits(idiCredits);
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Counter-Teroristi au acces la accest meniu."Prefix );
            }
        }
        
        
    }
    
menu_destroy(menu);
    return 
1;
}

public 
AntiFurien(idmenuitem ) {
    
    if( 
item == MENU_EXIT )
    {
        return 
1;
    }
    
    new 
data ], szName 64 ];
    new 
accesscallback;
    
menu_item_getinfo menuitemaccessdata,charsmax data ), szName,charsmax szName ), callback );
    new 
key str_to_num data );
    
    switch ( 
key )
    {
        case 
1:
        {
            if( 
cs_get_user_team(id) == CS_TEAM_CT)
            {
                if( 
Upgradeid ] )
                {
                    
ColorChat(idGREEN"%s Poti upgrada HP si AP doar o data pe runda"Prefix );
                }
                else
                {
                    
Pack(id);
                    
Upgradeid ] = true;
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Counter-Teroristi au acces la accest meniu."Prefix );
            }
            
        }  
        case 
2:
        {
            
            if( 
cs_get_user_team(id) == CS_TEAM_CT)
            {
                new 
iCredits fcs_get_user_credits id ) - 50;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai suficiente credite."Prefix );
                    return 
1;
                    
                }
                else
                { 
                    
                    
get_harryid )
                    
                    
ColorChat(idGREEN"%s Ai cumparat Harry Potter."Prefix );
                    
fcs_set_user_credits idiCredits );
                    return 
1;
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Counter-Teroristi au acces la accest meniu."Prefix );
            }
        }
        case 
3:
        {
            
            if( 
cs_get_user_team(id) == CS_TEAM_CT)
            {
                new 
iCredits fcs_get_user_credits id ) - 2;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai suficiente credite."Prefix);
                    return 
1;
                    
                }
                else
                { 
                    
fm_give_item id"item_thighpack" )
                    
ColorChat(idGREEN"%s Ai cumparat Defuse KIT."Prefix );
                    
fcs_set_user_credits idiCredits );
                    return 
1;
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Counter-Teroristi au acces la accest meniu."Prefix );
            }
        }
        
        case 
4:
        {
            
            if( 
cs_get_user_team(id) == CS_TEAM_CT)
            {
                new 
iCredits fcs_get_user_credits id ) - 5;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai suficiente credite."Prefix);
                    return 
1;
                    
                }
                else
                {
                    new 
Health get_user_health id );
                    if ( 
Health 250 ) {
                        
fm_set_user_healthidget_user_health id ) + 50 );
                        
ColorChat(idGREEN"%s Ai cumparat 50 HP."Prefix );
                        
fcs_set_user_credits idiCredits );
                        return 
1;
                    }
                    
                    if ( 
Health >= 250 ) {
                        
                        
ColorChatidGREEN"%s Nu poti cumpara mai mult de 250 HP."Prefix );
                        return 
1;
                    }
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Counter-Teroristi au acces la accest meniu."Prefix );
            }
        }
        
        case 
5:
        {
            
            if( 
cs_get_user_team(id) == CS_TEAM_CT)
            {
                new 
iCredits fcs_get_user_credits id ) - 5;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai credite suficiente."Prefix);
                    return 
1;
                    
                }
                else
                {
                    new 
Armor get_user_armor id );
                    if ( 
Armor 300 ) {
                        
fm_set_user_armoridget_user_armor id ) + 100 );
                        
ColorChat(idGREEN"%s Ai cumparat 100 AP."Prefix );
                        
fcs_set_user_credits idiCredits );
                        return 
1;
                    }
                    
                    if ( 
Armor >= 300 ) {
                        
                        
ColorChatidGREEN"%s Nu poti cumpara mai mult de 300 AP." );
                        return 
1;
                    }
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Counter-Teroristi au acces la accest meniu."Prefix );
            }
        }
        case 
6:
        {
            
            if( 
cs_get_user_team(id) == CS_TEAM_CT)
            {
                new 
iCredits fcs_get_user_credits id ) - 5;
                if( 
iCredits )
                {
                    
ColorChatidGREEN"%s Nu ai credite suficiente."Prefix);
                    return 
1;
                    
                }
                else
                {
                    
HaveNoFlash id ] = true;
                    
                    
ColorChat(idGREEN"%s Ai cumparat No Flash."Prefix );
                    
fcs_set_user_credits(idiCredits);
                }
            }
            else
            {
                
ColorChat(idGREEN"%s Doar Counter-Teroristi au acces la accest meniu."Prefix );
            }
            
        }
        
        
        case 
7:
        {
            
set_user_pet(id)    
        }
    }
    
menu_destroy(menu);
    return 
1;
}

public 
eventFlash(id)
{
    if(
is_user_connected(id) && HaveNoFlash id ])
    {
        
message_begin(MSG_ONEg_msgScreenFade, {0,0,0}, id)
        
write_short(1)
        
write_short(1)
        
write_short(1)
        
write_byte(0)
        
write_byte(0)
        
write_byte(0)
        
write_byte(255)
        
message_end()
    }
}

public 
Player_TakeDamage iVictimiInflictoriAttackerFloat:fDamageiDamageBits 
{
    if ( 
IsPlayer iAttacker ) ) {
        if( 
iInflictor == iAttacker && superknife2X iAttacker ] && is_user_aliveiAttacker ) && get_user_weaponiAttacker ) == CSW_KNIFE && cs_get_user_teamiAttacker ) == CS_TEAM_T )
        {
            
SetHamParamFloat4fDamage 2.0);
            return 
HAM_HANDLED;
        }
        if( 
iInflictor == iAttacker && superknife3X iAttacker ] && is_user_aliveiAttacker ) && get_user_weaponiAttacker ) == CSW_KNIFE && cs_get_user_teamiAttacker ) == CS_TEAM_T )
        {
            
SetHamParamFloat4fDamage 3.0);
            return 
HAM_HANDLED;
        }
    }
    
    return 
HAM_IGNORED;
}

// -- // -- // ---> | Pack HP & AP | <--- // -- // -- //

public Packid ) {
    
    new 
iCredits fcs_get_user_credits id ) - 10;
    if( 
iCredits )
    {
        
ColorChatidGREEN"%s Nu ai suficiente credite."Prefix);
    return 
1;
                        
    }
    else
    { 
        new 
Armor get_user_armor id );
                        
        if ( 
Armor <= 250 )
        {
            
fm_set_user_armor idget_user_armor id ) + 300 );
        }
                        
        new 
Health get_user_health id );
                        
        if ( 
Health <= 250 )
        {
            
fm_set_user_healthidget_user_health id ) + 300 );
            
ColorChat(idGREEN"%s Ai cumparat Upgrade la Health & Armor!"Prefix );
        }
                        
            
fcs_set_user_credits idiCredits );
        return 
1;
        }
    
    return 
0;
}


// -- | He Grenade | -- //

public CountDown_HeGrnd id ) {
    
    if(!
is_user_alive(id) || get_user_team id ) != 1) {
        
Hegrnd_Countdown[id] = 0;
    }
    else if(
Hegrnd_Countdown[id] > 0) {
        
set_hudmessage(2551700, -1.00.8706.01.0)
        
show_hudmessage(id"Vei putea cumpara grenada in %d secund%s"Hegrnd_Countdown[id], Hegrnd_Countdown[id] == "a" "e");
        
Hegrnd_Countdown[id]--;
        
set_task(1.0"CountDown_HeGrnd"id);
    }
    else if(
Hegrnd_Countdown[id] <= 0) {
        
set_hudmessage(2551700, -1.00.8706.01.0)
        
show_hudmessage(id"Acum poti cumpara grenada");
        
Hegrnd_Countdown[id] = 0;
    }
    
}
    
boolbuyhegrnd id ) {
    
    
fm_give_item id"weapon_hegrenade" );
    return 
true;
}

//////////////////// ------------ || Hanrry Potter Wand || ----------- ///////////////////////////

public GiveHarryidlevelcid ) {
    
    if( !
cmd_accessidlevelcid) ) 
        return 
PLUGIN_HANDLED;
    
    new 
szTtarget32 ], szAmmoHarry21 ];
    
    
read_argv1szTtarget31 );
    
read_argv2szAmmoHarry20 );

    new 
iPlayer cmd_targetidszTtarget);

    new 
szAdminName32 ], szPlayerName32 ];

    
get_user_nameidszAdminName31 );
    
get_user_nameiPlayerszPlayerName31 );

    if( !
iPlayer )
        return 
PLUGIN_HANDLED;

    if( !
is_user_aliveiPlayer ) ) {

        
client_printidprint_console"Jucatorul %s nu este in viata !"szPlayerName );
        return 
1;
    }

    if( 
g_HasHarryWandiPlayer ] ) {

        
client_printidprint_console"Jucatorul %s are deja bagheta !"szPlayerName );
        return 
1;
    }

    else {
    
        new 
AmmoForMagic str_to_numszAmmoHarry );

        
ColorChat0GREEN"^x04%s^x01 Adminul^x03 %s i-a dat lui^x03 %s^x01 bagheta lui Harry cu^x03 %d ammo^x01 !"TagszAdminNameszPlayerNameszAmmoHarry );

        
get_harryiPlayer );
        
Harry_AmmoiPlayer ] += AmmoForMagic;
    }

    return 
PLUGIN_CONTINUE;
}

public 
get_harryid ) {

    if( 
is_user_aliveid ) ) {

        
superknife2Xid ] = false;
        
superknife3Xid ] = false;
        
g_HasHarryWandid ] = true;
        
engclient_cmdid"weapon_knife" );

        
Harry_Ammoid ] = get_pcvar_numHarryAmmo );
    }

    else {

        
client_printidprint_console"Jucatorul nu este in viata! " );
        
g_HasHarryWandid ] = false;

        return 
1;
    }

    return 
1;
}

public 
CurrentWeaponid )
    if( 
get_user_weaponid ) == CSW_KNIFE && g_HasHarryWandid ] )
        
set_pevidpev_viewmodel2HarryModel );



public 
Harry_CmdStartiduc_handleseed ) {
    
    if( 
is_user_aliveid ) && g_HasHarryWandid ] ) {
        
        static 
CurButton;
        
CurButton get_ucuc_handleUC_Buttons );
        new 
Float:flNextAttack get_pdata_floatid83);

        if( 
CurButton IN_ATTACK ) {

            if( 
get_user_weaponid ) == CSW_KNIFE && g_HasHarryWandid ] ) {

                if( 
Harry_Ammoid ] > 0  && flNextAttack <= 0.0 ) {

                    if( 
get_gametime(  ) - HarryLastShotTimeid ] > HARRY_WAND_SPEED ) {
                        
                        
set_weapon_animidHARRY_WAND_FIRE );
                        
emit_soundidCHAN_WEAPONHarryFireSoundVOL_NORMATTN_NORM0PITCH_NORM );
                        
                        
Harry_Fireid );

                        if( 
Harry_Ammoid ] > ) {
                            
                            
set_hudmessage01272550.010.8506.01.0 );
                            
show_hudmessageid"Remaining Ammo: %d !"Harry_Ammoid ] );
                        }
                        
                        else if( 
Harry_Ammoid ] <= ) {
                            
                            
set_hudmessage255000.010.9006.01.0 );
                            
show_hudmessageid"No Ammo !" );
                            
                        }
                        
                        static 
Float:Punch_Angles];
                        
                        
Punch_Angles0]  = -5.0;
                        
Punch_Angles] = HARRY_WAND_RECOIL;
                        
Punch_Angles] = HARRY_WAND_RECOIL;
                        
                        
set_pevidpev_punchanglePunch_Angles );

                        
Harry_Ammoid ] -= 1;
                        
HarryLastShotTimeid ] = get_gametime(  );
                        
                    }    
                }
                
                
CurButton &= ~IN_ATTACK;
                
set_ucuc_handleUC_ButtonsCurButton );
            }        
        }
        
        else if( 
CurButton IN_ATTACK2 ) {

            if( 
get_user_weaponid ) == CSW_KNIFE && g_HasHarryWandid ] ) {

                if( 
Harry_Ammoid ] >= 5  && flNextAttack <= 0.0 ) {

                    if( 
get_gametime(  ) - HarryLastShotTimeid ] > HARRY_WAND_SPEED2 ) {
                        
                        
set_weapon_animidHARRY_WAND_FIRE2 );
                        
emit_soundidCHAN_WEAPONHarryFireSoundVOL_NORMATTN_NORM0PITCH_NORM );
                        
                        
Harry_Fire2id );

                        
set_hudmessage01272550.010.8506.01.0 );
                        
show_hudmessageid"Remaining Ammo: %d !"Harry_Ammoid ] );
                        
                        static 
Float:Punch_Angles];
                        
                        
Punch_Angles] = -5.0;
                        
Punch_Angles] = HARRY_WAND_RECOIL;
                        
Punch_Angles] = HARRY_WAND_RECOIL;
                        
                        
set_pevidpev_punchanglePunch_Angles );

                        
Harry_Ammoid ] -= 3;
                        
HarryLastShotTimeid ] = get_gametime(  );
                        
                    }    
                }
                
                
CurButton &= ~IN_ATTACK2;
                
set_ucuc_handleUC_ButtonsCurButton );
            }
        }
    }
    
    else if( 
is_user_alive id ) && !g_HasHarryWandid ] )
        return 
PLUGIN_CONTINUE;

    return 
PLUGIN_CONTINUE;
}

public 
Harry_Fireid ) {
    
    static 
VictimBodyEndOrigin], BeamOrigin];
    
get_user_originidBeamOrigin);
    
get_user_originidEndOrigin);

    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byte);
    
write_shortid 0x1000 );
    
write_coordBeamOrigin] );    // Start X
    
write_coordBeamOrigin] );    // Start Y
    
write_coordBeamOrigin] );    // Start Z
    
write_shortHarryBeam);        // Sprite
    
write_byte);              // Start frame                
    
write_byte);             // Frame rate                    
    
write_byte);            // Life
    
write_byte40 );           // Line width                
    
write_byte);            // Noise
    
write_byte108 );         // Red
    
write_byte236 );            // Green
    
write_byte23 );            // Blue
    
write_byte150 );             // Brightness                    
    
write_byte25 );              // Scroll speed                    
    
message_end(  );

    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byte);
    
write_coordEndOrigin] );
    
write_coordEndOrigin] );
    
write_coordEndOrigin] );
    
write_shortHarryExp );    // sprite
    
write_byte10 );        // scale in 0.1's
    
write_byte15 );        // framerate
    
write_byte);        // flags
    
message_end(  );
    
    
get_user_aimingidVictimBodyget_pcvar_numHarryDistance ) );

    if( 
is_user_connectedVictim ) ) {

        new 
Float:Damage floatget_damage_bodyBodyget_pcvar_floatHarryDamageCvar ) ) );
        
        new 
Float:VictimOrigin];
        
VictimOrigin] = floatEndOrigin] );
        
VictimOrigin] = floatEndOrigin] );
        
VictimOrigin] = floatEndOrigin] );
        
        if( 
get_user_healthVictim ) - get_pcvar_floatHarryDamageCvar ) >= && is_user_aliveVictim ) && !fm_get_user_godmodeVictim ) && get_user_teamVictim ) != get_user_teamid ) ) {

            new 
iOrigin];
            
get_user_originVictimiOrigin);

            
message_beginMSG_PVSSVC_TEMPENTITYiOrigin ); 
            
write_byte21 );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] + 60 );    // end axis + radius
            
write_shortHarryExp );    // sprite
            
write_byte);        // startfrate
            
write_byte);        // framerate
            
write_byte10 );        // life in 0.1 sec
            
write_byte60 );        // width
            
write_byte);        // amplitude
            
write_byte);        // red
            
write_byte200 );        // green
            
write_byte200 );        // blue
            
write_byte153 );        // brightness
            
write_byte);        // speed
            
message_end(  );
            
            
message_beginMSG_BROADCASTSVC_TEMPENTITY );
            
write_byte15 );
            
write_coordiOrigin] );     // start position (X)
            
write_coordiOrigin] );     // start position (Y)
            
write_coordiOrigin] + 40 ); // start position (Z)
            
write_coordiOrigin] );     // end position (X)
            
write_coordiOrigin] );    // end position (Y)
            
write_coordiOrigin] );    // end position (Z)
            
write_shortDeathSprite );    // sprite index
            
write_byte50 );        // count
            
write_byte20 );        // life in 0.1's
            
write_byte);        // scale in 0.1's
            
write_byte50 );        // velocity along vector in 10's
            
write_byte10 );        // randomness of velocity in 10's
            
message_end(  );
            
            
make_knockbackVictimVictimOriginget_pcvar_floatHarryDamageCvar ) );
            
            
ExecuteHamHam_TakeDamageVictimididDamageDMG_NERVEGAS );
            
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid"Damage" ), _Victim );
            
write_byte);
            
write_byte);
            
write_longDMG_SHOCK );
            
write_coord);
            
write_coord);
            
write_coord);
            
message_end(  );
            
            
FadeScreenVictim4.0255122122100 );
            
ShakeScreenVictim3.0 );
        }

        else if( 
get_user_healthVictim ) - get_pcvar_floatHarryDamageCvar ) < && is_user_aliveVictim ) && !fm_get_user_godmodeVictim ) && get_user_teamVictim ) != get_user_teamid ) ) {
            
            new 
iOrigin];
            
get_user_originVictimiOrigin);

            
message_beginMSG_PVSSVC_TEMPENTITYiOrigin ); 
            
write_byte21 );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] + 60 );    // end axis + radius
            
write_shortHarryExp );    // sprite
            
write_byte);        // startfrate
            
write_byte);        // framerate
            
write_byte10 );        // life in 0.1 sec
            
write_byte60 );        // width
            
write_byte);        // amplitude
            
write_byte);        // red
            
write_byte200 );        // green
            
write_byte200 );        // blue
            
write_byte153 );        // brightness
            
write_byte);        // speed
            
message_end(  );
            
            
message_beginMSG_BROADCASTSVC_TEMPENTITY );
            
write_byte15 );
            
write_coordiOrigin] );     // start position (X)
            
write_coordiOrigin] );     // start position (Y)
            
write_coordiOrigin] + 40 ); // start position (Z)
            
write_coordiOrigin] );     // end position (X)
            
write_coordiOrigin] );    // end position (Y)
            
write_coordiOrigin] );    // end position (Z)
            
write_shortDeathSprite );    // sprite index
            
write_byte50 );        // count
            
write_byte20 );        // life in 0.1's
            
write_byte);        // scale in 0.1's
            
write_byte50 );        // velocity along vector in 10's
            
write_byte10 );        // randomness of velocity in 10's
            
message_end(  );
            
            
make_knockbackVictimVictimOriginget_pcvar_floatHarryDamageCvar ) );
            
            
death_messageidVictim1"Magic Wand" );
        }
    }

    else {

        static 
ClassName32 ];
        
pevVictimpev_classnameClassNamecharsmaxClassName ) );

        if( 
equalClassName"func_breakable" ) )
            if( 
entity_get_floatVictimEV_FL_health ) <= 80 )
                
force_useidVictim );
    }
    
    
emit_soundidCHAN_WEAPONHarryHitSoundVOL_NORMATTN_NORM0PITCH_NORM );
}

public 
Harry_Fire2id ) {
    
    static 
VictimBodyEndOrigin[3], BeamOrigin[3];
    
get_user_originidBeamOrigin) ;
    
get_user_originidEndOrigin);

    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byte);
    
write_shortid 0x1000 );
    
write_coordBeamOrigin] );    // Start X
    
write_coordBeamOrigin] );    // Start Y
    
write_coordBeamOrigin] );    // Start Z
    
write_shortHarryBeam );    // Sprite
    
write_byte);              // Start frame                
    
write_byte);             // Frame rate                    
    
write_byte);            // Life
    
write_byte40 );           // Line width                
    
write_byte);            // Noise
    
write_byte150 );         // Red
    
write_byte22 );            // Green
    
write_byte235 );            // Blue
    
write_byte150 );             // Brightness                    
    
write_byte25 );              // Scroll speed                    
    
message_end(  );

    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byte);
    
write_coordEndOrigin] );
    
write_coordEndOrigin] );
    
write_coordEndOrigin] );
    
write_shortHarryExp2 );
    
write_byte10 );
    
write_byte15 );
    
write_byte);
    
message_end(  );
    
    
get_user_aimingidVictimBodyget_pcvar_numHarryDistance ) );

    if( 
is_user_aliveVictim ) ) {

        new 
Float:Damage floatget_damage_bodyBodyget_pcvar_floatHarryDamageCvar ) ) );

        new 
Float:VictimOrigin];
        
VictimOrigin] = floatEndOrigin] );
        
VictimOrigin] = floatEndOrigin] );
        
VictimOrigin] = floatEndOrigin] );
        
        if( 
get_user_healthVictim ) - get_pcvar_floatHarryDamageCvar2 ) >= && is_user_aliveVictim ) && !fm_get_user_godmodeVictim ) && get_user_teamVictim ) != get_user_teamid ) ) {
            
            new 
iOrigin];
            
get_user_originVictimiOrigin);

            
message_beginMSG_PVSSVC_TEMPENTITYiOrigin ); 
            
write_byte21 );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] + 60 );    // end axis + radius
            
write_shortHarryExp2 );    // sprite
            
write_byte);        // startfrate
            
write_byte);        // framerate
            
write_byte10 );        // life in 0.1 sec
            
write_byte60 );        // width
            
write_byte);        // amplitude
            
write_byte217 );        // red
            
write_byte132 );        // green
            
write_byte47 );        // blue
            
write_byte153 );        // brightness
            
write_byte);        // speed
            
message_end(  );
            
            
message_beginMSG_BROADCASTSVC_TEMPENTITY );
            
write_byte15 );
            
write_coordiOrigin] );     // start position (X)
            
write_coordiOrigin] );     // start position (Y)
            
write_coordiOrigin] + 40 ); // start position (Z)
            
write_coordiOrigin] );     // end position (X)
            
write_coordiOrigin] );    // end position (Y)
            
write_coordiOrigin] );    // end position (Z)
            
write_shortDeathSprite );    // sprite index
            
write_byte50 );        // count
            
write_byte20 );        // life in 0.1's
            
write_byte);        // scale in 0.1's
            
write_byte50 );        // velocity along vector in 10's
            
write_byte10 );        // randomness of velocity in 10's
            
message_end(  );
            
            
make_knockbackVictimVictimOriginget_pcvar_floatHarryDamageCvar2 ) );
            
            
ExecuteHamHam_TakeDamageVictimididDamageDMG_NERVEGAS );
            
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid"Damage" ), _Victim );
            
write_byte);
            
write_byte);
            
write_longDMG_NERVEGAS );
            
write_coord) ;
            
write_coord);
            
write_coord);
            
message_end(  );
            
            
FadeScreenVictim4.002550100 );
            
ShakeScreenVictim3.0 );
        }

        else if( 
get_user_healthVictim ) - get_pcvar_floatHarryDamageCvar2 ) < && is_user_aliveVictim ) && !fm_get_user_godmodeVictim ) && get_user_teamVictim ) != get_user_teamid ) ) {
            
            new 
iOrigin];
            
get_user_originVictimiOrigin);

            
message_beginMSG_PVSSVC_TEMPENTITYiOrigin ); 
            
write_byte21 );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] );
            
write_coordiOrigin] + 60 );    // end axis + radius
            
write_shortHarryExp2 );    // sprite
            
write_byte);        // startfrate
            
write_byte);        // framerate
            
write_byte10 );        // life in 0.1 sec
            
write_byte60 );        // width
            
write_byte);        // amplitude
            
write_byte217 );        // red
            
write_byte132 );        // green
            
write_byte47 );        // blue
            
write_byte153 );        // brightness
            
write_byte);        // speed
            
message_end(  );
            
            
message_beginMSG_BROADCASTSVC_TEMPENTITY );
            
write_byte15 );
            
write_coordiOrigin] );     // start position (X)
            
write_coordiOrigin] );     // start position (Y)
            
write_coordiOrigin] + 40 ); // start position (Z)
            
write_coordiOrigin] );     // end position (X)
            
write_coordiOrigin] );    // end position (Y)
            
write_coordiOrigin] );    // end position (Z)
            
write_shortDeathSprite );    // sprite index
            
write_byte50 );        // count
            
write_byte20 );        // life in 0.1's
            
write_byte);        // scale in 0.1's
            
write_byte50 );        // velocity along vector in 10's
            
write_byte10 );        // randomness of velocity in 10's
            
message_end(  );
            
            
make_knockbackVictimVictimOriginget_pcvar_floatHarryDamageCvar2 ) );
            
            
death_messageidVictim1"Double Magic Wand" );
        }
    }

    else {

        static 
ClassName32 ];
        
pevVictimpev_classnameClassNamecharsmaxClassName ) );

        if( 
equalClassName"func_breakable" ) )
            if( 
entity_get_floatVictimEV_FL_health ) <= 80 )
                
force_useidVictim );
    }

    
emit_soundidCHAN_WEAPONHarryHitSoundVOL_NORMATTN_NORM0PITCH_NORM );
}

public 
make_knockbackVictimFloat:origin], Float:maxspeed ) {

    new 
Float:fVelocity];
    
    
kickbackVictimoriginmaxspeedfVelocity );
    
entity_set_vectorVictimEV_VEC_velocityfVelocity );
    
    return( 
);
}

stock ShakeScreenid, const Float:iSeconds ) {

    
message_beginMSG_ONEget_user_msgid"ScreenShake" ), { 00}, id );
    
write_shortfloatround4096.0 iSecondsfloatround_round ) );
    
write_shortfloatround4096.0 iSecondsfloatround_round ) );
    
write_short1<<13 );
    
message_end(  );
}

stock FadeScreenid, const Float:iSeconds, const iRed, const iGreen, const iBlue, const iAlpha ) {
      
    
message_beginMSG_ONEget_user_msgid"ScreenFade" ), _id );
    
write_shortfloatround4096.0 iSecondsfloatround_round ) );
    
write_shortfloatround4096.0 iSecondsfloatround_round ) );
    
write_short0x0000 );
    
write_byteiRed );
    
write_byteiGreen );
    
write_byteiBlue );
    
write_byteiAlpha );
    
message_end(  );
}        

stock kickbackentFloat:fOrigin], Float:fSpeedFloat:fVelocity] ) {

    new 
Float:fEntOrigin];
    
entity_get_vectorentEV_VEC_originfEntOrigin );
    
    new 
Float:fDistance];
    
fDistance] = fEntOrigin] - fOrigin];
    
fDistance] = fEntOrigin] - fOrigin];
    
fDistance] = fEntOrigin] - fOrigin];

    new 
Float:fTime =( vector_distancefEntOriginfOrigin ) / fSpeed );
    
fVelocity] = fDistance] / fTime;
    
fVelocity] = fDistance] / fTime;
    
fVelocity] = fDistance] / fTime;
    
    return( 
fVelocity] && fVelocity] && fVelocity] );
}

// stock from "m79"
stock death_messageKillerVictimScoreBoard, const Weapon[  ] ) {
    
    
set_msg_blockget_user_msgid"DeathMsg" ), BLOCK_SET );

    
ExecuteHamBHam_KilledVictimKiller);

    
set_msg_blockget_user_msgid"DeathMsg" ), BLOCK_NOT );

    
make_deathmsgKillerVictim0Weapon );
    
cs_set_user_moneyKillercs_get_user_moneyKiller ) + get_pcvar_numHarryKillMoney ) );
    
    if( 
ScoreBoard ) {

        
message_beginMSG_BROADCASTget_user_msgid"ScoreInfo" ) );
        
write_byteKiller );
        
write_shortpevKillerpev_frags ) );
        
write_shortcs_get_user_deathsKiller ) );
        
write_short);
        
write_shortget_user_teamKiller ) );
        
message_end(  );
        
        
message_beginMSG_BROADCASTget_user_msgid"ScoreInfo" ) );
        
write_byteVictim );
        
write_shortpevVictimpev_frags ) );
        
write_shortcs_get_user_deathsVictim ) );
        
write_short);
        
write_shortget_user_teamVictim ) );
        
message_end(  );
    }
}

stock set_weapon_animidanim ) {

    
set_pevidpev_weaponanimanim );

    if( 
is_user_aliveid ) ) {

        
message_beginMSG_ONESVC_WEAPONANIM_id );
        
write_byteanim );
        
write_bytepevidpev_body ) );
        
message_end(  );
    }
}

stock get_damage_bodybodyFloat:fDamage ) {

    switch( 
body ) {

        case 
HIT_HEADfDamage *= 4.0;

        case 
HIT_STOMACHfDamage *= 1.1;

        case 
HIT_CHESTfDamage *= 1.5;

        case 
HIT_LEFTARMfDamage *= 0.77;

        case 
HIT_RIGHTARMfDamage *= 0.77;

        case 
HIT_LEFTLEGfDamage *= 0.75;

        case 
HIT_RIGHTLEGfDamage *= 0.75;

        default: 
fDamage *= 1.0;
    }
    
    return 
floatroundfDamage );

i use this code,, need to add menu for give and remove credits

Last edited by zombiesucker; 09-23-2015 at 15:41.
zombiesucker is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 09-25-2015 , 09:37   Re: Give and remove Credits
Reply With Quote #6

amx_give_credits <name> <credits>
amx_set_credits <name> <credits>
Attached Files
File Type: sma Get Plugin or Get Source (DontKnowTheName.sma - 344 views - 46.2 KB)
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
zombiesucker
Member
Join Date: Sep 2015
Old 09-25-2015 , 15:29   Re: Give and remove Credits
Reply With Quote #7

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
amx_give_credits <name> <credits>
amx_set_credits <name> <credits>
Big thanks,, do you know how make a menu for set and give credits ??
when you click on the give credits it will show you for who you need to give credits
zombiesucker 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 08:35.


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