TakeMoneyFromPP() not working for this script
I've tried to use TakeMoneyFromPP() in Lua, in several different scripts and can't seem to get it working. I'm using an EQEMU version from October. Perhaps I'm just doing it wrong.
Example from global\global_player.lua (there is no global_player.pl): Code:
function event_enter_zone(e) |
Value is in copper. I.E the 1,000 you have is 1 Platunum, not 1,000 Platinum. For 1,000 you’d need to put 1,000,000 there.
|
Thanks for the reply... I understand about the value being copper.
The problem is that no money is being taken at all. The method is not returning a Boolean, and no message is shown to the entering client that has the proper name. I wanted to know if this script will fire on someone else's server, of course checking for a different client name, etc. Edit: I've updated the script, to verify the event is firing correctly... and it does: Code:
function event_enter_zone(e) The only message I see with my test client is "Hi Raccoon". I don't see either of the 'if' statement branch messages, with no money taken. |
Looks like I figured out the problem:
zone/lua_client.h Code:
bool TakeMoneyFromPP(uint64 copper); The wrapped client function still uses uint64, so I just a cast inside of it: Code:
… |
I think your original problem was that you were trying to call a client function off of an entity/mob object.
You would either need to pull the client pointer from entity list or cast e to client - after an IsClient() check. I could be wrong... |
Quote:
|
Disregard..I always forget semicolons are optional in lua...
|
All times are GMT -4. The time now is 11:36 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.