Script not working for "player 2"
#1

Player 1 (ID 0): everything in the script works exactly as it should.

Player 2 (ID 1): no camera movement, when going into camera mode, camera always faced the sky.





Pastebin
Reply
#2

Bump (been 24 hours, no reply)
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Put your code on pastebin - people can't copy, modify, or test an image. Plus, they are larger.
Added
Reply
#4

I believe this is the problem:
pawn Код:
new CamSet[MAX_PLAYERS];
new bool:CamEnabled[MAX_PLAYERS] = false;
new PlayerLock[MAX_PLAYERS] = -1;
new CamSpeed[MAX_PLAYERS] = 3;
new PlayerCatch[MAX_PLAYERS][6];
new FlyTimer[MAX_PLAYERS];
new BoxCount[MAX_PLAYERS] = 0;
When giving arrays a default value, you can't just put array[20] = value. It won't work.

To actually initialize an array, you have to do:
pawn Код:
new CamSet[MAX_PLAYERS];
new bool:CamEnabled[MAX_PLAYERS] = {false, ...};
new PlayerLock[MAX_PLAYERS] = {-1, ...};
new CamSpeed[MAX_PLAYERS] = {3, ...};
new PlayerCatch[MAX_PLAYERS][6];
new FlyTimer[MAX_PLAYERS];
new BoxCount[MAX_PLAYERS] = {0, ...};
Or else it'll only put the value in the first array cell, that's why only player ID 0 (first cell) works.
That's my theory, however.
Reply
#5

Excellent theory. Makes sense. I'll try it out when I return home. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)