Drug and Animation Systems
#1

i need a drug system where i need command /takedrugs [/td]
Where health increase for ex: i have almost 10 hp health so i /td 10 hp 20hp 30hp.......to 100hp


Sit animations ex: /sit 8 for stop it enter
ex: /dance 3 enter stop
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/td", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(Drugs[playerid] > 1) //or whatever your variable for storing drugs is
            {
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health + 10.0);
                SendClientMessage(playerid, COLOR_GREY, "  You used 1g of your drugs.");
                Drugs[playerid] -= 1;
               
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You dont have any drugs.");
            }
        }//not connected
        return 1;
    }
Reply
#3

how can i give player 500 drugs?
and when player type /td he will take 5g not 1g
Reply
#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
#5

This one will take 5g each time the player used /td

pawn Код:
{
        if(IsPlayerConnected(playerid))
        {
            if(Drugs[playerid] > 1) //or whatever your variable for storing drugs is
            {
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health + 10.0);
                SendClientMessage(playerid, COLOR_GREY, "  You used 1g of your drugs.");
                Drugs[playerid] -= 5;
               
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You dont have any drugs.");
            }
        }//not connected
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)