/givemoney
#2

pawn Код:
if(strcmp(cmd, "/givemoney", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /givemoney [playerid/PartOfName] [money]");
                return 1;
            }
            new playa;
            new money;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            money = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        ConsumingMoney[playa] = 1;
                        GivePlayerMoney(playa, money);
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, 128, "AdmWarning: %s has admin given %d to %s.", sendername,money,giveplayer);
                        ABroadCast(COLOR_YELLOW,string,1);
                        AdminLog(string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Nu esti autorizat sa folosesti aceasta comanda!");
            }
        }
        return 1;
    }
You must update the admin variable to yours.
P.S. Sorry cause it's strcmp, but it's from my gm, I don't have time to make it with ycmd right now...
Reply


Messages In This Thread
/givemoney - by Blackazur - 16.11.2012, 15:23
Re: /givemoney - by DiGiTaL_AnGeL - 16.11.2012, 15:34
AW: /givemoney - by Blackazur - 16.11.2012, 15:43
Re: /givemoney - by [HK]Ryder[AN] - 16.11.2012, 15:46
Re: /givemoney - by Konstantinos - 16.11.2012, 15:55
AW: /givemoney - by Blackazur - 16.11.2012, 15:58
Re: /givemoney - by Faisal_khan - 16.11.2012, 16:08
Re: /givemoney - by [HK]Ryder[AN] - 16.11.2012, 16:10

Forum Jump:


Users browsing this thread: 1 Guest(s)