Raised This Month: $ Target: $400
 0% 

Execute Menu Action on target


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-29-2005 , 19:32   Execute Menu Action on target
Reply With Quote #1

Ok, i want to know how to do soemthing to a selcted player...


For example I have a menu

Code:
Bla Bla

1. Bob
2. Joe
3. etc

9. Next
0. Exit
If i select Bob, I want to know how do i find out his index?

This is the code i have...

Code:
public ShowtryoutSelMenu(id) {         new szPlayer[200]     new szMenu[200]     new num[33]     new i         add(szMenu, 199, "Tryout\Accept Menu ( Press 8 To change Action ) ")         for( i = 0; i <get_maxplayers(); i++) {                 if( !is_user_connected(i) ) continue                 if( indexDislpayed[i] ) continue             //  if( is_user_admin(i) ) continue             //  if( i == id ) continue                 num[id]++                 if( num[id] == 8 ) {                         num[id] = 0                         break         }                     if( num[id] < 8 ) {                     new name[32]                         get_user_name(i, name, 31)                         szPlayer = ("%d. %s^n", num[id], name)                         add(szMenu, 199, szPlayer)                         indexDislpayed[i] = true                 }     }         switch(Action[id]) {                 case 1: add(szMenu, 199, "8. Tryout^n" )         case 2: add(szMenu, 199, "8. Accept^n" )     }         add(szMenu, 199, "9. Next^n")     add(szMenu, 199, "0. Exit")         show_menu(id,KeystryoutSelMenu, szMenu, -1, "tryoutSelMenu") // Display menu     } public PressedtryoutSelMenu(id, key) {     /* Menu:     * TryOut\Accept Menu     * $players(1,7,%n. %v)         * 8. Tryout\Accept         * 9.Next     * 0. Exit     */     switch (key) {         case 9: {                         new i                         for( i = 1; i < get_maxplayers(); i++ ) {                                 indexDislpayed[i] = false             }         }                     case 8: {                         ShowtryoutSelMenu(id)                     }                 case 7: {                         switch(Action[id]) {                                 case 1: Action[id] = ACTION_ACCEPT                 case 2: Action[id] = ACTION_TRYOUT             }                         ShowtryoutSelMenu(id)         }                 case 6: {                         // Do something to target         }     } }


I tried looking at AMXX's default menu plugin to find out how they did it but
I couldnt understand it :/

If you need any more info regarding this code, please tell me.

I thank you for all your help
--Zenith77
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
 


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 23:40.


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