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

Solved Derpy code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 12-31-2013 , 14:13   Derpy code
Reply With Quote #1

PHP Code:
#include <sourcemod>
#include <tf2items>
#include <tf2_player>
public Plugin:myinfo =
{
    
name "FlexCraft Admin Weapons Handler",
    
author "WildCard65",
    
description "Autocreates the admin weapons in flexcraft.",
    
version "1.0",
    
url "http://wildcard65gaming.bounceme.net/"
};
public 
OnPluginStart()
{
    
PrintToServer("Flexcraft Admin Weapons Loaded!");
    
//AddCommandOverride("moderators_weapons_override",Override_Command,ADMFLAG_CHAT);
    //AddCommandOverride("admins_weapons_override",Override_Command,ADMFLAG_GENERIC);
    //AddCommandOverride("super_admins_weapons_override",Override_Command,ADMFLAG_UNBAN);
    //AddCommandOverride("full_admins_weapons_override",Override_Command,ADMFLAG_PASSWORD);
    
AddCommandOverride("root_admins_weapons_override",Override_Command,ADMFLAG_ROOT);
}
public 
Action:TF2Items_OnGiveNamedItem(clientString:classname[], iItemDefinitionIndex, &Handle:hItem)
{
    if(
CheckCommandAccess(client,"root_admins_weapons_override",ADMFLAG_ROOT)){
        if (
hItem != INVALID_HANDLE) {
            
PrintToServer("Handle not invalid");
            return 
Plugin_Continue;
        }
        
hItem TF2Items_CreateItem(OVERRIDE_ITEM_QUALITY|OVERRIDE_ITEM_LEVEL|OVERRIDE_ATTRIBUTES);
        
TF2Items_SetQuality(hItem,8);
        
TF2Items_SetLevel(hItem,5000);
        if(
StrEqual(classname,"tf_wearable")){
            
TF2Items_SetAttribute(hItem113413);
            
TF2Items_SetAttribute(hItem22610);
        }
        return 
Plugin_Changed;
    }
    return 
Plugin_Continue;
}
public 
OnPluginEnd()
{

Can someone tell me if anywhere in this is causing it to be derpy on assigning attributes?

Last edited by WildCard65; 01-01-2014 at 07:58.
WildCard65 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-01-2014 , 06:58   Re: Derpy code
Reply With Quote #2

You aren't setting the number of attributes.
__________________
asherkin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-01-2014 , 07:58   Re: Derpy code
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
You aren't setting the number of attributes.
Thx for help, I added that in a new test of code and it's working quite well. Thx.
WildCard65 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-02-2014 , 02:05   Re: Derpy code
Reply With Quote #4

Do you really want particles on every wearable?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-02-2014 , 07:09   Re: Derpy code
Reply With Quote #5

Quote:
Originally Posted by friagram View Post
Do you really want particles on every wearable?
yes.
WildCard65 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 05:13.


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