Hospital spawn.
#1

when player dies and passes the hospital time and reconnects , he is spawning inside the hospital again.

Код:
forward HospitalTimer(playerid);
public HospitalTimer(playerid)
{
 if(IsPlayerLoggedIn(playerid))
 {
  new string[128];
  if(HospitalTime[playerid] > 0)
  {
   format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Saavadmyopos dro darcha: ~w~%d ~r~wami", HospitalTime[playerid]);
   GameTextForPlayer(playerid, string,1500, 3);
   HospitalTime[playerid] --;
   HospitalCountDown[playerid] = SetTimerEx("HospitalTimer", 1000, false, "d", playerid);
  }
  else if(HospitalTime[playerid] <= 0)
  {
      if(Hospital[playerid] == 0)
      {
       SetPlayerPos(playerid, 1177.5485,-1323.5773,14.0761);
       SetPlayerFacingAngle(playerid, 269.4692);
      }
      else if(Hospital[playerid] == 1)
      {
             SetPlayerPos(playerid, 2034.0833,-1404.6536,17.2539);
       SetPlayerFacingAngle(playerid, 178.1200);
      }
      PlayerInfo[playerid][pHospital] = 0;
      SetCameraBehindPlayer(playerid);
      TogglePlayerControllable(playerid, 1);
      PlayerInfo[playerid][pArmor] = 0;
      SetZaiatHealth(playerid, 40);
      SetZaiatArmour(playerid, 0);
      SendClientMessage(playerid, COLOR_ORANGE, "GAPRTXILEBA: {FFFFFF}Tqven mokvdit rac imas nishnavs rom tqven gaqvt amnezia.");
   SendClientMessage(playerid, COLOR_ORANGE, "GAPRTXILEBA: {FFFFFF}rac imas nishnavs rom tqven konkretuli RP scenebi agar gaxsovt.");
   SendClientMessage(playerid, COLOR_ORANGE, "GAPRTXILEBA: {FFFFFF}aseve tqven dagaviwydat yvelaferi rac wina 30 wutis ganmavlobashi moxda.");
   KillTimer(HospitalCountDown[playerid]);
   SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
   PlayerInfo[playerid][pHospital] = 0;
   HospitalTime[playerid] = 0;
   KillTimer(HospitalCountDown[playerid]);
   if(PlayerInfo[playerid][pVIP])
   {
    SetZaiatHealth(playerid, 100);
    SendClientMessage(playerid, COLOR_VIP, "Bronze VIP: Tqven daspawndit 100 sicocxlit.");
   }
   if(PlayerInfo[playerid][pVIP] >= 2) SendClientMessage(playerid, COLOR_VIP, "Silver VIP: Tqven gamoiweret saavadmyopodan dzalian male.");
   if(PlayerInfo[playerid][pVIP] >= 3)
   {
    SetZaiatHealth(playerid, 100);
    SetZaiatArmour(playerid, 20);
    SendClientMessage(playerid, COLOR_VIP, "Gold VIP: Tqven daspawndit 100 sicocxlit da 20 bronit.");
   }
   if(PlayerInfo[playerid][pVIP] >= 4)
   {
    SetZaiatHealth(playerid, 100);
    SetZaiatArmour(playerid, 30);
    SendClientMessage(playerid, COLOR_VIP, "Platinum VIP: Tqven daspawndit 100 sicocxlit da 30 bronit.");
   }
  }
 }
 return 1;
}
here is the hospital time code
Reply
#2

try putting this under OnPlayerConnect
pawn Код:
Hospital[playerid] == 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)