How to make heart attack in pills
#1

how to make an heart attack when you using /usepill randomize if you are Gold Donator You will have 80% no heart attack but if you are not a gold donator 30 % heart attack and you will die when you are using pills.


pawn Код:
forward pills5(playerid);
public pills5(playerid)
{
    if(GetPVarInt(playerid, "usingpills") == 1)
    {
        new Float:armour;
        GetPlayerArmour(playerid, armour);
        if(armour < 50.0)
        {
            if((armour+100.0) <= 100.0)
            {
                SetPlayerArmourEx(playerid, armour+100.0);
            }
        }
    }
}

pawn Код:
CMD:usepill(playerid, params[])
{
    if(GetPVarInt(playerid, "PBM") > 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "You can't do this while being in a arena!");
        return 1;
    }
    if(GetPVarInt(playerid, "Injured") == 1)
    {
        SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
        return 1;
    }
    if(PlayerBoxing[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "You can't use firstaid while you're boxing.");
        return 1;
    }
    if(PlayerInfo[playerid][pPills] > 0)
    {
        if(GetPVarInt(playerid, "usingpills") == 0)
        {
            new string[128];
            PlayerInfo[playerid][pPills]--;
            SetPVarInt(playerid, "pills5", SetTimerEx("pills5", 5000, 1, "d", playerid));
            SetPVarInt(playerid, "pillsexpire", SetTimerEx("pillsexpire",2*60000, 0, "d", playerid));
            SetPVarInt(playerid, "usingpills", 1);
            format(string, sizeof(string), "* %s has take their pills", GetPlayerNameEx(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "You're already using pills!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "You don't have a pills!");
    }
    return 1;
}
Reply
#2

pawn Код:
if (PLAYER_IS_GOLD_DONATOR_CHECK) // EDIT THE LINE..
{
    switch (random(100))
    {
        case 0 .. 19:
        {
            // 20% of getting heart attack..
        }
        default:
        {
            // player is lucky!
        }
    }
}
else
{
    switch (random(100))
    {
        case 0 .. 29:
        {
            // 30% of getting heart attack..
        }
        default:
        {
            // player is lucky!
        }
    }
}
Reply
#3

what can i script in Case 0 .. 29 and Case 0 .. 19
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)