(78) : error 035: argument type mismatch (argument 2)
#7

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
pawn Код:
forward isPlayerIn(playerid, menu[]);
public isPlayerIn(playerid, menu[])
if menu is a string you have to define it as such
and this should be

pawn Код:
if(!strcmp("main", menu, true,4))
its checking the var "menu" too see if the first 4 chars are "main"
it will return 0 if this is a match so thats why i added the !

you can also write it like
pawn Код:
if(strcmp("main", menu, true,4)==0)
this is the same thing.





Also


its not it is actually checking to see if "menu" contains the string "main"






regards,
For some reason I still am getting the tag mismatch on this line:
pawn Код:
if(isPlayerIn(playerid, "main") == false)

Heres all of it:

pawn Код:
forward isPlayerIn(playerid, menu[]);
public isPlayerIn(playerid, menu[])
{
    if(!strcmp("main", menu, true, 4)) //if "main" == menu (menu being a string parameter with the name of a menu screen, ie. "main", "weapons", "cars" etc.....)
    {
        //opening users .txt file
        new readLine[64];
        new str[50], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(str,sizeof(str),"/Users/%s.txt",name);
        new File:example = fopen(str, io_read);

        while(fread(example, readLine)) //reads the file line-by-line
        {
            if(strcmp(readLine, "inMenu = true", true)) //if a line in the example file has "inMain == true"
            {
                fclose(example);
                return true;
            }
        }
        fclose(example);
    }
    return false;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
 if(strcmp(cmdtext, "/admin") == 0 && isPlayerIn(playerid, "main") == false)
    {
        return 1;
    }
       
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)