Raised This Month: $ Target: $400
 0% 

Plugin_Changed not working for me


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 05-14-2013 , 23:41   Plugin_Changed not working for me
Reply With Quote #1

PHP Code:
/* * *
 * tf2items code written with help from asherkin
 * * */

#include <sourcemod>
#include <sdktools>
#include <tf2items> 

new Handle:Heavy_Sandvich INVALID_HANDLE;

public 
Plugin:myinfo =
{
    
name "sandvichtest",
    
author "CoolJosh3k",
    
description "Swaps the stock shotgun for a sandvich",
    
version "1.0.0",
    
url ""
}

public 
OnPluginStart()
{
    
Heavy_Sandvich TF2Items_CreateItem(OVERRIDE_ALL FORCE_GENERATION);
    
TF2Items_SetClassname(Heavy_Sandvich"tf_weapon_lunchbox");
    
TF2Items_SetItemIndex(Heavy_Sandvich42);
    
TF2Items_SetQuality(Heavy_Sandvich6);
    
TF2Items_SetLevel(Heavy_Sandvich1);
    
TF2Items_SetNumAttributes(Heavy_Sandvich0);
}

public 
Action:TF2Items_OnGiveNamedItem(clientString:classname[], iItemDefinitionIndex, &Handle:hItem)
{
    if (
iItemDefinitionIndex == 11)
    {
        
hItem Heavy_Sandvich;
        return 
Plugin_Changed;
    }
    return 
Plugin_Continue;

That sample from my code, doesn't work quite as planned.

If the player has a heavy stock shotgun, I want to force a sandvich instead. It does take the shotgun away, but it does not replace it with the sandvich.

The versions are:

Code:
] meta version
Metamod:Source version 1.9.1
Build ID: 805:44644c375f80
Loaded As: Valve Server Plugin
Compiled on: Dec 23 2012
Plugin interface version: 15:14
SourceHook version: 5:5
http://www.metamodsource.net/
] sm version
 SourceMod Version Information:
    SourceMod Version: 1.5.0-dev+3838
    SourcePawn Engine: SourcePawn 1.1, jit-x86 (build 1.5.0-dev+3838)
    SourcePawn API: v1 = 4, v2 = 4
    Compiled on: May  3 2013 12:46:42
    Build ID: 3838:32bab19b2f64
    http://www.sourcemod.net/
] tf2items_version 
"tf2items_version" = "1.5.3"
 notify singleplayer replicated
 - TF2 Items Version
CoolJosh3k is offline
 



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 23:31.


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