i need help with error
#1

Hey, i need some help with this error..
Код:
C:\Users\MAD\Desktop\Serverio failai\[+]SANFR\gamemodes\SANFR.pwn(16002) : error 033: array must be indexed (variable "-unknown-")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
and the line is

new Skaiciai = (inputtext);
if(Skaiciai == "&")
Reply
#2

inputtext is a string, not a int. There is no point in making a new string if you're going to just assign another string to it and then check for something. If you want to check if the string just has an & then do this
pawn Код:
if(inputtext[0] = '&' & !inputtext[1])
That will check if there is a & for the first character and there is nothing for the second.
Reply
#3

Код:
C:\Users\MAD\Desktop\Serverio failai\[+]SANFR\gamemodes\SANFR.pwn(16158) : warning 211: possibly unintended assignment
C:\Users\MAD\Desktop\Serverio failai\[+]SANFR\gamemodes\SANFR.pwn(16158) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           8892 bytes
Code size:          1706684 bytes
Data size:         18125068 bytes
Stack/heap size:      16384 bytes; estimated max. usage=5815 cells (23260 bytes)
Total requirements:19857028 bytes

2 Warnings.
I get this

Код:
if(inputtext[0] = '&' & !inputtext[1])
Reply
#4

Quote:
Originally Posted by madh3r0
Посмотреть сообщение
Код:
C:\Users\MAD\Desktop\Serverio failai\[+]SANFR\gamemodes\SANFR.pwn(16158) : warning 211: possibly unintended assignment
C:\Users\MAD\Desktop\Serverio failai\[+]SANFR\gamemodes\SANFR.pwn(16158) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           8892 bytes
Code size:          1706684 bytes
Data size:         18125068 bytes
Stack/heap size:      16384 bytes; estimated max. usage=5815 cells (23260 bytes)
Total requirements:19857028 bytes

2 Warnings.
I get this

Код:
if(inputtext[0] = '&' & !inputtext[1])
Sorry about that, should be
Код:
if(inputtext[0] == '&' && !inputtext[1])
Happens sometimes when you use other coding languages heaps :P.
Reply
#5

oh thank you...
Reply
#6

UP..
How to do that cant use & symbol in inputtext?
Reply
#7

You could use strfind and just look for the & in inputtext or you could do the following:
pawn Код:
for(new b; b<strlen(inputtext); b++)
{
    if(inputtext[b] == '&')
    {
        SendClientMessage(playerid, -1, "You cannot use '&' in your input");
        return 0;
    }
}
Reply
#8

thanks again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)