Raised This Month: $ Target: $400
 0% 

Menus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 09-01-2004 , 22:56   Menus
Reply With Quote #1

How would you know if a player chose something from a menu and how would you give him a weapon right after it? Can anyone show me with code?
Peli is offline
Send a message via MSN to Peli
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-01-2004 , 23:01  
Reply With Quote #2

show us ur menu code
Freecode is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 09-01-2004 , 23:05  
Reply With Quote #3

I didn't have one yet but I was just wondering.
Peli is offline
Send a message via MSN to Peli
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-01-2004 , 23:10  
Reply With Quote #4

well u do like this
Code:
switch (keys) {     case 1:     {         //code to give weapons or u can call another function in the plugin     }     case 2:     {         //code to give weapons or u can call another function in the plugin     } }
Freecode is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 09-01-2004 , 23:14  
Reply With Quote #5

Okay , so if you did that function by itself then it would automaticly no how many cases the menu has and would apply each number to the function?
Peli is offline
Send a message via MSN to Peli
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-01-2004 , 23:51  
Reply With Quote #6

no u pass on the keys to that function
Freecode is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 09-01-2004 , 23:56  
Reply With Quote #7

Okay I think I got it , but here's my code ( part of it ) :
Code:
public Myfunc(id, key) {     switch(key)     {         case 0:         { client_print(id, print_chat, "You have selected choice number 1") //Give a SMG         }         case 1:         { client_print(id, print_chat, "You have selected choice number 2") //Give a Rifle         }         case 2:         { client_print(id, print_chat, "You have selected choice number 3") //Give a Sniper Rifle         }         case 3:         { return PLUGIN_HANDLED         }     } }
BTW , thanks Freecode.
Peli is offline
Send a message via MSN to Peli
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-01-2004 , 23:59  
Reply With Quote #8

yep u got it
Freecode is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 09-02-2004 , 00:00  
Reply With Quote #9

Okay , thanks man!!!
Peli is offline
Send a message via MSN to Peli
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 09-02-2004 , 01:27  
Reply With Quote #10

Couple more questions.
1. How would take off a players bind to buy something and how would you stop a player from binding a key to the regular CS buy menus ( B & O ) while they play on that server?
2. After a player clicks on a button how would you make a new menu pop-up asking them which weapon to pick? Ex : If they picked a rifle class and you let them choose between all the CS rifles , like AK's , Colt's etc... If anyone could help me , it would be appreciated.
Peli is offline
Send a message via MSN to Peli
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 17:10.


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