Need help in /giveallscore (rep++)
#1

I want /giveallscore cmd. I don't have it in admin script. Please can any one make for me>??

I have sample:
pawn Код:
dcmd_armourall(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 3)
    {
        SendCommandToAdmins(playerid,"ArmourAll");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) && (i != playerid) && i != ServerInfo[MaxAdminLevel])
        {
        PlayerPlaySound(i,1057,0.0,0.0,0.0);
        SetPlayerArmour(i,100.0);
        }
        }
        new string[128];
        format(string,sizeof(string),"|- Administrator \"%s\" has Restored all players armour -|", pName(playerid));
        return SendClientMessageToAll(blue, string);
    }
    else return ErrorMessages(playerid, 6);
}
Reply
#2

try this:

pawn Код:
dcmd_giveallscore(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3)
    {
        SendCommandToAdmins(playerid,"ScoreAll");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) && (i != playerid) && i != ServerInfo[MaxAdminLevel])
        {
        SetPlayerScore(i, strval(params));
        }
        }
        new string[128];
        format(string,sizeof(string),"|- Administrator \"%s\" has set all players score to %d -|", pName(playerid),strval(params));
        return SendClientMessageToAll(blue, string);
    }
    else return ErrorMessages(playerid, 6);
}
Reply
#3

when i did this in game it said server unknown command..
Reply
#4

pawn Код:
dcmd_giveallscore(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3)
    {
        SendCommandToAdmins(playerid,"ScoreAll");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) && (i != playerid) && i != ServerInfo[MaxAdminLevel])
        {
        SetPlayerScore(i, strval(params));
        }
        }
        new string[128];
        format(string,sizeof(string),"|- Administrator \"%s\" has set all players score to %d -|", pName(playerid),strval(params));
        return SendClientMessageToAll(blue, string);
    }
    else return ErrorMessages(playerid, 6);
    return 1;
}
Reply
#5

ok i make it for u
Reply
#6

Of course it said unknown command because you didn't add
pawn Код:
dcmd(giveallscore, 12, cmdtext);
to your OnPlayerCommandText.

This is necessary when using DCMD.
Click me for more info!

Also:
pawn Код:
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;
}
PS: What CrazyMax and Romel posted is SETallscore, not GIVEallscore.
Reply
#7

try this:


Код:
dcmd_givescore(playerid, params[])
{
    new giveplayerid,
        amount,
        gscore = GetPlayerScore(playerid);
    if(sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /givescore [playerid/partname] [amount]");
    else if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not found");
    else if(amount > gscore) return SendClientMessage(playerid, 0xFF0000AA, "ERROE:Unknown Score");
    else
    {
        SetPlayerScore(giveplayerid,GetPlayerScore(giveplayerid) + amount);
        SetPlayerScore(playerid,gscore - amount);
        SendClientMessage(playerid, 0x00FF00AA, "Score Sent");
        SendClientMessage(giveplayerid, 0x00FF00AA, "You Recieved Score");
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by $$inSane
Посмотреть сообщение
try this:


Код:
dcmd_givescore(playerid, params[])
{
    new giveplayerid,
        amount,
        gscore = GetPlayerScore(playerid);
    if(sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /givescore [playerid/partname] [amount]");
    else if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not found");
    else if(amount > gscore) return SendClientMessage(playerid, 0xFF0000AA, "ERROE:Unknown Score");
    else
    {
        SetPlayerScore(giveplayerid,GetPlayerScore(giveplayerid) + amount);
        SetPlayerScore(playerid,gscore - amount);
        SendClientMessage(playerid, 0x00FF00AA, "Score Sent");
        SendClientMessage(giveplayerid, 0x00FF00AA, "You Recieved Score");
    }
    return 1;
}
He needs giveALLscore, not givescore.
Reply
#9

Thnx Al. It worked. Thnx Mean.... (rep added)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)