So i made a setscore command:
But when I use the command ingame (i do get the score), But the text is bugged.
What it says: [ADMIN] has set yo. And [ADMIN] You have se.
Code:
CMD:setscore(playerid, params[])
{
new targetid, score, name[24], texttotarget[20], textadmin[20];
if(Player[playerid][Admin] < 4) return SendClientMessage(playerid, COLOR_RED, "[WARNING] You are not authorized to use this command!");
if(sscanf(params, "ui", targetid, score)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /setscore <ID> <Score>");
GetPlayerName(targetid, name, 24);
SetPlayerScore(targetid, GetPlayerScore(targetid) + score);
format(texttotarget, sizeof(texttotarget),"[ADMIN] %s has set your score to: %i", playerid, score);
format(textadmin, sizeof(textadmin),"[ADMIN] You have set the score of %s to: %i", targetid, score);
SendClientMessage(targetid, COLOR_GREEN, texttotarget);
SendClientMessage(playerid, COLOR_GREEN, textadmin);
return 1;
}
What it says: [ADMIN] has set yo. And [ADMIN] You have se.