06.02.2011, 12:44
Easy with sscanf and zcmd
pawn Code:
CMD:score(playerid, params[])
{
new id, score, str[84], victimname[28], adminname[28];
if (pInfo[playerid][pAdminLevel] >= 4)
{
if (sscanf(params, "ui", id, score)) return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /score [id] [ammount]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAY, "AdmCmd: This player is not connected.");
SetPlayerScore(id, score);
GetPlayerName(id, victimname, 28);
GetPlayerName(playerid, adminname, 28);
format(str, 84, "AdmWarn: You've given %s [ID %d] score %d", victimname, id, score);
SendClientMessage(COLOR_LIGHTBLUE,str);
format(str,84,"You've received %d score from admin %s [ID %d]", score, adminname, playerid);
SendClientMessage(id, COLOR_LIGHTBLUE, str);
return 1;
}
else return SendClientMessage(playerid,COLOR_GRAY," You don't have authorization!");
}