Lloyd Logan Posted August 8, 2012 Posted August 8, 2012 Right guys, If I do a command to blowveh using getPlayerByName and you have to be exact with the name e.g blowveh Lloydlogan, Instead of blowveh Lloyd , what function could I use instead of getPlayerByName? I tried getPlayerByPartialNick, but it doesn't work??? Thanks Lloyd logan If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
Castillo Posted August 8, 2012 Posted August 8, 2012 You may use this function I made for my server: function getPlayerFromPartOfName ( playerName ) local playerFound = false if ( playerName and type ( playerName ) == "string" ) then if ( getPlayerFromName ( playerName ) ) then return getPlayerFromName ( playerName ) end for index, player in ipairs ( getElementsByType ( "player" ) ) do if ( getPlayerName ( player ):lower ( ):find ( playerName:lower ( ), 1, true ) ) then playerFound = player break end end end return playerFound end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Lloyd Logan Posted August 8, 2012 Author Posted August 8, 2012 You may use this function I made for my server:[lua]function getPlayerFromPartOfName ( playerName ) local playerFound = false if ( playerName and type ( playerName ) == "string" ) then if ( getPlayerFromName ( playerName ) ) then return getPlayerFromName ( playerName ) end for index, player in ipairs ( getElementsByType ( "player" ) ) do if ( getPlayerName ( player ):lower ( ):find ( playerName:lower ( ), 1, true ) ) then playerFound = player break end end end return playerFound end I am confused, how do I put this into my blowveh resource , and if you want I will pm you the resource? If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
Castillo Posted August 8, 2012 Posted August 8, 2012 Well, instead of using: getPlayerFromName ( playerName ) in your script, you use: getPlayerFromPartOfName ( playerName ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Lloyd Logan Posted August 8, 2012 Author Posted August 8, 2012 Thanks a lot guys Couldn't have done it without you !! If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
Castillo Posted August 9, 2012 Posted August 9, 2012 You're welcome. P.S: How exactly Alexs helped . San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Lloyd Logan Posted August 9, 2012 Author Posted August 9, 2012 You're welcome.P.S: How exactly Alexs helped . 1. No Problem 2. When i say thanks i am usually talking to you as you always help me, (Teach me LUA, you are so good at it!!!) If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
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