Raised This Month: $ Target: $400
 0% 

Weapon Attributes, Help me please or where can i learn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
medic917
Senior Member
Join Date: Aug 2014
Old 11-04-2014 , 01:29   Weapon Attributes, Help me please or where can i learn
Reply With Quote #1

I want to use two addons that works, but has few things needed to change for a public server.
https://forums.alliedmods.net/showthread.php?t=205793 (be the saxton)
https://forums.alliedmods.net/showthread.php?p=1550563 (be the horsemann)

I want to change the amount of damage saxton does to others. Right now it's one hit KO and I want to make it weaker so it isn't too overpowered. I tried contacting the author, searching the posts in the thread, and posting in the thread, but all I got was no response or other posts that asked the same questions with no response.

This is the part of the sp file that has some numbers, but it is too many and I couldn't find a snippet or tutorial on allied modders.
Code:
 stock MakePlayerSaxton(iClient)
{
    g_bSaxton[iClient] = true;

    TF2_SetPlayerClass(iClient, TFClass_Soldier, _, false);
    TF2_RemoveAllWeapons(iClient);

    if(g_bModel)
    {
        SetVariantString(MODEL_HALE);
        AcceptEntityInput(iClient, "SetCustomModel");
        SetEntProp(iClient, Prop_Send, "m_bUseClassAnimations", 1);
    }

    new iEntity = -1;
    while((iEntity = FindEntityByClassname(iEntity, "tf_wearable")) != -1)
    {
        if(GetEntPropEnt(iEntity, Prop_Send, "m_hOwnerEntity") == iClient)
            AcceptEntityInput(iEntity, "Kill");
    }

    decl String:strAttributes[128];
    Format(strAttributes, sizeof(strAttributes), "68 ; 2.0 ; 2 ; 3.1 ;  259 ; 1.0 ; 252 ; 0.6 ; 275 ; 1 ; 26 ; %i ; 107 ; 1.7 ; 214 ; %d",  g_iHealth - 200, GetRandomInt(9999, 99999));
    TF2Items_GiveWeapon(iClient, "tf_weapon_shovel", 5, 100, 4, strAttributes);

    SetEntProp(iClient, Prop_Data, "m_iHealth", g_iHealth);
}

stock TF2Items_GiveWeapon(iClient, String:strName[], iIndex, iLevel = 1, iQuality = 0, String:strAtt[] = "0")
{
    new Handle:hWeapon = TF2Items_CreateItem(OVERRIDE_ALL | FORCE_GENERATION);

    TF2Items_SetClassname(hWeapon, strName);
    TF2Items_SetItemIndex(hWeapon, iIndex);
    TF2Items_SetLevel(hWeapon, iLevel);
    TF2Items_SetQuality(hWeapon, iQuality);

    new String:strAtts[32][32];
    new iCount = ExplodeString(strAtt, " ; ", strAtts, 32, 32);
    if(iCount > 0)
    {
        TF2Items_SetNumAttributes(hWeapon, iCount / 2);
        new z;
        for(new i = 0; i < iCount; i += 2)
        {
            TF2Items_SetAttribute(hWeapon, z, StringToInt(strAtts[i]), StringToFloat(strAtts[i + 1]));
            z++;
        }
    }
    else
        TF2Items_SetNumAttributes(hWeapon, 0);

    if(hWeapon == INVALID_HANDLE)
        return -1;

    new iEntity = TF2Items_GiveNamedItem(iClient, hWeapon);
    CloseHandle(hWeapon);
    EquipPlayerWeapon(iClient, iEntity);
    return iEntity;
}
The headless horseman, I wanted to do the same for the weapon strength, but also for this plugin there is a crazy damage resistance, so when people do damage to the horsemann player, it only does like 1 damage or less.

Code:
stock GiveAxe(client)
{
    TF2_RemoveWeaponSlot(client, TFWeaponSlot_Melee);
    new Handle:hWeapon = TF2Items_CreateItem(OVERRIDE_ALL|FORCE_GENERATION);
    if (hWeapon != INVALID_HANDLE)
    {
        TF2Items_SetClassname(hWeapon, "tf_weapon_sword");
        TF2Items_SetItemIndex(hWeapon, 266);
        TF2Items_SetLevel(hWeapon, 100);
        TF2Items_SetQuality(hWeapon, 5);
        new String:weaponAttribs[256];
        //This is so, so bad and I am so very, very sorry, but TF2Attributes will be better.
        Format(weaponAttribs, sizeof(weaponAttribs), "264 ; 1.75 ; 263 ;  1.3 ; 15 ; 0 ; 26 ; %d ; 2 ; 999.0 ; 107 ; 4.0 ; 109 ; 0.0 ; 62 ; 0.70 ;  205 ; 0.05 ; 206 ; 0.05 ; 68 ; -2 ; 69 ; 0.0 ; 53 ; 1.0 ; 27 ; 1.0",  GetConVarInt(hCvarHealth));
        new String:weaponAttribsArray[32][32];
        new attribCount = ExplodeString(weaponAttribs, " ; ", weaponAttribsArray, 32, 32);
        if (attribCount > 0) {
            TF2Items_SetNumAttributes(hWeapon, attribCount/2);
            new i2 = 0;
            for (new i = 0; i < attribCount; i+=2) {
                TF2Items_SetAttribute(hWeapon, i2, StringToInt(weaponAttribsArray[i]), StringToFloat(weaponAttribsArray[i+1]));
                i2++;
            }
        } else {
            TF2Items_SetNumAttributes(hWeapon, 0);
        }
        new weapon = TF2Items_GiveNamedItem(client, hWeapon);
        EquipPlayerWeapon(client, weapon);

        CloseHandle(hWeapon);
        SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", PrecacheModel(AXE));
        SetEntProp(weapon, Prop_Send, "m_nModelIndexOverrides", PrecacheModel(AXE), _, 0);
    }    
}

Can you help me and tell me which numbers I have to change? At least tell me a nice resource that explains the long row of numbers on what each one does?
medic917 is offline
talesrune
Junior Member
Join Date: Mar 2014
Old 11-07-2014 , 05:07   Re: Weapon Attributes, Help me please or where can i learn
Reply With Quote #2

Quote:
Originally Posted by medic917 View Post
Code:
Saxton hale:
    Format(strAttributes, sizeof(strAttributes), "68 ; 2.0 ; 2 ; 3.1 ;  259 ; 1.0 ; 252 ; 0.6 ; 275 ; 1 ; 26 ; %i ; 107 ; 1.7 ; 214 ; %d",  g_iHealth - 200, GetRandomInt(9999, 99999));

HHH:
Format(weaponAttribs, sizeof(weaponAttribs), "264 ; 1.75 ; 263 ;  1.3 ; 15 ; 0 ; 26 ; %d ; 2 ; 999.0 ; 107 ; 4.0 ; 109 ; 0.0 ; 62 ; 0.70 ;  205 ; 0.05 ; 206 ; 0.05 ; 68 ; -2 ; 69 ; 0.0 ; 53 ; 1.0 ; 27 ; 1.0",  GetConVarInt(hCvarHealth));
Hi medic917, you just have to change the numbers in this code. This is the one that changes the attributes of the weapon to make saxton/hhh to be OP. First take a look at this for reference.

https://wiki.teamfortress.com/wiki/L...tem_attributes

This link shows the list of attributes (mostly all) that the numbers represents.
For example: "2 ; 3.1" means "damage bonus ; 210% increase"
"62 ; 0.70" means "dmg taken from crit reduced ; 30% decreased"
***Take note of percentage and inverted_percentage

Last edited by talesrune; 11-07-2014 at 05:09.
talesrune is offline
medic917
Senior Member
Join Date: Aug 2014
Old 11-10-2014 , 00:42   Re: Weapon Attributes, Help me please or where can i learn
Reply With Quote #3

hey tales thanks so much bro, hey, sent you a pm btw.
medic917 is offline
Reply


Thread Tools
Display Modes

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 21:32.


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