18.03.2011, 06:44
Hey i just scripted in my server when people die they respawn in front of the hosptial, and spawn with 50.0 hp. I am trying to make it so when they die the camera mode changes to just looking in front of All Saints, and they are stuck in this mode for 20 seconds before spawning in front of All Saints.Please, can anyone help me!
This is my Script:
public OnPlayerDeath(playerid)
{
Hspawn[playerid] = 1;
return 0;
}
public OnPlayerSpawn(playerid)
{
if (Hspawn[playerid] == 1)
{
if(GetPlayerMoney(playerid) > 100)
{
SetPlayerHealth(playerid, 50.5);
SetPlayerPos(playerid,1176.6060,-1323.7875,14.0296);
SendClientMessage(playerid,0xDD000096,"You spawned at the Los Santos hospital.");
SendClientMessage(playerid,0xFFFFFF96,"|-----------------------------------|");
SendClientMessage(playerid,0xDD000096,"Your medical bill cost: 100$");
GivePlayerMoney(playerid, -100);
return 1;
}
}
return 1;
}
This is my Script:
public OnPlayerDeath(playerid)
{
Hspawn[playerid] = 1;
return 0;
}
public OnPlayerSpawn(playerid)
{
if (Hspawn[playerid] == 1)
{
if(GetPlayerMoney(playerid) > 100)
{
SetPlayerHealth(playerid, 50.5);
SetPlayerPos(playerid,1176.6060,-1323.7875,14.0296);
SendClientMessage(playerid,0xDD000096,"You spawned at the Los Santos hospital.");
SendClientMessage(playerid,0xFFFFFF96,"|-----------------------------------|");
SendClientMessage(playerid,0xDD000096,"Your medical bill cost: 100$");
GivePlayerMoney(playerid, -100);
return 1;
}
}
return 1;
}