Advertisement
Guest User

Untitled

a guest
May 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.76 KB | None | 0 0
  1. stock SkinyCorner[] =
  2. {
  3.     2, 4, 6, 7, 13, 15, 19, 21, 22, 23, 24, 25, 28, 29, 30, 44, 47, 48, 65, 66, 67, 143, 144, 180, 182, 184, 190, 193, 262, 273
  4. }; // 30
  5. new Float:CornerSpawn[12][4]=
  6. {
  7. {1684.3773,-2086.4626,13.5469,0.4292},
  8. {2761.9941,-2015.4427,13.5620,270.6478},
  9. {2823.2334,-1466.2240,16.2500,180.2579},
  10. {2630.9182,-1600.9365,12.1635,269.9246},
  11. {2550.3235,-1209.2046,54.5403,184.8661},
  12. {2209.8579,-1148.9612,25.7475,264.6206},
  13. {2402.2468,-1344.1748,25.3429,266.8655},
  14. {1978.4595,-1232.3274,20.0469,191.2826},
  15. {2427.7283,-1633.2139,13.4112,179.7761},
  16. {2344.8398,-1949.5105,13.5651,32.1162},
  17. {2063.2766,-1779.8597,13.5557,94.4358},
  18. {2507.9312,-1471.7263,24.0362,326.6046}
  19. };
  20.  
  21. PublicFunc::Corner_OPD(playerid, reason)
  22. {
  23.     if(GetPVarInt(playerid, "ProcesCorner"))
  24.     {
  25.         schowajmnie(playerid);
  26.     }
  27. }
  28.  
  29. stock schowajmnie(playerid) {
  30.     DestroyActor(GetPVarInt(playerid, "ProcesCorner") - 1);
  31.     DeletePVar(playerid, "ProcesCorner");
  32.     DeletePVar(playerid, "ProcesCornerID");
  33.     DeletePVar(playerid, "ProcesCornerRodzaj");
  34.     DisablePlayerCheckpoint(playerid);
  35. }
  36.  
  37. PublicFunc::Corner_OPEC(playerid)
  38. {
  39.     if(GetPVarInt(playerid, "ProcesCorner") >= 1)
  40.     {
  41.         if(PlayerToPoint(2.5, playerid, CornerSpawn[GetPVarInt(playerid, "ProcesCornerID")][0], CornerSpawn[GetPVarInt(playerid, "ProcesCornerID")][1], CornerSpawn[GetPVarInt(playerid, "ProcesCornerID")][2]))
  42.         {
  43.             DaneGracza[playerid][pLimitCorner] += 1;
  44.             new Wartosc = random(4);
  45.             new nazwy[][] = {"zielska", "kokainy", "amfetaminy", "cracku"};
  46.            
  47.             new str[50];
  48.             SetPVarInt(playerid, "ProcesCornerRodzaj", Wartosc+1);
  49.             format(str, sizeof str, "Potrzebny mi jest gram %s, masz to gówno?", nazwy[Wartosc]);
  50.             PokazDialog(playerid, 217, DIALOG_STYLE_MSGBOX, "{A4CE30}Corner", str, "Tak", "Nie");
  51.         }
  52.     }
  53.     return 1;
  54. }
  55.  
  56. PublicFunc::Corner_ODR(playerid, dialogid, response, listitem, inputtext[])
  57. {
  58.     if(dialogid == 217)
  59.     {
  60.         if(response)
  61.         {
  62.             if(GetPVarInt(playerid, "ProcesCornerRodzaj"))
  63.             {
  64.                 for(new p = 0; p < sizeof(DanePrzedmiotu); p++)
  65.                 {
  66.                     if(DanePrzedmiotu[p][pID] && DanePrzedmiotu[p][pTyp] == TYP_NARKOTYK && DanePrzedmiotu[p][pGracz] == DaneGracza[playerid][pID] && DanePrzedmiotu[p][pWartosc2] == GetPVarInt(playerid, "ProcesCornerRodzaj"))
  67.                     {
  68.                         if(DanePrzedmiotu[p][pWartosc1] > 1)
  69.                         {
  70.                             DanePrzedmiotu[p][pWartosc1] -= 1;
  71.                         }
  72.                         else
  73.                         {
  74.                             SkasujPrzedmiot(p);
  75.                         }
  76.                         Info(playerid, "Transakcja zakończona pomyślnie.");
  77.                         schowajmnie(playerid);
  78.                         return 1;
  79.                     }
  80.                 }
  81.             }
  82.             Info(playerid, "Nie posiadasz wymaganego przedmiotu i transakcja nie powiodła się.");
  83.         }
  84.         schowajmnie(playerid);
  85.     }
  86.     return 1;
  87. }
  88.  
  89. CMD:corner(playerid, cmdtext[])
  90. {
  91.     if(SprawdzUprawnieniaGrupy(playerid, GRUPA_TYP_GANG))
  92.     {
  93.         if(GetPVarInt(playerid, "ProcesCorner") >= 1) return Info(playerid, "Aktualnie jesteś w trakcie procesu sprzedaży.");
  94.         else if(DaneGracza[playerid][pLimitCorner] >= 5) return Info(playerid, "Wykorzystałeś już dzienny limit i nie możesz sprzedać więcej narkotyków, spróbuj jutro.");
  95.        
  96.         DeletePVar(playerid, "ProcesCorner");
  97.         Info(playerid, "Teraz musisz się udać w wskazane miejsce na mapie, aby porozmawiać z klientem.");
  98.         new ID = random(12);
  99.         SetPlayerCheckpoint(playerid, CornerSpawn[ID][0], CornerSpawn[ID][1], CornerSpawn[ID][2], 2.0);
  100.         SetPVarInt(playerid, "ProcesCorner", CreateActor(SkinyCorner[random(30)], CornerSpawn[ID][0], CornerSpawn[ID][1], CornerSpawn[ID][2], CornerSpawn[ID][3]) + 1);
  101.         SetPVarInt(playerid, "ProcesCornerID", ID);
  102.         new str[32]; format(str, sizeof(str), "%d | %d", GetPVarInt(playerid, "ProcesCorner"), GetPVarInt(playerid, "ProcesCornerID")); WiadomoscMe(playerid, str);
  103.     }
  104.     else
  105.     {
  106.         GameTextForPlayer(playerid, "Brak uprawnien", 2000, 3);
  107.     }
  108.     return 1;
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement