AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block IN_SCORE (https://forums.alliedmods.net/showthread.php?t=89598)

One 04-08-2009 09:42

block IN_SCORE
 
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 :(:cry:
in console : unknown cmd lol ...
but play can see the score....

TheRadiance 04-08-2009 09:47

Re: block IN_SCORE
 
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



hleV 04-08-2009 09:48

Re: block IN_SCORE
 
You forgot
Code:
return FMRES_SUPERCEDE;

TheRadiance 04-08-2009 09:51

Re: block IN_SCORE
 
Quote:

Originally Posted by hleV (Post 800702)
You forgot
Code:
return FMRES_SUPERCEDE;

Right, thanks.

hleV 04-08-2009 09:53

Re: block IN_SCORE
 
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; }

One 04-08-2009 09:53

Re: block IN_SCORE
 
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



hleV 04-08-2009 09:56

Re: block IN_SCORE
 
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; }

One 04-08-2009 09:58

Re: block IN_SCORE
 
TY, ill test it

Arkshine 04-08-2009 10:49

Re: block IN_SCORE
 
I don't think it's possible to block it with a plugin since it's client-side.

One 04-08-2009 11:07

Re: block IN_SCORE
 
Quote:

Originally Posted by arkshine (Post 800755)
I don't think it's possible to block it with a plugin since it's client-side.

:(( i think arkshine is right :cry::cry:

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 ? :(


All times are GMT -4. The time now is 02:15.

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