Hospital System - Not working.
#2

Try this:

pawn Код:
stock dohospital(playerid)
{
    if(Hospitalized[playerid] == 1)
    {
        if(AdminDuty[playerid] == 1)
            {
                Hospitalized[playerid] = 0;
                SetPlayerPos(playerid, -227.3866, 1039.8873, 19.7422);
                SendClientMessage(playerid, COLOUR_WHITE, "You are currently administrating, you were removed from hospital.");
            }
            else
            {
                ResetPlayerWeapons(playerid);
                SetPlayerHealth(playerid, 100);
                SetPlayerInterior(playerid, 0);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerDrunkLevel(playerid, 50000);
                HospitalTime[playerid] = 1;
                SetPlayerColor(playerid, COLOUR_GREY);
                SetPlayerVirtualWorld(playerid, playerid+59);
                TogglePlayerControllable(playerid, false);
                SetPlayerPos(playerid, -227.3866, 1039.8873 -5, 19.7422);
                SetPlayerCameraPos(playerid, -833.5241, -1358.8575, 86.9054);
                SetPlayerCameraLookAt(playerid, -830.8118, -1360.3612, 87.0289);
                SendClientMessage(playerid, COLOUR_WHITE, "You are recovering in hospital.");
                SendClientMessage(playerid, COLOUR_WHITE, "You will be released shortly. ((Revenge killing is against the server rules)).");
                SetTimer("OneSecondTimer", 1000, false); // I've added this. You never called it!
            }
        }
    return 1;
}
And OnPlayerSpawn:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(Hospitalized[playerid])
    {
        dohospital(playerid);
    }
    return 1;
}
Make sure you add

pawn Код:
Hospitalized[playerid] = 1;
Under OnPlayerDeath.
Reply


Messages In This Thread
Hospital System - Not working. - by Dokins - 26.11.2011, 17:31
Re: Hospital System - Not working. - by SlashQ - 26.11.2011, 18:06

Forum Jump:


Users browsing this thread: 1 Guest(s)