SA-MP Forums Archive
GiveAllScore - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GiveAllScore (/showthread.php?tid=420309)



GiveAllScore - Elasmar - 04.03.2013

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.


Re: GiveAllScore - DarkPower - 04.03.2013

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);
}



Re: GiveAllScore - Elasmar - 04.03.2013

Unfortunately it doesn't work..


Re: GiveAllScore - Gamer_007 - 04.03.2013

You loggedin as RCON or not?


Re: GiveAllScore - MehranGta - 04.03.2013

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;
}



Re: GiveAllScore - Jewell - 04.03.2013

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

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