Sscanf issue, unable to compile due to "argument type mismatch". -
Malicious - 07.10.2014
Alright, so I've attempted to make the command and it's coming back with an error, it says that the number of arguments doesn't match the definition on the sscanf section, I am kind of lost with this if anyone can help it would be appreciated greatly!
Код:
C:\Users\matt\Desktop\UG RP\gamemodes\SanRP.pwn(276) : error 035: argument type mismatch (argument 1)
C:\Users\matt\Desktop\UG RP\gamemodes\SanRP.pwn(659) : warning 203: symbol is never used: "ooctoggled"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Код:
}
CMD:makeadmin(playerid, params)
{
new string[600], id, level;
if(pInfo[playerid][Admin] >= 1337)
if(sscanf(params,"ud",id, level)) return SendClientMessage(playerid, YELLOW, "[CMD] [/makeadmin] [id] [lvl]");
{
format(string, sizeof(string), "{FF0000}[admin] you have made {FFFFFF}%s(%d){FF0000} admin level{FFFFFF} %d",GetName(id),id,level);
SendClientMessage(playerid, RED, string);
pInfo[id][Admin] = level;
format(string, sizeof(string), "{FF0000}(( [admin]{FFFFFF} %s {FF0000}has made{FFFFFF} %s {FF0000}an administrator! Congratulations! ))",GetName(playerid), GetName(id));
SendClientMessageToAll(RED, string);
return 1;
}
}
Re: Sscanf issue, unable to compile due to "argument type mismatch". -
Vince - 07.10.2014
Код:
CMD:makeadmin(playerid, params[])
Re: Sscanf issue, unable to compile due to "argument type mismatch". -
rodrijose2009 - 07.10.2014
Try this, the variable type was wrong:
Код:
CMD:makeadmin(playerid, params[])
{
new string[256], id, level;
if(pInfo[playerid][Admin] >= 1337)
if(sscanf(params,"di",id, level)) return SendClientMessage(playerid, YELLOW, "[CMD] [/makeadmin] [id] [lvl]");
{
format(string, sizeof(string), "{FF0000}[admin] you have made {FFFFFF}%s(%d){FF0000} admin level{FFFFFF} %d",GetName(id),id,level);
SendClientMessage(playerid, RED, string);
pInfo[id][Admin] = level;
format(string, sizeof(string), "{FF0000}(( [admin]{FFFFFF} %s {FF0000}has made{FFFFFF} %s {FF0000}an administrator! Congratulations! ))",GetName(playerid), GetName(id));
SendClientMessageToAll(RED, string);
return 1;
}
}
Re: Sscanf issue, unable to compile due to "argument type mismatch". -
YanLanger - 07.10.2014
PHP код:
CMD:makeadmin(playerid, params)
to
PHP код:
CMD:makeadmin(playerid, params[])
Re: Sscanf issue, unable to compile due to "argument type mismatch". -
Malicious - 07.10.2014
I knew I was missing something.... thanks guys, just me being blonde lol. +rep for all of you for your quick response.