Piorun Posted June 4, 2011 Share Posted June 4, 2011 Hi guys. In samp scripters are using a playerid. It's a number of player. How to create function which i can set player this id?? Link to comment
BinSlayer1 Posted June 4, 2011 Share Posted June 4, 2011 All I could find is this. https://community.multitheftauto.com/index.php?p= ... ils&id=953 Hope it helps Link to comment
proracer Posted June 4, 2011 Share Posted June 4, 2011 Here I created player id for the scoreboard, I tested it and should work: addEventHandler ( 'onClientResourceStart', resourceRoot, function ( ) for i,v in ipairs ( getElementsByType ( 'player' ) ) do setElementData ( v, 'data.playerID', i ) end exports.scoreboard:scoreboardAddColumn ( 'data.playerID', 70, 'ID' ) end ) Link to comment
Aibo Posted June 4, 2011 Share Posted June 4, 2011 Here I created player id for the scoreboard, I tested it and should work: addEventHandler ( 'onClientResourceStart', resourceRoot, function ( ) for i,v in ipairs ( getElementsByType ( 'player' ) ) do setElementData ( v, 'data.playerID', i ) end exports.scoreboard:scoreboardAddColumn ( 'data.playerID', 70, 'ID' ) end ) and what will happen when player leaves? or when another join? MTA uses element system and that system work pretty nice, i dont get why people try to complicate things with IDs. 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