MikeChip Posted October 26, 2009 Share Posted October 26, 2009 Hello, This is my first post and I'm still learning LUA (stopped here - http://www.lua.org/pil/5.2.html) My gamemode: http://athos.pastebin.com/f78050b09 (WIP) The problem is that when the player dies it is supposed that the PlayerStatus[Player].Deaths should increase but that's not happening, should I use triggerClientEvent ? I'm also reading the MTA wiki. Another thing, how to use the executeSQLInsert properly ? I saw on the wiki but that was't clear enough The gamemode doesn't have client lua files yet. Thanks in advance P.S: Sorry for my bad english... Link to comment
Gamesnert Posted October 26, 2009 Share Posted October 26, 2009 About your first problem: It's a simple typo. addEventHandler("OnPlayerWasted", g_root, DeathAdd) Note that "on" should not contain any capitals. It should be: addEventHandler("onPlayerWasted", g_root, DeathAdd) For the second problem, for the saving of data, you can also use account functions. Although these require the player to be logged in, they're simpler to use, and are not exactly name dependent. I'm not exactly an SQL expert. But as far as I can see, the executeSQLInsert is used in a fine way. By the way, for someone who's still learning Lua, you're doing pretty well. Link to comment
MikeChip Posted October 26, 2009 Author Share Posted October 26, 2009 Now it's working thanks dude Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now