29.09.2012, 20:47
for these kind of CMDs i refer you to use zcmd
pawn Code:
CMD:setscore(playerid, params[])
{
new targetid, score, sendername[MAX_PLAYER_NAME], receivername[MAX_PLAYER_NAME], string[128];
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params,"ui", targetid, score)) return SendClientMessage(playerid, 0xFFFFFFF, "USAGE: /SetScore [PlayerID] [Score]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "Error: Your not Admin!");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, red, "Error: This Player isnt Connected!");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(targetid, receivername,sizeof(receivername));
format(string, sizeof(string),"Your Score been setted to %d by admin %s", score, sendername);
SendClientMessage(targetid, 0xFFFFFF, string);
format(string, sizeof(string),"Admin %s Setted your score to %d", receivername, score);
SendClientMessage(targetid, sand, string);
SetPlayerScore(playerid, score);
return 1;
}