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

Block pick up weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-11-2011 , 09:15   Re: Block pick up weapon
Reply With Quote #11

Quote:
Originally Posted by ShufflexDD View Post
I dont like use a libraries...
You've got a car? Blame you using it! You didn't invent the wheels it runs on!!!
__________________
Peace-Maker is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-12-2011 , 17:05   Re: Block pick up weapon
Reply With Quote #12

SDKHooks has become almost a requirement for SM servers these days. I have a feeling it will one day ship with SM.

It is made by the same people that SM is maintained by, so you can trust it.
__________________
Greyscale is offline
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 07-26-2011 , 10:28   Re: Block pick up weapon
Reply With Quote #13

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;

players can't get weapons now...
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
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
Martin
BANNED
Join Date: Mar 2009
Location: China
Old 08-22-2011 , 04:43   Re: Block pick up weapon
Reply With Quote #14

Use Touch in SDKHooks

PHP Code:
#include <sourcemod>
#include <sdkhooks>
 
public Plugin:myinfo 
{
 
name "New Plugin",
 
author "Unknown",
 
description "<- Description ->",
 
version "1.0",
 
url "<- URL ->"
}
public 
OnPluginStart()
{
 
}
public 
OnEntityCreated(entity, const String:Classname[])
{
 if(
strcmp(Classname,"Weapon_")>&& !StrEqual(Classname,"weapon_knife"))
 {
  if(
entity MaxClients && IsValidEntity(entity))
   
SDKHook(entity,SDKHook_Touch,FW_Touch);
 }
}
 
public 
Action:FW_Touch(touchertouched)
{
 
 if(
1<=touched<=32
   return 
Plugin_Handled;
 
 return 
Plugin_Continue;


Last edited by Martin; 08-22-2011 at 05:00.
Martin is offline
Send a message via ICQ to Martin
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 08:52.


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