17.05.2013, 18:09
I made a Hospitalized system, when you die you spawn in the hospital and have to stay there for 5 mins.
But when I die it shows the spawn buttons...
What did I do wrong?
But when I die it shows the spawn buttons...
What did I do wrong?
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,25,1000);
JustDied[playerid]=1;
switch(reason)
{
case 0:
{
SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
SendClientMessage(playerid, SERVERCOLOR, "You have been beaten unconsious!");
SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
Player[playerid][Hospitalized] = 300;
SetSpawnInfo(playerid, 0, 62,-198.6134,-1790.6299,675.7859,351.7826,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 3);
}
case 51:
{
SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
SendClientMessage(playerid, SERVERCOLOR, "You have been in flames!");
SendClientMessage(playerid, SERVERCOLOR, "Docters are curing your burn wounds!");
SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
Player[playerid][Hospitalized] = 300;
SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 3);
}
case 53:
{
SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
SendClientMessage(playerid, SERVERCOLOR, "You have been drowned!");
SendClientMessage(playerid, SERVERCOLOR, "Docters are pumping the water out of your lungs!");
SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
Player[playerid][Hospitalized] = 300;
SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 3);
}
case 54:
{
SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
SendClientMessage(playerid, SERVERCOLOR, "You have felt from a very high hight!");
SendClientMessage(playerid, SERVERCOLOR, "Docters are repairing your backbone!");
SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
Player[playerid][Hospitalized] = 300;
SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 3);
}
case 50,49:
{
SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
SendClientMessage(playerid, SERVERCOLOR, "You have been hit by a vehicle!");
SendClientMessage(playerid, SERVERCOLOR, "Docters are repairing your backbone!");
SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
Player[playerid][Hospitalized] = 300;
SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 3);
}
case 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15:
{
SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
SendClientMessage(playerid, SERVERCOLOR, "You have been stabbed!");
SendClientMessage(playerid, SERVERCOLOR, "Docters are cleaning your wounds!");
SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
Player[playerid][Hospitalized] = 300;
SetSpawnInfo(playerid, 0, 62,-211.9630,-1761.9679,675.7687,309.1454,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 3);
}
case 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40:
{
SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
SendClientMessage(playerid, SERVERCOLOR, "You have been shot!");
SendClientMessage(playerid, SERVERCOLOR, "Docters are removing the bullets!");
SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
Player[playerid][Hospitalized] = 300;
SetSpawnInfo(playerid, 0, 62,-211.9630,-1761.9679,675.7687,309.1454,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 3);
}
}
return 1;
}