Creating entrances to buildings zcmd
#1

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;
}
Reply
#2

Here is how you find where the coordinates go...They go with "IsPlayerInRangeOfPoint"
Код:
if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
{
The coordinates are probably being loaded via a scriptfile


Usually they go


if(IsPlayerInRangeOfPoint(playerid, 2, 0.00, 0.00, 0.00))

X, Y, Z

You can easily find them now...Just look
Reply
#3

Okay so I found them in a scriptfile what should I use to edit the it? Its a .cfg file
can I just put my coordinates in?




1247|1555.235229|-1675.652343|16.195312|246.802215|62.723056|1003.64 0625|0|0|6|0|0|0|357.348266|Police Department - /enter to go inside|90.095787
1318|1462.409545|-1011.160156|26.843750|2228.763427|1668.019165|961. 753112|0|0|0|0|1|0|199.426513|Bank - /enter to go inside|179.709915
1318|1568.619873|-1690.286743|5.890625|246.388671|87.625534|1003.640 625|0|0|6|0|0|0|179.228729|Police Department - /enter to go inside|180.142669
1318|2045.611938|-1908.055175|13.546875|1494.521118|1303.977783|1093 .289062|0|0|3|0|0|0|357.348419|DMV - /enter to go inside|268.987609
1314|267.241424|80.097160|1001.039062|2459.677246|-1258.213867|1067.420288|6|0|1|0|1|0|267.879211|Pri son - /enter to go inside|1.108358
1318|1481.084106|-1771.856323|18.795755|389.894622|173.829742|1008.3 82812|0|0|3|0|0|0|88.650794|City Hall - /enter to go inside|358.264953
1212|370.322540|162.368316|1019.984375|368.524566| 162.351776|1019.984375|3|0|3|27934|0|0|90.432548|T ax Vault - /enter to go inside|269.324249
1318|2166.137207|-1671.506958|15.073657|318.589019|1114.814331|1083. 882812|0|0|5|0|0|0|2.071882|Drugs House - /enter to go inside|224.830596
1318|2351.986328|-1170.177124|28.050933|2352.600341|-1180.878540|1027.976562|0|0|5|0|0|0|90.577537|Crac k Lab - /enter to go inside|1.300104
1318|1564.787231|-1666.779052|28.395605|242.435791|66.315818|1003.64 0625|0|0|6|0|0|0|268.215759|Police Department - /enter to go inside|354.023254
1318|2229.716308|-1721.451293|13.563076|772.349060|-5.197093|1000.728759|0|0|5|1|0|0|1.688295|Gym - /enter to go inside|134.180435
1318|1570.653930|-1337.241455|16.484375|1548.597290|-1364.126464|326.218292|0|0|0|0|0|0|180.000000|Star Tower - /enter to be inside|312.211914
1276|1310.099121|-1367.254638|13.525835|290.077362|-178.549026|999.605957|0|0|2|0|1|0|87.756370|VIP Lounge - /enter to go inside|179.947647
0|0.000000|0.000000|0.000000|0.000000|0.000000|0.0 00000|0|0|0|0|0|0|0.000000||0.000000
0|0.000000|0.000000|0.000000|0.000000|0.000000|0.0 00000|0|0|0|0|0|0|0.000000||0.000000
0|0.000000|0.000000|0.000000|0.000000|0.000000|0.0 00000|0|0|0|0|0|0|0.000000||0.000000
0|0.000000|0.000000|0.000000|0.000000|0.000000|0.0 00000|0|0|0|0|0|0|0.000000||0.000000
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)