18.03.2011, 06:54
PHP код:
public OnPlayerSpawn(playerid)
{
if (Hspawn[playerid] == 1)
{
if(GetPlayerMoney(playerid) > 100)
{
Hspawn[playerid] = 0;
SetPlayerHealth(playerid, 50.5);
SetPlayerCameraPos(playerid, x, y, z);
SetPlayerCameraLookAt(playerid, x, y, z);
TogglePlayerControllable(playerid, true);
SetTimerEx("SpawnPlayerToHospital", 20000, 0, "%d", playerid);
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;
}
forward SpawnPlayerToHospital(playerid);
public SpawnPlayerToHospital(playerid)
{
TogglePlayerControllable(playerid, false);
SetPlayerPos(playerid,1176.6060,-1323.7875,14.0296);
SetCameraBehindPlayer(playerid);
}