error 035: argument type mismatch (argument 1)
#1

Hello all,

I'm trying to interpolate a value of an array into sscanf. I use zcmd and sscanf2.

Код:
CMD:enemyandhisfriend
{
    if(sscanf(params, "uus", players[0], players[1], xyz-example)
    {
        SendClientMessage(playerid, your_dream_color, "[USAGE] /cmd <userid> <enemyid> <mode>");
    }
    else
    {
        new players[2];
            players[0] = playerData[targetId];
            players[1] = playerData[targetId];
 
        if(playerData[online])
        {
            .........your code.........
            ...............................
        }
        else
        {
            SendClientMessage(playerid, error_color, NOTONLINEMSG);
        }
    }
}
..\include\commands.inc(83) : error 035: argument type mismatch (argument 1)
..\include\commands.inc(83) : warning 215: expression has no effect
..\include\commands.inc(83) : error 001: expected token: ";", but found "]"
..\include\commands.inc(83) : error 029: invalid expression, assumed zero

Код:
SendClientMessage(playerid, your_dream_color, "[USAGE] /cmd <userid> <enemyid> <mode>");
This line causes the problem but I think it is the declaration of the two targetids but I don't know it at the moment.

-Doddinger
Reply
#2

Remove Open building { you have 2 on the same position :/
Reply
#3

You're missing a ) at the end of the sscanf line.

EDIT: Also your command line is missing the parameters.

Код:
CMD:enemyandhisfriend(playerid, params[])
Reply
#4

Quote:
Originally Posted by SaMuRy
Посмотреть сообщение
Remove Open building { you have 2 on the same position :/
I think you're in the wrong thread.
Reply
#5

Код:
CMD:enemyandhisfriend(playerid, params[])
{
    new players[2];
    if(sscanf(params, "uus", players[0], players[1], xyz-example)
    {
        SendClientMessage(playerid, your_dream_color, "[USAGE] /cmd <userid> <enemyid> <mode>");
        return true;
    }

    players[0] = playerData[targetId];
    players[1] = playerData[targetId];

    if(!playerData[online]) return SendClientMessage(playerid, error_color, NOTONLINEMSG);

	// Your codes if player is online.
    return 1;
}
but i don't understand, where targetid, players[0] and players[1] are used. Anyhow try this.
Reply
#6

Quote:
Originally Posted by Burridge
Посмотреть сообщение
You're missing a ) at the end of the sscanf line.

EDIT: Also your command line is missing the parameters.

Код:
CMD:enemyandhisfriend(playerid, params[])
Oh! Yeah I see it now!
Reply
#7

Quote:
Originally Posted by UFF
Посмотреть сообщение
but i don't understand, where targetid, players[0] and players[1] are used. Anyhow try this.
That is not important. The error doesn't come from the code because the following code is working

Only this (what I described) is not working.
Reply
#8

Can someone explain the general problem here? The code is useless until I don't fix this problem here.
Reply
#9

Quote:
Originally Posted by Doddinger
Посмотреть сообщение
Can someone explain the general problem here? The code is useless until I don't fix this problem here.
The whole code doesn't work? Provide the full command code here and explain the issue from your side.
Reply


Forum Jump:


Users browsing this thread: