AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Strip knife / set knife (https://forums.alliedmods.net/showthread.php?t=235093)

Going Dutch 02-08-2014 13:35

[REQ] Strip knife / set knife
 
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!

hornet 02-08-2014 17:21

Re: [REQ] Strip knife / set knife
 
You should try to explain in more detail without saying "like xyz plugin" .

Going Dutch 02-08-2014 17:35

Re: [REQ] Strip knife / set knife
 
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.

hornet 02-08-2014 18:05

Re: [REQ] Strip knife / set knife
 
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".

Going Dutch 02-08-2014 18:12

Re: [REQ] Strip knife / set knife
 
Sorry, i meant hiding the knife.

hornet 02-08-2014 18:18

Re: [REQ] Strip knife / set knife
 
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, "" ); }

Going Dutch 02-08-2014 19:17

Re: [REQ] Strip knife / set knife
 
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.

ConnorMcLeod 02-09-2014 03:11

Re: [REQ] Strip knife / set knife
 
In last function, change :

PHP Code:

    if( g_bNoKnifeid ] ) 

with

PHP Code:

    if( g_bNoKnifeid ] && get_pdata_int(idm_iPlayerTeam ) == 


Going Dutch 02-09-2014 05:26

Re: [REQ] Strip knife / set knife
 
Works perfect now, Thank you!


All times are GMT -4. The time now is 16:49.

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