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

Change to player's skin on pickup


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Keyinator
New Member
Join Date: Jul 2018
Old 07-12-2018 , 20:55   Change to player's skin on pickup
Reply With Quote #1

I really can't find a plugin that does it. I tried my best xD (found one but didn't work).
What it needs to do: Change the skin of a weapon on the ground to the player's skin (in his inventory) on pick up.
Keyinator is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-13-2018 , 08:18   Re: Change to player's skin on pickup
Reply With Quote #2

I belive GivePlayerItem sets it to the client's skin when given, not sure though.
mug1wara is offline
Keyinator
New Member
Join Date: Jul 2018
Old 07-13-2018 , 10:29   Re: Change to player's skin on pickup
Reply With Quote #3

I think it doesn't work for weapons that are being picked up

Last edited by Keyinator; 07-13-2018 at 11:04.
Keyinator is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-13-2018 , 11:21   Re: Change to player's skin on pickup
Reply With Quote #4

PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

public void OnPluginStart()
{
    
HookEvent("item_pickup"Event_Pickup);
}

public 
Action Event_Pickup(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    
char sWeapon[32];
    
    
GetClientWeapon(iClientsWeaponsizeof(sWeapon));
    
    
GivePlayerItem(iClientsWeapon);

mug1wara is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-13-2018 , 11:21   Re: Change to player's skin on pickup
Reply With Quote #5

but u need to remove the client's weapon, this is just a sample
mug1wara is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 07-13-2018 , 14:35   Re: Change to player's skin on pickup
Reply With Quote #6

Search.....
https://forums.alliedmods.net/showpo...23&postcount=6

Or direct link to github:
https://github.com/quasemago/WeaponSkinOnEquip

Last edited by brunoronning; 07-13-2018 at 14:35.
brunoronning is offline
Keyinator
New Member
Join Date: Jul 2018
Old 07-14-2018 , 18:34   Re: Change to player's skin on pickup
Reply With Quote #7

Quote:
Originally Posted by brunoronning View Post
Doesn't work for me.
Keyinator is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 07-15-2018 , 07:59   Re: Change to player's skin on pickup
Reply With Quote #8

Quote:
Originally Posted by Keyinator View Post
Doesn't work for me.
New version! it's working for me:
- https://github.com/quasemago/WeaponSkinOnEquip

Last edited by brunoronning; 07-15-2018 at 08:02.
brunoronning 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 06:00.


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