AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [CSGO] Menu with Knife! SIMPLE for coder! (https://forums.alliedmods.net/showthread.php?t=234022)

bakaczysko 01-23-2014 21:54

[CSGO] Menu with Knife! SIMPLE for coder!
 
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:
http://oi44.tinypic.com/25kmn1w.jpg

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!

Static2601 01-24-2014 14:44

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
2 Attachment(s)
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.

bakaczysko 01-24-2014 15:22

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
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."

GsiX 01-24-2014 15:50

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
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"); 


Static2601 01-24-2014 16:27

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
Quote:

Originally Posted by GsiX (Post 2090473)
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.

GsiX 01-24-2014 16:32

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
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..

Static2601 01-24-2014 16:53

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
2 Attachment(s)
Quote:

Originally Posted by GsiX (Post 2090486)
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.

bakaczysko 01-24-2014 18:17

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
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.

Static2601 01-24-2014 20:04

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
Not sure, Ill have to read up on it and try it first. Hopefully, someone else will have helped you by then.

GsiX 01-25-2014 00:12

Re: [CSGO] Menu with Knife! SIMPLE for coder!
 
1 Attachment(s)
This should save your Knife and load in the next spawn...
Untested.. but should be work just fine..

EDIT:
Quote:

Originally Posted by GsiX (Post 2090486)
anyway, the command executed on wrong index or something. Also possibility to wrong index or...

I fall in love with my english.. >.<"


All times are GMT -4. The time now is 02:19.

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