Originally Posted by Pandabeer1337
use virtual worlds.
|
if(strcmp(cmd, "/enter", true) == 0) { if(IsPlayerConnected(playerid)) { for(new i = 0; i < sizeof(HouseInfo); i++) { if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez])) { //printf("Found House :%d",i); if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0) { if(HouseInfo[i][hLevel] = 1) { SetPlayerInterior(playerid,HouseInfo[i][hInt]); SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]); GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1); PlayerInfo[playerid][pInt] = HouseInfo[i][hInt]; PlayerInfo[playerid][pLocal] = i; } else { SetPlayerVirtualWorld(playerid, 7); SetPlayerInterior(playerid,HouseInfo[i][hInt]); SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]); GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1); PlayerInfo[playerid][pInt] = HouseInfo[i][hInt]; PlayerInfo[playerid][pLocal] = i; } } else { GameTextForPlayer(playerid, "~r~Locked", 5000, 1); } } }
if(strcmp(cmd, "/exit", true) == 0) { if(IsPlayerConnected(playerid)) { for(new i = 0; i < sizeof(HouseInfo); i++) { //printf("House :%d",i); if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz])) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]); PlayerInfo[playerid][pInt] = 0; SetPlayerVirtualWorld(playerid,0); PlayerInfo[playerid][pLocal] = 255; if(HouseInfo[i][hHel] == 1) { new Float:tempheal; GetPlayerHealth(playerid,tempheal); if(tempheal < 100.0) { SetPlayerHealth(playerid,100.0); } } } }
if(house !=255) { if(SpawnChange[playerid]) //If 1, then you get to your house, else spawn somewhere else { if(HouseInfo[house][hLevel] <= 2) { 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 { 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]; SetPlayerVirtualWorld(playerid, 7); return 1; } } }