02.07.2011, 19:36
Quote:
With this i get the message, but of some reason the name you get back is ID 0 always, who is my NPC :O
|
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, "ui", giveplayerid,score)) // This was "ii" again
{
if (giveplayerid != INVALID_PLAYER_ID)
{
new string[128];
format(string, sizeof(string), "The admin %s has set your score to %d",sendername,score);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
SetPlayerScore(giveplayerid, score);
format(string, sizeof(string), "You have set %s score to %d",giveplayername,score);
SendClientMessage(playerid, 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;
}