Forum

> > CS2D > General > Lua Script Return Values
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Lua Script Return Values

1 reply
To the start Previous 1 Next To the start

old closed Lua Script Return Values

wenn
User Off Offline

Quote
Hi, I'm pretty well oriented with the new lua script, but not as much as I thought. Here are a few issues i need help with.

1. I can't use player(id,"weaponid") in hook_attack or hook_attack2, why is this? and what values does it return?

2. I thought it was common sense that player(id,"nightvision") returns 0 or 1, but it doesnt, and i cant even use msg(player(id,"nightvision") to see what it returns. Why is this?

3. player(id,"flag") is the same like tring to get a return value for nightvision.

Here are a few issues I'm having with the new beta that could be bugs.

1. Sounds goes off after a while, need to restart cs2d to fix this. It's not just me, I see and know people in-game that was complaining about this problem.

2. I can't seem to add any server to Favorite List anymore.

Well, that's all from me, Thank you in advance!

**Edit

I just realized that there is a thread for questions like these... Sorry!
edited 2×, last 06.05.09 08:15:15 am

old Re: Lua Script Return Values

DC
Admin Off Offline

Quote
About your Lua problems: please read sys/lua/info.txt more carefully. the command player(id,values) accepts only certain values which are all listed in the info file. most names of items are no valid value. the command simply does not understand that! please only use the listed values.
moreover for many values such as player(id,"flag") it returns a boolean value (true or false). you have to use it with if. if (player(id,"flag")) then msg "player has a flag" end.
(there is currently no command which shows if the player has a certain weapon or not. it will be added later)

sound problem: try another driver (options -> sfx) and/or update your system sound drivers.

favorite problem: known bug.

closed.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview