ID:143702
 
Code:
    Login()
var/A = src.client.address
if(findtext(BannedIP,A,1)==1)
src << "I am sorry, but you are ip banned."
del src



var
list
BannedIP = list()



switch(alert("Are you sure you wish to ban [M]/[M.key]?","Confirmation","Yes","No"))
if("Yes")
var/A = M.client.address//Copys the IP
BannedIP+=A


Problem description:
Alright, those are really the only segments of code you need to see. If it is at ==1 it doesn't let me, the host connect. If I do ==0, it won't let others connect.


You're using findtext on a list, which doesn't quite work! You want to use Find instead.

Also, Find (and findtext) returns the index of the found item, and 0 if nothing is found. So you don't want to use if(find()==1) - you want to use if(find()).
In response to Elation (#1)
Or even better, he could use in since the position doesn't matter to him.

if(A in BannedIP)
In response to DarkCampainger (#2)
Well, I could do that, but I am debating on whether or not to use copytext on the ip range so I can range ban. And I do know why it was banning me for ==0...It was because it doesn't see my ip address because I'm host. Thanks, both of you. I will test these when I get back home on the computer that has the dme file on it.