soul2eat
Expired VIP Member
Posts: 110
Joined: Nov 2013
Reputation: 24
Version:
1.4.2.132
|
Help please O_o
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?
(This post was last modified: 12-23-2014 20:20 PM by soul2eat.)
|
|
12-23-2014 20:19 PM |
|
tophersoccer
Expired VIP Member
Posts: 422
Joined: Aug 2012
Reputation: 142
Version:
1.4.3.143
|
RE: Help please O_o
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 |
|
soul2eat
Expired VIP Member
Posts: 110
Joined: Nov 2013
Reputation: 24
Version:
1.4.2.132
|
RE: Help please O_o
(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.....
|
|
12-24-2014 00:49 AM |
|
tophersoccer
Expired VIP Member
Posts: 422
Joined: Aug 2012
Reputation: 142
Version:
1.4.3.143
|
RE: Help please O_o
wow this is really bothering me! I'm gonna have to try it myself. did you try comparing just one?
(This post was last modified: 12-24-2014 01:05 AM by tophersoccer.)
|
|
12-24-2014 01:03 AM |
|
soul2eat
Expired VIP Member
Posts: 110
Joined: Nov 2013
Reputation: 24
Version:
1.4.2.132
|
RE: Help please O_o
(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.
(This post was last modified: 12-24-2014 02:35 AM by soul2eat.)
|
|
12-24-2014 02:35 AM |
|
Pelukis
MaboX
Posts: 50
Joined: Oct 2014
Reputation: 21
Version:
1.4.2.138
|
RE: Help please O_o
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..
(This post was last modified: 12-25-2014 02:46 AM by Pelukis.)
|
|
12-24-2014 05:19 AM |
|
Reputed by : | soul2eat(+1) |