Forum

> > CS2D > Scripts > does ai_buy return true or false?
Forums overviewCS2D overview Scripts overviewLog in to reply

English does ai_buy return true or false?

2 replies
To the start Previous 1 Next To the start

old does ai_buy return true or false?

Loooser
User Off Offline

Quote
HI us

I am working on my bots at the moment and my question is if ai_buy(id,type) returns if the bot managed to buy or not?

If it returns true or false

old Re: does ai_buy return true or false?

DC
Admin Off Offline

Quote
Taking a look at the command reference helps in most cases: cs2d lua cmd ai_buy - no return value mentioned.

You can still easily check if buying succeeded:
• Save the return value of player(id,"money") in a variable
• Use cs2d lua cmd ai_buy
• Afterwards compare the variable with the current player(id,"money") value. Buying succeeded if the value changed. Otherwise it didn't work.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview