Raised This Month: $12 Target: $400
 3% 

*[REQUEST]* ExTra Item with Duble Damage & Skin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mFsethh
Senior Member
Join Date: Jun 2014
Old 09-25-2014 , 04:51   *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #1

Hallo AlL
I am looking for plugin in my Extra items Shop. When player Say: /shop then can see Extra items and one of the items is Golden AK-47.
When player buy Golden AK-47 [10000$], player's skin are changed to new "Golden.mdl" skin. Player with Golden AK-47 talke duble damage and Golden AK-47 have skin too "Golden_AK-47.mdl".

PLzzzz without bad comments (Use google, n00b, search, ...). I just want code of the plugin I need.

THX Whery much...

Last edited by mFsethh; 09-25-2014 at 05:06. Reason: Sorry for my ban english...
mFsethh is offline
Send a message via Yahoo to mFsethh Send a message via Skype™ to mFsethh
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 09-25-2014 , 07:41   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #2

if i understand u right u mean u want to do skin for ak47 and double damage if yes here u go:
[NOT TESTED]
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Golden AK Shop"
#define VERSION "1.0"
#define AUTHOR "/A/"
// Shop menu by bizzard
// duble shot by ConnorMcLeod

new g_bGoldenAk47[33]
new 
cash[33];
new 
g_iMaxPlayers;
new 
g_bGoldenSkinAk47[33]
new const 
g_szGoldenAk[] = "models/goldenak.mdl"

public plugin_init() {
    
    
register_clcmd("say /shop""cmdShop"0);
    
register_event("CurWeapon""event_current_weapon""be""1=1");
    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage");
    
    
g_iMaxPlayers get_maxplayers();
}

public 
plugin_precache(){
    
precache_model(g_szGoldenAk)
}

public 
cmdShop(id)
{

    new 
menu menu_create("\rShop Menu:""cmdShop_handler");
    
    
menu_additem(menu"\wGolden Ak47""1"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

}

public 
cmdShop_handler(idmenuitem)
{

    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }


    new 
data[6], szName[64];
    new 
accesscallback;

    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);

    
cash[id] = cs_get_user_money(id);
    
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            if(
cash[id] > 10000)
            {
                
client_print(idprint_chat"You Have Bought Golden Ak47");
                
cs_set_user_money(idcash[id] - 10000);
                
give_item(id"weapon_ak47");
           
g_bGoldenAk47[id] = true
           g_bGoldenSkinAk47
[id] = true
            
}
            else {
                
client_print(idprint_chat"You Dont Have Enough Money");
           
g_bGoldenAk47[id] = false
           g_bGoldenSkinAk47
[id] = false
            
}
        }
    }


    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}  

public 
Player_TakeDamage(idinflictorattackerFloat:damagedamagebits

    if (
g_bGoldenAk47[id])
    if(    !(
<= attacker <= g_iMaxPlayers)  
    ||    
attacker != inflictor 
    
||    get_user_weapon(attacker) != CSW_AK47    
        return 
HAM_IGNORED
    
SetHamParamFloat(4damage 2); //Here knife does double damage, ofc you can set it to 0.0 or anything. 
    
return HAM_HANDLED
  
}

public 
event_current_weapon(id){
    if (
read_data(2) == CSW_AK47 && g_bGoldenSkinAk47[id]){
        
set_pev(idpev_viewmodel2g_szGoldenAk)
    }
    return 
PLUGIN_CONTINUE

just type /shop and menu will open to u choose golden ak!
and upload to: models and his name is goldenak.mdl!!
Enjoy !

Last edited by Eviatar Mor; 09-25-2014 at 07:44.
Eviatar Mor is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-25-2014 , 09:06   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #3

Don't use CurWeapon Event for one single weapon, use Ham_Item_Deploy instead.
__________________
Kia is offline
mFsethh
Senior Member
Join Date: Jun 2014
Old 09-25-2014 , 12:54   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #4

But when player Have Golden AK-47 then Player's skin are changed too broo...
mFsethh is offline
Send a message via Yahoo to mFsethh Send a message via Skype™ to mFsethh
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 09-25-2014 , 13:01   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #5

Use Ham_Item_Deploy so you don't have to spam it with model replacement when ever CurWeapon Event is fired(which basically after every shots)

Last edited by RateX; 09-25-2014 at 13:02.
RateX is offline
mFsethh
Senior Member
Join Date: Jun 2014
Old 09-25-2014 , 13:03   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #6

Can you make me code PLzz? And add in shop "Golden AK-47" then [1000$] (show price)
mFsethh is offline
Send a message via Yahoo to mFsethh Send a message via Skype™ to mFsethh
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 09-25-2014 , 17:54   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #7

Quote:
Originally Posted by mFsethh View Post
But when player Have Golden AK-47 then Player's skin are changed too broo...
Try:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Golden AK Shop"
#define VERSION "1.0"
#define AUTHOR "/A/"
// Shop menu by bizzard
// duble shot by ConnorMcLeod

new g_bGoldenAk47[33]
new 
cash[33];
new 
g_iMaxPlayers;
new 
g_bGoldenSkinAk47[33]
new const 
g_szGoldenAk[] = "models/goldenak.mdl"

public plugin_init() {
    
    
register_clcmd("say /shop""cmdShop"0);
    
RegisterHamHam_Item_Deploy"weapon_ak47""Ak47_Model" 1)
    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage");
    
    
g_iMaxPlayers get_maxplayers();
}

public 
plugin_precache(){
    
precache_model(g_szGoldenAk)
}

public 
cmdShop(id)
{

    new 
menu menu_create("\rShop Menu:""cmdShop_handler");
    
    
menu_additem(menu"\wGolden Ak47""1"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

}

public 
cmdShop_handler(idmenuitem)
{

    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }


    new 
data[6], szName[64];
    new 
accesscallback;

    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);

    
cash[id] = cs_get_user_money(id);
    
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            if(
cash[id] > 1000)
            {
                
client_print(idprint_chat"You Have Bought Golden Ak47");
                
cs_set_user_money(idcash[id] - 10000);
                
give_item(id"weapon_ak47");
           
g_bGoldenAk47[id] = true
           g_bGoldenSkinAk47
[id] = true
            
}
            else {
                
client_print(idprint_chat"You Dont Have Enough Money");
           
g_bGoldenAk47[id] = false
           g_bGoldenSkinAk47
[id] = false
            
}
        }
    }


    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}  

public 
Player_TakeDamage(idinflictorattackerFloat:damagedamagebits

    if (
g_bGoldenAk47[id])
    if(    !(
<= attacker <= g_iMaxPlayers)  
    ||    
attacker != inflictor 
    
||    get_user_weapon(attacker) != CSW_AK47    
        return 
HAM_IGNORED
    
SetHamParamFloat(4damage 2); //Here knife does double damage, ofc you can set it to 0.0 or anything. 
    
return HAM_HANDLED
  
}
public 
Ak47_Modelplr 
{
    new 
id get_pdata_cbaseplr41); 
    if( 
is_user_alive(id) || is_user_connected(id) && g_bGoldenSkinAk47[id])   
        
set_pevidpev_viewmodel2g_szGoldenAk 

Quote:
Originally Posted by Kia View Post
Don't use CurWeapon Event for one single weapon, use Ham_Item_Deploy instead.
I Changed TO Ham_Item_Deploy .
Eviatar Mor is offline
mFsethh
Senior Member
Join Date: Jun 2014
Old 09-26-2014 , 04:46   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #8

But where is here player model? Do you understend me brother... When player buy Golden AK-47 then automaticly PLAYER's Skin are changed too... (models/Golden/Golden_Player.mdl)
mFsethh is offline
Send a message via Yahoo to mFsethh Send a message via Skype™ to mFsethh
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 09-26-2014 , 05:26   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #9

Try:
PHP Code:
/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <cstrike> 
#include <fun> 
#include <hamsandwich> 
#include <fakemeta> 

#define PLUGIN "Golden AK Shop" 
#define VERSION "1.0" 
#define AUTHOR "/A/" 
// Shop menu by bizzard 
// duble shot by ConnorMcLeod 

new g_bGoldenAk47[33
new 
cash[33]; 
new 
g_iMaxPlayers
new 
g_bGoldenSkinAk47[33
new const 
g_szGoldenAk[] = "models/goldenak.mdl" 

public plugin_init() 

     
    
register_clcmd("say /shop""cmdShop"0); 
    
RegisterHam(Ham_Item_Deploy"weapon_ak47""Ak47_Model" 1
    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage"); 
     
    
g_iMaxPlayers get_maxplayers(); 


public 
plugin_precache()

    
precache_model(g_szGoldenAk


public 
cmdShop(id

    new 
menu menu_create("\rShop Menu:""cmdShop_handler"); 
     
    
menu_additem(menu"\wGolden Ak47""1"0); 
     
    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 

    
menu_display(idmenu0); 


public 
cmdShop_handler(idmenuitem

    if(
item == MENU_EXIT
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
    new 
data[6], szName[64]; 
    new 
accesscallback
    
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback); 

    
cash[id] = cs_get_user_money(id); 
     
    new 
key str_to_num(data); 
    switch(
key
    { 
        case 
1
        { 
            if(
cash[id] > 10000
            { 
                
client_print(idprint_chat"You Have Bought Golden Ak47"); 
                
cs_set_user_money(idcash[id] - 10000); 
                
give_item(id"weapon_ak47"); 
                
set_pevidpev_viewmodel2g_szGoldenAk )
                
g_bGoldenAk47[id] = true 
                g_bGoldenSkinAk47
[id] = true 
            

            else
            { 
                
client_print(idprint_chat"You Dont Have Enough Money"); 
                
g_bGoldenAk47[id] = false 
                g_bGoldenSkinAk47
[id] = false 
            

        } 
    }
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED
}   

public 
Player_TakeDamage(idinflictorattackerFloat:damagedamagebits)  
{  
    if (
g_bGoldenAk47[id]) 
    if(    !(
<= attacker <= g_iMaxPlayers)   
    ||    
attacker != inflictor  
    
||    get_user_weapon(attacker) != CSW_AK47    )  
        return 
HAM_IGNORED;  
    
SetHamParamFloat(4damage 2); //Here knife does double damage, ofc you can set it to 0.0 or anything.  
    
return HAM_HANDLED;  
   

public 
Ak47_Modelplr )  

    new 
id get_pdata_cbaseplr41);  
    if( 
is_user_alive(id) || is_user_connected(id) && g_bGoldenSkinAk47[id])    
        
set_pevidpev_viewmodel2g_szGoldenAk )  

RateX is offline
mFsethh
Senior Member
Join Date: Jun 2014
Old 09-26-2014 , 05:58   Re: *[REQUEST]* ExTra Item with Duble Damage & Skin
Reply With Quote #10

Just help me one more think...
PHP Code:
"Ak47_model" 
Change to
PHP Code:
"models/.....mdl" 
?
PHP Code:
"Player_TakeDamage" 
Change to
PHP Code:
"models/....mdl" 
?

Last edited by mFsethh; 09-26-2014 at 05:59.
mFsethh is offline
Send a message via Yahoo to mFsethh Send a message via Skype™ to mFsethh
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 18:08.


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