18.03.2012, 20:58
SendClientMessageToAll() doesnt take a playerid
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
mole[128];
format(mole, sizeof(mole), "SMS from Mole (000): %s", params);
SendClientMessageToAll(COLOR_SMS, mole); // Error line.
}
return 1;
}
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;
}