BlueskyVPS Posted November 28, 2011 Posted November 28, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 Z3R0 Posted November 28, 2011 Posted November 28, 2011 Excluding GM's OnPCLoginEvent: // Increase Variable on NON GM Logins and Check Against 10 if (!getgmlvl()) { set .player_count, .player_count + 1; if (.player_count > 10) { set .player_count, 10; // Keep @ 10, to avoid incrementing this further... mes "I'm sorry you cannot enter..."; close2; atcommand "@kick " + strcharinfo(0); } } OnPCLogoutEvent: // Decrease Variable on NON GM Char Logout if (!getgmlevel()) { set .player_count, .player_count - 1; } } Quote
0 Z3R0 Posted November 28, 2011 Posted November 28, 2011 depends on what the "Game" is, and how it's ran, but yes, anything's possible... create a counter variable, either $var or .var increase it's amount +1 on each character if ($var or .var == 10) { mes "Sorry Max Players reached"; close; } 1 Quote
0 Emistry Posted November 28, 2011 Posted November 28, 2011 you mean limit how many players can access to your Server ? or custom game like event ?? hmm - script Sample -1,{ OnPCLoginEvent: if( getusers(1) > 10 ) atcommand "@Kick "+strcharinfo(0); end; } Quote
0 BlueskyVPS Posted November 28, 2011 Author Posted November 28, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 Emistry Posted November 28, 2011 Posted November 28, 2011 (edited) LOL...actually to limit player to connect to your game..there is 1 simple way rather than my script conf/char_athena.conf // Maximum users able to connect to the server. Set to 0 for unlimited. max_connect_user: 0 anyway..for vendor not counting.. erm..not sure..maybe can do a trick like this when character logon...add +1 to a variable. then attach a timer to character... every interval of time check whether player is vending or else.. if yes then detach the timer and -1 to variable. Edited November 28, 2011 by Emistry 1 Quote
0 BlueskyVPS Posted November 28, 2011 Author Posted November 28, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 Z3R0 Posted November 28, 2011 Posted November 28, 2011 what is a "vendor" ???? you want to differentiate active 10 players vs vendors? seems kinda pointless right? Quote
0 BlueskyVPS Posted November 28, 2011 Author Posted November 28, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 Truly Posted November 28, 2011 Posted November 28, 2011 The script Emistry made should do the trick, if not tell us whats wrong, or what isnt the way you want in detail o: Quote
0 BlueskyVPS Posted November 28, 2011 Author Posted November 28, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 Sneaky Posted November 28, 2011 Posted November 28, 2011 alright how about a script just to limit for only 10player including gm accounts? There's no need to do such script, as Emistry said. eathena > conf > char_athena.conf Just change the values...should be like this // Maximum users able to connect to the server. Set to 0 for unlimited. max_connect_user: 10 // Minimum GM level that is allowed to bypass the server limit of users. gm_allow_level: 100 Will allow to connect 10 users as max, and only GMs level 100 or above will be able to connect. Since admins are 99 they will still not be able to connect, nor any other lower gms. 1 Quote
0 llchrisll Posted November 28, 2011 Posted November 28, 2011 (edited) to limit players that can access server --- edit: but i wont count venders? is that possible too for this there is the command checkvending() o.o *checkvending ({"<player name>"})*checkchatting ({"<Player Name>"}) If the player's name is given, this command checks for that player to be online and wether he/she is chatting or vending. When no name is given, the attached player is used for checking. Returns true or false (1 or 0) when the player is chatting/vending or not. Example(s): if (checkVending("Aaron")) mes "Aaron is currently vending!"; //This will check if Aaron is vending, and if so, put a message in front //of the attached player saying Aaron is vending. if (checkChatting()) mes "You are currently chatting!"; //This will check if you're in a chat room or not Well for this to work you would need an array to check the players since it requires an character (obviously o.o), Regards, Chris Edited November 28, 2011 by llchrisll Quote
0 BlueskyVPS Posted November 29, 2011 Author Posted November 29, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 BlueskyVPS Posted November 29, 2011 Author Posted November 29, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 Z3R0 Posted November 29, 2011 Posted November 29, 2011 sorry my first IF check is wrong function name change if (!getgmlvl()) to if (!getgmlevel()) Quote
0 BlueskyVPS Posted November 29, 2011 Author Posted November 29, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 Z3R0 Posted November 29, 2011 Posted November 29, 2011 remove the double IF if if does not work Quote
0 BlueskyVPS Posted November 29, 2011 Author Posted November 29, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
0 BlueskyVPS Posted November 29, 2011 Author Posted November 29, 2011 (edited) SOLVED Edited November 30, 2011 by TooTpher Quote
Question
BlueskyVPS
SOLVED
Edited by TooTpher20 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.