09.08.2018, 12:08
i has been fix HospitalTimer = 1 2 3 4 5 .... but it was still be it at the Hospital that no res sinh
Quote:
TogglePlayerControllable(playerid, 0); SetPlayerHealth(playerid, 0.5); if(PlayerInfo[playerid][pHealthCare] == 0) { SendClientMessageEx(playerid, COLOR_CYAN, "Ban khong co tieu chuan de cham soc suc khoe tot hon, su dung /chamsocsuckhoe de mua goi cham soc suc khoe tot hon."); SetPVarInt(playerid, "HospitalTimer", 1); } else if(PlayerInfo[playerid][pHealthCare] == 1) { if(PlayerInfo[playerid][pCredits] >= ShopItems[18][sItemPrice]) { GivePlayerCredits(playerid, -ShopItems[18][sItemPrice], 1); printf("Price18: %d", 1); SetPVarInt(playerid, "HealthCareActive", 1); AmountSold[18]++; AmountMade[18] += ShopItems[18][sItemPrice]; //ShopItems[18][sSold]++; //ShopItems[18][sMade] += ShopItems[18][sItemPrice]; new szQuery[128]; format(szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold18` = '%d', `AmountMade18` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[18], AmountMade[18]); mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", SENDDATA_THREAD); format(string, sizeof(string), "[HC] [User: %s(%i)][IP: %s][XU: %s][Binh dan][Gia: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[18][sItemPrice])); Log("logs/credits.log", string), print(string); } else { SendClientMessageEx(playerid, COLOR_CYAN, "Ban khong co du XU de chon goi cham soc suc khoe Binh dan."); } SetPVarInt(playerid, "HospitalTimer", 1); } else { if(PlayerInfo[playerid][pCredits] >= ShopItems[19][sItemPrice]) { GivePlayerCredits(playerid, -ShopItems[19][sItemPrice], 1); printf("Price19: %d", 2); SetPVarInt(playerid, "HospitalTimer", 5); SetPVarInt(playerid, "HealthCareActive", 1); AmountSold[19]++; AmountMade[19] += ShopItems[19][sItemPrice]; //ShopItems[19][sSold]++; //ShopItems[19][sMade] += ShopItems[19][sItemPrice]; new szQuery[128]; format(szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold19` = '%d', `AmountMade19` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[19], AmountMade[19]); mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", SENDDATA_THREAD); format(string, sizeof(string), "[HC] [User: %s(%i)][IP: %s][XU: %s][Dai gia][Gia: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[19][sItemPrice])); Log("logs/credits.log", string), print(string); } else { SetPVarInt(playerid, "HospitalTimer", 1); SendClientMessageEx(playerid, COLOR_CYAN, "Ban khong co du XU de chon goi cham soc suc khoe Dai gia."); } } SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_HOSPITALTIMER); return 1; } if(PlayerInfo[playerid][pHospital] == 0) { SetPlayerPos(playerid,PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]); //PlayerInfo[playerid][pInterior] = PlayerInfo[playerid][pInt]; SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]); SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPos_r]); SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]); if(PlayerInfo[playerid][pHealth] < 1) PlayerInfo[playerid][pHealth] = 100; SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]); if(PlayerInfo[playerid][pArmor] > 0) { SetPlayerArmor(playerid, PlayerInfo[playerid][pArmor]); } SetCameraBehindPlayer(playerid); if(PlayerInfo[playerid][pInt] > 0) Player_StreamPrep(playerid, PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z], FREEZE_TIME); } else { PlayerInfo[playerid][pDuty] = 0; PlayerInfo[playerid][pVW] = 0; PlayerInfo[playerid][pInt] = 0; SetPlayerVirtualWorld(playerid, 0); if( GetPVarInt( playerid, "EventToken" ) == 1 ) { //SendClientMessageEx( playerid, COLOR_WHITE, "As you've just come from an event, your weapons have been refunded." ); } else { ResetPlayerWeaponsEx(playerid); } SetPVarInt(playerid, "MedicBill", 1); new string[70+MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pInsurance] == 1) { if(PlayerInfo[playerid][pWantedLevel] >= 1) { SendClientMessageEx(playerid, COLOR_YELLOW, "Canh sat da duoc benh vien thong bao vi tri cua ban va ho dang tren duong toi."); format(string, sizeof(string), " County General Hospital bao cao co %s truy na o day.", GetPlayerNameEx(playerid)); SendGroupMessage(1, DEPTRADIO, string); } SetPlayerCameraPos(playerid,1999.5308,-1449.3281,13.5594+6.0); SetPlayerCameraLookAt(playerid,2036.2179,-1410.3223,17.1641); SetPlayerPos(playerid, 1999.5308,-1449.3281,10.5594); PlayerInfo[playerid][pHospital] = 2; } else if(PlayerInfo[playerid][pInsurance] == 2) { if(PlayerInfo[playerid][pWantedLevel] >= 1) { SendClientMessageEx(playerid, COLOR_YELLOW, "Canh sat da duoc benh vien thong bao vi tri cua ban va ho dang tren duong toi."); format(string, sizeof(string), " All Saints Hospital bao cao co %s truy na o day.", GetPlayerNameEx(playerid)); SendGroupMessage(1, DEPTRADIO, string); } SetPlayerCameraPos(playerid,1188.4574,-1309.2242,13.5625+6.0); SetPlayerCameraLookAt(playerid,1175.5581,-1324.7922,18.1610); SetPlayerPos(playerid, 1188.4574,-1309.2242,10.5625); // Warp the player PlayerInfo[playerid][pHospital] = 1; } else if(PlayerInfo[playerid][pInsurance] == 3) { if(PlayerInfo[playerid][pWantedLevel] >= 1) { SendClientMessageEx(playerid, COLOR_YELLOW, "Canh sat da duoc benh vien thong bao vi tri cua ban va ho dang tren duong toi."); format(string, sizeof(string), " Red County Hospital bao cao co %s truy na o day.", GetPlayerNameEx(playerid)); SendGroupMessage(1, DEPTRADIO, string); } SetPlayerCameraPos(playerid,1248.4147,338.8385,19. 4063+6.0); SetPlayerCameraLookAt(playerid,1241.4449,326.3389, 19.7555); SetPlayerPos(playerid, 1248.4147,338.8385,19.4063); PlayerInfo[playerid][pHospital] = 3; } else if(PlayerInfo[playerid][pInsurance] == 4) { if(PlayerInfo[playerid][pWantedLevel] >= 1) { SendClientMessageEx(playerid, COLOR_YELLOW, "Canh sat da duoc benh vien thong bao vi tri cua ban va ho dang tren duong toi."); format(string, sizeof(string), " Benh vien Fort Carson bao cao co %s truy na o day.", GetPlayerNameEx(playerid)); SendGroupMessage(1, DEPTRADIO, string); } SetPlayerCameraPos(playerid,-314.0242,1060.7919,19.5938+6.0); SetPlayerCameraLookAt(playerid,-320.0992,1049.0341,20.3403); SetPlayerPos(playerid, -314.0242,1060.7919,19.593; PlayerInfo[playerid][pHospital] = 4; } else if(PlayerInfo[playerid][pInsurance] == 5) { if(PlayerInfo[playerid][pWantedLevel] >= 1) { SendClientMessageEx(playerid, COLOR_YELLOW, " Canh sat da duoc thong bao rang ban dang bi truy na va ho dang tren duong toi."); format(string, sizeof(string), " Benh vien San Fierro bao cao co %s truy na o day.", GetPlayerNameEx(playerid)); SendGroupMessage(1, DEPTRADIO, string); } SetPlayerCameraPos(playerid,-2571.2766,558.7813,68.1754); SetPlayerCameraLookAt(playerid,-2619.2883,596.2850,49.0966); SetPlayerPos(playerid, -2653.6685,626.6485,4.8930); PlayerInfo[playerid][pHospital] = 5; } else if(PlayerInfo[playerid][pInsurance] == 6) { SetPlayerCameraPos(playerid,2787.102050, 2392.162841, 1243.898681); SetPlayerCameraLookAt(playerid,2801.281982, 2404.575683, 1240.531127); SetPlayerPos(playerid, 2788.561523, 2387.321044, 1227.350219); PlayerInfo[playerid][pHospital] = 7; } else if(PlayerInfo[playerid][pInsurance] == 7) { SetPlayerCameraPos(playerid,2787.102050, 2392.162841, 1243.898681); SetPlayerCameraLookAt(playerid,2801.281982, 2404.575683, 1240.531127); SetPlayerPos(playerid, 2788.561523, 2387.321044, 1227.350219); PlayerInfo[playerid][pHospital] = 8; } else if(PlayerInfo[playerid][pInsurance] == { new Float:X, Float:Y, Float:Z; GetDynamicObjectPos(Carrier[0], X, Y, Z); SetPlayerCameraPos(playerid,(X-100),(Y-100),30); SetPlayerCameraLookAt(playerid,X, Y, Z); SetPlayerPos(playerid, (X-0.377671),(Y-10.91701,0); PlayerInfo[playerid][pHospital] = 9; } else if(PlayerInfo[playerid][pInsurance] == 9) { SetPlayerCameraPos(playerid, -1529.847167, 2539.394042, 62.038913); SetPlayerCameraLookAt(playerid, -1514.883300, 2527.161132, 55.743553); SetPlayerPos(playerid, -1514.809204, 2526.305175, 51.865501); PlayerInfo[playerid][pHospital] = 10; } if(PlayerInfo[playerid][pInsurance] == 0) { new randhos = Random(1,3); switch(randhos) { case 1: { if(PlayerInfo[playerid][pWantedLevel] >= 1) { SendClientMessageEx(playerid, COLOR_YELLOW, " Canh sat da duoc thong bao rang ban dang bi truy na va ho dang tren duong toi."); format(string, sizeof(string), " Tat ca benh vien da bao cao %s la toi pham truy na.", GetPlayerNameEx(playerid)); SendGroupMessage(1, DEPTRADIO, string); } SetPlayerCameraPos(playerid,1188.4574,-1309.2242,13.5625+6.0); SetPlayerCameraLookAt(playerid,1175.5581,-1324.7922,18.1610); SetPlayerPos(playerid, 1188.4574,-1309.2242,10.5625); // Warp the player PlayerInfo[playerid][pHospital] = 6; } case 2: { if(PlayerInfo[playerid][pWantedLevel] >= 1) { SendClientMessageEx(playerid, COLOR_YELLOW, " Canh sat da duoc thong bao rang ban dang bi truy na va ho dang tren duong toi."); format(string, sizeof(string), " Benh vien da khoa quan da thong bao %s la toi pham truy na.", GetPlayerNameEx(playerid)); SendGroupMessage(1, DEPTRADIO, string); } SetPlayerCameraPos(playerid,1999.5308,-1449.3281,13.5594+6.0); SetPlayerCameraLookAt(playerid,2036.2179,-1410.3223,17.1641); SetPlayerPos(playerid, 1999.5308,-1449.3281,10.5594); PlayerInfo[playerid][pHospital] = 2; } } } TogglePlayerControllable(playerid, 0); SetPlayerHealth(playerid, 0.5); if(PlayerInfo[playerid][pHealthCare] == 0) { SendClientMessageEx(playerid, COLOR_CYAN, "Ban dang co goi cham soc suc khoe /chamsocsuckhoe de mua goi cham soc suc khoe tot hon."); SetPVarInt(playerid, "HospitalTimer", 1); } else if(PlayerInfo[playerid][pHealthCare] == 1) { if(PlayerInfo[playerid][pCredits] >= ShopItems[18][sItemPrice]) { GivePlayerCredits(playerid, -ShopItems[18][sItemPrice], 1); printf("Price18: %d", 1); SetPVarInt(playerid, "HealthCareActive", 1); AmountSold[18]++; AmountMade[18] += ShopItems[18][sItemPrice]; //ShopItems[18][sSold]++; //ShopItems[18][sMade] += ShopItems[18][sItemPrice]; new szQuery[128]; format(szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold18` = '%d', `AmountMade18` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[18], AmountMade[18]); mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", SENDDATA_THREAD); format(string, sizeof(string), "[HC] [User: %s(%i)][IP: %s][XU: %s][Adv][Gia tien: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[18][sItemPrice])); Log("logs/credits.log", string), print(string); } else { SendClientMessageEx(playerid, COLOR_CYAN, "Ban khong co du XU cho goi cham soc suc khoe binh dan."); } SetPVarInt(playerid, "HospitalTimer", 1); } else { if(PlayerInfo[playerid][pCredits] >= ShopItems[19][sItemPrice]) { GivePlayerCredits(playerid, -ShopItems[19][sItemPrice], 1); printf("Price19: %d", ShopItems[19][sItemPrice]); SetPVarInt(playerid, "HospitalTimer", 5); SetPVarInt(playerid, "HealthCareActive", 1); AmountSold[19]++; AmountMade[19] += ShopItems[19][sItemPrice]; //ShopItems[19][sSold]++; //ShopItems[19][sMade] += ShopItems[19][sItemPrice]; new szQuery[128]; format(szQuery, sizeof(szQuery), "UPDATE `sales` SET `TotalSold19` = '%d', `AmountMade19` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH", AmountSold[19], AmountMade[19]); mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", SENDDATA_THREAD); format(string, sizeof(string), "[HC] [User: %s(%i)][IP: %s][XU: %s][Super][Gia tien: %s]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[19][sItemPrice])); Log("logs/credits.log", string), print(string); } else { SetPVarInt(playerid, "HospitalTimer", 1); SendClientMessageEx(playerid, COLOR_CYAN, "Ban khong co du XU cho goi cham soc suc khoe dai gia."); } } SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_HOSPITALTIMER); } new Float: x, Float: y, Float: z; GetPlayerPos(playerid, x, y, z); if(x == 0.0 && y == 0.0) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid, 1715.1201,-1903.1711,13.5665); SetPlayerFacingAngle(playerid, 359.4621); SetCameraBehindPlayer(playerid); } SetPlayerToTeamColor(playerid); return 1; } return 1; } |