Author Topic: PutToCar all players in derby problem.  (Read 2283 times)

Ankris

  • Full Member
  • ***
  • Posts: 110
  • Karma: +29/-44
    • View Profile
Re: PutToCar all players in derby problem.
« Reply #15 on: July 22, 2015, 08:43:36 pm »
Explain me a thing: Why the local "player" changes to integer 1 when shouldn't be changed?

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: PutToCar all players in derby problem.
« Reply #16 on: July 22, 2015, 10:34:11 pm »
I notice a problem though. You don't need to create a new player variable in the foreach loop. This is because the "ii" and "iv" are index AND value. When I first created that loop, I used the abbreviation "ii" as "iterator index" and "iv" as "iterator value". I think I should've mentioned that before but I don't think I ever did. It was just for readability purposes.

If you use "iv" as your player variable while inside the loop, then it should work. The "iv" is a pointer to the instance for the player and can be used just like any "player" instance.

Example:
iv.Skin = 1;

Does the exact same thing as this:
local player = FindPlayer( ii );
player.Skin = 1;


rwwpl

  • Full Member
  • ***
  • Posts: 126
  • Karma: +18/-6
  • LU-DM Team
    • View Profile
    • LU-DM Team
Re: PutToCar all players in derby problem.
« Reply #17 on: July 23, 2015, 02:05:48 pm »
And how to fix that? Maybe there's a different way? I tired that, but it still doesn't work...

 

© Liberty Unleashed Team.