15.10.2012, 01:49
So I am trying to figure out how to make a entrance to a house or anything for that matter, and this is the code im working with as a example, the rest of the biz's are else ifs, I dont see any coordinates for the entrance? Just when your inside the interior, I am confused on how to make one given these examples.
CMD:enter(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
for(new idx=0; idx<MAX_DOORS; idx++) // Dynamic Doors
{
if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
{
if(DoorInfo[idx][dIInt] == 83 && DoorInfo[idx][dIVW] == 8473 && BankBlock)
{
SendClientMessage(playerid, COLOR_GREY, "You can't enter the bank as it is being robbed at the moment.");
return 1;
}
if(DoorInfo[idx][dCInt])
{
GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 3);
TogglePlayerControllable(playerid, 0);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
PlayerInfo[playerid][pSpawnFreeze] = 1;
}
PlayerInfo[playerid][pSpawnFreeze] = 0;
SetPlayerInterior(playerid, DoorInfo[idx][dIInt]);
SetPlayerVirtualWorld(playerid, DoorInfo[idx][dIVW]);
SetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
return 1;
}
}
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
{
if(!BizInfo[idx][bStatus] && PlayerInfo[playerid][pBiz] != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "This business is closed.");
if(BizInfo[idx][bType] == 1) // 24/7 Business
{
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerPos(playerid, -27.3025,-57.6649,1003.5469);
SetPlayerFacingAngle(playerid, 357.5915);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 6);
SetPlayerVirtualWorld(playerid, idx+100);
format(string, sizeof(string), "** Welcome to %s's 24/7 Market (( /list & /buy )) **", BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
else if(BizInfo[idx][bType] == 2) // Clothes Shop Business
{
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerPos(playerid, 207.0638,-139.9965,1003.507;
SetPlayerFacingAngle(playerid, 356.3849);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, idx+100);
format(string, sizeof(string), "** Welcome to %s's Clothes Shop (( /buyclothes & /buytoys )) **", BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
else if(BizInfo[idx][bType] == 3) // Ammunation Business
{
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerPos(playerid, 285.8044,-85.9956,1001.5229);
SetPlayerFacingAngle(playerid, 358.989;
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 4);
SetPlayerVirtualWorld(playerid, idx+100);
format(string, sizeof(string), "** Welcome to %s's Ammunation (( /list & /buy )) **", BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
CMD:enter(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
for(new idx=0; idx<MAX_DOORS; idx++) // Dynamic Doors
{
if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
{
if(DoorInfo[idx][dIInt] == 83 && DoorInfo[idx][dIVW] == 8473 && BankBlock)
{
SendClientMessage(playerid, COLOR_GREY, "You can't enter the bank as it is being robbed at the moment.");
return 1;
}
if(DoorInfo[idx][dCInt])
{
GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 3);
TogglePlayerControllable(playerid, 0);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
PlayerInfo[playerid][pSpawnFreeze] = 1;
}
PlayerInfo[playerid][pSpawnFreeze] = 0;
SetPlayerInterior(playerid, DoorInfo[idx][dIInt]);
SetPlayerVirtualWorld(playerid, DoorInfo[idx][dIVW]);
SetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
return 1;
}
}
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
{
if(!BizInfo[idx][bStatus] && PlayerInfo[playerid][pBiz] != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "This business is closed.");
if(BizInfo[idx][bType] == 1) // 24/7 Business
{
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerPos(playerid, -27.3025,-57.6649,1003.5469);
SetPlayerFacingAngle(playerid, 357.5915);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 6);
SetPlayerVirtualWorld(playerid, idx+100);
format(string, sizeof(string), "** Welcome to %s's 24/7 Market (( /list & /buy )) **", BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
else if(BizInfo[idx][bType] == 2) // Clothes Shop Business
{
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerPos(playerid, 207.0638,-139.9965,1003.507;
SetPlayerFacingAngle(playerid, 356.3849);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, idx+100);
format(string, sizeof(string), "** Welcome to %s's Clothes Shop (( /buyclothes & /buytoys )) **", BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
else if(BizInfo[idx][bType] == 3) // Ammunation Business
{
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerPos(playerid, 285.8044,-85.9956,1001.5229);
SetPlayerFacingAngle(playerid, 358.989;
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 4);
SetPlayerVirtualWorld(playerid, idx+100);
format(string, sizeof(string), "** Welcome to %s's Ammunation (( /list & /buy )) **", BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}