error 021: symbol already defined: "i"
#1

new bool: spec_enabled[MAX_PLAYERS]

for (new i=0, i<MAX_PLAYERS, i++) spec_enabled[i]= true;

please help me
Reply
#2

for (new i; i<MAX_PLAYERS; i++)

It's ';', not ','.
Reply
#3

Quote:
Originally Posted by Crayder
Посмотреть сообщение
for (new i; i<MAX_PLAYERS; i++)

It's ';', not ','.
I suggest reading the title first...
Reply
#4

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
I suggest reading the title first...
Well then you sir are a complete dumbass.

What happens when you do "new i, i"? Well, that would be defining the same var twice, thus the error 021. The for loop consist of three parts, he is only doing the var init because he never ends the section with a ';'. So the compiler thinks he is defining more vars. Now, I suggest you pay attention and look at his problem again.
Reply
#5

PHP код:
for (new 910a++)
{
    
// Code in the loop
}
// Code after the loop 
https://sampwiki.blast.hk/wiki/Control_S...res#for_.28.29
Reply
#6

can you show full script ?
Reply
#7

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
I suggest reading the title first...
Crayder's right, you should read his code before replying.
Reply
#8

Quote:
Originally Posted by HolyScripter
Посмотреть сообщение
can you show full script ?
Why do you need the full script? Don't give this guy your script! We already answered your question, who knows what this guy was gonna do...
Reply
#9

Did you defined somewhere "i" as global variable ?
Reply
#10

Quote:
Originally Posted by MikE1990
Посмотреть сообщение
Did you defined somewhere "i" as global variable ?
Wow, stfu dude. I just explained what the problem was.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)