26.07.2010, 03:08
How i respawn back to Medic place when i deid then back home?
Код:
public SetPlayerSpawn(playerid) { if(IsPlayerConnected(playerid)) { new rand; new house = PlayerInfo[playerid][pPhousekey]; if(PlayerPaintballing[playerid] != 0) { ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 29, 99999); GivePlayerWeapon(playerid, 24, 99999); GivePlayerWeapon(playerid, 31, 99999); GivePlayerWeapon(playerid, 34, 99999); rand = random(sizeof(PaintballSpawns)); SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]); SetPlayerInterior(playerid, 10); return 1; } if(MedicBill[playerid] == 1) { if(PlayerInfo[playerid][pMInsure] == 0) { PlayerInfo[playerid][pDeaths] += 1; SetPlayerPos(playerid,1182.7733,-1323.6193,13.5785); positionx = 1182.7733; positiony = -1323.6193; positionz = 13.5785; SetPlayerInterior(playerid, 0); SetPlayerHealth(playerid, 100); MedicBill[playerid] = 0; GivePlayerMoney(playerid, -360); SendClientMessage(playerid, COLOR_LIGHTBLUE, " Your medical insurance did not cover the bill, you where charged $360. "); } if(PlayerInfo[playerid][pMInsure] == 1) { SetPlayerPos(playerid,1182.7733,-1323.6193,13.5785); positionx = 1182.7733; positiony = -1323.6193; positionz = 13.5785; SetPlayerInterior(playerid, 0); SetPlayerHealth(playerid, 100); MedicBill[playerid] = 0; SendClientMessage(playerid, COLOR_LIGHTBLUE, " Your medical insurance covered the bill, you where not charged. "); } } if(PlayerInfo[playerid][pTut] == 0) { gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1; SetPlayerSkin(playerid, 137); TogglePlayerControllable(playerid, 0); RegistrationStep[playerid] = 1; SendClientMessage(playerid, COLOR_GREEN, "Welcome to Delta RP, please fill in some information to proceed."); ShowPlayerDialog(playerid, SEXMENU, DIALOG_STYLE_LIST, "Gender","Male\nFemale ", "Select", "Cancel"); } if(house !=255) { if(SpawnChange[playerid]) //If 1, then you get to your house, else spawn somewhere else { SetPlayerToTeamColor(playerid); SetPlayerInterior(playerid,HouseInfo[house][hInt]); SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player PlayerInfo[playerid][pLocal] = house; PlayerInfo[playerid][pInt] = HouseInfo[house][hInt]; return 1; } } else { SetPlayerPos(playerid,1109.5496,-1796.3885,16.5938); SetPlayerInterior(playerid,0); } } return 1; }