Array Must be indexed, text
#1

pawn Код:
public OnPlayerText(playerid, text[])
{
    if( text == NumberToWrite )
    {
         }
         return 1;
}
Error
Код:
array must be indexed (variable "text")
Reply
#2

Код:
==
Is for comparisons on integer values, in this case text is a string, not an integer.

You would use strcmp.
pawn Код:
public OnPlayerText(playerid, text[])
{
    if( strcmp(text,NumberToWrite,true) == 0 )
    {
         }
         return 1;
}
Reply
#3

pawn Код:
text = string/array.
Use: printf(text);// show the text in to console.

NumberToWrite = Interator/Nunber
Use: printf("This is number 1: %d", 1);
you can make:
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "50", true) != -1)
    {
          printf("I find the 50!!");
    }
    return 1;
}
Reply
#4

DELETE; no errors anymore

Thanks for you guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)