AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   End button help (https://forums.alliedmods.net/showthread.php?t=128041)

drakeris 05-28-2010 05:50

End button help
 
the title says all:
PHP Code:

public FwdCmdStart(identuc_handleseed)
{
    if (
is_user_connected(id) && get_pcvar_num(ff_stat))
        return 
FMRES_IGNORED;
    
    new 
button get_uc(uc_handleUC_Buttons);

    new 
target[32]
    
pev(entpev_targetnametarget31)
        
    if ((
button IN_USE))
    {
        if(
equal(target"endbut")) 
        {
            
set_task1.0 "text" 2356 "a" );
        }
    }
    return 
FMRES_IGNORED;
}

public 
text()
{
    
client_print(0print_chat"gratz You almost won the fear factory left only one victory...")


im using this everything wokrs except when i push button i do not get message...

minato 05-28-2010 09:41

Re: need help with button...
 
It tries with this code
PHP Code:

    new button pev(idpev_button)
   
    if ((
button IN_USE) && !(pev(idpev_oldbuttons) & IN_USE)) {

        
//Your Code
    



drakeris 05-30-2010 08:54

Re: need help with button...
 
Quote:

Originally Posted by minato (Post 1193406)
It tries with this code
PHP Code:

    new button pev(idpev_button)
   
    if ((
button IN_USE) && !(pev(idpev_oldbuttons) & IN_USE)) {

        
//Your Code
    



srry didn`t understand you...
any solutions?

Bugsy 05-30-2010 09:32

Re: need help with button...
 
PHP Code:

#include <amxmodx>
#include <fakemeta>

#define TASK_ENDBUT    2356

public plugin_init() 
{
    
register_forwardFM_CmdStart "FwdCmdStart" );
}

public 
FwdCmdStartid uc_handle seed )
{
    
//if (is_user_connected(id) && get_pcvar_num(ff_stat))
    //    return FMRES_IGNORED;
    
    //this is your problem code
    
static target[32]
    
peventpev_targetname target 31 )
    
//&& equal( target , "endbut" )
    
    
if ( ( get_ucuc_handle UC_Buttons ) & IN_USE ) && !( pevid pev_oldbuttons ) & IN_USE ) )
    {
        
set_task1.0 "text" TASK_ENDBUT id );
    }
    
    return 
FMRES_IGNORED;
}

public 
texttaskid )
{
    
client_printtaskid TASK_ENDBUT print_chat"gratz You almost won the fear factory left only one victory...")



drakeris 05-30-2010 12:36

Re: need help with button...
 
Quote:

Originally Posted by Bugsy (Post 1195208)
PHP Code:

#include <amxmodx>
#include <fakemeta>

#define TASK_ENDBUT    2356

public plugin_init() 
{
    
register_forwardFM_CmdStart "FwdCmdStart" );
}

public 
FwdCmdStartid uc_handle seed )
{
    
//if (is_user_connected(id) && get_pcvar_num(ff_stat))
    //    return FMRES_IGNORED;
    
    //this is your problem code
    
static target[32]
    
peventpev_targetname target 31 )
    
//&& equal( target , "endbut" )
    
    
if ( ( get_ucuc_handle UC_Buttons ) & IN_USE ) && !( pevid pev_oldbuttons ) & IN_USE ) )
    {
        
set_task1.0 "text" TASK_ENDBUT id );
    }
    
    return 
FMRES_IGNORED;
}

public 
texttaskid )
{
    
client_printtaskid TASK_ENDBUT print_chat"gratz You almost won the fear factory left only one victory...")



thanks it worked :} now i know my problem
P.S.Your the best :}

Exolent[jNr] 05-31-2010 02:06

Re: need help with button...
 
Your topic title must be descriptive.
Fix it before posting again.

drakeris 05-31-2010 03:01

Re: End button help
 
im using bugsy method, and i just know saw that when i push E button it shows the text but i wanted that only if i push button that is called endbut
P.S.title edited


All times are GMT -4. The time now is 05:26.

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