Raised This Month: $ Target: $400
 0% 

block IN_SCORE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-08-2009 , 09:42   block IN_SCORE
Reply With Quote #1

how can i kill +showscore ?? i tried so :


if(is_user_alive(1))
{
if (button == IN_SCORE)
{
client_cmd(id, "lol")
set_hudmessage(255,255,255,-1.0,0.55,0,0.1,5.0,0.0,0.0,1);
show_hudmessage(id,"Only Dead users can see the Table!!");
}
}

the hud message willbe showed under the table & score works perfect. so i cant kill this cmd
in console : unknown cmd lol ...
but play can see the score....
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 04-08-2009 , 09:47   Re: block IN_SCORE
Reply With Quote #2

PHP Code:
#include < amxmodx >
#include < fakemeta >

public plugin_init ( )
{
    
register_plugin "BlockScore""1.0""One" )
    
register_forward FM_CmdStart"Forward_HookCmdStartPre")
}

public 
Forward_HookCmdStartPre iUseruc_handle )
{
    if ( !
is_user_alive iUser ) )
    {
        static 
iButtons
        iButtons 
get_uc uc_handleUC_Buttons )

        if ( 
iButtons IN_SCORE )
            
iButtons &= ~IN_SCORE

        set_uc 
uc_handleUC_ButtonsiButtons )
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED


Last edited by TheRadiance; 04-08-2009 at 10:01.
TheRadiance is offline
Send a message via ICQ to TheRadiance
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-08-2009 , 09:53   Re: block IN_SCORE
Reply With Quote #3

Ty. problem :

i have this in case :

PHP Code:
switch(Level)
    {
        case 
1:
        {
    
            if(
is_user_alive(1))
            {
                if (
button == IN_SCORE)
                {
                    
//KILL SCORE
                
}
            } 
would this work so or better said, its correct?

PHP Code:
switch(Level)
{
    case 
1:
    {
    
        if(
is_user_alive(1))
        {
            if (
button == IN_SCORE)
            {
                
Forward_HookCmdStartPre uc_handleiUser )         //KILL SCORE
            
}
        }
    }
}
public 
Forward_HookCmdStartPre uc_handleiUser )
{
    if ( !
is_user_alive iUser ) )
    {
        static 
iButtons
        iButtons 
get_uc uc_handleUC_Buttons )

        if ( 
iButtons IN_SCORE )
            
iButtons &= ~IN_SCORE

        set_uc 
uc_handleUC_ButtonsiButtons )
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-08-2009 , 09:48   Re: block IN_SCORE
Reply With Quote #4

You forgot
Code:
return FMRES_SUPERCEDE;
__________________
hleV is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 04-08-2009 , 09:51   Re: block IN_SCORE
Reply With Quote #5

Quote:
Originally Posted by hleV View Post
You forgot
Code:
return FMRES_SUPERCEDE;
Right, thanks.
TheRadiance is offline
Send a message via ICQ to TheRadiance
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-08-2009 , 09:53   Re: block IN_SCORE
Reply With Quote #6

Also the first FM_CmdStart's parameter is Client's ID, then the UC Handle.
Code:
#include <amxmodx> #include <fakemeta>   public plugin_init() {         register_plugin("Block Score", "1.0", "hleV");         register_forward(FM_CmdStart, "CommandStart"); }   public CommandStart(ClientID, UC_Handle) {         if (!is_user_alive(ClientID))                 return FMRES_IGNORED;           if (get_uc(UC_Handle, UC_Buttons) & IN_SCORE)         {                 set_uc(UC_Handle, UC_Buttons, ~IN_SCORE);                   return FMRES_SUPERCEDE;         }           return FMRES_IGNORED; }
__________________
hleV is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-08-2009 , 09:56   Re: block IN_SCORE
Reply With Quote #7

Just check the level in CmdStart forward.
Code:
#include <amxmodx> #include <fakemeta>   public plugin_init() {         register_plugin("Block Score", "1.0", "hleV");         register_forward(FM_CmdStart, "CommandStart"); }   public CommandStart(ClientID, UC_Handle) {         if (!is_user_alive(ClientID) && Level == 1 && (get_uc(UC_Handle, UC_Buttons) & IN_SCORE))         {                 set_uc(UC_Handle, UC_Buttons, ~IN_SCORE);                   return FMRES_SUPERCEDE;         }           return FMRES_IGNORED; }
__________________
hleV is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-08-2009 , 09:58   Re: block IN_SCORE
Reply With Quote #8

TY, ill test it
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-08-2009 , 10:49   Re: block IN_SCORE
Reply With Quote #9

I don't think it's possible to block it with a plugin since it's client-side.
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-08-2009 , 11:07   Re: block IN_SCORE
Reply With Quote #10

Quote:
Originally Posted by arkshine View Post
I don't think it's possible to block it with a plugin since it's client-side.
( i think arkshine is right

is this poss to block to use 2 command in one time??

for example :

+forward & +moveright. so that when player presses both keys, only one of this keys has function & another do nothing. somthing like this ?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 02:15.


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