error 035: argument type mismatch (argument 1) -
Doddinger - 16.09.2018
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
Re: error 035: argument type mismatch (argument 1) -
SaMuRy - 16.09.2018
Remove Open building { you have 2 on the same position :/
Re: error 035: argument type mismatch (argument 1) -
Burridge - 16.09.2018
You're missing a ) at the end of the sscanf line.
EDIT: Also your command line is missing the parameters.
Код:
CMD:enemyandhisfriend(playerid, params[])
Re: error 035: argument type mismatch (argument 1) -
Doddinger - 16.09.2018
Quote:
Originally Posted by SaMuRy
Remove Open building { you have 2 on the same position :/
|
I think you're in the wrong thread.
Re: error 035: argument type mismatch (argument 1) -
UFF - 16.09.2018
Код:
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.
Re: error 035: argument type mismatch (argument 1) -
Doddinger - 16.09.2018
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!
Re: error 035: argument type mismatch (argument 1) -
Doddinger - 16.09.2018
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.
Re: error 035: argument type mismatch (argument 1) -
Doddinger - 16.09.2018
Can someone explain the general problem here? The code is useless until I don't fix this problem here.
Re: error 035: argument type mismatch (argument 1) -
UFF - 16.09.2018
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.