Forum

> > CS2D > Scripts > [Lua Problem] Images visible to all players
Forums overviewCS2D overview Scripts overviewLog in to reply

English [Lua Problem] Images visible to all players

9 replies
To the start Previous 1 Next To the start

old [Lua Problem] Images visible to all players

EngiN33R
Moderator Off Offline

Quote
So I've been working on my VisualLua mod lately and I've experienced a very weird problem. When one player opens his backpack, the buttons are interactable and visible to all other players as well.

I've made sure that images are only shown to the player who opened the backpack and stuff, so don't post 'you forgot to add the id parameter at the end of image function' without actually reading the code.

Now it may be ineffective and I could be using some for loops and functions that 'are unused/bad/getting deprecated nuuuu don't use them', so please don't post only to point out that.

I won't post the whole code on the forum, here's a pastebin link: http://pastebin.com/uZdfTcKR

Thank you in advance!

old Re: [Lua Problem] Images visible to all players

Yasday
User Off Offline

Quote
I don't see why it doesn't work. You didn't forget anything, there are no errors, the id parameter is given in every image function.

I had a problem like this aswell. I don't know how I fixed it, it just worked after some time.

old Re: [Lua Problem] Images visible to all players

DannyDeth
User Off Offline

Quote
The Linux dedicated server software is perfectly stable AFAIK, it most probably isn't because of that. And like Yasday* ( wrote Yates, lol ftw ), I couldn't really find anything wrong It is most probably contained in some sort of loop ( most probably a For ) that is looping through all the players and sending it to each of them when you were supposed to send it to only one.

old Re: [Lua Problem] Images visible to all players

EngiN33R
Moderator Off Offline

Quote
DannyDeth has written
It is most probably contained in some sort of loop ( most probably a For ) that is looping through all the players and sending it to each of them when you were supposed to send it to only one.

Did you even read the code? God...

old Re: [Lua Problem] Images visible to all players

Yates
Reviewer Off Offline

Quote
user DannyDeth has written
Common, not really, if it was then 9/10 people here on US.de have lost their minds ( like me ).

Look at Yasday's thread about the RP script. people reffered to me aswell. I lol'd.

Soz for the spam Engi, I know you want this fixed.

old Re: [Lua Problem] Images visible to all players

DC
Admin Off Offline

Quote
that's too much code for me to check but a very simple debugging solution is to add some prints to your code.

like whenever you call the image function add a print right after it which prints the parameters that you were using to the console.

afterwards run the script and see what it really does by checking the console output.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview