[Help] Trunk problem
#1

Код:
			            new Float:plyArmour;
			            GetPlayerArmour(playerid, plyArmour);

                        if(plyArmour != 0)
			            {
			                SetPlayerArmour(playerid, 0);
			                vehTrunkArmour[result] = plyArmour;

			                GetPlayerName(playerid, sendername, sizeof(sendername));
			                format(string, sizeof(string), "* %s takes off his/her body armour and puts it into car trunk.", sendername);
			                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			                SaveTrunk();
			                return 1;
			            }
			            else
			            {
			                SendClientMessage(playerid, COLOR_GREY, "   You haven't got any armour ");
			                return 1;
			            }
			        }
This is saving the armour to you trunk... how can i make it with my drug system i'm using PlayerInfo[playerid][pDrugs]
Reply
#2

this?
pawn Код:
if(strcmp(cmd, "/drunk", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            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, "NДIDE: /drunk [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);
                    if(STDPlayer[playerid]==1)
                    {
                        STDPlayer[playerid] = 0;
                        SendClientMessage(playerid, COLOR_WHITE, "* You are no longer infected with a STD anymore because of the Drugs !");
                    }
                    else if(STDPlayer[playerid]==2)
                    {
                        STDPlayer[playerid] = 1;
                        SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Chlamydia because of the Drugs !");
                    }
                    else if(STDPlayer[playerid]==3)
                    {
                        STDPlayer[playerid] = 2;
                        SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Gonorrhea because of the Drugs !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You dont have any Drug Grams left !");
                }
            }
            else if(strcmp(x_nr,"heroin",true) == 0)
            {
                if(PlayerInfo[playerid][pDrugs] > 2)
                {
                    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 + 15.0);
                    }
                    PlayerInfo[playerid][pDrugs] -= 3;
                    SetPlayerArmour(playerid, PlayersArmour + 15.0);
                    SetPlayerWeather(playerid, -30);
                    UsingDrugs[playerid] = 1;
                    SetTimerEx("DrugEffectGone", 25000, false, "i", playerid);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* %s uses some heroin.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                    if(STDPlayer[playerid]==1)
                    {
                        STDPlayer[playerid] = 0;
                        SendClientMessage(playerid, COLOR_WHITE, "* You are no longer infected with a STD anymore because of the Drugs !");
                    }
                    else if(STDPlayer[playerid]==2)
                    {
                        STDPlayer[playerid] = 1;
                        SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Chlamydia because of the Drugs !");
                    }
                    else if(STDPlayer[playerid]==3)
                    {
                        STDPlayer[playerid] = 2;
                        SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Gonorrhea because of the Drugs !");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You dont have any Drug Grams left !");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "NДIDE: /drunk [name]");
                SendClientMessage(playerid, COLOR_WHITE, "Availible names: weed, heroin");
            }
        }
        return 1;
    }
Reply
#3

no...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)