[HELP]Index array
#1

Hi guys, I need some help.
I did this code: http://pastebin.com/pvdAAE0N
But the compiler tells me that I should index the arrays. How can I fix? Thanks.
Reply
#2

pawn Код:
new
    MVP[MAX_PLAYERS],
    WP[MAX_PLAYERS];
pawn Код:
MVP = i;
WP = i;
Reply
#3

You need to tell which element of an array you are using...
For example:
pawn Код:
new array[2];
array[0] = 5;
Reply
#4

Borg you answer didn't help too much, because is like the actual code. Dusk, I didn't understand, so I UP the topic. ktm
Reply
#5

You're declaring the array MVP with 500 indexes but you aren't specifying which index you want to set.

Incorrect:

pawn Код:
new MVP[MAX_PLAYERS];
MVP = 1;
Correct:

pawn Код:
new MVP[MAX_PLAYERS];
MVP[0] = 1;
Replace 0 with the ID of a player to get the result you want.
Reply
#6

Thanks so much, that compiled the GM, but I still have a problem: my message won't send only 1 time, but it will flood and it will send over 15 messages! How can I fix this?
Reply
#7

Send the message to i rather than to all.
Reply
#8

Already tried, it didn't work.
Reply
#9

Try putting the SendClientMessage outside of the FOR LOOP.
Reply
#10

What SuperViper said. If MAX_PLAYERS is 50 (an example), it will send 50 times the message to all players.

Use:
pawn Код:
SendClientMessage(i, -1, stringa);
instead.
Reply
#11

Thanks everybody, exspecially to eemalekorraks and SuperViper who solved the problem. Rep ++!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)