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

Mediguns works wrong


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SkyeOfGrey
New Member
Join Date: Jul 2013
Old 07-24-2013 , 08:20   Mediguns works wrong
Reply With Quote #1

When i deployed Ubercharge with 4 different mediguns(medigun, kritz, quickfix, vaccinator), Ubercharge deploys wrongly.

In fact, each Mediguns have their own Ubercharge. but in this case, Ubercharges doesn't match with their own mediguns.

this is my code:
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2>
#include <tf2_stocks>
#include <tf2items>

new Handle:hWeaponMedigun INVALID_HANDLE;
new 
Handle:hWeaponQuickFix INVALID_HANDLE;
new 
Handle:hWeaponVaccinator INVALID_HANDLE;
new 
Handle:hWeaponKritzkrieg INVALID_HANDLE;

public 
OnPluginStart()
{
    
RegAdminCmd("sm_test"command_testADMFLAG_GENERIC"gives medigun");
    
RegAdminCmd("sm_test2"command_test2ADMFLAG_GENERIC"gives kritz");
    
RegAdminCmd("sm_test3"command_test3ADMFLAG_GENERIC"gives q-fix");
    
RegAdminCmd("sm_test4"command_test4ADMFLAG_GENERIC"gives vaccinator");

    
SetStockMedigun();
}

SetStockMedigun()
{
    
// Stock Medi-Gun
    
hWeaponMedigun TF2Items_CreateItem(OVERRIDE_ALL);
    
TF2Items_SetClassname(hWeaponMedigun"tf_weapon_medigun");
    
TF2Items_SetItemIndex(hWeaponMedigun29);
    
TF2Items_SetQuality(hWeaponMedigun6);
    
//TF2Items_SetLevel(hWeaponMedigun, 0);
    
TF2Items_SetNumAttributes(hWeaponMedigun0);
    
    
// Kritzkrieg
    
hWeaponKritzkrieg TF2Items_CreateItem(OVERRIDE_ALL);
    
TF2Items_SetClassname(hWeaponKritzkrieg"tf_weapon_medigun");
    
TF2Items_SetItemIndex(hWeaponKritzkrieg35);
    
TF2Items_SetQuality(hWeaponKritzkrieg6);
    
TF2Items_SetAttribute(hWeaponKritzkrieg0181.0);
    
TF2Items_SetAttribute(hWeaponKritzkrieg12922.0);
    
TF2Items_SetAttribute(hWeaponKritzkrieg22931.0);
    
TF2Items_SetAttribute(hWeaponKritzkrieg391.25);
    
TF2Items_SetNumAttributes(hWeaponKritzkrieg4);
    
    
// Quick Fix
    
hWeaponQuickFix TF2Items_CreateItem(OVERRIDE_ALL);
    
TF2Items_SetClassname(hWeaponQuickFix"tf_weapon_medigun");
    
TF2Items_SetItemIndex(hWeaponQuickFix411);
    
TF2Items_SetQuality(hWeaponQuickFix6);
    
//TF2Items_SetLevel(hWeaponQuickFix, 0);
    
TF2Items_SetAttribute(hWeaponQuickFix081.4);
    
TF2Items_SetAttribute(hWeaponQuickFix12312.0);
    
TF2Items_SetAttribute(hWeaponQuickFix2101.25);
    
TF2Items_SetAttribute(hWeaponQuickFix31050.5);
    
TF2Items_SetNumAttributes(hWeaponQuickFix4);
    
    
// Vaccinator
    
hWeaponVaccinator TF2Items_CreateItem(OVERRIDE_ALL);
    
TF2Items_SetClassname(hWeaponVaccinator"tf_weapon_medigun");
    
TF2Items_SetItemIndex(hWeaponVaccinator998);
    
TF2Items_SetQuality(hWeaponVaccinator6);
    
//TF2Items_SetLevel(hWeaponVaccinator, 0);
    
TF2Items_SetAttribute(hWeaponVaccinator01443.0);
    
TF2Items_SetAttribute(hWeaponVaccinator14733.0);
    
TF2Items_SetAttribute(hWeaponVaccinator2101.5);
    
TF2Items_SetAttribute(hWeaponVaccinator34790.34);
    
TF2Items_SetAttribute(hWeaponVaccinator42921.0);
    
TF2Items_SetAttribute(hWeaponVaccinator52932.0);
    
TF2Items_SetNumAttributes(hWeaponVaccinator6);
}

public 
Action:command_test(clientargs)
{
    
TF2_RemoveWeaponSlot(client1);

    new 
iEntity TF2Items_GiveNamedItem(clienthWeaponMedigun);
    
EquipPlayerWeapon(clientiEntity);
    
    return 
Plugin_Continue;
}

public 
Action:command_test2(clientargs)
{
    
TF2_RemoveWeaponSlot(client1);

    new 
iEntity TF2Items_GiveNamedItem(clienthWeaponKritzkrieg);
    
EquipPlayerWeapon(clientiEntity);
    
    return 
Plugin_Continue;
}

public 
Action:command_test3(clientargs)
{
    
TF2_RemoveWeaponSlot(client1);

    new 
iEntity TF2Items_GiveNamedItem(clienthWeaponQuickFix);
    
EquipPlayerWeapon(clientiEntity);
    
    return 
Plugin_Continue;
}

public 
Action:command_test4(clientargs)
{
    
TF2_RemoveWeaponSlot(client1);

    new 
iEntity TF2Items_GiveNamedItem(clienthWeaponVaccinator);
    
EquipPlayerWeapon(clientiEntity);
    
    return 
Plugin_Continue;

in this script, mediguns have their original attributes(non-custom, non-removed).

sorry for bad english
SkyeOfGrey is offline
SkyeOfGrey
New Member
Join Date: Jul 2013
Old 07-24-2013 , 08:24   Re: Mediguns works wrong
Reply With Quote #2

oh, i forgot this:
Quote:
Sourcemod :
1.6.0-hg3958 for Windows

Metamod :
1.10.0-hg849 for Windows

TF2Items :
1.6.0-hg253 for Windows
SkyeOfGrey 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 01:40.


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