Jump to content
  • 0

Problema /givebonus


gamercs98

Question

Problema intalnita (descriere): Cand dau gen givebonus la celalalte factiuni nu apare pe chat, doar cand folosesc /givebonus la lspd.
Ero(area / rile) / warning-(ul / urile): - 
Liniile de cod / sursa / script-ul(obligatoriu):

 

CMD:givebonus(playerid, params[])
{
    new id, suma, string[128];
    if(sscanf(params, "ui", id, suma)) return SCM(playerid, -1, "Syntax: /givebonus [playerid] [bonus]");
    if(playerVariables[playerid][pGroupRank] == 7)
    {
        if(id != INVALID_PLAYER_ID)
        {
            if(playerVariables[playerid][pGroup] == playerVariables[id][pGroup])
            {
                if(groupVariables[playerVariables[id][pGroup]][gSafe][0] >= suma)
                {
                        format(string, sizeof(string), "{73a2ad}Faction manager %s paid a bonus of $%s to %s.", playerVariables[playerid][pNormalName], NumberFormat(suma), playerVariables[id][pNormalName]);
                        SendToGroup(1, COLOR_TEAL, string);
        //            nearByMessage(playerid, COLOR_TEAL, string);
                    playerVariables[id][pMoney] += suma;
                    groupVariables[playerVariables[playerid][pGroup]][gSafe][0] -= suma;
//                    Update(id, pMoney);
                }
                else
                {
                    SCM(playerid, COLOR_LIGHT, "Your group safe doesn't have enought money!");
                }
            }
            else
            {
                SCM(playerid, -1, "That player is not in your faction!");
            }
        }
        else
        {
            SCM(playerid, -1, "That player is not connected!");
        }

    }
    else
    {
        SCM(playerid, -1, "You have to be a leader to use this command!");
    }

    return 1;
}

 


Imagini / Video (optional): - 
Ati incercat sa rezolvati singur?: Da, banuiesc ca aici trebuie sa modific SendToGroup(1, COLOR_TEAL, string); dar cum fac sa trimit mesaj nu doar la group 1 si la celalalte cand folosesc /givebonus

Edited by gamercs98
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.