PtokaX forum

Development Section => Your Developing Problems => Topic started by: [ES]latinmusic on 07 November, 2003, 14:55:03

Title: GetItemByName()
Post by: [ES]latinmusic on 07 November, 2003, 14:55:03
Scripting part are driving me crazy, please help me here:
1.- What do i supposse this: GetItemByName() does?.
2.- If i put the following line:
temp = GetItemByName(arg)
and if arg have the string value test
what is the exact value i obtain in var: temp ?.
Or i doing something really wrong or i'm an idiot, probably the second :(
Title:
Post by: Guibs on 07 November, 2003, 15:28:37
Hi there,,

GetItemByName() < check if a string can be converted as an 'user object'

temp = GetItemByName(arg) < so, check if 'arg' is connected,...

if your arg = 'test', & if 1 user called 'test' is connected, then the script will get the user object 'temp'.
-----
Code: [Select]
temp = GetItemByName(arg)
if temp ~= nil then
SendToOps("Log",temp.sName.." is connected...., & his Ip is: "..temp.sIP.." :)")
else
SendToOps("Log",arg.." is not connected.... :s")
end
-----
So,, as 'temp' is connected, you can use those properties with him:
-----
sName
bOperator
sIP
iVersion
sMyInfoString
iProfile
-----
See the scripting.txt file for more help about,,
Hoping it helps,, :)

l8tr, ;)
Title:
Post by: [ES]latinmusic on 07 November, 2003, 16:59:03
Yes it help a lot althougth does not fix my problem, thanks guibs  :P