AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   dynamic menu building (https://forums.alliedmods.net/showthread.php?t=47603)

SSJ2GOKU 11-22-2006 03:09

dynamic menu building
 
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

dutchmeat 11-22-2006 03:26

Re: dynamic menu building
 
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,:)

SSJ2GOKU 11-22-2006 03:58

Re: dynamic menu building
 
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

dutchmeat 11-22-2006 04:05

Re: dynamic menu building
 
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.

watch 11-22-2006 05:23

Re: dynamic menu building
 
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

SSJ2GOKU 11-22-2006 13:30

Re: dynamic menu building
 
Quote:

Originally Posted by watch (Post 405932)
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]

watch 11-22-2006 14:04

Re: dynamic menu building
 
An array index starts from 0


All times are GMT -4. The time now is 06:55.

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