Jump to content

[Help] Script problems


MikeChip

Recommended Posts

Hello,

This is my first post :D

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 :S

The gamemode doesn't have client lua files yet.

Thanks in advance

P.S: Sorry for my bad english...

Link to comment

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...