Et-win Posted March 7, 2015 Posted March 7, 2015 outputChatBox(tostring(getResourceFromName("race"))) This always returns 'false' in client-side, I'm wondering why? (Server-side works only) EDIT: If I use outputChatBox(tostring(getResourceFromName("admin"))) it works fine. Why doesn't this work with "race"?
Et-win Posted March 7, 2015 Author Posted March 7, 2015 I found out that the resource needs to be running when using 'getResourceFromName'. So I have an editbox and can fill in any name and want to check if it exists. How can I do this when I can't use 'getResourceFromName' when the resource is not running?
Addlibs Posted March 7, 2015 Posted March 7, 2015 I guess you'd most likley have to do some server-client events (preferably latent events, so the server wouldn't lag)
toxicsmoke11 Posted March 7, 2015 Posted March 7, 2015 just like you can't get a player from getPlayerFromName while he/she is offline, you can't get a resource with getResourceFromName if it's not running. you can use serverside and use getResources() and check if it exists server-side if you insist on client-side then idk, i didn't really use this client-sided nor i needed to
Et-win Posted March 7, 2015 Author Posted March 7, 2015 you can't get a resource with getResourceFromName if it's not running. Server-side you can, so I don't see the reason for not being able to do it client-side.
Addlibs Posted March 7, 2015 Posted March 7, 2015 I guess it's because the client is not aware of all resources; only those which are running, have an instance, have their resourceRoot element are visible to the client.
Et-win Posted March 8, 2015 Author Posted March 8, 2015 Well anyway, I did a trigger to server-side and back to client-side to check or the resource exists. Thanks all for the thinking (and helping).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now