AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu key question (simple) (https://forums.alliedmods.net/showthread.php?t=13255)

v3x 05-09-2005 16:36

Menu key question (simple)
 
Would these 2 work the same way?

Code:
public showMenu(id,key) {     if(!cs_get_user_buyzone(id)) {         client_print(id,3,"You must be in a buyzone to purchase that!")         return PLUGIN_HANDLED     }     switch(key) {         case 0: // blah blah         case 1: // blah blah         case 2: // blah blah     } } // AND public showMenu(id,key) {     switch(key) {         case 0: {             if(!cs_get_user_buyzone(id)) {                 client_print(id,3,"You must be in a buyzone to purchase that!")                 return PLUGIN_HANDLED             }         }         case 1: {             if(!cs_get_user_buyzone(id)) {                 client_print(id,3,"You must be in a buyzone to purchase that!")                 return PLUGIN_HANDLED             }         }         case 2: {             if(!cs_get_user_buyzone(id)) {                 client_print(id,3,"You must be in a buyzone to purchase that!")                 return PLUGIN_HANDLED             }         }     }     return PLUGIN_HANDLED }
:?:

teame06 05-09-2005 17:02

yes they both work the same way.

This was pulled out of atac config menu
Code:
switch(key)         {             case 0: MenuPage[id] = 2             case 1: MenuPage[id] = 4             case 2: MenuPage[id] = 5             case 3: MenuPage[id] = 7             case 7:             {                 atac_save(id)             }             case 9:             {                 // Menu Fix (Popup)                 MenuPage[id] = 0                 return PLUGIN_HANDLED             }         }

v3x 05-09-2005 17:05

Word.. :D


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

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