Raised This Month: $ Target: $400
 0% 

[REQ] Strip knife / set knife


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Going Dutch
Member
Join Date: Dec 2013
Old 02-08-2014 , 13:35   [REQ] Strip knife / set knife
Reply With Quote #1

Hi,

I need this menu which shows only once to an terrorist when they have joined the game.
It will have the option to show the knife or not.

Its like the hns_fakeknife cvar from the hidenseek mod.

Quote:
hns_fakeknife 0/1/2
- Enables or disables a fake knife for Terrorists to avoid speed bug. 0: disable, 1: invisible knife, 2: visible knife (default: 1)

The menu should look like this:

Quote:
/rShow the Knife?:
1. Yes.
2. No.

Thank you, i have tried creating this myself but i'm completely lost.

Thanks in advance!
__________________
Learning amxx/pawn and all that good stuff.
Going Dutch is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 02-08-2014 , 17:21   Re: [REQ] Strip knife / set knife
Reply With Quote #2

You should try to explain in more detail without saying "like xyz plugin" .
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Going Dutch
Member
Join Date: Dec 2013
Old 02-08-2014 , 17:35   Re: [REQ] Strip knife / set knife
Reply With Quote #3

Alright, i'm sorry.

When a player has joined the server and has chosen the terrorist team there should come up an menu which will ask the player if he wants an knife or not.

If the player has chosen Yes, it will give the terrorist an Knife.
If not, the knife will be removed.

This menu will only show once when the player joined terrorist.
__________________
Learning amxx/pawn and all that good stuff.
Going Dutch is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 02-08-2014 , 18:05   Re: [REQ] Strip knife / set knife
Reply With Quote #4

Much better. Although I'm still confused as to whether you want to hide the knife or actually strip it, since you have used the term "strip" in your title but in your post you say "show the knife".
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Going Dutch
Member
Join Date: Dec 2013
Old 02-08-2014 , 18:12   Re: [REQ] Strip knife / set knife
Reply With Quote #5

Sorry, i meant hiding the knife.
__________________
Learning amxx/pawn and all that good stuff.
Going Dutch is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 02-08-2014 , 18:18   Re: [REQ] Strip knife / set knife
Reply With Quote #6

Is this what your looking for:
Code:
#include <amxmodx> #include <fakemeta> new const VERSION[]     =   "0.0.1"; const m_iPlayerTeam     =   114; const m_iJoiningState       =   121; const m_iMenu           =   205; const MENU_CHOOSECLASS      =   3; const STATE_CHOOSECLASS     =   4; new bool:g_bNoKnife[ 33 ], g_iMenu; public plugin_init() {     register_plugin( "Knife Model Option", VERSION, "hornet" );         BuildMenu();         register_clcmd( "menuselect", "ClientCommand_JoinClass" );     register_clcmd( "joinclass", "ClientCommand_JoinClass" );         register_event( "CurWeapon", "Event_CurWeapon", "be", "1=1", "2=29" ); } BuildMenu() {     g_iMenu = menu_create( "\yShow the knife model?", "MenuHandle_Knife" );         menu_additem( g_iMenu, "Yes" );     menu_additem( g_iMenu, "No" );         menu_setprop( g_iMenu, MPROP_EXIT, MEXIT_NEVER ); } public MenuHandle_Knife( id, iMenu, iItem ) {     if( iItem != 0 )         g_bNoKnife[ id ] = true;     else    g_bNoKnife[ id ] = false; } public ClientCommand_JoinClass( id ) {     if( get_pdata_int( id, m_iMenu ) == MENU_CHOOSECLASS && get_pdata_int( id, m_iJoiningState ) == STATE_CHOOSECLASS && get_pdata_int( id, m_iPlayerTeam ) == 1 )         menu_display( id, g_iMenu ); } public Event_CurWeapon( id ) {     if( g_bNoKnife[ id ] )         set_pev( id, pev_viewmodel2, "" ); }
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 02-08-2014 at 18:19.
hornet is offline
Going Dutch
Member
Join Date: Dec 2013
Old 02-08-2014 , 19:17   Re: [REQ] Strip knife / set knife
Reply With Quote #7

Yes, Thank you!

But can you maybe add so when the player is swapped over to CT it show the knife again.
And when he goes to the Terrorist team the knife stays hiden.
__________________
Learning amxx/pawn and all that good stuff.

Last edited by Going Dutch; 02-08-2014 at 19:25.
Going Dutch is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-09-2014 , 03:11   Re: [REQ] Strip knife / set knife
Reply With Quote #8

In last function, change :

PHP Code:
    if( g_bNoKnifeid ] ) 
with

PHP Code:
    if( g_bNoKnifeid ] && get_pdata_int(idm_iPlayerTeam ) == 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Going Dutch
Member
Join Date: Dec 2013
Old 02-09-2014 , 05:26   Re: [REQ] Strip knife / set knife
Reply With Quote #9

Works perfect now, Thank you!
__________________
Learning amxx/pawn and all that good stuff.
Going Dutch 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 16:49.


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