Quote:
Originally Posted by arthurdead
PHP Code:
stock MultiplyBy(client, index, &Handle:hItem, multiply) { hItem = TF2Items_CreateItem(OVERRIDE_ATTRIBUTES | PRESERVE_ATTRIBUTES); TF2Items_SetFlags(hItem, OVERRIDE_ATTRIBUTES | PRESERVE_ATTRIBUTES); new iAIndexes[16] new Float:flAValues[16]; new iNumAttributes = TF2II_GetItemNumAttributes(index); TF2Items_SetNumAttributes(hItem, iNumAttributes); if(iNumAttributes > 0) { for(new a = 0; a < (iNumAttributes > 16 ? 16 : iNumAttributes); a++) { iAIndexes[a] = TF2II_GetItemAttributeID(index, a); flAValues[a] = TF2II_GetItemAttributeValue(index, a); TF2Items_SetAttribute(hItem, a, iAIndexes[a], flAValues[a] * multiply); } } }
public Action:TF2Items_OnGiveNamedItem(client, String:classname[], iItemDefinitionIndex, &Handle:hItem) { MultiplyBy(client, iItemDefinitionIndex, hItem, 10); return Plugin_Changed; }
just that of course they have blacklist custom attributes etc but if you want just X10
|
Thankyou!
But blacklisting attributes would be needed as there are weapons that would just break or be extremely over powered.
Another aspect of this would be to be able to keep it to a certain team if possible. So only read team gets x10 weapons.
Also can we add a chunk of code to this that would be executed if the weapon meets a certain index?
Sorry if I am wrong, I am very new to sourcepawn and coding in general. I just have experience with html and php.
Code:
if item index= xxx
{
attributes or just plain code
}
extra code if needed
if not item index:
YOUR CODE HERE
__________________