PanaFive Posted April 14, 2020 Posted April 14, 2020 (edited) const giveplayer = findRageMpPlayer(nameOrID); function findRageMpPlayer(playerNameOrPlayerId) { if (playerNameOrPlayerId == parseInt(playerNameOrPlayerId)) { return mp.players.at(playerNameOrPlayerId); } else { let foundPlayer = null; mp.players.forEach((rageMpPlayer) => { if (rageMpPlayer.name.toLowerCase().startsWith(playerNameOrPlayerId.toLowerCase())) { foundPlayer = rageMpPlayer; return; } }); return foundPlayer; } } Edited April 14, 2020 by PanaFive 2
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