giving scores to people under 999 scores only
#1

Hi how do i make a command to give scores to people under 999 scores only?

because i am refunding them 1000 score. so if they didn't receieve 1000 scores, they wont get it.

And i want to set them VIP onplayerconnect.

Код:
PlayerInfo[playerid][dRank] = 3;
Reply
#2

PHP код:
public OnPlayerConnect(playerid)
{
         
PlayerInfo[playerid][dRank] = 3;
}

CMD:refundscore(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1)
    {
        new 
string[128], giveplayerid;
        if(
sscanf(params"u"giveplayerid)) return SendClientMessage(playerid"Syntax: /refundscore [playername/id]");
        if(
PlayerInfo[playerid][pScore] < 999)
        {
            
PlayerInfo[playerid][pScore] = 1000;
            
format(stringsizeof(string), "You have set %s's score to one thousand!"GetPlayerName(giveplayerid);
            
SendClientMessage(playerid, -1string);
        }
        else
        {
            
format(stringsizeof(string), "%s has already been refunded!"GetPlayerName(giveplayerid);
            
SendClientMessage(playerid, -1string);
        }
    }
    else
    {
        
SendClientMessage(playerid, -1"You are not authorized to use this command!");
    }
    return 
1;

Reply
#3

rekstar, I want to give EVERYONE 1000 scores who are below 999 score with 1 command, instead of giving it to everyone (/refund <ammount>).
Reply
#4

pawn Код:
CMD:refund(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /Refund < Amount >");

    new amount = strval(params);

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i) || GetPlayerScore(i) > 1000) continue;

        SetPlayerScore(i, GetPlayerScore(i) + 1000); // Give players with less than 1000 score 1000 score
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by -Prodigy-
Посмотреть сообщение
pawn Код:
CMD:refund(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /Refund < Amount >");

    new amount = strval(params);

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i) || GetPlayerScore(i) > 1000) continue;

        SetPlayerScore(i, GetPlayerScore(i) + 1000); // Give players with less than 1000 score 1000 score
    }
    return 1;
}
ty repped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)