Lineage 2 Tower Forum

Full Version: Help please O_o
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
man1 = "playerplayer"
man2 = "Cdesz"
man3 = "cheaper"
man4 = ""
man5 = ""



repeat
player = GetPlayerList(); -- getting list
for play in player.list do
if play:GetName() == man1
or play:GetName() == man2
or play:GetName() == man3
or play:GetName() == man4
or play:GetName() == man5
then
ShowToClient("found","who? "..play:GetName())
Sleep(500)
else
ShowToClient("found","none ")
Sleep(10*1000)
end
end
until false



why it show i found none when my other guys are beside him?
I dont see anything wrong ><. Try this though, all i added was tostring() when you are showing the name to client because it wouldn't print out otherwise


    LUA Programming
man1 = "playerplayer"
man2 = "Cdesz"
man3 = "cheaper"
man4 = ""
man5 = ""
 
 
 
repeat
	player = GetPlayerList(); -- getting list
	for play in player.list do
		if play:GetName() == man1 or play:GetName() == man2 or play:GetName() == man3 or play:GetName() == man4 or play:GetName() == man5 then
			ShowToClient("found","who? ".. tostring(play:GetName()))
			Sleep(500)
		else
			ShowToClient("found","none ")
			Sleep(10*1000)
		end
	end
until false

(12-23-2014 22:51 PM)tophersoccer Wrote: [ -> ]I dont see anything wrong ><. Try this though, all i added was tostring() when you are showing the name to client because it wouldn't print out otherwise


    LUA Programming
man1 = "playerplayer"
man2 = "Cdesz"
man3 = "cheaper"
man4 = ""
man5 = ""
 
 
 
repeat
	player = GetPlayerList(); -- getting list
	for play in player.list do
 if play:GetName() == man1 or play:GetName() == man2 or play:GetName() == man3 or play:GetName() == man4 or play:GetName() == man5 then
 ShowToClient("found","who? ".. tostring(play:GetName()))
 Sleep(500)
 else
 ShowToClient("found","none ")
 Sleep(10*1000)
 end
	end
until false


still found none.....
wow this is really bothering me! I'm gonna have to try it myself. did you try comparing just one?
(12-24-2014 01:03 AM)tophersoccer Wrote: [ -> ]wow this is really bothering me! I'm gonna have to try it myself. did you try comparing just one?

nope, but i'm using GetUserByName() at the moment, but i don't like it O_o i would rather use this if it work..i know it work but mine is just mess up somewhere lol.
try this..

    LUA Programming
--- User Inrange Check
--- Pelukis 2014
--- Hope it work... 
 
sUserList = {'Name1','Name2','Name3'};
CheckRange = 2000;
InProgres = false;
 
function IsInList(sName)
	for x,y in pairs(sUserList) do
 if (y == sName) then
 return true;
 end;
	end;
	return false;
end;
 
function CheckUser()
	InProgres = true;
	local Ret = false;
	local Plist = GetPlayerList();
	for Ppl in Plist.list do
 if (GetMe():GetRangeTo(Ppl) < CheckRange) and IsInList(Ppl:GetName()) then
 ShowToClient("UserCheck", "Found : " .. tostring(Ppl:GetName()))
 Sleep(1000);
 Ret = true;
 end;
 Sleep(1000);
	end;
	InProgres = false;
	return Ret;
end;
 
repeat
	if not InProgres then
 if not CheckUser() then
 ShowToClient("UserCheck", "Nothing Found!");
 end;
	end;
	Sleep(2000);
until false;



Tested working..
Reference URL's