Guest User

Untitled

a guest
Oct 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.09 KB | None | 0 0
  1. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2. {
  3.     if(newkeys == KEY_SECONDARY_ATTACK)
  4.     {
  5.          if(IsPlayerConnected(playerid))
  6.         {
  7.             for(new i = 0; i < sizeof(HouseInfo); i++)
  8.             {
  9.                 if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
  10.                 {
  11.                     //printf("Found House :%d",i);
  12.                     if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
  13.                     {
  14.                         SetPlayerInterior(playerid,HouseInfo[i][hInt]);
  15.                         SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
  16.                         GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
  17.                         PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
  18.                         PlayerInfo[playerid][pLocal] = i;
  19.                     }
  20.                     else
  21.                     {
  22.                         GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
  23.                     }
  24.                 }
  25.             }
  26.             for(new i = 0; i < sizeof(BizzInfo); i++)
  27.             {
  28.                 if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
  29.                 {
  30.                     //printf("Found House :%d",i);
  31.                     if(!IsACop(playerid) && i == 3)
  32.                     {
  33.                         SendClientMessage(playerid, COLOR_GREY, "   Cops only !");
  34.                         return 1;
  35.                     }
  36.                     if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
  37.                     {
  38.                         if(PlayerInfo[playerid][pPbiskey] != i)
  39.                         {
  40.                             if(BizzInfo[i][bLocked] == 1)
  41.                             {
  42.                                 GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
  43.                                 return 1;
  44.                             }
  45.                             if(BizzInfo[i][bProducts] == 0)
  46.                             {
  47.                                 GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
  48.                                 return 1;
  49.                             }
  50.                             GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
  51.                             new string[128];
  52.                             format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
  53.                             BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
  54.                             ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
  55.                             BizzInfo[i][bProducts]--;
  56.                             OnPropUpdate();
  57.                             GameTextForPlayer(playerid, string, 5000, 3);
  58.                         }
  59.                         SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
  60.                         SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
  61.                         PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
  62.                         PlayerInfo[playerid][pLocal] = i+99;
  63.                         new dood[MAX_PLAYER_NAME];
  64.                         GetPlayerName(playerid, dood, sizeof(dood));
  65.                         new string[128];
  66.                         format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i);
  67.                         printf("%s", string);
  68.                         PayLog(string);
  69.                         //PlayerInfo[playerid][pLocal] = i;
  70.                     }
  71.                     else
  72.                     {
  73.                         GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
  74.                     }
  75.                 }
  76.             }
  77.             for(new i = 0; i < sizeof(SBizzInfo); i++)
  78.             {
  79.                 if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
  80.                 {
  81.                     if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
  82.                     {
  83.                         if(PlayerInfo[playerid][pPbiskey] != i)
  84.                         {
  85.                             if(SBizzInfo[i][sbLocked] == 1)
  86.                             {
  87.                                 GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
  88.                                 return 1;
  89.                             }
  90.                             if(SBizzInfo[i][sbProducts] == 0)
  91.                             {
  92.                                 GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
  93.                                 return 1;
  94.                             }
  95.                             if(i == 10)
  96.                             {
  97.                                 PaintballPlayers ++;
  98.                                 PlayerPaintballing[playerid] = 1;
  99.                                 new rand = random(sizeof(PaintballSpawns));
  100.                                 SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
  101.                                 TogglePlayerControllable(playerid, 0);
  102.                             }
  103.                             else if(i == 11)
  104.                             {
  105.                                 PlayerKarting[playerid] = 1;
  106.                                 SendClientMessage(playerid, TEAM_GROVE_COLOR, "You can now parcipitate in a Karting Race, grab a Kart.");
  107.                             }
  108.                             else
  109.                             {
  110.                                 return 1;
  111.                             }
  112.                             GivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
  113.                             gSpentCash[playerid] = GetPlayerMoney(playerid);
  114.                             SBizzInfo[i][sbProducts]--;
  115.                             SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
  116.                             ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]);
  117.                             new dood[MAX_PLAYER_NAME];
  118.                             GetPlayerName(playerid, dood, sizeof(dood));
  119.                             new string[128];
  120.                             format(string, sizeof(string), "%s payed $%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i);
  121.                             printf("%s", string);
  122.                             PayLog(string);
  123.                             OnPropUpdate();
  124.                         }
  125.                     }
  126.                     else
  127.                     {
  128.                         GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
  129.                     }
  130.                 }
  131.             }
  132.             if (PlayerToPoint(3.0, playerid,-2162.2554,-2385.9541,30.6250))
  133.             {
  134.                 SetPlayerInterior(playerid,3);
  135.                 SetPlayerPos(playerid,387.7978,173.8582,1008.3828);
  136.                 GameTextForPlayer(playerid, "~w~Welcome to the City Hall", 5000, 1);
  137.                 PlayerInfo[playerid][pInt] = 3;
  138.                 PlayerInfo[playerid][pLocal] = 241;
  139.             }
  140.             else if (PlayerToPoint(3.0, playerid,1073.0619,-344.5148,73.9922))
  141.             {
  142.                 if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
  143.                 {
  144.                     SetPlayerInterior(playerid,2);
  145.                     SetPlayerPos(playerid,1205.0947,-10.1685,1000.9219);
  146.                     PlayerInfo[playerid][pInt] = 2;
  147.                     PlayerInfo[playerid][pLocal] = 242;
  148.                 }
  149.             }
  150.             else if (PlayerToPoint(3.0, playerid,2695.6235,-1704.6960,11.8438))
  151.             {
  152.                 GameTextForPlayer(playerid, "~w~Welcome to the 8ball Track", 5000, 1);
  153.                 SetPlayerInterior(playerid,7);
  154.                 SetPlayerPos(playerid,-1404.5299,-259.0602,1043.6563);
  155.             }
  156.             else if (PlayerToPoint(8.0, playerid,-2111.5686,-443.9720,38.7344))
  157.             {
  158.                 GameTextForPlayer(playerid, "~w~Welcome to the Dirt Track", 5000, 1);
  159.                 SetPlayerInterior(playerid,4);
  160.                 SetPlayerPos(playerid,-1443.0554,-581.1879,1055.0472);
  161.             }
  162.             else if (PlayerToPoint(8.0, playerid,-2080.3079,-406.0309,38.7344))
  163.             {
  164.                 GameTextForPlayer(playerid, "~w~Welcome to the Stunting Track", 5000, 1);
  165.                 SetPlayerInterior(playerid,14);
  166.                 SetPlayerPos(playerid,-1464.7732,1557.5533,1052.5313);
  167.             }
  168.         }
  169. return 1;
  170. }
Add Comment
Please, Sign In to add comment