Jump to content

Problem with userpanel (race)


verona

Recommended Posts

Hi. Sory for bad english. I download and running this script: https://community.multitheftauto.com/index.php?p= ... ils&id=811

Points works OK, but if i reconnect, then all stats going to 0. Why this cant save?

In console:

[2012-08-14 14:15:40] Stopping userpanel

[2012-08-14 14:15:41] Starting userpanel

[2012-08-14 14:15:41] Creating new DB table RaceStats

[2012-08-14 14:15:41] INFO: Race userpanel by Castillo loaded.

[2012-08-14 14:15:41] userpanel restarted successfully

[2012-08-14 14:16:38] ERROR: [gamemodes]/[race]/[addons]/userpanel/server.lua:242: attempt to index field '?' (a nil value)

This is line 242:

newData = tonumber(oldData[1]["RaceWins"]) + 1 

And this is function:

addEventHandler("onPlayerWasted",rootElement, 
function () 
setElementData(source,"Race Loses",tonumber(getElementData(source,"Race Loses"))+1) 
setElementData(source,"Points",tonumber(getElementData(source,"Points"))-2) 
local serial = getPlayerSerial(source) 
local oldData = executeSQLSelect( "RaceStats", "RaceLoses","serial = '" .. serial .. "'") 
newData = tonumber(oldData[1]["RaceWins"]) + 1 
executeSQLUpdate ( "RaceStats", "RaceLoses = '"..newData.."'","serial = '" .. serial .. "'")     
end) 
  

I think problem is with SQL commands, but why? Where is this .db file? Maybe is this permission problem?

Somebody can help me with this?

PS

Car color and lights is restarted in new map :/

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...