Jump to content

Problem with userpanel (race)


verona

Recommended Posts

Posted

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

Sorry for bad English!

Posted

The resource is outdated badly, I didn't get free time to update it yet ( if I ever do ).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Oh, ok you dont have time :( But you know what is wrong, and tell me? I should use newest commands, or what? Its very important for me :/

Sorry for bad English!

Posted

If I am not wrong:

local oldData = executeSQLSelect( "RaceStats", "RaceLoses","serial = '" .. serial .. "'") 

Will just select "RaceLoses" not "RaceWins".

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

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