/prepweed help
#1

Hello, i am currently making a command that you have to use /prepweed before to smoke drugs. This is the command

pawn Код:
if(strcmp(cmd, "/prepweed", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(Prepweed[playerid] == 0)
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "* %s takes some weed and a joint from his jacket, and starts rolling it up", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                SetTimerEx("prepweed", 25000, false, "i", playerid);
                return 1;
                }
            }
        }
But i dont figure out how to make that you have to use that command before using /usedrugs weed.

This is the start of the code on /usedrugs weed,

pawn Код:
if(strcmp(cmd, "/usedrugs", true) == 0) // Drug system by Ellis
    {
        if(IsPlayerConnected(playerid))
        {
            if(Prepweed[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_RED, " Error, You dont have finished joint, use /prepweed to start smoking");
                return 1;
            }
            if(PlayerBoxing[playerid] > 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Cant use Drugs while you are fighting !");
                return 1;
            }
            if(UsingDrugs[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "   You are high already !");
                return 1;
            }
            new x_nr[256];
            x_nr = strtok(cmdtext, idx);
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /usedrugs [name]");
                SendClientMessage(playerid, COLOR_WHITE, "Available names: weed, heroin");
                return 1;
            }
            if(strcmp(x_nr,"weed",true) == 0)
            {
                if(PlayerInfo[playerid][pDrugs] > 1)
                {
                    PlayerStoned[playerid] += 1;
                    if(PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid, "~w~You are~n~~p~Stoned", 4000, 1); }
                    new Float:PlayersArmour;
                    GetPlayerArmour(playerid, PlayersArmour);
                    if(PlayerInfo[playerid][pDrugPerk] > 0)
                    {
                        SetPlayerArmour(playerid, PlayersArmour + 10.0);
                    }
                    PlayerInfo[playerid][pDrugs] -= 2;
                    SetPlayerArmour(playerid, PlayersArmour + 10.0);
                    SetPlayerWeather(playerid, -68);
                    UsingDrugs[playerid] = 1;
                    SetTimerEx("DrugEffectGone", 25000, false, "i", playerid);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* %s takes some weed from his jacket and starts smoking.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);]
Please help, i cant figure it out
Reply
#2

why doesnt the timer just set PrepWeed = 1;
and the weed cmd check if its 1. and when you use the weed, it goes to 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)