Advertisement
Guest User

/enter/exit

a guest
Apr 14th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 8.19 KB | None | 0 0
  1. if(strcmp(cmd, "/enter", true) == 0)
  2.     {
  3.         if(IsPlayerConnected(playerid))
  4.         {
  5.             for(new i = 0; i < sizeof(HouseInfo); i++)
  6.             {
  7.                 if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
  8.                 {
  9.                     //printf("Found House :%d",i);
  10.                     if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
  11.                     {
  12.                         SetPlayerInterior(playerid,HouseInfo[i][hInt]);
  13.                         SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
  14.                         GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
  15.                         PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
  16.                         PlayerInfo[playerid][pLocal] = i;
  17.                     }
  18.                     else
  19.                     {
  20.                         GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
  21.                     }
  22.                 }
  23.             }
  24.             for(new i = 0; i < sizeof(BizzInfo); i++)
  25.             {
  26.                 if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
  27.                 {
  28.                     //printf("Found House :%d",i);
  29.                     if(!IsACop(playerid) && i == 3)
  30.                     {
  31.                         SendClientMessage(playerid, COLOR_GREY, "   Cops only !");
  32.                         return 1;
  33.                     }
  34.                     if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
  35.                     {
  36.                         if(PlayerInfo[playerid][pPbiskey] != i)
  37.                         {
  38.                             if(BizzInfo[i][bLocked] == 1)
  39.                             {
  40.                                 GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
  41.                                 return 1;
  42.                             }
  43.                             if(BizzInfo[i][bProducts] == 0)
  44.                             {
  45.                                 GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
  46.                                 return 1;
  47.                             }
  48.                             GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
  49.                             format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
  50.                             BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
  51.                             ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
  52.                             BizzInfo[i][bProducts]--;
  53.                             OnPropUpdate();
  54.                             GameTextForPlayer(playerid, string, 5000, 3);
  55.                         }
  56.                         SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
  57.                         SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
  58.                         PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
  59.                         PlayerInfo[playerid][pLocal] = i+99;
  60.                         new dood[MAX_PLAYER_NAME];
  61.                         GetPlayerName(playerid, dood, sizeof(dood));
  62.                         format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i);
  63.                         printf("%s", string);
  64.                         PayLog(string);
  65.                         //PlayerInfo[playerid][pLocal] = i;
  66.                     }
  67.                     else
  68.                     {
  69.                         GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
  70.                     }
  71.                 }
  72.             }
  73.             for(new i = 0; i < sizeof(SBizzInfo); i++)
  74.             {
  75.                 if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
  76.                 {
  77.                     if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
  78.                     {
  79.                         if(PlayerInfo[playerid][pPbiskey] != i)
  80.                         {
  81.                             if(SBizzInfo[i][sbLocked] == 1)
  82.                             {
  83.                                 GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
  84.                                 return 1;
  85.                             }
  86.                             if(SBizzInfo[i][sbProducts] == 0)
  87.                             {
  88.                                 GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
  89.                                 return 1;
  90.                             }
  91.                             if(i == 10)
  92.                             {
  93.                                 PaintballPlayers ++;
  94.                                 PlayerPaintballing[playerid] = 1;
  95.                                 new rand = random(sizeof(PaintballSpawns));
  96.                                 SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
  97.                                 TogglePlayerControllable(playerid, 0);
  98.                             }
  99.                             else if(i == 11)
  100.                             {
  101.                                 PlayerKarting[playerid] = 1;
  102.                                 SendClientMessage(playerid, TEAM_GROVE_COLOR, "You can now parcipitate in a Karting Race, grab a Kart.");
  103.                             }
  104.                             else
  105.                             {
  106.                                 return 1;
  107.                             }
  108.                             GivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
  109.                             gSpentCash[playerid] = GetPlayerMoney(playerid);
  110.                             SBizzInfo[i][sbProducts]--;
  111.                             SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
  112.                             ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]);
  113.                             new dood[MAX_PLAYER_NAME];
  114.                             GetPlayerName(playerid, dood, sizeof(dood));
  115.                             format(string, sizeof(string), "%s payed $%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i);
  116.                             printf("%s", string);
  117.                             PayLog(string);
  118.                             OnPropUpdate();
  119.                         }
  120.                     }
  121.                     else
  122.                     {
  123.                         GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
  124.                     }
  125.                 }
  126.             }
  127.             if (PlayerToPoint(3.0, playerid,-2162.2554,-2385.9541,30.6250))
  128.             {
  129.                 SetPlayerInterior(playerid,3);
  130.                 SetPlayerPos(playerid,387.7978,173.8582,1008.3828);
  131.                 GameTextForPlayer(playerid, "~w~Welcome to the City Hall", 5000, 1);
  132.                 PlayerInfo[playerid][pInt] = 3;
  133.                 PlayerInfo[playerid][pLocal] = 241;
  134.             }
  135.             else if (PlayerToPoint(3.0, playerid,1073.0619,-344.5148,73.9922))
  136.             {
  137.                 if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
  138.                 {
  139.                     SetPlayerInterior(playerid,2);
  140.                     SetPlayerPos(playerid,1205.0947,-10.1685,1000.9219);
  141.                     PlayerInfo[playerid][pInt] = 2;
  142.                     PlayerInfo[playerid][pLocal] = 242;
  143.                 }
  144.             }
  145.             else if (PlayerToPoint(3.0, playerid,2695.6235,-1704.6960,11.8438))
  146.             {
  147.                 GameTextForPlayer(playerid, "~w~Welcome to the 8ball Track", 5000, 1);
  148.                 SetPlayerInterior(playerid,7);
  149.                 SetPlayerPos(playerid,-1404.5299,-259.0602,1043.6563);
  150.             }
  151.             else if (PlayerToPoint(8.0, playerid,-2111.5686,-443.9720,38.7344))
  152.             {
  153.                 GameTextForPlayer(playerid, "~w~Welcome to the Dirt Track", 5000, 1);
  154.                 SetPlayerInterior(playerid,4);
  155.                 SetPlayerPos(playerid,-1443.0554,-581.1879,1055.0472);
  156.             }
  157.             else if (PlayerToPoint(8.0, playerid,-2080.3079,-406.0309,38.7344))
  158.             {
  159.                 GameTextForPlayer(playerid, "~w~Welcome to the Stunting Track", 5000, 1);
  160.                 SetPlayerInterior(playerid,14);
  161.                 SetPlayerPos(playerid,-1464.7732,1557.5533,1052.5313);
  162.             }
  163.         }
  164.         return 1;
  165.     }
  166.     if(strcmp(cmd, "/exit", true) == 0)
  167.     {
  168.         if(IsPlayerConnected(playerid))
  169.         {
  170.             for(new i = 0; i <  sizeof(HouseInfo); i++)
  171.             {
  172.                 //printf("House :%d",i);
  173.                 if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
  174.                 {
  175.                     SetPlayerInterior(playerid,0);
  176.                     SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
  177.                     PlayerInfo[playerid][pInt] = 0;
  178.                     PlayerInfo[playerid][pLocal] = 255;
  179.                     if(HouseInfo[i][hHel] == 1)
  180.                     {
  181.                         new Float:tempheal;
  182.                         GetPlayerHealth(playerid,tempheal);
  183.                         if(tempheal < 100.0)
  184.                         {
  185.                             SetPlayerHealth(playerid,100.0);
  186.                         }
  187.                     }
  188.                 }
  189.             }
  190.             for(new i = 0; i <  sizeof(BizzInfo); i++)
  191.             {
  192.                 //printf("Bizz :%d",i);
  193.                 if (PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
  194.                 {
  195.                     SetPlayerInterior(playerid,0);
  196.                     PlayerInfo[playerid][pInt] = 0;
  197.                     SetPlayerPos(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
  198.                     PlayerInfo[playerid][pLocal] = 255;
  199.                 }
  200.             }
  201.             if(GetPlayerVehicleID(playerid) >= 71 && GetPlayerVehicleID(playerid) <= 77)
  202.             {
  203.                 TogglePlayerControllable(playerid, 1);
  204.                 RemovePlayerFromVehicle(playerid);
  205.             }
  206.             else if (PlayerToPoint(3.0, playerid,387.7978,173.8582,1008.3828))
  207.             {
  208.                 SetPlayerInterior(playerid,0);
  209.                 SetPlayerPos(playerid,-2162.2554,-2385.9541,30.6250);
  210.                 PlayerInfo[playerid][pInt] = 0;
  211.                 PlayerInfo[playerid][pLocal] = 255;
  212.             }
  213.             else if (PlayerToPoint(6.0, playerid,-1404.5299,-259.0602,1043.6563))
  214.             {
  215.                 SetPlayerInterior(playerid,0);
  216.                 SetPlayerPos(playerid,2695.6235,-1704.6960,11.8438);
  217.             }
  218.             else if (PlayerToPoint(8.0, playerid,-1443.0554,-581.1879,1055.0472))
  219.             {
  220.                 SetPlayerInterior(playerid,0);
  221.                 SetPlayerPos(playerid,-2111.5686,-443.9720,38.7344);
  222.             }
  223.             else if (PlayerToPoint(8.0, playerid,-1464.7732,1557.5533,1052.5313))
  224.             {
  225.                 SetPlayerInterior(playerid,0);
  226.                 SetPlayerPos(playerid,-2080.3079,-406.0309,38.7344);
  227.             }
  228.             else if(NoFuel[playerid] == 1)
  229.             {
  230.                 TogglePlayerControllable(playerid, 1);
  231.                 RemovePlayerFromVehicle(playerid);
  232.                 NoFuel[playerid] = 0;
  233.             }
  234.         }
  235.         return 1;
  236.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement