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

extra Weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gian_Yagami
Member
Join Date: Apr 2014
Old 08-01-2014 , 11:27   extra Weapon
Reply With Quote #1

hello, how are you
I am thinking about add weapon without replace. I got native get_weaponname, how does it work? The syntax is written as:
Code:
get_weaponname ( id, weapon[], len )
anyone can explain to me how to use this code?
Gian_Yagami is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 08-01-2014 , 11:50   Re: extra Weapon
Reply With Quote #2

i think , ex :
Quote:
get_weaponname(id,"weapon_deagle",32);
__________________
Eagle07 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 08-01-2014 , 12:34   Re: extra Weapon
Reply With Quote #3

Quote:
Originally Posted by Eagle07 View Post
i think , ex :
No

Quote:
Originally Posted by Gian_Yagami View Post
hello, how are you
I am thinking about add weapon without replace. I got native get_weaponname, how does it work? The syntax is written as:
Code:
get_weaponname ( id, weapon[], len )
anyone can explain to me how to use this code?
PHP Code:
    new id CSW_KNIFE
    
new weaponname[20]
    
get_weaponname(idweaponnamecharsmax(weaponname))
    
    
//output:
    //weaponname[] = "weapon_knife" 
__________________
Hey ^_^
NikKOo31 is offline
Gian_Yagami
Member
Join Date: Apr 2014
Old 08-01-2014 , 19:46   Re: extra Weapon
Reply With Quote #4

I always get problem with native with have index id. Does index id can be added new id?
Gian_Yagami is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-01-2014 , 21:25   Re: extra Weapon
Reply With Quote #5

What?
mottzi is offline
Send a message via MSN to mottzi
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-02-2014 , 03:18   Re: extra Weapon
Reply With Quote #6

In most situations, you need to pass the id param into the function header.
HamletEagle is offline
Gian_Yagami
Member
Join Date: Apr 2014
Old 08-02-2014 , 07:32   Re: extra Weapon
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
In most situations, you need to pass the id param into the function header.
does that difficult?
Gian_Yagami is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-03-2014 , 05:48   Re: extra Weapon
Reply With Quote #8

public something ( id )
{

}

This seems hard ?
HamletEagle is offline
Gian_Yagami
Member
Join Date: Apr 2014
Old 08-04-2014 , 06:48   Re: extra Weapon
Reply With Quote #9

Quote:
Originally Posted by HamletEagle View Post
public something ( id )
{

}

This seems hard ?
Just that?
I am not sure because my friend said weapon can't add more. Just replace it witch variable ID.
ex: I'd like to add nitestick as mele in cs. so, I must replace Knife with nitestick skin and edit weapon value (damage, speed, etc)
Gian_Yagami is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 08-04-2014 , 09:49   Re: extra Weapon
Reply With Quote #10

He's right. What's so hard? I have commented each line

PHP Code:
new gKnife[33]; //declare new variable

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
RegisterHam(Ham_Item_Deploy"weapon_knife""OnCBase_Item_Deploy"); //item deploy native
    
    
register_clcmd("give_knife""ClCmd_Knife"); //register the clcmd to buy the knife
}

public 
plugin_precache()
{
    
precache_model("models/v_knife2.mdl"); //custom knife must be precached
}

public 
ClCmd_Knife(iIndex)
{
    
gKnife[iIndex] = 1//user has knife
}

public 
OnCBase_Item_Deploy(iEnt)
{
    new 
iIndex get_pdata_cbase(iEntm_pPlayerXTRA_OFS_PLAYER);
    
    if (
gKnife[iIndex]) Set_Knife(iIndex); //when player deploys a knife and he has bought the new knife, set the new knife skin
}

Set_Knife(iIndex)
{
    if (!
gKnife[iIndex]) return;
    
    
set_pev(iIndexpev_viewmodel2"models/v_knife2.mdl"); //set the model

__________________
What are you looking for here?

Last edited by DavidJr; 08-04-2014 at 09:51.
DavidJr 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 11:37.


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