Raised This Month: $32 Target: $400
 8% 

Why Saxxy weapon not work for me? :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
barel31
Member
Join Date: Mar 2011
Old 09-16-2013 , 14:43   Why Saxxy weapon not work for me? :(
Reply With Quote #1

this my code:
PHP Code:
TF2Items_GiveSaxxy(client)
{
    new 
String:ClientClass[18];
    switch(
TF2_GetPlayerClass(client))
    {
        case 
TFClass_Scout:        strcopy(ClientClasssizeof(ClientClass), "tf_weapon_bat");
        case 
TFClass_Soldier:    strcopy(ClientClasssizeof(ClientClass), "tf_weapon_shovel");
        case 
TFClass_Pyro:        strcopy(ClientClasssizeof(ClientClass), "tf_weapon_fireaxe");
        case 
TFClass_DemoMan:    strcopy(ClientClasssizeof(ClientClass), "tf_weapon_bottle");
        case 
TFClass_Heavy:        strcopy(ClientClasssizeof(ClientClass), "tf_weapon_fists");
        case 
TFClass_Engineer:    strcopy(ClientClasssizeof(ClientClass), "tf_weapon_wrench");
        case 
TFClass_Medic:        strcopy(ClientClasssizeof(ClientClass), "tf_weapon_bonesaw");
        case 
TFClass_Sniper:    strcopy(ClientClasssizeof(ClientClass), "tf_weapon_club");
        case 
TFClass_Spy:        strcopy(ClientClasssizeof(ClientClass), "tf_weapon_knife");
    }
    
    new 
Handle:weapon TF2Items_CreateItem(OVERRIDE_ALL|FORCE_GENERATION);
    
TF2Items_SetClassname(weaponClientClass);
    
TF2Items_SetItemIndex(weapon423);
    
TF2Items_SetLevel(weapon100);
    
TF2Items_SetQuality(weapon3);
    
TF2Items_SetNumAttributes(weapon1);
    
TF2Items_SetAttribute(weapon11501.0);
    
    new 
entity TF2Items_GiveNamedItem(clientweapon);
    if(
weapon != INVALID_HANDLE)
        
CloseHandle(weapon);
    
    
EquipPlayerWeapon(cliententity);


Last edited by barel31; 09-16-2013 at 15:03.
barel31 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-16-2013 , 15:02   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #2

For one, you need to use the varioua TF2Items_Set functions BEFORE calling TF2Items_GiveNamedItem.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-16-2013 at 15:03.
Powerlord is offline
barel31
Member
Join Date: Mar 2011
Old 09-16-2013 , 15:04   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
For one, you need to use the varioua TF2Items_Set functions BEFORE calling TF2Items_GiveNamedItem.
edit - still not working.
barel31 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-16-2013 , 15:12   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #4

Quote:
Originally Posted by barel31 View Post
edit - still not working.
Do they not have it or is it just invisible? If it's invisible... that's by design on Valve's part.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
barel31
Member
Join Date: Mar 2011
Old 09-16-2013 , 15:13   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #5

dont have it.
barel31 is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 09-18-2013 , 02:45   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #6

why don't just
PHP Code:
    new Handle:weapon TF2Items_CreateItem(OVERRIDE_ALL);
    
TF2Items_SetClassname(weapon"saxxy"); 
Leonardo is offline
barel31
Member
Join Date: Mar 2011
Old 09-18-2013 , 07:13   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #7

Quote:
Originally Posted by Leonardo View Post
why don't just
PHP Code:
    new Handle:weapon TF2Items_CreateItem(OVERRIDE_ALL);
    
TF2Items_SetClassname(weapon"saxxy"); 
I try it now

EDIT - Don't work. :<

PHP Code:
stock TF2Items_GiveSaxxy(client)
{
    new 
Handle:weapon TF2Items_CreateItem(OVERRIDE_ALL);

    
TF2Items_SetClassname(weapon"saxxy");
    
TF2Items_SetItemIndex(weapon423);
    
TF2Items_SetLevel(weapon25);
    
TF2Items_SetQuality(weapon3);
    
TF2Items_SetNumAttributes(weapon1);
    
TF2Items_SetAttribute(weapon11501.0);

    if(
weapon == INVALID_HANDLE)
        return -
1;

    new 
entity TF2Items_GiveNamedItem(clientweapon);
    
CloseHandle(weapon);
    
EquipPlayerWeapon(cliententity);
    return 
entity;


Last edited by barel31; 09-18-2013 at 08:18.
barel31 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-18-2013 , 12:21   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #8

Quote:
Originally Posted by Leonardo View Post
why don't just
PHP Code:
    new Handle:weapon TF2Items_CreateItem(OVERRIDE_ALL);
    
TF2Items_SetClassname(weapon"saxxy"); 
saxxy is a meta-class and requires FORCE_GENERATION to work.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 09-18-2013 , 12:37   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #9

Quote:
Originally Posted by Powerlord View Post
saxxy is a meta-class and requires FORCE_GENERATION to work.
tf2items_giveweapons.sp:1837
PHP Code:
    if (strcmp(weaponClassname"saxxy"false) != 0flags |= FORCE_GENERATION
Leonardo is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-18-2013 , 12:41   Re: Why Saxxy weapon not work for me? :(
Reply With Quote #10

Quote:
Originally Posted by Leonardo View Post
tf2items_giveweapons.sp:1837
PHP Code:
    if (strcmp(weaponClassname"saxxy"false) != 0flags |= FORCE_GENERATION
See? tf2items_giveweapons.sp even agrees with me.
__________________
Not currently working on SourceMod plugin development.
Powerlord 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 01:55.


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