Raised This Month: $ Target: $400
 0% 

Menu with Use


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Linux inside
New Member
Join Date: Jan 2010
Old 01-23-2010 , 22:23   Menu with Use
Reply With Quote #1

Hey Folks , yeah the Titel of thise Thread is Pretty lame but i realy need help because im not so good at Scripting

I want to Create a Menu if A CT presses (+use) on a Terrorist
and then he could do things like Glowing and so on ( for exemple he want to Glow T the id of the T should be saved to an other "public" and the public Function should glow him when The round ends he should be autmaticly unglowed)

Is about Cs 1.6 and i Can t post Snippets because we don t want to make thise Plugin Public . But I realy hope that some can help me .
mfg Linux

Last edited by Linux inside; 01-23-2010 at 22:29.
Linux inside is offline
Linux inside
New Member
Join Date: Jan 2010
Old 01-24-2010 , 14:08   Re: Menu with Use
Reply With Quote #2

No one has an Idea ?
Linux inside is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 01-24-2010 , 14:13   Re: Menu with Use
Reply With Quote #3

1 ) Don't bump before 15 days have passed.

2 ) I'll code you whatever you need tonight once I get home. PM me the details if that's not all you want.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-24-2010 , 14:47   Re: Menu with Use
Reply With Quote #4

Quote:
Originally Posted by wrecked_ View Post
1 ) Don't bump before 15 days have passed.

2 ) I'll code you whatever you need tonight once I get home. PM me the details if that's not all you want.
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

const m_afButtonPressed 246
const m_afButtonReleased 247

public client_PostThink(id)
{
    if( !
is_user_alive(id) )
    {
        return
    }

    if( 
get_pdata_int(idm_afButtonPressed) & IN_USE )
    {
        
//Display the menu here To get your targets id. Use get_user_aiming
    
}

Doc-Holiday is offline
Linux inside
New Member
Join Date: Jan 2010
Old 01-24-2010 , 16:16   Re: Menu with Use
Reply With Quote #5

First , Sry i m new in Thise Forum so excuse me when i done something Wrong

Second : Thank you for thise help , and i have thougt that i should make it like

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
g_iMaxPlayers get_maxplayers()
    
register_clcmd("+use""menu")
    
cvar_playerinfo register_cvar("jailbreak_playerinfo""1")
}

public 
menu (id)
{
    if (
cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id))
    {
        return 
PLUGIN_HANDLED;
    } 
but i don t know how get the get_user_aiming to the next function that Glows the Player wich the Ct has Looked at . Any idea ?
Linux inside is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-24-2010 , 16:44   Re: Menu with Use
Reply With Quote #6

Quote:
Originally Posted by Linux inside View Post
First , Sry i m new in Thise Forum so excuse me when i done something Wrong

Second : Thank you for thise help , and i have thougt that i should make it like

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
g_iMaxPlayers get_maxplayers()
    
register_clcmd("+use""menu")
    
cvar_playerinfo register_cvar("jailbreak_playerinfo""1")
}

public 
menu (id)
{
    if (
cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id))
    {
        return 
PLUGIN_HANDLED;
    } 
but i don t know how get the get_user_aiming to the next function that Glows the Player wich the Ct has Looked at . Any idea ?
The way that mine is set up is Where the comment is it is called when you press the use key.

So try it out. put something like

PHP Code:
get_user_aiming(idtargetbody)
new 
targname[18
get_user_name(idtargname17)
client_print(idprint_chat"You pressed the use key aiming at %s"targname
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-25-2010 , 13:36   Re: Menu with Use
Reply With Quote #7

Code:
#include < amxmodx > #include < engine > #include < cstrike > #include < hamsandwich > new g_hMenu[ 33 ]; new g_iMenuPlayer[ 33 ]; public plugin_init( ) {     RegisterHam( Ham_ObjectCaps, "player", "FwdObjectCaps", 1 ); } public client_disconnect( iPlayer ) {     new hMenu = g_hMenu[ iPlayer ];     if( hMenu ) {         menu_destroy( hMenu );         g_hMenu[ iPlayer ] = 0;     }         g_iMenuPlayer[ iPlayer ] = 0;         for( new i = 1; i < 33; i++ ) {         if( g_iMenuPlayer[ i ] == iPlayer ) {             g_iMenuPlayer[ i ] = 0;         }     } } public FwdObjectCaps( iPlayer ) {     if( ( get_user_button( iPlayer ) & IN_USE )     && cs_get_user_team( iPlayer ) == CS_TEAM_CT ) {         new iEntity, iBody;         get_user_aiming( iPlayer, iEntity, iBody );                 if( is_user_alive( iEntity )         && cs_get_user_team( iEntity ) == CS_TEAM_T ) {             new hMenu = g_hMenu[ iPlayer ];             if( hMenu ) {                 menu_destroy( hMenu );             }                         hMenu = menu_create( "Your Menu", "MenuHandler" );                         menu_additem( hMenu, "Item 1", "1" );             menu_additem( hMenu, "Item 2", "2" );             menu_additem( hMenu, "Item 3", "3" );                         g_hMenu[ iPlayer ] = hMenu;             g_iMenuPlayer[ iPlayer ] = iEntity;                         menu_display( iPlayer, hMenu );         }     } } public MenuHandler( iPlayer, hMenu, iItem ) {     new hCurMenu = g_hMenu[ iPlayer ];     if( !hCurMenu     || hCurMenu != hMenu ) {         return;     }         new iMenuPlayer = g_iMenuPlayer[ iPlayer ];     if( !iMenuPlayer     || cs_get_user_team( iMenuPlayer ) != CS_TEAM_T     || iItem == MENU_EXIT ) {         goto exit_menu;     }         new iAccess, szInfo[ 3 ], hCallback;     menu_item_getinfo( hMenu, iItem, iAccess, szInfo, 2, _, _, hCallback );         switch( str_to_num( szInfo ) ) {         case 1: {             // iPlayer = ct player             // iMenuPlayer = t player                         // pressed item 1         }         case 2: {             // iPlayer = ct player             // iMenuPlayer = t player                         // pressed item 2         }         case 3: {             // iPlayer = ct player             // iMenuPlayer = t player                         // pressed item 3         }     }         exit_menu:     g_hMenu[ iPlayer ] = 0;     g_iMenuPlayer[ iPlayer ] = 0;     menu_destroy( hMenu ); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Gabriel
New Member
Join Date: Dec 2009
Old 01-26-2010 , 05:22   Re: Menu with Use
Reply With Quote #8

register_forward(FM_EmitSound, "fwEmitSnd")
Then :
public fwEmitSnd(id, channel, const snd[]){
if(!id || !is_user_connected(id) || !equal(snd,"common/wpn_denyselect.wav")) return

....
}
Gabriel 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 07:19.


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