DazzaJay Posted September 22, 2008 Share Posted September 22, 2008 Basically, we have a Script that works alongside a customised version of DM Race. This script is a RaceRanks script. saving race times. It saves by Username (which untill DP2.3 was UNIQUE) But because DP2.3 users all share the same account and crap serial, we have had to make a slight change to the script, so it dosent bother saving times for prople with DP2.3 as their username. however there is a problem with the script now. and i have no bloody idea how to fix it (i didnt write it) i would like to post more of the code, but the creator dosent want it released just yet, so heres only a small snippet of the problem area. addEventHandler ( "onPlayerFinish", getRootElement(), function ( time, player ) if ( getClientUsername(player) == "DP2.3" ) then return false end local rankinfo2 = getRank ( 1 ) rank = checkRank ( time, player ) if( rank ) then There is somthing wrong with this line: if ( getClientUsername(player) == "DP2.3" ) then return false end The error that is returned whenever ANYONE finishs the race (Even Prople Pre DP2.3 with PROPER UNIQUE USERNAMES) is this: ERROR: rank_server.lua:646: attempt to call global 'getClientusername' (a nil value) Link to comment
Ace_Gambit Posted September 22, 2008 Share Posted September 22, 2008 Well, getClientusername does not exist. You probably want to use getClientName. Link to comment
DazzaJay Posted September 22, 2008 Author Share Posted September 22, 2008 Well, its trying to get the Username that they log into mtabeta.com with, not their Nick. the reason we decided it would be best to save by Username, is because 1. its password protected at mtabeta.com and 2. it WAS UNIQUE (dill DP2.3 came along and boned everything up) and 3. it was so that Users tiem could be set without them havint to /register and /login with server. (So more like the Classic Simplicity of MTA:Race) So What exactly does getClientName return? their Nick or their mtabeta.com username? Link to comment
Ace_Gambit Posted September 22, 2008 Share Posted September 22, 2008 You have mistaken two functions, getClientName and getPlayerUserName. The first one returns the nickname while the other returns the clients' community name. You should pick either one of those but not getClientUsername because that isn't a valid MTA core function. Link to comment
DazzaJay Posted September 22, 2008 Author Share Posted September 22, 2008 Ah shit. That was deffinatley the issue, thanks man! The server is now saving times for anyone that has NOT got DP2.3 again 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