Naokimaza

my problem enter

Jan 22nd, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1. CMD:enter(playerid, params[])
  2. {
  3. new string[128];
  4. for(new i = 0; i < sizeof(DoorInfo); i++)
  5. for(new b = 1; b < sizeof(BusinessInfo); b++)//Loops through all the businesses.
  6. {
  7. if(IsPlayerInRangeOfPoint(playerid, 3.0, 389.6382, 173.8151, 1008.2424))
  8. {
  9. SetPlayerPos(playerid, 1481.1545, -1771.3710, 18.9013);
  10. }
  11. if(IsPlayerInRangeOfPoint(playerid, 3.0, 1481.1545, -1771.3710, 18.9013))
  12. {
  13. SetPlayerPos(playerid, 389.6382, 173.8151, 1008.2424);
  14. }
  15. if(IsPlayerInRangeOfPoint(playerid, 3.0, -2029.7515, -118.6284, 1035.4371))
  16. {
  17. SetPlayerPos(playerid, 2045.6399, -1913.1650, 13.7576);
  18. }
  19. if(IsPlayerInRangeOfPoint(playerid, 3.0, 2045.6399, -1913.1650, 13.7576))
  20. {
  21. SetPlayerPos(playerid, -2029.7515, -118.6284, 1035.4371);
  22. }
  23. if(IsPlayerInRangeOfPoint(playerid, 2.0, 1172.3539, -1323.5497, 15.1271))
  24. {
  25. SetPlayerPos(playerid, 1170.0100, -1355.9119, 2423.1870);
  26. }
  27. if(IsPlayerInRangeOfPoint(playerid, 2.0, 1170.0100, -1355.9119, 2423.1870))
  28. {
  29. SetPlayerPos(playerid, 1172.3539, -1323.5497, 15.1271);
  30. }
  31. if(IsPlayerInRangeOfPoint(playerid, 2.0, BusinessInfo[b][bEntranceX], BusinessInfo[b][bEntranceY], BusinessInfo[b][bEntranceZ]))//Checks if player is near the entrance.
  32. {
  33. if(BusinessInfo[b][bLocked] == 1) return SendClientMessage(playerid, COLOR_GREY, "This Business is locked!");//Checks it it is locked/
  34. SetPlayerPos(playerid, BusinessInfo[b][bExitX], BusinessInfo[b][bExitY], BusinessInfo[b][bExitZ]);
  35. SetPlayerFacingAngle(playerid, BusinessInfo[b][bExitA]);
  36. SetPlayerInterior(playerid, BusinessInfo[b][bInsideInt]);
  37. SetPlayerVirtualWorld(playerid, BusinessInfo[b][bInsideWorld]);
  38. InsideBiz[playerid] = b;
  39. return 1;
  40. }
  41. if(IsPlayerInRangeOfPoint(playerid, 2.0, BusinessInfo[b][bExitX], BusinessInfo[b][bExitY], BusinessInfo[b][bExitZ]) && GetPlayerVirtualWorld(playerid) == BusinessInfo[b][bInsideWorld])//Checks if player is in near the exit.
  42. {
  43. SetPlayerPos(playerid, BusinessInfo[b][bEntranceX], BusinessInfo[b][bEntranceY], BusinessInfo[b][bEntranceZ]);
  44. SetPlayerFacingAngle(playerid, BusinessInfo[b][bEntranceA]);
  45. SetPlayerInterior(playerid, BusinessInfo[b][bInt]);
  46. SetPlayerVirtualWorld(playerid, BusinessInfo[b][bWorld]);
  47. InsideBiz[playerid] = 0;
  48. return 1;
  49. }
  50. if(IsPlayerInRangeOfPoint(playerid,3.0,DoorInfo[i][ddExteriorX], DoorInfo[i][ddExteriorY], DoorInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DoorInfo[i][ddExteriorVW])
  51. {
  52. format(string, sizeof(string), "* %s entered %s.", GetPlayerNameEx(playerid), DoorInfo[i][ddName]);
  53. ProxDetector(25.0, playerid, string, COLOR_PURPLE);
  54. SetPlayerInterior(playerid,DoorInfo[i][ddInteriorInt]);
  55. PlayerInfo[playerid][pInt] = DoorInfo[i][ddInteriorInt];
  56. PlayerInfo[playerid][pVW] = DoorInfo[i][ddInteriorVW];
  57. SetPlayerVirtualWorld(playerid, DoorInfo[i][ddInteriorVW]);
  58. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER){
  59. SetPlayerPos(playerid,DoorInfo[i][ddInteriorX],DoorInfo[i][ddInteriorY],DoorInfo[i][ddInteriorZ]);
  60. }
  61. SetPlayerFacingAngle(playerid, DoorInfo[i][ddInteriorA]);
  62. SetCameraBehindPlayer(playerid);
  63. if(DoorInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  64. {
  65. new car;
  66. car = GetPlayerVehicleID(playerid);
  67. SetVehiclePos(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorX],DoorInfo[i][ddInteriorY],DoorInfo[i][ddInteriorZ]);
  68. SetVehicleZAngle(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorA]);
  69. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorVW]);
  70. PutPlayerInVehicle(playerid, car, 0);
  71. LinkVehicleToInterior(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorInt]);
  72. return 1;
  73. }
  74. }
  75. if(IsPlayerInRangeOfPoint(playerid,3,DoorInfo[i][ddInteriorX], DoorInfo[i][ddInteriorY], DoorInfo[i][ddInteriorZ]) && PlayerInfo[playerid][pVW] == DoorInfo[i][ddInteriorVW])
  76. {
  77. if(DoorInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  78. {
  79. new car;
  80. car = GetPlayerVehicleID(playerid);
  81. SetVehiclePos(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorX],DoorInfo[i][ddExteriorY],DoorInfo[i][ddExteriorZ]);
  82. SetVehicleZAngle(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorA]);
  83. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorVW]);
  84. PutPlayerInVehicle(playerid, car, 0);
  85. LinkVehicleToInterior(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorInt]);
  86. }
  87. format(string, sizeof(string), "* %s exited %s.", GetPlayerNameEx(playerid), DoorInfo[i][ddName]);
  88. ProxDetector(25.0, playerid, string, COLOR_PURPLE);
  89. SetPlayerInterior(playerid,DoorInfo[i][ddExteriorInt]);
  90. PlayerInfo[playerid][pInt] = DoorInfo[i][ddExteriorInt];
  91. SetPlayerVirtualWorld(playerid, DoorInfo[i][ddExteriorVW]);
  92. PlayerInfo[playerid][pVW] = DoorInfo[i][ddExteriorVW];
  93. if(DoorInfo[i][ddCustomExterior])
  94. {
  95. LoadObjectsForPlayer(playerid);
  96. }
  97. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER){
  98. SetPlayerPos(playerid,DoorInfo[i][ddExteriorX],DoorInfo[i][ddExteriorY],DoorInfo[i][ddExteriorZ]);
  99. SetPlayerFacingAngle(playerid, DoorInfo[i][ddExteriorA]);
  100. SetCameraBehindPlayer(playerid);
  101. }
  102. }
  103. }
  104. return 1;
  105. }
  106.  
  107. CMD:exit(playerid, params[]) return cmd_enter(playerid, params);
Advertisement
Add Comment
Please, Sign In to add comment