19.10.2011, 12:43
pawn Код:
public AfterSpawnHos(playerid)
{
if(IsPlayerConnected(playerid))
{
if(Hospitalized[playerid] == 1)
{
if(PlayerInfo[playerid][pMember] == 1 ||PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pMember] == 3 ||PlayerInfo[playerid][pMember] == 4 ||PlayerInfo[playerid][pMember] == 14)
{
SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
SendClientMessage(playerid,COLOR_LIGHTYELLOW5," Hospital: ");
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: The government paid your medical bills.");
SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
}
else
{
new string[256];
SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
SendClientMessage(playerid,COLOR_LIGHTYELLOW5," Hospital: ");
format(string, sizeof(string),"[INFO]: You've paid your medical bill that came to be %d", MedicalBill);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
new pocketmoney = GetPlayerPCash(playerid);
if(pocketmoney <= MedicalBill)
{
GivePlayerPCash(playerid, -pocketmoney);
FamilyInfo[3][FamilyMoney] += pocketmoney;
}
else
{
GivePlayerPCash(playerid, -MedicalBill);
FamilyInfo[3][FamilyMoney] += MedicalBill;
}
OnPlayerDataSave(playerid);
}
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid,-2209.9553,-2288.4492,30.6250); // Warp the player
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerHealth(playerid, 50.0);
Hospitalized[playerid] = 0;
SetPlayerVirtualWorld(playerid,0);
PlayerInfo[playerid][pInvWeapon] = 0;
PlayerInfo[playerid][pInvAmmo] = 0;
ResetPlayerWeaponsEx(playerid);
}
return 1;
}
}