Help please
#1

PHP код:
mysql_escape_string(inputtextPlayer[playerid][name]);
if(
len 16) {
    new 
plus[8] = "...";
    
strcat(inputtextplus);
}
PlayerTextDrawSetString(playeridLTextdraw[16][playerid], inputtext); 
And warning:
PHP код:
warning 224indeterminate array size in "sizeof" expression (symbol "maxlength"
Whats wrong ?
Reply
#2

https://sampwiki.blast.hk/wiki/Strcat

Quote:

maxlength=sizeof dest

You can't use sizeof (inputtext).
Reply
#3

PHP код:
strcat(inputtextplussizeof(inputtext)); 
PHP код:
warning 224indeterminate array size in "sizeof" expression (symbol ""
Reply
#4

Stinged told you that you can't use sizeof with inputtext or an array without a size in general. Make another string and copy the text stored:
pawn Код:
#if !defined strcpy
    #define strcpy(%0,%1) strcat((%0[0] = EOS, %0), %1)
#endif
pawn Код:
static input_text[129];
strcpy(input_text, inputtext);
and then you can use strcat and join any text you want to "input_text" string. I'm not really sure if you meant to add 3 dots or it was just an example but if the text you are trying to "join" is constant, then you don't need to declare a string just for that.
pawn Код:
strcat(input_text, "...");
After done all that, use "input_text" in PlayerTextDrawSetString function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)