SA-MP Forums Archive
Error: Argument MisMatch - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error: Argument MisMatch (/showthread.php?tid=326828)



Error: Argument MisMatch - Jack.7331 - 18.03.2012

CMD:mole(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 3) {
new
mole[128];

format(mole, sizeof(mole), "SMS from Mole (000): %s", params);
SendClientMessageToAll(playerid, COLOR_SMS, mole); // Error line.
}
return 1;
}

I don't see the problem?
C:\Users\Admin\Desktop\Server Uploads\vx-rp.pwn(5654) : error 035: argument type mismatch (argument 2)


Re: Error: Argument MisMatch - Babul - 18.03.2012

SendClientMessageToAll() doesnt take a playerid
pawn Код:
CMD:mole(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 3) {
new
mole[128];

format(mole, sizeof(mole), "SMS from Mole (000): %s", params);
SendClientMessageToAll(COLOR_SMS, mole); // Error line.
}
return 1;
}
may i ask: is the command meant as a PM from an admin? if so, you need to parse a destination id aswell, i suggest to have a look at the sscanf2 plugin, using it, your command, meant as PM from an admin, inclusive parsing a TargetPlayerID and the text, will look like:
pawn Код:
CMD:mole(playerid, params[]) {
    if(playerVariables[playerid][pAdminLevel] >= 3)
    {
        new targetid,moletext[128];
        if(!sscanf(params,"us[128]",targetid,moletext))
        {
            new string[128];
            format(string, sizeof(string), "SMS from Mole (000): %s", moletext);
            SendClientMessage(targetid,COLOR_SMS, string);
        }
        else
        {
            SendClientMessage(playerid,COLOR_SMS,"/mole <playerid/name> <text>");
        }
    }
    return 1;
}



Re: Error: Argument MisMatch - Daddy Yankee - 19.03.2012

nvm.