mob/Login()
if(playerlimit==14)
alert("This server already has 14 players. Find another, or start your own.")
del src
else
usr.icon='player.dmi'
usr.icon_state="base"
usr.loc=locate(11,4,1)
world<<"<font color=olive><b>[usr] has joined the game."
playerlimit+=1
mob/Logout()
playerlimit-=1
del src
Problem description:
Just curious if this would work okay for the time being as a makeshift player limit code for my island survival prototype I'm hashing together real quickly.
I won't need anything advanced. Just something I'm doing for the month of October to make a horror related project.
Tips, comments appreciated.
Your variable is called "playerlimit" but it's really just "the number of players in the game", or "player count". The actual "player limit" is apparently 14.
You can set the player's icon and icon state at compile time.
If your player is deleted but the player didn't log out, your player_count will be inaccurate. This can lead to the player limit appearing lower than it should be, because you're counting players that don't exist.