Removing a unit.
#1

Okay, so I just wanted to know if the following was possible: If you had a server where every time a player killed another player, they got +10 to their score but you wanted to change this to +1 every time they kill another player. However, you didn't want new players to have to catch up to older players' ridiculous scores when they joined after the change, so you want to remove a single unit off of everyone's score with a command.

I.E: /removeunit = 234 = 23
34423 = 3442

Would it be possible to make a command that did this/how would you do it?

Thanks!
Reply
#2

I'm not sure what you mean, sorry, but I'll try and elaborate.

Basically, you divide their score by 10 so it removes the last digit from their score (e.g. (1312 / 10) -> 131).

pawn Код:
CMD:removeunit(playerid, params[])
{
    for (new i = 0, j = GetMaxPlayers(); i != j; i ++)
    {
        if (!IsPlayerConnected(i))
            continue;

        SetPlayerScore(i, (GetPlayerScore(i) / 10));
    }
    return 1;
}
Reply
#3

Yeah, that's exactly what I meant! Would it work for offline players too? Thanks. !
Reply
#4

Depends, what saving system do you use for player accounts?
Reply
#5

Tbh. I don't. I was more asking this for a friend. Thanks so much for your help though.

I guess this can be locked!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)