ArmedGuy Posted August 2, 2009 Share Posted August 2, 2009 Yeah, so when someone logs in to their account i want to retrive their name/account name, but if i use this code: function onPlayerJoin ( source ) if ( saveFile ) then local sourcename = getClientName( source ) addEventHandler("onClientLogin", getRootElement(), onPlayerJoin) i get this error: ERROR: Line Blabla: Bad "Client" Pointer @ getClientName anyone know why? Link to comment
DiSaMe Posted August 2, 2009 Share Posted August 2, 2009 onClientLogin parameters are different from parameter in your script. Never put 'source' into parameters list for events. Link to comment
Mr.Hankey Posted August 2, 2009 Share Posted August 2, 2009 'source' is a hidden variable that most events are using to define which element triggered the event. You don't have to declare it it's already there. Link to comment
ArmedGuy Posted August 2, 2009 Author Share Posted August 2, 2009 But when i remove that source i get this Error: Bad Argument @ "getClientName" Thats why i added that source. So anyone know? Link to comment
DakiLLa Posted August 2, 2009 Share Posted August 2, 2009 function onPlayerJoin () if ( saveFile ) then local playerName = getClientName( source ) addEventHandler("onClientLogin", getRootElement(), onPlayerJoin) this should works Link to comment
robhol Posted August 2, 2009 Share Posted August 2, 2009 There are two ends missing there... Link to comment
50p Posted August 2, 2009 Share Posted August 2, 2009 There are two ends missing there... I guess he just posted a piece of his code. If he has error: ERROR: Line Blabla: Bad "Client" Pointer @ getClientName That means the script has ran but failed when calling getClientName. When you forget about ends you get unexpected symbol near ''. Link to comment
ArmedGuy Posted August 2, 2009 Author Share Posted August 2, 2009 Yeah, Its just a piece, but anyone want the whole code to try finding whats wrong? As i seriously cant find any problem. Link to comment
Zadara Posted August 2, 2009 Share Posted August 2, 2009 Yeah, Its just a piece, but anyone want the whole code to try finding whats wrong? As i seriously cant find any problem. Did you saw the post of DaK? Link to comment
ArmedGuy Posted August 2, 2009 Author Share Posted August 2, 2009 Oh yea, I Finally got it working, and no idea why it didnt work before, even after i removed that source... Link to comment
ArmedGuy Posted August 2, 2009 Author Share Posted August 2, 2009 Sorry for bumping, but, does the skin and money of a player get reset if you use the command spawnPlayer? as the script(which is a playerstats script loads the data sucessfully, also when the screens faded out, but then when i use a inbuilt command, /spawn, it goes back to regular CJ and no money Link to comment
Killeralec99 Posted August 2, 2009 Share Posted August 2, 2009 so make it when you do /spawn, make it so i will get playerskin and save it as a variable, and do the same for the money. Then make it so when player spawns, it will load the skin and the money 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