Player dont get cancer
#1

Hi, ive made it so when you smoke more than the choosen ammount (i put it on 2 for test) you get cancer. Now.. my problem is that i dont know if the player have cancer... This is the smoke code
pawn Код:
if(strcmp(cmd, "/smoke", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLighter] > 0)
            {
                if(PlayerInfo[playerid][pCigarettes] > 0)
                {
                    IsSmoking[playerid] = 1;
                    PlayerInfo[playerid][pCigarettes] --;
                    PlayerInfo[playerid][pLighter] --;
                    if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* Stranger takes out his lighter and cigarette and lights it up."); }
                    else { format(string, sizeof(string), "* Stranger takes out her lighter and cigarette and lights it up."); }
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                    PlayerInfo[playerid][pTimesSmoked] ++;
                    if(PlayerInfo[playerid][pTimesSmoked] > 2)
                    {
                        PlayerInfo[playerid][pCancer] = 1;
                    }
                    if(PlayerInfo[playerid][pCancer])
                    {
                        new Float: HP;
                        GetPlayerHealth(playerid, HP);
                        SetPlayerHealth(playerid, HP-5);
                    }
                }
                else
                {
                    SendClientMessage(playerid,COLOR_GREY,"You dont have any ciggarettes left,Go buy some more!");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "You dont have a lighter!");
            }
        }
        return 1;
     }
and if the player have cancer this is supose to come
pawn Код:
if(PlayerInfo[playerid][pCancer] == 1)
    {
        SendClientMessage(playerid, COLOR_BLUE, "You're having trouble breathing... (( Lung Cancer ))");
        SetTimerEx("Cough", 6000, 1, "d", playerid);
    }
    return 1;
}

forward Cough(playerid);
public Cough(playerid)
{
    if(PlayerInfo[playerid][pCancer] == 1)
    {
        new string[256];
        format(string, sizeof(string), "%s is coughing really hard...", playerid);
        ProxDetector(20.0, playerid, string,COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
        new Float:HP;
        GetPlayerHealth(playerid, HP);
        SetPlayerHealth(playerid, HP-4);
    }
}
But it dont, i have been waiting longer than the timer is supose to be and still nothing
Reply


Messages In This Thread
Player dont get cancer - by Don_Cage - 23.03.2013, 04:04
Re: Player dont get cancer - by PaulDinam - 23.03.2013, 04:05
Re: Player dont get cancer - by Don_Cage - 23.03.2013, 04:07
Re: Player dont get cancer - by PaulDinam - 23.03.2013, 04:10
Re: Player dont get cancer - by Don_Cage - 23.03.2013, 04:16
Re: Player dont get cancer - by PaulDinam - 23.03.2013, 04:18
Re: Player dont get cancer - by Don_Cage - 23.03.2013, 04:23
Re: Player dont get cancer - by PaulDinam - 23.03.2013, 04:27
Re: Player dont get cancer - by Don_Cage - 23.03.2013, 04:55
Re: Player dont get cancer - by Don_Cage - 23.03.2013, 17:53

Forum Jump:


Users browsing this thread: 3 Guest(s)