10.07.2015, 12:50
This is an admin score adding command:
but when i use it,i set the player score to the entered amount but i want it to "+" the score with the entered amount,please help
PHP код:
CMD:givefreeroamscore(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5) {
new string[128], pName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], pID, score;
if(sscanf(params, "ud", pID, score)) return GameTextForPlayer(playerid,"~g~/givefreeroamscore [id] [score]",4500,3);
if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "This player is not connected");
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(pID, pName, sizeof(pName));
format(string, sizeof(string), "%s has given you %d freeroam score", name, score);
SendClientMessage(pID, BAN, string);
format(string, sizeof(string), "You have given %d freeroam score to %s", score, pName);
SendClientMessage(playerid, BAN, string);
PlayerInfo[pID][pKills] = ++score;
}
return 1;
}