Raised This Month: $32 Target: $400
 8% 

[Knife Menu Save Choice] Scripting help


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-19-2024 , 22:56   Re: [Knife Menu Save Choice] Scripting help
Reply With Quote #11

This is the Scripting Help section for helping people write their own plugins so I rarely "do it for you". How much of this plugin did you write?

You need to give the player a specific knife based on their previous menu selection. You have a function that gives them a knife based on their menu selection. You can get their previous menu selection with GetKnife(id).

Therefore, you can simply call the appropriate function based on the value of GetKnife(id). It is basically the same as your menu handler code except you use GetKnife(id) instead of the menu key. You can literally copy and paste the code and remove all the menu functions and replace "key" with GetKnife(id). Extremely simple.

Just remember to do this in client_authorized(id) and not client_putinserver(id) because the SteamID is not valid until client_authorized(id) has been executed.
__________________
fysiks is offline
Tote
Senior Member
Join Date: Jul 2023
Old 02-21-2024 , 07:12   Re: [Knife Menu Save Choice] Scripting help
Reply With Quote #12

Suggestion: i don't think you need to make global for every knife like: bool g_knife1[33] , g_knife2[33]
just make like: g_knife[33] and use on each case g_knife[id] = 1 , g_knife[id] = 2
Then make a vault and save this g_knife[id] then when connect auto will be that knife
Sorry for bad explaination

Last edited by Tote; 02-21-2024 at 07:13.
Tote is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-21-2024 , 20:30   Re: [Knife Menu Save Choice] Scripting help
Reply With Quote #13

Quote:
Originally Posted by Tote View Post
Suggestion: i don't think you need to make global for every knife like: bool g_knife1[33] , g_knife2[33]
just make like: g_knife[33] and use on each case g_knife[id] = 1 , g_knife[id] = 2
Then make a vault and save this g_knife[id] then when connect auto will be that knife
Sorry for bad explaination
I agree, generally, but the author/OP is new to programming so this is too big of a change to handle at the same time as implementing the request in the thread. So, one step at a time. Once this feature is added, he can refactor to make it more effective.
__________________
fysiks is offline
tedaimlocks
Member
Join Date: Jan 2024
Old 02-22-2024 , 03:59   Re: [Knife Menu Save Choice] Scripting help
Reply With Quote #14

Quote:
Originally Posted by fysiks View Post
This is the Scripting Help section for helping people write their own plugins so I rarely "do it for you". How much of this plugin did you write?

You need to give the player a specific knife based on their previous menu selection. You have a function that gives them a knife based on their menu selection. You can get their previous menu selection with GetKnife(id).

Therefore, you can simply call the appropriate function based on the value of GetKnife(id). It is basically the same as your menu handler code except you use GetKnife(id) instead of the menu key. You can literally copy and paste the code and remove all the menu functions and replace "key" with GetKnife(id). Extremely simple.

Just remember to do this in client_authorized(id) and not client_putinserver(id) because the SteamID is not valid until client_authorized(id) has been executed.

I didnt write this plugin, i just found it and added the survivor knife,vip,pvip and made it a little bit better
tedaimlocks is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-23-2024 , 00:48   Re: [Knife Menu Save Choice] Scripting help
Reply With Quote #15

Quote:
Originally Posted by tedaimlocks View Post
I didnt write this plugin, i just found it and added the survivor knife,vip,pvip and made it a little bit better
Ok, fine, I guess I have to be pedantic. Replace "write their own plugins" with "write or edit plugins". If you are not going to write or edit your own plugins, post in the Suggestions/Requests subforum and wait for someone to do do your request for you. The community is quite small these days so it's possible it will never be done for you. So, learning to do it on your own is a good idea.

P.S. Your original post shows you as the sole author.
__________________

Last edited by fysiks; 02-23-2024 at 00:55.
fysiks is offline
Reply


Thread Tools
Display Modes

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 14:25.


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