Advertisement
Guest User

Untitled

a guest
Dec 11th, 2009
1,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 12.88 KB | None | 0 0
  1.     if(strcmp(cmd, "/enter", true) == 0)
  2.     {
  3.         if(IsPlayerConnected(playerid))
  4.         {
  5.             for(new i = 0; i < sizeof(BizzInfo); i++)
  6.             {
  7.                 if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
  8.                 {
  9.                     if(!IsACop(playerid) && i == 3)
  10.                     {
  11.                         SendClientMessage(playerid, COLOR_GREY, "   Cops only !");
  12.                         return 1;
  13.                     }
  14.                     if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
  15.                     {
  16.                         if(PlayerInfo[playerid][pPbiskey] != i)
  17.                         {
  18.                             if(BizzInfo[i][bLocked] == 1)
  19.                             {
  20.                                 GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
  21.                                 return 1;
  22.                             }
  23.                             if(BizzInfo[i][bProducts] == 0)
  24.                             {
  25.                                 GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
  26.                                 return 1;
  27.                             }
  28.                             GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
  29.                             format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
  30.                             BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
  31.                             ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
  32.                             BizzInfo[i][bProducts]--;
  33.                             OnPropUpdate();
  34.                             GameTextForPlayer(playerid, string, 5000, 3);
  35.                         }
  36.                         SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
  37.                         SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
  38.                         PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
  39.                         PlayerInfo[playerid][pLocal] = i+99;
  40.                         new dood[MAX_PLAYER_NAME];
  41.                         GetPlayerName(playerid, dood, sizeof(dood));
  42.                         format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i);
  43.                         printf("%s", string);
  44.                         PayLog(string);
  45.                     }
  46.                     else
  47.                     {
  48.                         GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
  49.                     }
  50.                 }
  51.             }
  52.             for(new i = 0; i < sizeof(SBizzInfo); i++)
  53.             {
  54.                 if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
  55.                 {
  56.                     if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
  57.                     {
  58.                         if(PlayerInfo[playerid][pPbiskey] != i)
  59.                         {
  60.                             if(SBizzInfo[i][sbLocked] == 1)
  61.                             {
  62.                                 GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
  63.                                 return 1;
  64.                             }
  65.                             if(SBizzInfo[i][sbProducts] == 0)
  66.                             {
  67.                                 GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
  68.                                 return 1;
  69.                             }
  70.                             if(i == 10)
  71.                             {
  72.                                 PaintballPlayers ++;
  73.                                 PlayerPaintballing[playerid] = 1;
  74.                                 new rand = random(sizeof(PaintballSpawns));
  75.                                 SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
  76.                                 TogglePlayerControllable(playerid, 0);
  77.                             }
  78.                             else if(i == 11)
  79.                             {
  80.                                 PlayerKarting[playerid] = 1;
  81.                                 SendClientMessage(playerid, TEAM_GROVE_COLOR, "You can now parcipitate in a Karting Race, grab a Kart.");
  82.                             }
  83.                             else
  84.                             {
  85.                                 return 1;
  86.                             }
  87.                             GivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
  88.                             gSpentCash[playerid] = GetPlayerMoney(playerid);
  89.                             SBizzInfo[i][sbProducts]--;
  90.                             SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
  91.                             ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]);
  92.                             new dood[MAX_PLAYER_NAME];
  93.                             GetPlayerName(playerid, dood, sizeof(dood));
  94.                             format(string, sizeof(string), "%s payed $%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i);
  95.                             printf("%s", string);
  96.                             PayLog(string);
  97.                             OnPropUpdate();
  98.                         }
  99.                     }
  100.                     else
  101.                     {
  102.                         GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
  103.                     }
  104.                 }
  105.             }
  106.             if(InvitedToHouse[playerid] == 1)
  107.             {
  108.                 new houseowner = InvitedToHouseOwnerId[playerid];
  109.                 new Float:housex = PlayerInfo[houseowner][pHouseX];
  110.                 new Float:housey = PlayerInfo[houseowner][pHouseY];
  111.                 new Float:housez = PlayerInfo[houseowner][pHouseZ];
  112.                 new Float:houseintx = PlayerInfo[houseowner][pHouseIntX];
  113.                 new Float:houseinty = PlayerInfo[houseowner][pHouseIntY];
  114.                 new Float:houseintz = PlayerInfo[houseowner][pHouseIntZ];
  115.                 new housevw = PlayerInfo[houseowner][pHouseVW];
  116.                 new houseint = PlayerInfo[houseowner][pHouseInt];
  117.  
  118.                 new Float:px, Float:py, Float:pz;
  119.                 GetPlayerPos(playerid,px,py,pz);
  120.  
  121.                 new HouseOwnerstring[MAX_PLAYER_NAME];
  122.                 GetPlayerName(houseowner, HouseOwnerstring, sizeof(HouseOwnerstring));
  123.  
  124.                 if(PlayerToPoint(3.0,playerid,housex,housey,housez))
  125.                 {
  126.  
  127.                     GameTextForPlayer(playerid, "~r~Welcome!", 5000, 3);
  128.                     SetPlayerPos(playerid,houseintx,houseinty,houseintz);
  129.                     SetPlayerVirtualWorld(playerid,housevw);
  130.                     SetPlayerInterior(playerid,houseint);
  131.                 }
  132.                 return 1;
  133.             }
  134.             new Float:vx, Float:vy, Float:vz;
  135.             GetVehiclePos(65, vx,vy,vz);
  136.             if (PlayerToPoint(3.0, playerid,vx,vy,vz))
  137.             {
  138.                 GameTextForPlayer(playerid, "~y~A~p~L~g~O", 5000, 1);
  139.                 PutPlayerInVehicle(playerid,65,15);
  140.                 PlayerInfo[playerid][pLocal] = 7481;
  141.             }
  142.             else if (PlayerToPoint(3, playerid,1528.8412,-1678.1052,5.8906) || PlayerToPoint(3, playerid,612.7213,-590.4556,17.2330))
  143.             {
  144.                 GameTextForPlayer(playerid, "~y~/arrest", 5000, 5);
  145.             }
  146.             else if (PlayerToPoint(3.0, playerid,2695.6235,-1704.6960,11.8438))
  147.             {
  148.                 GameTextForPlayer(playerid, "~w~Welcome to the 8ball Track", 5000, 1);
  149.                 SetPlayerInterior(playerid,7);
  150.                 SetPlayerPos(playerid,-1404.5299,-259.0602,1043.6563);
  151.             }
  152.             else if (PlayerToPoint(8.0, playerid,-2111.5686,-443.9720,38.7344))
  153.             {
  154.                 GameTextForPlayer(playerid, "~w~Welcome to the Dirt Track", 5000, 1);
  155.                 SetPlayerInterior(playerid,4);
  156.                 SetPlayerPos(playerid,-1443.0554,-581.1879,1055.0472);
  157.             }
  158.             else if (PlayerToPoint(8.0, playerid,-2080.3079,-406.0309,38.7344))
  159.             {
  160.                 GameTextForPlayer(playerid, "~w~Welcome to the Stunting Track", 5000, 1);
  161.                 SetPlayerInterior(playerid,14);
  162.                 SetPlayerPos(playerid,-1464.7732,1557.5533,1052.5313);
  163.             }
  164.             if(PlayerInfo[playerid][pHouseX] != 0 && PlayerInfo[playerid][pHouseY] != 0 && PlayerInfo[playerid][pHouseZ] != 0)
  165.             {
  166.                 if(PlayerInfo[playerid][pEnterHouse] == 1)
  167.                 {
  168.                     new Float:housex = PlayerInfo[playerid][pHouseX];
  169.                     new Float:housey = PlayerInfo[playerid][pHouseY];
  170.                     new Float:housez = PlayerInfo[playerid][pHouseZ];
  171.                     new Float:houseintx = PlayerInfo[playerid][pHouseIntX];
  172.                     new Float:houseinty = PlayerInfo[playerid][pHouseIntY];
  173.                     new Float:houseintz = PlayerInfo[playerid][pHouseIntZ];
  174.                     new housevw = PlayerInfo[playerid][pHouseVW];
  175.                     new houseint = PlayerInfo[playerid][pHouseInt];
  176.  
  177.                     new Float:px, Float:py, Float:pz;
  178.                     GetPlayerPos(playerid,px,py,pz);
  179.  
  180.                     if(PlayerToPoint(3.0,playerid,housex,housey,housez))
  181.                     {
  182.                         SetPlayerPos(playerid,houseintx,houseinty,houseintz);
  183.                         SetPlayerVirtualWorld(playerid,housevw);
  184.                         SetPlayerInterior(playerid,houseint);
  185.                     }
  186.                 }
  187.             }
  188.         }
  189.         return 1;
  190.     }
  191.     if(strcmp(cmd, "/exit", true) == 0)
  192.     {
  193.         if(IsPlayerConnected(playerid))
  194.         {
  195.             for(new i = 0; i <  sizeof(BizzInfo); i++)
  196.             {
  197.                 if (PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]) && GetPlayerVirtualWorld(playerid) == 0)
  198.                 {
  199.                     SetPlayerInterior(playerid,0);
  200.                     PlayerInfo[playerid][pInt] = 0;
  201.                     SetPlayerPos(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
  202.                     PlayerInfo[playerid][pLocal] = 255;
  203.                 }
  204.             }
  205.             if(InvitedToHouse[playerid] == 1)
  206.             {
  207.                 new houseowner = InvitedToHouseOwnerId[playerid];
  208.                 new Float:housex = PlayerInfo[houseowner][pHouseX];
  209.                 new Float:housey = PlayerInfo[houseowner][pHouseY];
  210.                 new Float:housez = PlayerInfo[houseowner][pHouseZ];
  211.                 new Float:houseintx = PlayerInfo[houseowner][pHouseIntX];
  212.                 new Float:houseinty = PlayerInfo[houseowner][pHouseIntY];
  213.                 new Float:houseintz = PlayerInfo[houseowner][pHouseIntZ];
  214.                 new housevw = PlayerInfo[houseowner][pHouseVW];
  215.  
  216.                 new Float:px, Float:py, Float:pz;
  217.                 GetPlayerPos(playerid,px,py,pz);
  218.  
  219.                 new HouseOwnerstring[MAX_PLAYER_NAME];
  220.                 GetPlayerName(houseowner, HouseOwnerstring, sizeof(HouseOwnerstring));
  221.                
  222.                 new currentworld = GetPlayerVirtualWorld(playerid);
  223.  
  224.                 if(PlayerToPoint(3.0,playerid,houseintx,houseinty,houseintz) && currentworld == housevw)
  225.                 {
  226.                     SetPlayerPos(playerid,housex,housey,housez+0.5);
  227.                     SetPlayerVirtualWorld(playerid,0);
  228.                     SetPlayerInterior(playerid,0);
  229.                     InvitedToHouse[playerid] = 0;
  230.                 }
  231.                 return 1;
  232.             }
  233.             if(HouseBreakin[playerid] == 1)
  234.             {
  235.                 new houseowner = HouseBreakinOwnerId[playerid];
  236.                 new Float:housex = PlayerInfo[houseowner][pHouseX];
  237.                 new Float:housey = PlayerInfo[houseowner][pHouseY];
  238.                 new Float:housez = PlayerInfo[houseowner][pHouseZ];
  239.                 new Float:houseintx = PlayerInfo[houseowner][pHouseIntX];
  240.                 new Float:houseinty = PlayerInfo[houseowner][pHouseIntY];
  241.                 new Float:houseintz = PlayerInfo[houseowner][pHouseIntZ];
  242.                 new housevw = PlayerInfo[houseowner][pHouseVW];
  243.  
  244.                 new Float:px, Float:py, Float:pz;
  245.                 GetPlayerPos(playerid,px,py,pz);
  246.  
  247.                 new HouseOwnerstring[MAX_PLAYER_NAME];
  248.                 GetPlayerName(houseowner, HouseOwnerstring, sizeof(HouseOwnerstring));
  249.  
  250.                 new currentworld = GetPlayerVirtualWorld(playerid);
  251.  
  252.                 if(PlayerToPoint(3.0,playerid,houseintx,houseinty,houseintz) && currentworld == housevw)
  253.                 {
  254.                     SetPlayerPos(playerid,housex,housey,housez+0.5);
  255.                     SetPlayerVirtualWorld(playerid,0);
  256.                     SetPlayerInterior(playerid,0);
  257.                     HouseBreakin[playerid] = 0;
  258.                     HouseBreakinOwnerId[playerid] = 999;
  259.                 }
  260.                 return 1;
  261.             }
  262.             new Float:vx, Float:vy, Float:vz;
  263.             GetVehiclePos(65, vx,vy,vz);
  264.             if(GetPlayerVehicleID(playerid) == 65)
  265.             {
  266.                 SetPlayerPos(playerid,vx,vy+5,vz);
  267.                 PlayerInfo[playerid][pLocal] = 255;
  268.             }
  269.             if(GetPlayerVehicleID(playerid) >= 71 && GetPlayerVehicleID(playerid) <= 77)
  270.             {
  271.                 TogglePlayerControllable(playerid, 1);
  272.                 RemovePlayerFromVehicle(playerid);
  273.             }
  274.             else if(PlayerToPoint(3.0, playerid,387.7978,173.8582,1008.3828))
  275.             {
  276.                 SetPlayerInterior(playerid,0);
  277.                 SetPlayerPos(playerid,1480.9673,-1772.0413,18.7958);
  278.                 PlayerInfo[playerid][pInt] = 0;
  279.                 PlayerInfo[playerid][pLocal] = 255;
  280.             }
  281.             else if(PlayerToPoint(3.0, playerid,322.4845,302.6965,999.1484))
  282.             {
  283.                 SetPlayerInterior(playerid,0);
  284.                 SetPlayerPos(playerid,611.1556,-586.3437,17.2266);
  285.                 PlayerInfo[playerid][pInt] = 0;
  286.                 PlayerInfo[playerid][pLocal] = 255;
  287.             }
  288.             else if (PlayerToPoint(3.0, playerid,246.3196,73.8794,1003.6406)) // pd
  289.             {
  290.                 SetPlayerInterior(playerid,0);
  291.                 SetPlayerPos(playerid,1551.2357,-1675.4714,15.7592);
  292.                 PlayerInfo[playerid][pInt] = 0;
  293.                 PlayerInfo[playerid][pLocal] = 255;
  294.             }
  295.             else if (PlayerToPoint(6.0, playerid,-1404.5299,-259.0602,1043.6563))
  296.             {
  297.                 SetPlayerInterior(playerid,0);
  298.                 SetPlayerPos(playerid,2695.6235,-1704.6960,11.8438);
  299.             }
  300.             else if (PlayerToPoint(6.0, playerid,1169.7621,1359.1492,10.9219)) //cabs
  301.             {
  302.                 SetPlayerInterior(playerid,0);
  303.                 SetPlayerPos(playerid,2131.3894,-1150.5890,24.1359);
  304.             }
  305.             else if (PlayerToPoint(3.0, playerid,229.2174,1822.8274,7.4141))
  306.             {
  307.                 if(IsACop(playerid))
  308.                 {
  309.                     SetPlayerInterior(playerid,0);
  310.                     SetPlayerPos(playerid,2729.9309,-2451.3738,17.5937);
  311.                     GameTextForPlayer(playerid, "~w~Welcome to LS", 5000, 1);
  312.                     PlayerInfo[playerid][pInt] = 0;
  313.                 }
  314.             }
  315.             else if (PlayerToPoint(8.0, playerid,-1443.0554,-581.1879,1055.0472))
  316.             {
  317.                 SetPlayerInterior(playerid,0);
  318.                 SetPlayerPos(playerid,-2111.5686,-443.9720,38.7344);
  319.             }
  320.             else if (PlayerToPoint(8.0, playerid,-1464.7732,1557.5533,1052.5313))
  321.             {
  322.                 SetPlayerInterior(playerid,0);
  323.                 SetPlayerPos(playerid,-2080.3079,-406.0309,38.7344);
  324.             }
  325.             else if(NoFuel[playerid] == 1)
  326.             {
  327.                 TogglePlayerControllable(playerid, 1);
  328.                 RemovePlayerFromVehicle(playerid);
  329.                 NoFuel[playerid] = 0;
  330.             }
  331.             if(PlayerInfo[playerid][pHouseX] != 0 && PlayerInfo[playerid][pHouseY] != 0 && PlayerInfo[playerid][pHouseZ] != 0)
  332.             {
  333.                 new Float:housex = PlayerInfo[playerid][pHouseX];
  334.                 new Float:housey = PlayerInfo[playerid][pHouseY];
  335.                 new Float:housez = PlayerInfo[playerid][pHouseZ];
  336.                 new Float:houseintx = PlayerInfo[playerid][pHouseIntX];
  337.                 new Float:houseinty = PlayerInfo[playerid][pHouseIntY];
  338.                 new Float:houseintz = PlayerInfo[playerid][pHouseIntZ];
  339.                 new housevw = PlayerInfo[playerid][pHouseVW];
  340.  
  341.                 new Float:px, Float:py, Float:pz;
  342.                 GetPlayerPos(playerid,px,py,pz);
  343.  
  344.                 new currentworld = GetPlayerVirtualWorld(playerid);
  345.  
  346.                 if(PlayerToPoint(3.0,playerid,houseintx,houseinty,houseintz) && currentworld == housevw)
  347.                 {
  348.                     SetPlayerPos(playerid,housex,housey,housez);
  349.                     SetPlayerVirtualWorld(playerid,0);
  350.                     SetPlayerInterior(playerid,0);
  351.                 }
  352.                 return 1;
  353.             }
  354.         }
  355.         return 1;
  356.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement