Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Getting player index


Slasheree
 Share

Recommended Posts

Not sure if it exists by default, too tired to care and check Sooo..

```
Public Function GetPlayerIndexByName(Byval Name as String) as Long

Dim i as long

if Name = vbnullstring then exit function

for i = 1 to Player_HighIndex

If (Lower$(Player(i).Name) = Lower$(Name) then

GetPlayerIndexByName = i

Exit Function

End If

next

End Function
```

Should return 0 if the player doesn't exist.. And the number of the player if it does. Not really tested, just written off of the top of my head.
Link to comment
Share on other sites

Say, guys, according to Zero, I don't know my way around Eclipse, and I can't program!

But, contrary to his suggestions, we could actually use the function **FindPlayer**!

It's usage is as follows: FindPlayer("Name of the player here.")

It'll return the index of the player, provided they're online/it's correct, and 0 otherwise. It's already in default EO.
Link to comment
Share on other sites

> Say, guys, according to Zero, I don't know my way around Eclipse, and I can't program!
>
> But, contrary to his suggestions, we could actually use the function **FindPlayer**!
>
> It's usage is as follows: FindPlayer("Name of the player here.")
>
> It'll return the index of the player, provided they're online/it's correct, and 0 otherwise. It's already in default EO.

Ah, so there was one. ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) I was too tired to care and check. As for the Lower$() thing, I was confusing another BASIC language with VB6 xD Oh well.

And Zero, Just because YOU make a ton of mistakes here and act like a turd doesn't mean there's a need to curse at others. Go and slap yourself in a corner. Also, Trim$() does not do what I wanted to do with it, that being to make everything lowercase, LBound doesn't do this either.. So yeap, please stop answering if all you can do is give completely useless advice if you're unable to admit a mistake. I'm getting tired of your so called 'help'.
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...