Jump to content

Moocow

Members
  • Posts

    2
  • Joined

  • Last visited

Details

  • Gang
    No!

Moocow's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. In my disconnect code: local updatequery = mysql_query(link, "UPDATE mta SET kills=" .. getElementData(source, "stats.kills") .. " WHERE id=" .. getElementData(source, "stats.id")) local updatequery2 = mysql_query(link, "UPDATE accounts SET lastloggedinfrom='Multi Theft Auto' WHERE id=" .. getElementData(source, "stats.id"))
  2. I'm new to MTA Scripting, and I've been trying to use setElementData() to assign information to each player, such as their kills, deaths, other basic information. I want to save these stats to my database on disconnect, so in my query I'm calling getElementData(source, "stats.kills"), getElementData(source, "stats.deaths"), and getElementData(source, "stats.id") All these work fine, they don't return false and they return their respective values. Then in the line below, I have getElementData(source, "stats.id") in a second query, but this time it returns false. I could probably just declare a variable and only call getElementData() once, but then I'd never work out why it doesn't like being called twice. Another problem I was having was I'd assign all the element data stats default values on connect, and then try to reassign them on login, but setElementData() would just return false. Now I don't assign them default variables on connect, I only assign them on login and it's fine. It's like the functions don't like being called more than once or something, like the stats.id problem I'm having. Am I using these functions incorrectly? Should I reset the element data on disconnect or something? Any help would be appreciated.
×
×
  • Create New...