CS2D
Scripts does ai_buy return true or false? does ai_buy return true or false?
2 Antworten HI
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 DC Admin Offline
Taking a look at the command reference helps in most cases: 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 ai_buy
Afterwards compare the variable with the current player(id,"money") value. Buying succeeded if the value changed. Otherwise it didn't work. thank you
btw i did take a look but wasnt sure