GiveAllScore
#1

Can anyone give me Giveallscore code for LuxAdmin?
It's like when the player has +50 And in giveallscore 15 player score gets up to +65 ...
for LuxAdmin,Thanks.
Reply
#2

I don't know how LuxAdmin work's but i can make you similarly command, may help you

pawn Код:
YCMD:giveallscore(playerid, params[], help) // https://sampforum.blast.hk/showthread.php?tid=169029)
{
     new score = (0), string[128] = "\0", adminName[MAX_PLAYER_NAME];
     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Just RCON.");
     else if(sscanf(params, "d", score)) return SendClientMessage(playerid, -1, "USAGE: /giveallscore [score]"); // https://sampforum.blast.hk/showthread.php?tid=120356
     else
     {
          GetPlayerName(playerid, adminName, MAX_PLAYER_NAME);
          for(new i = (0), players = GetMaxPlayers(); i < players; ++ i)
          {
                SetPlayerScore(i, GetPlayerScore(i) + score);
          }
          format(string, (sizeof string), "RCON Administrator %s give %d scores to all.", adminName, score);
          SendClientMessageToAll(string);
     }
     return (true);
}
Reply
#3

Unfortunately it doesn't work..
Reply
#4

You loggedin as RCON or not?
Reply
#5

Try this :
OnPlayerCommandText :
Код:
dcmd(giveallscore, 12, cmdtext);
OnPlayerText :
Код:
dcmd_giveallscore(playerid,params[]) {
    if(AccInfo[playerid][Level] >= 3) {
        SendCommandToAdmins(playerid,"GiveAllScore");
        for(new i = 0; i < MAX_PLAYERS; i++) {
            SetPlayerScore(i, GetPlayerScore(i) + strval(params));
        }
        new string[128];
        format(string,sizeof string,"|- Administrator \"%s\" has given everyone %d score!", pName(playerid), strval(params));
        SendClientMessageToAll(blue, string);
    }
    else {
        ErrorMessages(playerid, 6);
    }
    return 1;
}
Reply
#6

pawn Код:
GiveAllScore(Amount); //

//
stock GiveAllScore(Amount)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(IsPlayerConnected(i))
    SetPlayerScore(i, GetPlayerScore(i)+Amount);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)