I need to find the parent object for a username
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

I need to find the parent object for a username

Started by Tiskelion, 18 October, 2005, 16:30:58

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tiskelion

Hello fellow LUA-users :D ,

I was wondering if someone could help me with this:

I have a function that gets a string (sUser is not a User object) that contains a users nick,  and i need to determine what User object it belongs to.

I've tried doing it this way:

function GetUserObject(sUser)

	SendToAll("Finding parent object for "..sUser)

	local sReturnUser
	
	for _,sUserObject in FrmHub:GetOnlineNonOperators() do

		if sUser == sUserObject.sName then
	
			sReturnUser = sUserObject
			
			break
			
		end
		
	end
	
	SendToAll("Success!")
	
	return sReturnUser
	
end


but then the function doesn't seem to process anything because the "Success!" message is never seen in mainchat and any script after the GetUserObject call is not processed...  ?(

If anybody can point out where im making a stupid mistake  please do  :rolleyes:



I forgot to say that ofcourse there is only me in my testhub, so it wont find any non operator users, but even when i change GetOnlineNonOperators() to GetOnlineOperators() it still doesn't work :(





Greets,

Tiskelion
:] I am master of what is my dome! :]


bastya_elvtars

If you want to fetch the userobject when only the nick is available:

local user=GetItemByName(nick)

Explanation here.
Everything could have been anything else and it would have just as much meaning.

Tiskelion

#2
Thanks for the ultra-fast reply! :D

I'm going to test that right now.



works like a dream :D



Greets,

Tiskelion
:] I am master of what is my dome! :]


SMF spam blocked by CleanTalk