Argument mismatch 1 and 2 on same line
#1

So im getting arguments mismatch 1 and 2 on the same line....

Here is the command

pawn Код:
command(remotewarn, playerid, params[])
{
    new pName, name[128], reason[128], string[128];
    if(sscanf(params, "ds", name, reason))
    {
        if(Player[playerid][AdminLevel] >= 5)
        {
            SendClientMessage(playerid, WHITE, "SYNTAX: /remotewarn [name] [reason]");
        }
    }
    else
    {
        if(Player[playerid][AdminLevel] >= 5)
        {
            GetPlayerName(name, pName, sizeof(pName));
            format(string, sizeof(string), "Accounts/%s.ini", name);

            if(fexist(string))
            {
                if(strcmp(Player[pName][Warning1], "None", true) == 0)
                {
                    SendClientMessage(playerid, WHITE, "You can't prison a higher level administrator (or equal to your rank).");
                }
                else
                {
                    SendClientMessage(playerid, WHITE, "dfhgkfjd");
                }
            }
            else
            {
                SendClientMessage(playerid, WHITE, "Account not found.");
            }
        }
    }
}
And the error is on

pawn Код:
GetPlayerName(name, pName, sizeof(pName));
Please help

Thanks
Reply
#2

pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
Reply
#3

Quote:
Originally Posted by [MWR]Blood
Посмотреть сообщение
pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
Now its only argument mismatch 1 and now i have Array must be indexed pName

pawn Код:
if(strcmp(Player[pName][Warning1], "None", true) == 0)
Please help

Thanks
Reply
#4

You have to use the playerid, not the player's name:
pawn Код:
if(strcmp(Player[playerid][Warning1], "None", true) == 0)
Reply
#5

Quote:
Originally Posted by [MWR]Blood
Посмотреть сообщение
You have to use the playerid, not the player's name:
pawn Код:
if(strcmp(Player[playerid][Warning1], "None", true) == 0)
That will only check if i have any warnings though

Please help

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)