Raised This Month: $51 Target: $400
 12% 

[CSGO] Menu with Knife! SIMPLE for coder!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bakaczysko
Junior Member
Join Date: Oct 2009
Old 01-23-2014 , 21:54   [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #1

Hello!
I need to add menu to this plugin: (Knife_get01a.sp) :
https://forums.alliedmods.net/showthread.php?t=231790

when player say in chat /knife he see this:

Menu style:


and use cookies to save that knife!

Now i must type in console sm_karambit or sm_flip etc. to change knife. I want change this in menu and save for next change (say /knife)

thx!

Last edited by bakaczysko; 01-23-2014 at 21:59. Reason: added
bakaczysko is offline
Static2601
Senior Member
Join Date: Jun 2010
Old 01-24-2014 , 14:44   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #2

I don't play CSGO and never made a plugin for it but I put together a simple menu that you can select the knives from it and it will run the command though ClientCommand. I also have never worked with cookies, so no cookies. I only tested the menu in tf2, but should work the same in CSGO, I would think. If I get client cookies working, ill be sure to update the files.
Attached Files
File Type: sp Get Plugin or Get Source (commandmenuhandler.sp - 592 views - 1.7 KB)
File Type: smx commandmenuhandler.smx (3.8 KB, 202 views)
Static2601 is offline
bakaczysko
Junior Member
Join Date: Oct 2009
Old 01-24-2014 , 15:22   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #3

THX BRO, menu ingame is ok but doesn't work... If I press 1,2,3,4,5 knife is this same.
Console ingame show this:
"Tried to look up command say as if it were a variable."
bakaczysko is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 01-24-2014 , 15:50   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #4

That menu only work for you alone (if you are the first one spawn in game );

Anyway try change this:
PHP Code:
ClientCommand(param1"sm_bayonet"); 
into this:
PHP Code:
ClientCommand(param1"say !bayonet"); 
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
Static2601
Senior Member
Join Date: Jun 2010
Old 01-24-2014 , 16:27   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #5

Quote:
Originally Posted by GsiX View Post
That menu only work for you alone (if you are the first one spawn in game );

Anyway try change this:
PHP Code:
ClientCommand(param1"sm_bayonet"); 
into this:
PHP Code:
ClientCommand(param1"say !bayonet"); 
I dont think I understand, Wouldnt it run the command for whoever called the menu? I also don't see how changing the command from console to chat would make a difference.
Static2601 is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 01-24-2014 , 16:32   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #6

I havent try the menu myself but:
PHP Code:
if (param1 == 
only work on client index 1. If you connect on index 2, you get no command.

EDIT:
I could be wrong here, haven't enough sleep. >.<"
anyway, the command executed on wrong index or something. Also possibility to wrong index or...
My brain can't think much..
its 5.35am here and i still awake on youtube..
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 01-24-2014 at 16:36.
GsiX is offline
Static2601
Senior Member
Join Date: Jun 2010
Old 01-24-2014 , 16:53   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #7

Quote:
Originally Posted by GsiX View Post
I havent try the menu myself but:
PHP Code:
if (param1 == 
only work on client index 1. If you connect on index 2, you get no command.

EDIT:
I could be wrong here, haven't enough sleep. >.<"
anyway, the command executed on wrong index or something. Also possibility to wrong index or...
My brain can't think much..
its 5.35am here and i still awake on youtube..
I was looking at param1 == 1 and wondering why I put that in there, I pulled it from a pluign i did a long time ago. It may be client index 1, which would only work on the first client to join the server. but I changed the sm_ to say ! while also changing ClientCommand to FakeClientCommand since you get a server cant exec, or whatever, error in console. Ive left the param1 == 1 the same for now. ill look into it in a bit.
Edit: Took out param1 == 1 from the attachment.
Attached Files
File Type: sp Get Plugin or Get Source (commandmenuhandler.sp - 464 views - 1.7 KB)

Last edited by Static2601; 01-24-2014 at 17:09.
Static2601 is offline
bakaczysko
Junior Member
Join Date: Oct 2009
Old 01-24-2014 , 18:17   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #8

Yeah now works fine THX!, but do you have any ideas how save this knife? Because when round is restarted, when player go to another team or play another map he again have standard knive.
bakaczysko is offline
Static2601
Senior Member
Join Date: Jun 2010
Old 01-24-2014 , 20:04   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #9

Not sure, Ill have to read up on it and try it first. Hopefully, someone else will have helped you by then.
Static2601 is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 01-25-2014 , 00:12   Re: [CSGO] Menu with Knife! SIMPLE for coder!
Reply With Quote #10

This should save your Knife and load in the next spawn...
Untested.. but should be work just fine..

EDIT:
Quote:
Originally Posted by GsiX View Post
anyway, the command executed on wrong index or something. Also possibility to wrong index or...
I fall in love with my english.. >.<"
Attached Files
File Type: sp Get Plugin or Get Source (commandmenuhandler.sp - 469 views - 3.0 KB)
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 01-25-2014 at 00:29.
GsiX 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 19:19.


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