View Single Post
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen.
Old 12-01-2013 , 02:21   [HELP] Create a new weapon ?
Reply With Quote #1

I don't know why this doesn't work.
I specified all what the weapon need (classname, index, attributs, etc...) !

Can someone tell me what's wrong with this ?
PHP Code:
if (action == MenuAction_Select)  
    {
       
ItemDefIndex[client] = StringToInt(info);
       
       
//Doesn't do what I want :
       //TF2Items_GiveWeapon(client, ItemDefIndex[client]);
       
       
       //Doesn't work :
       
new Handle:NewWeapon =   TF2Items_CreateItem(OVERRIDE_ATTRIBUTES|PRESERVE_ATTRIBUTES);
       
       
//Class name :
       
decl String:strClassname[64]; 
       
TF2II_GetItemClassiItemDefIDstrClassnamesizeof(strClassname) ); 
       
TF2Items_SetClassname(NewWeaponstrClassname);
       
       
TF2Items_SetItemIndex(NewWeaponItemDefIndex[client]);
       
TF2Items_SetQuality(NewWeapon10);
       
TF2Items_SetLevel(NewWeapon100);
       
       
TF2Items_GiveNamedItem(clientNewWeapon);
       
    } 
__________________
Want to check my plugins ?
Arkarr is offline