Raised This Month: $ Target: $400
 0% 

[REQ-TF2] Give/Equip player flare gun


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 01-09-2014 , 22:52   Re: [REQ-TF2] Give/Equip player flare gun
Reply With Quote #7

Sorry; here's another version that works. Tested this time around
PHP Code:
#include <tf2_stocks>
#include <tf2items>
#include <tf2items_giveweapon>

public TF2Items_OnGiveNamedItem_Post(clientString:classname[], itemDefinitionIndexitemLevelitemQualityentityIndex)
{
    if (
StrEqual(classname"tf_weapon_flaregun"false) || StrEqual(classname"tf_weapon_flaregun_revenge"false))
        return; 
// It's a flare gun already
    
new Handle:data;
    
CreateDataTimer(0.0Timer_CheckFlareGundataTIMER_FLAG_NO_MAPCHANGE);
    
WritePackCell(dataGetClientUserId(client));
    
WritePackCell(dataEntIndexToEntRef(entityIndex));
    
ResetPack(data);
}

public 
Action:Timer_CheckFlareGun(Handle:timerHandle:data)
{
    new 
client GetClientOfUserId(ReadPackCell(data));
    if (!
client) return;
    new 
entityIndex EntRefToEntIndex(ReadPackCell(data));
    if (
entityIndex <= MaxClients) return;
    
    if (
entityIndex != GetPlayerWeaponSlot(client1)) return;
    
TF2Items_GiveWeapon(client39);

You could just do point_servercommand, but then you'd be overriding players' own Flare Guns, and ensuring that they'd be invisible 100% of the time.
Attached Files
File Type: smx flareguns.smx (3.8 KB, 200 views)
File Type: sp Get Plugin or Get Source (flareguns.sp - 223 views - 922 Bytes)
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 01-09-2014 at 22:53.
MasterOfTheXP 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 12:18.


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