Tag mismatch?
#1

I don't know what's wrong with this line, I get a tag mismatch warning.

pawn Код:
new Bool:pLoggedIn[MAX_PLAYERS] = false;
This is where I use it:

pawn Код:
if(!pLoggedIn[playerid]) return 1;
Reply
#2

Booleans are automatically equaled to false once created

just remove '= false;'

pawn Код:
new bool:pLoggedIn[MAX_PLAYERS];
Should work now.
Reply
#3

Don't use 'bool' with capital letter 'B'.
pawn Код:
new bool: pLoggedIn[MAX_PLAYERS] = false;
try it now.
Reply
#4

lol, I used it with a capital B, that was the problem. I've got one more problem. I'm getting this error "array sizes do not match" for the following.

pawn Код:
if(listitem = 0){
            pInfo[playerid][pSex] = "Male";
        }
        else{
            pInfo[playerid][pSex] = "Female";
        }
this is in the enumeration

pawn Код:
pSex[10],
what am I doing wrong?
Reply
#5

Try using format.
Reply
#6

pawn Код:
format(pInfo[playerid][pSex], 10, "Male");
I did that but now it doesn't save.
Reply
#7

pawn Код:
strmid(pInfo[playerid][pSex], "Male", false, strlen("Male") /*4*/, 6);
make psex size [6]
Reply
#8

Should work, but using strcat and/or memcpy for copying strings is faster: http://forum.sa-mp.com/showpost.php?...postcount=2130

Example:
pawn Код:
strCopy("Male", pInfo[playerid][pSex], -1, sizeof(pInfo[]));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)