Error: Argument MisMatch
#1

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)
Reply
#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
#3

nvm.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)