Jump to content

Filtering Username Issue.


DazzaJay

Recommended Posts

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

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

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