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_GetItemClass( iItemDefID, strClassname, sizeof(strClassname) );
TF2Items_SetClassname(NewWeapon, strClassname);
TF2Items_SetItemIndex(NewWeapon, ItemDefIndex[client]);
TF2Items_SetQuality(NewWeapon, 10);
TF2Items_SetLevel(NewWeapon, 100);
TF2Items_GiveNamedItem(client, NewWeapon);
}
__________________