Drug and Animation Systems
#4

Use this... I haven't tested it so I'm not sure if it will compile
Also I have left out some parts where you will need to fill in your own variables.

But this command will allow you to give any player any amount of drugs, including negative amounts.

pawn Код:
if(strcmp(cmdtext, "/givedrugs", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(/*<insert your variable for checking admin level>*/)
            {
                tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givedrugs [PlayerID/PartOfName][Amount]");
                return 1;
            }
            new playa;
            new drugamount;
            new result[64];
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            drugamount = strval(tmp);
            if(playa != INVALID_PLAYER_ID)
                    {
                        format(string, sizeof(string), "You were given %dg of drugs by an administrator.", drugamount);
                    SendClientMessage(playa, COLOR_LIGHTGREEN, string);
                        Drugs[playerid] += drugamount;

                }
               
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Not Authorized.");
            }
        }//not connected
        return 1;
    }
Reply


Messages In This Thread
Drug and Animation Systems - by viosteaua98 - 25.11.2011, 21:00
Re: Drug and Animation Systems - by Rob_Maate - 25.11.2011, 21:11
Re: Drug and Animation Systems - by viosteaua98 - 25.11.2011, 22:22
Re: Drug and Animation Systems - by Rob_Maate - 25.11.2011, 23:46
Re: Drug and Animation Systems - by Rob_Maate - 25.11.2011, 23:48

Forum Jump:


Users browsing this thread: 2 Guest(s)