Raised This Month: $ Target: $400
 0% 

dynamic menu building


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 11-22-2006 , 03:09   dynamic menu building
Reply With Quote #1

me again ;)

how you make a dynamic menu builder ?

like you got an array[32] filled with players
some of them have the status 1 others 0

how you make a menu with those when their status is 1?
btw this might differ from time to time, since the array is only builded when a player pushes a button

thx in advance
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-22-2006 , 03:26   Re: dynamic menu building
Reply With Quote #2

ehm...
Code:
new array[33]
server_frame(){
for(new a = 1; a <= get_playersnum(); a++) {
if (pushedbutton[a]){
array[id] = 1
}else{
array[id] = 0 //make sure it's off
}
}
}
 
public menucommand(id){
if (!array[id])return PLUGIN_HANDLED
 
//whatever
}
this is what i think, but it should be inefficient or whatever,
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 11-22-2006 , 03:58   Re: dynamic menu building
Reply With Quote #3

bullcrap totally not what i asked

@dutchmeat: stop es met waardeloze posts man, die van jou nu trekt op niets
english: stop posting worthless posts, since this thing is totally crap
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-22-2006 , 04:05   Re: dynamic menu building
Reply With Quote #4

I posted what you asked,
Quote:
since the array is only builded when a player pushes a button
If it's not good, then explain your problem better.
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
watch
Senior Member
Join Date: Sep 2005
Old 11-22-2006 , 05:23   Re: dynamic menu building
Reply With Quote #5

Quote:
like you got an array[32] filled with players
some of them have the status 1 others 0

how you make a menu with those when their status is 1?
btw this might differ from time to time, since the array is only builded when a player pushes a button
Something along the lines of http://forums.alliedmods.net/showpos...31&postcount=5 ?

Would need to obviously edit the loop to your requirements

Also it should be array[33] as player id's are from 1 - 32
__________________
Code:
#include <amusing_small_signiture>

Last edited by watch; 11-22-2006 at 05:48.
watch is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 11-22-2006 , 13:30   Re: dynamic menu building
Reply With Quote #6

Quote:
Originally Posted by watch View Post
Also it should be array[33] as player id's are from 1 - 32
erm i don't think the worldspawn is required so [32]
btw 1 to 32 is [32]
0 to 32 is [33]
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
watch
Senior Member
Join Date: Sep 2005
Old 11-22-2006 , 14:04   Re: dynamic menu building
Reply With Quote #7

An array index starts from 0
__________________
Code:
#include <amusing_small_signiture>
watch is offline
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 02:33.


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