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

New axe after throw old one


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hoycieto
Senior Member
Join Date: Feb 2018
Old 01-15-2019 , 12:47   New axe after throw old one
Reply With Quote #1

Hi, how can I give player new weapon_axe after he throw his old axe? I think I need to hook throw point but i dont know how
hoycieto is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-15-2019 , 14:04   Re: New axe after throw old one
Reply With Quote #2

PHP Code:
/*
Server event "item_remove", Tick 7024:
- "userid" = "3"
- "item" = "melee"
- "defindex" = "75"
*/
#include <sdkhooks>
#include <sdktools>
#include <cstrike>

public void OnPluginStart()
{
    
HookEvent("item_remove"item_remove);
}

public 
void item_remove(Event event, const char[] namebool dontBroadcast)
{
    
int defindex event.GetInt("defindex");

    if(
defindex  == 0) return;

    
CSWeaponID weaponid CS_ItemDefIndexToID(defindex);
    
char alias[32];
    
CS_WeaponIDToAlias(weaponidaliassizeof(alias));

    if(!
StrEqual(alias"axe"false)) return;

    
int client GetClientOfUserId(event.GetInt("userid"));
    
GivePlayerItem(client"weapon_axe");

__________________
Do not Private Message @me

Last edited by Bacardi; 01-15-2019 at 14:05.
Bacardi is offline
hoycieto
Senior Member
Join Date: Feb 2018
Old 01-15-2019 , 16:57   Re: New axe after throw old one
Reply With Quote #3

I'll try this tomorrow, thanks
hoycieto is offline
hoycieto
Senior Member
Join Date: Feb 2018
Old 01-16-2019 , 17:22   Re: New axe after throw old one
Reply With Quote #4

I've tried this on 1v1 plugin as additional round and items are equpping but when I kill someones, server crashes. No logs, no nothing ;-; And accelerator dont tells me nothing 3VEX-AWWB-BJ3P
hoycieto is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-16-2019 , 17:56   Re: New axe after throw old one
Reply With Quote #5

...show your code/plugin, we can't guess

*edit
And in which game_type ?

*edit edit
Code:
PTaH.ext.2.csgo.so!__SourceHook_MFHCls_GiveNamedItemHook::Func(char const*, int, CEconItemView*, bool, void*) + 0x13d
Don't know what is this PTaH but lately this is one what crash server.

Last edited by Bacardi; 01-16-2019 at 17:59.
Bacardi is offline
hoycieto
Senior Member
Join Date: Feb 2018
Old 01-17-2019 , 03:05   Re: New axe after throw old one
Reply With Quote #6

Here is the code:
*Removed, was bugged*

Quote:
And in which game_type ?
Casual

Last edited by hoycieto; 01-27-2019 at 09:37.
hoycieto is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-17-2019 , 04:07   Re: New axe after throw old one
Reply With Quote #7

Quote:
Originally Posted by hoycieto View Post
Here is the code:

Casual
That could be another reason why it crash... I have tested in survival only.
Bacardi is offline
hoycieto
Senior Member
Join Date: Feb 2018
Old 01-17-2019 , 05:05   Re: New axe after throw old one
Reply With Quote #8

So probably there's no possibility to do this? :/
hoycieto 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 13:34.


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