Why would you even wanna have a function like that. The variable "Triggering Player" is already an integer, you just have to convert it from a preset to an integer with the Convert Preset to Int function.
Thanks for the reply. I am trying to create a function for one I already have, such as figuring a player integer. I need to be able to incrementally increase a variable for some other triggers and, in addition, I am trying to figure out how to create and use function definitions.
So I am trying to make a function which will return a player as a number. Player one returns 1 and so on....
I have an integer Local Variable (CurrentPlayer)
I have a For Each Integer loop for CurrentPlayer
If - Triggering player == CurrentPlayer
Then - Return CurrentPlayer
Else - Set Variable CurrentPlayer = CurrentPlayer + 1
and I get a compiling error. I am new to programming so forgive my ignorance. What have I done wrong, and how can I fix it?
Could you please copy/paste your exact code? There is a good chance there is a problem with your syntax.
@Purgatus: Go
Why would you even wanna have a function like that. The variable "Triggering Player" is already an integer, you just have to convert it from a preset to an integer with the Convert Preset to Int function.
@Krakarn: Go
Thanks for the reply. I am trying to create a function for one I already have, such as figuring a player integer. I need to be able to incrementally increase a variable for some other triggers and, in addition, I am trying to figure out how to create and use function definitions.
@MTops: Go
I tried to paste the code but its just a wall of text.
If you could give us a little more details on what you are doing with the players we could probably better answer your question.
That being said, here's a few things for reference.
You can refer to a player directly via their index, and not have to loop through to find the one you want
Also, you can loop through all players and use the "selected player" variable like this...
Give us a little more info on what you are attempting to accomplish and we can give you more speicific help.