02.07.2011, 14:49
Hello!
i made a setscore cmd, it works and gives the right player the right score and gets the message about it.
But the user of the cmd does not get the message that he have given a player score, why?
code:
i made a setscore cmd, it works and gives the right player the right score and gets the message about it.
But the user of the cmd does not get the message that he have given a player score, why?
code:
pawn Код:
CMD:setscore(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 5)
{
new id;
new sendername[MAX_PLAYER_NAME];
new giveplayername[MAX_PLAYER_NAME];
new giveplayerid,score;
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
if (!sscanf(params, "ii", playerid,score))
{
if (giveplayerid != INVALID_PLAYER_ID)
{
new string[128];
format(string, sizeof(string), "The admin %s has set your score to %d",sendername,score);
SendClientMessage(playerid, COLOR_GRAD1, string);
SetPlayerScore(playerid, score);
format(string, sizeof(string), "You have set %s score to %d",giveplayername,score);
SendClientMessage(id, COLOR_GRAD1, string);
}
}
else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setscore [playerid] [score]");
}
else SendClientMessage(playerid, 0xFF0000FF, "You are not an level 5 Admin!, or you are not a Admin!");
}
return 1;
}