CMD:enter(playerid, params[])
{
if(GetPVarInt(playerid, "IsInArena") >= 0) {
SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in a arena!");
return 1;
}
for(new i = 0; i < sizeof( BizzInfo ); i++)
{
if(IsPlayerInRangeOfPoint( playerid, 3, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(GetPlayerVirtualWorld( playerid ) == 0)
{
if(BizzInfo[i][bSegel] == 0)
{
if(BizzInfo[i][bLocked] == 0)
{
new vww = i + 10000;
TogglePlayerControllable(playerid, 1);
SetPlayerInterior( playerid, BizzInfo[i][bInteriorID]);
SetPlayerPos( playerid, BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]);
PlayerInfo[playerid][pInBizz] = i;
SetPlayerVirtualWorld( playerid, vww);
PlayerInfo[playerid][pVW] = vww; PlayerInfo[playerid][pInt] = BizzInfo[i][bInteriorID];
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Membuat Database Objek...", 4000, 5);
SetPVarInt(playerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
}
else
{
GameTextForPlayer(playerid, "~w~Biz ~r~Terkunci!", 1000, 5);
}
}
else return GameTextForPlayer(playerid, "~w~Biz ini ~r~Disegel", 1000, 5);
}
}
}
for(new i = 0; i < sizeof(HouseInfo); i++) {
if (IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ])) {
if(PlayerInfo[playerid][pPhousekey] == i || PlayerInfo[playerid][pPhousekey2] == i || HouseInfo[i][hLock] == 0 || PlayerInfo[playerid][pRenting] == i) {
SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
PlayerInfo[playerid][pLocal] = i+6000;
PlayerInfo[playerid][pVW] = i+6000;
SetPlayerVirtualWorld(playerid, i+6000);
if(HouseInfo[i][hCustomInterior] == 1) {
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Membuat Database Objek...", 4000, 5);
SetPVarInt(playerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
}
SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
SetPlayerFacingAngle(playerid,HouseInfo[i][hInteriorA]);
SetCameraBehindPlayer(playerid);
GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
Streamer_UpdateEx(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
}
else {
GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
}
return 1;
}
}
for(new i = 0; i < sizeof(DDoorsInfo); i++) {
if (IsPlayerInRangeOfPoint(playerid,3.0,DDoorsInfo[i][ddExteriorX], DDoorsInfo[i][ddExteriorY], DDoorsInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddExteriorVW]) {
if(DDoorsInfo[i][ddVIP] > 0 && PlayerInfo[playerid][pDonateRank] < DDoorsInfo[i][ddVIP]) {
SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, you are not a high enough VIP level.");
return 1;
}
if(DDoorsInfo[i][ddFamily] > 0) {
if(PlayerInfo[playerid][pFMember] != DDoorsInfo[i][ddFamily]-1) {
SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door is family restricted.");
return 1;
}
}
if(DDoorsInfo[i][ddFaction] > 0) {
if(DDoorsInfo[i][ddFaction] >= 32) {
if(!IsACop(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door is restricted to law enforcement officers.");
}
else if(DDoorsInfo[i][ddFaction] < 32 && PlayerInfo[playerid][pMember] != DDoorsInfo[i][ddFaction]) {
SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door is faction restricted.");
return 1;
}
}
if(DDoorsInfo[i][ddAdmin] > 0 && PlayerInfo[playerid][pAdmin] < DDoorsInfo[i][ddAdmin]) {
SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, you are not a high enough admin level.");
return 1;
}
if(DDoorsInfo[i][ddWanted] > 0 && PlayerInfo[playerid][pWantedLevel] != 0) {
SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door restricts those with wanted levels.");
return 1;
}
if(DDoorsInfo[i][dLocked] == 1) {
return SendClientMessageEx(playerid, COLOR_GRAD2, "This door is currently locked.");
}
SetPlayerInterior(playerid,DDoorsInfo[i][ddInteriorInt]);
PlayerInfo[playerid][pInt] = DDoorsInfo[i][ddInteriorInt];
PlayerInfo[playerid][pLocal] = DDoorsInfo[i][ddInteriorVW];
PlayerInfo[playerid][pVW] = DDoorsInfo[i][ddInteriorVW];
SetPlayerVirtualWorld(playerid, DDoorsInfo[i][ddInteriorVW]);
if(DDoorsInfo[i][ddCustomInterior]) {
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Membuat Database Objek...", 4000, 5);
SetPVarInt(playerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
}
if(DDoorsInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorA]);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), DDoorsInfo[i][ddInteriorVW]);
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , DDoorsInfo[i][ddInteriorInt]);
}
else
{
SetPlayerPos(playerid,DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
SetPlayerFacingAngle(playerid,DDoorsInfo[i][ddInteriorA]);
SetCameraBehindPlayer(playerid);
}
return Streamer_UpdateEx(playerid, DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
}
}
for(new i = 0; i < sizeof(FamilyInfo); i++) {
if (IsPlayerInRangeOfPoint(playerid,3.0,FamilyInfo[i][FamilyEntrance][0], FamilyInfo[i][FamilyEntrance][1], FamilyInfo[i][FamilyEntrance][2])) {
SetPlayerInterior(playerid,FamilyInfo[i][FamilyInterior]);
PlayerInfo[playerid][pInt] = FamilyInfo[i][FamilyInterior];
PlayerInfo[playerid][pLocal] = FamilyInfo[i][FamilyVirtualWorld];
PlayerInfo[playerid][pVW] = FamilyInfo[i][FamilyVirtualWorld];
SetPlayerVirtualWorld(playerid, FamilyInfo[i][FamilyVirtualWorld]);
if(FamilyInfo[i][FamilyCustomMap]) {
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Membuat Database Objek...", 4000, 5);
SetPVarInt(playerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
}
Streamer_UpdateEx(playerid, FamilyInfo[i][FamilyExit][0],FamilyInfo[i][FamilyExit][1],FamilyInfo[i][FamilyExit][2]);
SetPlayerPos(playerid,FamilyInfo[i][FamilyExit][0],FamilyInfo[i][FamilyExit][1],FamilyInfo[i][FamilyExit][2]);
SetPlayerFacingAngle(playerid,FamilyInfo[i][FamilyExit][3]);
return 1;
}
}
for(new i = 0; i < sizeof(HouseInfo); i++) {
if (IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ])) {
if(PlayerInfo[playerid][pPhousekey] == i || PlayerInfo[playerid][pPhousekey2] == i || HouseInfo[i][hLock] == 0 || PlayerInfo[playerid][pRenting] == i) {
SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
PlayerInfo[playerid][pLocal] = i+6000;
PlayerInfo[playerid][pVW] = i+6000;
SetPlayerVirtualWorld(playerid, i+6000);
if(HouseInfo[i][hCustomInterior] == 1) {
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Membuat Database Objek...", 4000, 5);
SetPVarInt(playerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
}
SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
SetPlayerFacingAngle(playerid,HouseInfo[i][hInteriorA]);
SetCameraBehindPlayer(playerid);
GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
Streamer_UpdateEx(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
}
else {
GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
}
return 1;
}
}
return 1;
}