Timer Help [REP ++]
#1

Hi Scripterzz.I need problem with my hospital system.When i /exit but im in Hospital becouse im dead and /exit and Send me message You can't exit now Remaining: 150 sec and how can i make to send me a message You cant exit now Remaining: Secounds remained for Hospital ?? Ex. /time - 46 secounds and when i /exit to send me Remaining: 50 secounds and go down
Reply
#2

Wha'the hell ??

If I understood you, you want to make this:

When player dies, he goes to hospital, and he can't exit it during 150 seconds is running out?

#if yes

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPVarInt(playerid, "Dead", 1);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(GetPVarInt(playerid, "Dead") == 1)
    {
        HospitalTimer[playerid] = SetTimerEx("HospTime", 1000, true, "d", playerid);
        SetPVarInt(playerid, "HospitalTime", 150);
        SetPVarInt(playerid, "Dead", 0);
    }
    return 1;
}

forward HospTime(playerid);
public HospTime(playerid)
{
    if(GetPVarInt(playerid, "HospitalTime") > 0)
    {
        SetPVarInt(playerid, "HospitalTime", GetPVarInt(playerid, "HospitalTime") - 1);
    }
    else KillTimer(HospitalTimer[playerid]);
}

YCMD:exit(playerid, params[], help)
{
    if(GetPVarInt(playerid, "HospitalTime") > 0)
    {
        new string_H[27];
        format(string_H, sizeof string_H, "Time left in hospital: %d", GetPvarInt(playerid, "HospitalTime"));
        return SendClientMessage(playerid, 0xFFFFFFFF, string_H);
    }

    SetPlayerPos(playerid, outsidehosp_X, outsidehosp_Y, outsidehosp_Z);
    return 1;
}
Reply
#3

Hvala )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)