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

About Hooker.. Need Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
franzcis066
Member
Join Date: Nov 2007
Old 05-19-2008 , 20:00   About Hooker.. Need Help
Reply With Quote #1

I have a problem at this code..
Someone try this?

There are two problems:
1.) FCVAR_CLIENTCMD_CAN_EXECUTE prevented running command: buy
2.) The Drop Command Does not allow to drop the c4..

The reason why i blocked the drop command is that it has a glitch when blocking the weapons.. when you drop a weapon with an ammo.. the reserved ammo is gone..well its a nice way to hook it but.....

Code:
//File weaponremover.sp
#include <sourcemod>
#include <hooker>//Secksy

new bool:IsBuying[MAXPLAYERS+1];
new bool:IsEquipped[MAXPLAYERS+1];

public Plugin:myinfo = 
{
    name = "WeaponRemover",
    author = "Francis",
    description = "Duh",
    version = "1.0",
    url = "http://www.sourcemod.net"
}

public OnPluginStart()
{
    RegConsoleCmd("drop", DropCommand);
    RegConsoleCmd("buy", Buy);
    RegConsoleCmd("autobuy", Buy);
    RegConsoleCmd("rebuy", Buy);

        RegisterHook(HK_WeaponDrop, WeaponDrop, false);
        RegisterHook(HK_WeaponCanSwitchTo, WeaponSwitchFunction, false);
}

public Action:WeaponSwitchFunction(client, weapon)
{
    decl String:cls[64];
    GetEdictClassname(weapon, cls, sizeof(cls));

    if(StrEqual(cls, "weapon_c4"))
    {
        IsEquipped[client] = true;
    }
    else if(!StrEqual(cls, "weapon_c4"))//double check
    {
        IsEquipped[client] = false;
    }
}
public Action:DropCommand(client, args)
{    
    if(IsEquipped[client] == false)
    {
        return Plugin_Handled;
    }
    return Plugin_Continue;
}
    
public Action:Buy(client,arg)
{
    IsBuying[client] = true;
    CreateTimer(0.1, IsBuyingDelay, client);
}

public Action:IsBuyingDelay(Handle:timer, any:client)
{
    IsBuying[client] = false;
}

public Action:WeaponDrop(client, weapon)
{
    decl String:WeaponName[64];
    GetEdictClassname(weapon, WeaponName, sizeof(WeaponName));

    if(StrContains(WeaponName, "weapon_c4") != -1)
    {
        return Plugin_Continue;
    }
    else if(IsBuying[client] == false)
    {
        return Plugin_Handled;
    }

    return Plugin_Continue;
}
franzcis066 is offline
franzcis066
Member
Join Date: Nov 2007
Old 05-20-2008 , 18:38   Re: About Hooker.. Need Help
Reply With Quote #2

Whichever way Plugin_Handled or Plugin_Continue ALWAYS block the buy command.. how could that be??
franzcis066 is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-20-2008 , 23:26   Re: About Hooker.. Need Help
Reply With Quote #3

i believe the buy command is handled client side so there is no way you could block it by RegConsoleCmd("buy",...)...i dont understand your issue with hooker...?
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd 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 23:01.


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