![]() |
players[index].var
In my past experiences with the players[] array, I haven't had pleasant experiences. I couldn't do things like manipulate players' hearts and things, and I have no idea why. Someone please explain why not, and suggest a way to do it instead. Here's what I had originally...
for (i = 0; i < playerscount; i++) { players[i].hearts = 3; } What's wrong? Thanks. |
-FooL-
Isn't players[i].hearts read only? If it is, you could try something like... for (i=0;i<playerscount;i++) hurt 3-players[i].hearts,players[i].x+1.5,players[i].y+1.5; Which probably won't get them to 3 every time, considering it's a Friday and my brain is suffering from schoolicidis... but you get the idea... |
I suppose it would. With hitplayer, it would'nt be too hard, I guess. However, will that set everyone in the level's hearts to 3, or are player indeces server-wide? And why would the variables be read-only? I have never heard of a const variable in Graal. Actually, I have, a few, but why would he make the players[] variables const?
|
A security thing, you say. How so? What a pain. If the indeces are level wide, how does it decide what index each player gets? All I know is that if you are playing, you are player 0.
|
| All times are GMT +2. The time now is 12:26 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.