Error: Argument MisMatch
#2

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;
}
Reply


Messages In This Thread
Error: Argument MisMatch - by Jack.7331 - 18.03.2012, 20:55
Re: Error: Argument MisMatch - by Babul - 18.03.2012, 20:58
Re: Error: Argument MisMatch - by Daddy Yankee - 19.03.2012, 05:35

Forum Jump:


Users browsing this thread: 2 Guest(s)