I have a loop through some files and at the moment when it finds one of the files it stops and boots the player from the server.
But the problem i have is that if it doesnt find the first file i dont want it to call the function the function till its checked them all, i want it to boot the person if any of the files are found but if it dont find the first file it just stops, or the opposite and it just spams chat with each file that is searched where as i only want it to post in chat once it searches all.
How would i go about doing this?
Post your code, we are not mind readers.
You dont need to know the code, i just want to know what is the best way to go about doing this.
I was thinking of adding 1 to a value every time no file is found then when that value reaches the number in the table then run the notification.
I have no clue what you just said.
Then why post?
So doing something like this is what I was wondering if it would work how I want.
[Lua]
for k,v in pairs (Blocked) do
if file.Find( v ) then
--Shiz here
else
local recount = recount + 1
--No find Shiz here
end
if recount >= #Blocked then
--Nothing found at all
end
end
[/Lua]
Would something like this work?
Because he wanted to help you but couldn't understand a shit what you typed?
Giving it a shot. Sec.
[editline]10th April 2011[/editline]
[lua]local recount = 0
for k, v in pairs(Blocked) do
if file.Find( v ) then
recount = recount + 1;
end
end
if recount != 0 then
dostuff()
end[/lua]
Assuming I understand what you said in OP, this is what you want:
[lua]for i, fileName in ipairs( Blocked ) do
if( file.Exists( fileName ) ) then
// file found, do your stuff
break;
end
end[/lua]
Dont worry guys.
I wont bother doing the second check, ill just ignore them if they pass the check, people dont need to know they passed, it could just be an unknown cheat.
Thanks anyway.
I don't understand why you are making an anticheat just edit flapjacks one its 10 times better than anything your going to make
Sorry, you need to Log In to post a reply to this thread.