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

Block pick up weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 07-05-2011 , 03:37   Block pick up weapon
Reply With Quote #1

Weapon can pick up only player who dropped this weapon.
How do it make?

--
sorry for my bad English
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
klausenbusk
AlliedModders Donor
Join Date: Jan 2011
Old 07-05-2011 , 06:50   Re: Block pick up weapon
Reply With Quote #2

PHP Code:
new OwnerOfWeapon[2048] = 0;
OnClientPostAdminCheck(client)
{
    
SDKHook(clientSDKHook_WeaponDropPostOnWeaponDropPost);
    
SDKHook(clientSDKHook_WeaponCanUseOnWeaponCanUse);
}

public 
OnWeaponDropPost(clientweapon)
{
    
OwnerOfWeapon[weapon] = client;
}

public 
Action:OnWeaponCanUse(clientweapon)
{
    if (
OwnerOfWeapon[weapon] == client)
    {
        return 
Plugin_Continue;
    }
    return 
Plugin_Handled;

klausenbusk is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 07-05-2011 , 09:41   Re: Block pick up weapon
Reply With Quote #3

Quote:
Originally Posted by klausenbusk View Post
PHP Code:
new OwnerOfWeapon[2048] = 0;
OnClientPostAdminCheck(client)
{
    
SDKHook(clientSDKHook_WeaponDropPostOnWeaponDropPost);
    
SDKHook(clientSDKHook_WeaponCanUseOnWeaponCanUse);
}

public 
OnWeaponDropPost(clientweapon)
{
    
OwnerOfWeapon[weapon] = client;
}

public 
Action:OnWeaponCanUse(clientweapon)
{
    if (
OwnerOfWeapon[weapon] == client)
    {
        return 
Plugin_Continue;
    }
    return 
Plugin_Handled;

aren't you missing an "else" before "return Plugin_Handled;" ?
napalm00 is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 07-05-2011 , 09:47   Re: Block pick up weapon
Reply With Quote #4

Quote:
Originally Posted by napalm00 View Post
aren't you missing an "else" before "return Plugin_Handled;" ?
it doesnt matter as the function execution stops after the first return
Zephyrus is offline
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 07-05-2011 , 10:11   Re: Block pick up weapon
Reply With Quote #5

Thx, but it possible make without sdkhooks?
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
lokizito
Veteran Member
Join Date: Dec 2010
Location: Brazil
Old 07-05-2011 , 10:21   Re: Block pick up weapon
Reply With Quote #6

Without SDKHooks you can't prevent players from picking up the weapons. Then you would need to make then drop again.
__________________
[CS:S] RankMe - Why pay for a rank plugin if you can have one for free?
[CS:S] RankMe Connect Announcer - Announce when a player connect
Translation Project - Let's make the plugins to be international
lokizito is offline
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 07-05-2011 , 12:01   Re: Block pick up weapon
Reply With Quote #7

it's possible create array of players and in drop save in array owner id who drop weapon and in EventItemPickup check?
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.

Last edited by ShufflexDD; 07-05-2011 at 12:07.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 07-05-2011 , 13:46   Re: Block pick up weapon
Reply With Quote #8

Quote:
Originally Posted by lokizito View Post
Without SDKHooks you can't prevent players from picking up the weapons. Then you would need to make then drop again.
please, write this....
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
klausenbusk
AlliedModders Donor
Join Date: Jan 2011
Old 07-08-2011 , 05:28   Re: Block pick up weapon
Reply With Quote #9

ShufflexDD why would you not use SDKHooks?
klausenbusk is offline
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 07-09-2011 , 17:06   Re: Block pick up weapon
Reply With Quote #10

I dont like use a libraries...
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
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 23:32.


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