Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 79.28 KB | None | 0 0
  1. /*
  2.  
  3.     -------------------------------------
  4.     [#]      KLUBŲ SISTEMA            [#]
  5.     [#]      Autorius: mariusqw       [#]
  6.     [#]      Discord: Jukyli#1107     [#]
  7.     -------------------------------------
  8.    MYSQL_KLUBAI Klubų lentelės pavadinimas.
  9.     -------------------------------------
  10.    
  11. */
  12.  
  13. #include <YSI\y_hooks>
  14.  
  15. #undef MAX_PLAYERS
  16. #define MAX_PLAYERS 100
  17.  
  18. #define MAX_CLUBS 2
  19. #define MONEY_PER_SECOND 10
  20. #define MAX_ISPIRKA 1000000
  21. #define MIN_ISPIRKA 100000
  22. #define MIN_ISPIRKA_A "100000"
  23. #define MAX_ISPIRKA_A "1000000"
  24. #define CLUB_SERVICE_CREDITS 100
  25. #define CLUB_SERVICE_MONEY 1000000
  26.  
  27.  
  28. #define PLAYER_CLOTHES_CLUB 3
  29.  
  30. #define DIALOG_NONE                 0
  31. #define DIALOG_KLUBAS_PIRKTI        243
  32. #define DIALOG_KLUBAS_PIRKTI_1      244
  33. #define DIALOG_CLUB_ISPIRKA         245
  34. #define DIALOG_CLUB_ISPIRKA_CHANGE  246
  35. #define DIALOG_CLUB_ISPIRKA_PAY     247
  36. #define DIALOG_KLUBAS_NAME          248
  37. #define DIALOG_KLUBAS_NAME_1        249
  38. #define DIALOG_KLUBAS_VSKIN         250
  39. #define DIALOG_KLUBAS_VSKIN_1       251
  40. #define DIALOG_KLUBAS_MSKIN         252
  41. #define DIALOG_KLUBAS_MSKIN_1       253
  42. #define DIALOG_KLUBAS_CARCOLOR      254
  43. #define DIALOG_KLUBAS_CARCOLOR_1    255
  44. #define DIALOG_KLUBAS_RENT          256
  45. #define DIALOG_KLUBAS_RENT_1        257
  46.  
  47. #define RED 0xFF0000FF
  48. #define YELLOW 0xFFFF00AA
  49. #define GRAY 0xb4b5b7FF
  50. #define ZYDRA 0x33ccffFF
  51.  
  52. #define ORANGE_CLUBS 0xdb881aFF //db881a
  53. #define GREEN_CLUBS 0x34A936FF
  54. #define RED_CLUBS 0xbe5441FF //be5441
  55. #define AQUA_CLUBS 0x36c9baFF //36c9ba
  56.  
  57. #define MYSQL_KLUBAI "Klubai"
  58. #define MYSQL_KLUBAI_CARS "KlubaiCars"
  59. #define MYSQL_KLUBAI_USERS "KlubaiUsers"
  60. #define MYSQL_KLUBAI_LEFT "KlubaiPaliko"
  61.  
  62. #define PRESSED(%0) \
  63.     (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  64.    
  65. #if !defined isnull
  66.     #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
  67. #endif
  68.  
  69. enum K_DATA
  70. {
  71.     clubId,
  72.     clubName[32],
  73.     clubOwner[24],
  74.     clubCoOwner[24],
  75.    
  76.     Float:posX,
  77.     Float:posY,
  78.     Float:posZ,
  79.    
  80.     clubLast,
  81.     clubPriceCredits,
  82.     clubPriceMoney,
  83.     clubJoinPickup,
  84.     Text3D:clubJoinLabel,
  85.    
  86.     clubCarColor,
  87.     clubMenSkin,
  88.     clubWomenSkin,
  89.  
  90.     Masinos[14],
  91.    
  92.     Float:car560_1[4],
  93.     Float:car560_2[4],
  94.     Float:car560_3[4],
  95.     Float:car560_4[4],
  96.    
  97.     Float:car522_1[4],
  98.     Float:car522_2[4],
  99.     Float:car522_3[4],
  100.     Float:car522_4[4],
  101.     Float:car522_5[4],
  102.     Float:car522_6[4],
  103.     Float:car522_7[4],
  104.     Float:car522_8[4],
  105.    
  106.     Float:car508[4],
  107.    
  108.     clubGates[2],
  109.     Float:clubGatesPosZ,
  110.     clubGatesState,
  111.    
  112.     clubMoney,
  113.     bool:clubGatesLocked,
  114.    
  115.     Float:uzimtiX,
  116.     Float:uzimtiY,
  117.     Float:uzimtiZ,
  118.     Text3D:clubAttackLabel,
  119.     secondTimer,
  120.     stolenMoney,
  121.    
  122.     attackTime,
  123.     attackTimeMinutes,
  124.     attackTimeHours,
  125.    
  126.     underAttack,
  127.     attackingClub,
  128.     attackDelay,
  129.     attackDate[24],
  130.     clubAttackPrice,
  131.     SkelbTim,
  132.     clubShield,
  133.     bool:UzkrautosMasinos
  134. };
  135.  
  136. new Klubai[MAX_CLUBS][K_DATA];
  137.  
  138. enum P_DATA
  139. {
  140.     clubOwner,
  141.     clubCoOwner,
  142.     club,
  143.     clubInvitation,
  144.     clubXP,
  145.     loginDate[32]
  146. }
  147.  
  148. new ClubDB[MAX_PLAYERS][P_DATA];
  149.  
  150. #define MAX_SKINS sizeof bannedSkins
  151.  
  152. new bannedSkins[] = {
  153.     165,
  154.     166,
  155.     280,
  156.     281,
  157.     282,
  158.     283,
  159.     284,
  160.     285,
  161.     286,
  162.     287,
  163.     288,
  164.     300,
  165.     301,
  166.     302,
  167.     306,
  168.     307,
  169.     309,
  170.     310,
  171.     311,
  172.     277,
  173.     278,
  174.     279,
  175.     274,
  176.     275,
  177.     276,
  178.     308,
  179.     163,
  180.     164,
  181.     0
  182. };
  183.  
  184. new
  185.     LastVehicle[MAX_PLAYERS] = INVALID_VEHICLE_ID,
  186.     counter = 10,
  187.     xpCounter,
  188.     bool:ClubOnAttack = false;
  189.  
  190. hook OnGameModeInit()
  191. {
  192.     SetTimer("CheckClub", 60000 * 10, true);
  193.  
  194.     LoadObjects();
  195.     printf("[KLUBAI] Klubu sistema - mariusqw");
  196.     mysql_tquery(connectionHandle, "SELECT * FROM `"MYSQL_KLUBAI"`;", "OnLoadClubs");
  197.     mysql_tquery(connectionHandle, "SELECT * FROM `"MYSQL_KLUBAI_CARS"`;", "OnLoadClubCars");
  198.     return 1;
  199. }
  200.  
  201. hook OnGameModeExit()
  202. {
  203.     for(new x = 0; x < MAX_CLUBS; x++)
  204.         SaveClubInfo(x);
  205.        
  206.     return 1;
  207. }
  208.  
  209. hook OnPlayerConnect(playerid)
  210. {
  211.     ClearPlayerInfo(playerid);
  212.     RemoveObjects(playerid);
  213.     return 1;
  214. }
  215.  
  216. hook OnPlayerSpawn(playerid)
  217. {
  218.     new
  219.         query[86];
  220.        
  221.     if(PlayerDB[playerid][Loaded] == 0)
  222.     {
  223.         mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_USERS"` WHERE `Name` = '%e'", Vardas(playerid));
  224.         mysql_tquery(connectionHandle, query, "OnLoadUserClubData", "d", playerid);
  225.     }
  226.     return 1;
  227. }
  228.  
  229. hook OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  230. {
  231.     if(ispassenger == 1)
  232.     {
  233.         if(VehicleDB[vehicleid][vehicleClub] != -1 && GetVehicleModel(vehicleid) == 508)
  234.         {
  235.             SetPlayerInterior(playerid, 2);
  236.             SetPlayerVirtualWorld(playerid, vehicleid + 1);
  237.             SetPlayerPos(playerid, 267.2381, 304.8850, 999.148437);
  238.            
  239.             LastVehicle[playerid] = vehicleid;
  240.         }
  241.     }
  242.     return 1;
  243. }
  244.  
  245. hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  246. {
  247.     if(PRESSED(KEY_SECONDARY_ATTACK) && GetPlayerInterior(playerid) == 2)
  248.     {
  249.         new Float:vehx, Float:vehy, Float:vehz;
  250.         GetVehiclePos(LastVehicle[playerid], vehx, vehy, vehz);
  251.        
  252.         SetPlayerInterior(playerid, 0);
  253.         SetPlayerVirtualWorld(playerid, 0);
  254.         SetPlayerPos(playerid, vehx + 1, vehy, vehz + 1);
  255.        
  256.         LastVehicle[playerid] = INVALID_PLAYER_ID;
  257.     }
  258.     if(PRESSED(KEY_HANDBRAKE) || PRESSED(KEY_CTRL_BACK))
  259.     {
  260.         new
  261.             Float:ObjPosX,
  262.             Float:ObjPosY,
  263.             Float:ObjPosZ,
  264.             cId = -1
  265.         ;
  266.  
  267.         for(new i = 0; i < MAX_CLUBS; i++)
  268.         {
  269.             GetDynamicObjectPos(Klubai[i][clubGates][0], ObjPosX, ObjPosY, ObjPosZ);
  270.             if(IsPlayerInRangeOfPoint(playerid, 10.0, ObjPosX, ObjPosY, ObjPosZ))
  271.             {
  272.                 cId = i;
  273.                 break;
  274.             }
  275.         }
  276.        
  277.         if(cId != -1 && ClubDB[playerid][club] == cId || cId != -1 && ClubDB[playerid][clubInvitation] == cId)
  278.         {
  279.             if(Klubai[cId][clubGatesLocked] && ClubDB[playerid][clubOwner] == cId)
  280.             {
  281.  
  282.             } else return 0;
  283.  
  284.             if(Klubai[cId][clubGatesState] == 1)
  285.             {
  286.                 MoveDynamicObject(Klubai[cId][clubGates][0], ObjPosX, ObjPosY, Klubai[cId][clubGatesPosZ] - 7, 4);
  287.  
  288.                 if(IsValidDynamicObject(Klubai[cId][clubGates][1]))
  289.                 {
  290.                     new
  291.                         Float:ObjPosX1,
  292.                         Float:ObjPosY1,
  293.                         Float:ObjPosZ1
  294.                     ;
  295.  
  296.                     GetDynamicObjectPos(Klubai[cId][clubGates][1], ObjPosX1, ObjPosY1, ObjPosZ1);
  297.                     MoveDynamicObject(Klubai[cId][clubGates][1], ObjPosX1, ObjPosY1, Klubai[cId][clubGatesPosZ] - 7, 4);
  298.                 }
  299.  
  300.                 Klubai[cId][clubGatesState] = 0;
  301.                 GameTextForPlayer(playerid,"~g~Atidaroma", 1000, 3);
  302.             }
  303.             else
  304.             {
  305.                 MoveDynamicObject(Klubai[cId][clubGates][0], ObjPosX, ObjPosY, Klubai[cId][clubGatesPosZ], 4);
  306.  
  307.                 if(IsValidDynamicObject(Klubai[cId][clubGates][1]))
  308.                 {
  309.                     new
  310.                         Float:ObjPosX1,
  311.                         Float:ObjPosY1,
  312.                         Float:ObjPosZ1
  313.                     ;
  314.  
  315.                     GetDynamicObjectPos(Klubai[cId][clubGates][1], ObjPosX1, ObjPosY1, ObjPosZ1);
  316.                     MoveDynamicObject(Klubai[cId][clubGates][1], ObjPosX1, ObjPosY1, Klubai[cId][clubGatesPosZ], 4);
  317.                 }
  318.  
  319.                 Klubai[cId][clubGatesState] = 1;
  320.                 GameTextForPlayer(playerid,"~r~Uzdaroma", 1000, 3);
  321.             }
  322.         }
  323.     }
  324.     return 1;
  325. }
  326.  
  327. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  328. {
  329.     new
  330.         inputdialogtext[1000];
  331.        
  332.     format(inputdialogtext, sizeof inputdialogtext, "%s", inputtext);
  333.     strreplace(inputdialogtext, "%", "%%", true);
  334.    
  335.     if(dialogid == DIALOG_KLUBAS_PIRKTI)
  336.     {
  337.         if(response)
  338.         {
  339.             if(IsNumeric(inputtext))
  340.             {
  341.                 new
  342.                     inputId = strval(inputdialogtext);
  343.                    
  344.                 if(Klubai[inputId][clubLast] > 1 || inputId > MAX_CLUBS) return SendClientMessage(playerid, RED, "* Šio klubo pirkti negali.");
  345.                 if(ClubDB[playerid][clubOwner] != -1 || ClubDB[playerid][clubCoOwner] != -1) return SendClientMessage(playerid, RED, "* Šiuo metu jūs turite klubą.");
  346.  
  347.                 SetPVarInt(playerid, "selectedClubId", inputId);
  348.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_PIRKTI_1, DIALOG_STYLE_LIST, "Klubo pirkimas", "\n \nPirkti už kreditus\nPirkti už pinigus", "Pirkti", "Atšaukti");
  349.             } else return cmd_pirktikluba(playerid);
  350.         }
  351.         return 1;
  352.     }
  353.     if(dialogid == DIALOG_KLUBAS_PIRKTI_1)
  354.     {
  355.         if(response && listitem > 0)
  356.         {
  357.             new
  358.                 inputId = GetPVarInt(playerid, "selectedClubId");
  359.                
  360.             if(listitem == 1)
  361.             {
  362.                 if(PlayerDB[playerid][Credits] < Klubai[inputId][clubPriceCredits]) return SendClientMessage(playerid, RED, "* Neturi tiek kreditų.");
  363.                 PlayerDB[playerid][Credits] -= Klubai[inputId][clubPriceCredits];
  364.                 SendClientMessage(playerid, GREEN_CLUBS, "* Sėkmingai nusipirkai klubą.");
  365.                
  366.                 ClubDB[playerid][clubOwner] = inputId;
  367.                 Klubai[inputId][clubLast] = gettime() + 2592000;
  368.                 format(Klubai[inputId][clubOwner], 24, "%s", Vardas(playerid));
  369.  
  370.                 SaveClubInfo(Klubai[inputId][clubId]);
  371.             }
  372.             if(listitem == 2)
  373.             {
  374.                 if(GetPlayerMoneyA(playerid) < Klubai[inputId][clubPriceMoney]) return SendClientMessage(playerid, RED, "* Neturi tiek pinigų.");
  375.                 GivePlayerMoneyA(playerid, -Klubai[inputId][clubPriceMoney]);
  376.  
  377.                 SendClientMessage(playerid, GREEN_CLUBS, "* Sėkmingai nusipirkai klubą.");
  378.                
  379.                 ClubDB[playerid][clubOwner] = inputId;
  380.                 Klubai[inputId][clubLast] = gettime() + 2592000;
  381.                 format(Klubai[inputId][clubOwner], 24, "%s", Vardas(playerid));
  382.                
  383.                 SaveClubInfo(Klubai[inputId][clubId]);
  384.             }
  385.         }
  386.         return 1;
  387.     }
  388.     if(dialogid == DIALOG_CLUB_ISPIRKA)
  389.     {
  390.         if(response)
  391.         {
  392.             new
  393.                 string[180],
  394.                 cId = -1,
  395.                 clubid = -1
  396.             ;
  397.                
  398.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  399.             if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  400.  
  401.             if(clubid != -1 && Klubai[clubid][underAttack] == -1)
  402.             {
  403.                 cId = Klubai[clubid][attackingClub];
  404.                 format(string, sizeof string,
  405.                     "{ffffff}Užimtas klubas: {00ff00}„%s“\n\
  406.                     {ffffff}Dabartinė išpirkos suma: {00ff00}%s€\n\
  407.                     {ffffff}Įveskite naują išpirkos sumą",
  408.                     Klubai[cId][clubName],
  409.                     AddPoints(Klubai[cId][clubAttackPrice])
  410.                 );
  411.                 ShowPlayerDialog(playerid, DIALOG_CLUB_ISPIRKA_CHANGE, DIALOG_STYLE_INPUT, "Klubo išpirka", string, "Pasirinkti", "Atšaukti");
  412.             }
  413.             else
  414.             {
  415.                 for(new i = 0; i < MAX_CLUBS; i++)
  416.                 {
  417.                     if(Klubai[i][underAttack] != -1)
  418.                     {
  419.                         cId = i;
  420.                         break;
  421.                     }
  422.                 }
  423.                 new
  424.                     price = Klubai[cId][clubAttackPrice];
  425.  
  426.                 SetPVarInt(playerid, "selectedClub", cId);
  427.                 SetPVarInt(playerid, "selectedClubPrice", price);
  428.  
  429.                 format(string, sizeof string, "Ar tikrai norite sumokėti: %s € išpirką?", AddPoints(price));
  430.                 ShowPlayerDialog(playerid, DIALOG_CLUB_ISPIRKA_PAY, DIALOG_STYLE_MSGBOX, "Išpirkos mokėjimas", string, "Gerai", "Atšaukti");
  431.             }
  432.         }
  433.         return 1;
  434.     }
  435.     if(dialogid == DIALOG_CLUB_ISPIRKA_CHANGE)
  436.     {
  437.         if(response && IsNumeric(inputtext))
  438.         {
  439.             new
  440.                 string[40],
  441.                 clubid = -1,
  442.                 cId = -1,
  443.                 input = strval(inputdialogtext)
  444.             ;
  445.  
  446.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  447.             if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  448.            
  449.             if(input < MIN_ISPIRKA || input > MAX_ISPIRKA) return SendClientMessage(playerid, RED, "* Intervalas: "MIN_ISPIRKA_A" - "MAX_ISPIRKA_A"");
  450.  
  451.             if(clubid != -1)
  452.             {
  453.                 cId = Klubai[clubid][attackingClub];
  454.                 Klubai[cId][clubAttackPrice] = input;
  455.                
  456.                 format(string, sizeof string, "* Pakeista išpirkos kaina: %s €", AddPoints(input));
  457.                 SendClubMessage(cId, YELLOW, string);
  458.             }
  459.             SendClientMessage(playerid, GREEN_CLUBS, "* Išpirkos suma uždėta.");
  460.         }
  461.         return 1;
  462.     }
  463.     if(dialogid == DIALOG_CLUB_ISPIRKA_PAY)
  464.     {
  465.         if(response)
  466.         {
  467.             new
  468.                 price = GetPVarInt(playerid, "selectedClubPrice"),
  469.                 cId = GetPVarInt(playerid, "selectedClub"),
  470.                 string[46]
  471.             ;
  472.            
  473.             if(price < MIN_ISPIRKA) return SendClientMessage(playerid, RED, "* Išpirka dar nenustatyta.");
  474.             if(price > GetPlayerMoneyA(playerid)) return SendClientMessage(playerid, RED, "* Neturite tiek pinigų.");
  475.             GivePlayerMoneyA(playerid, -price);
  476.            
  477.             foreach(new i : Player)
  478.             {
  479.                 if(ClubDB[i][club] == Klubai[cId][underAttack])
  480.                 {
  481.                     GameTextForPlayer(i, "~g~puolamas klubas sumokejo\nispirka", 2000, 3);
  482.                 }
  483.             }
  484.            
  485.             Klubai[Klubai[cId][underAttack]][clubMoney] += price;
  486.             Klubai[Klubai[cId][underAttack]][attackDelay] = gettime() + 1800;
  487.            
  488.             format(string, sizeof string, "* %s sumokėjo išpirką %s €", Vardas(playerid), AddPoints(price));
  489.             SendClubMessage(Klubai[cId][underAttack], YELLOW, string);
  490.            
  491.             ResetClubAttack();
  492.         }
  493.         return 1;
  494.     }
  495.     if(dialogid == DIALOG_KLUBAS_NAME)
  496.     {
  497.         if(response && listitem > 0)
  498.         {
  499.             new
  500.                 string[128],
  501.                 clubid = -1;
  502.                
  503.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  504.  
  505.             if(listitem == 1)
  506.             {
  507.                 if(PlayerDB[playerid][Credits] < CLUB_SERVICE_CREDITS) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
  508.                 SetPVarInt(playerid, "ChoosenPayment", 1);
  509.                
  510.                 format(string, sizeof string,
  511.                     "Dabartinis klubo pavadinimas: %s. Keitimo kaina %d kreditų\nĮveskite klubo pavadinimą apačioje.",
  512.                     Klubai[clubid][clubName], CLUB_SERVICE_CREDITS
  513.                 );
  514.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_NAME_1, DIALOG_STYLE_INPUT, "Klubo pavadinimas", string, "Keisti", "Atšaukti");
  515.             }
  516.             if(listitem == 2)
  517.             {
  518.                 if(GetPlayerMoneyA(playerid) < CLUB_SERVICE_MONEY) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
  519.                 SetPVarInt(playerid, "ChoosenPayment", 2);
  520.                
  521.                 format(string, sizeof string,
  522.                     "Dabartinis klubo pavadinimas: %s. Keitimo kaina %s €\nĮveskite klubo pavadinimą apačioje.",
  523.                     Klubai[clubid][clubName], AddPoints(CLUB_SERVICE_MONEY)
  524.                 );
  525.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_NAME_1, DIALOG_STYLE_INPUT, "Klubo pavadinimas", string, "Keisti", "Atšaukti");
  526.             }
  527.         }
  528.         return 1;
  529.     }
  530.     if(dialogid == DIALOG_KLUBAS_NAME_1)
  531.     {
  532.         if(response)
  533.         {
  534.             if(strlen(inputdialogtext) < 3 || strlen(inputdialogtext) > 13) return SendClientMessage(playerid, RED, "* Intervalas: 3 - 13.");
  535.  
  536.             new
  537.                 string[64],
  538.                 clubid = -1,
  539.                 typee = GetPVarInt(playerid, "ChoosenPayment");
  540.  
  541.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  542.  
  543.             if(typee == 1) PlayerDB[playerid][Credits] -= CLUB_SERVICE_CREDITS;
  544.             if(typee == 2) GivePlayerMoneyA(playerid, -CLUB_SERVICE_MONEY);
  545.            
  546.             format(Klubai[clubid][clubName], 32, "%s", inputdialogtext);
  547.  
  548.             format(string, sizeof string, "* Naujas klubo pavadinimas: {db881a}%s", Klubai[clubid][clubName]);
  549.             SendClientMessage(playerid, YELLOW, string);
  550.  
  551.             format(string, sizeof string, "Įstojimas į „%s“ klubą", Klubai[clubid][clubName]);
  552.             UpdateDynamic3DTextLabelText(Klubai[clubid][clubJoinLabel], GRAY, string);
  553.            
  554.             SaveClubInfo(clubid);
  555.         }
  556.         return 1;
  557.     }
  558.     if(dialogid == DIALOG_KLUBAS_VSKIN)
  559.     {
  560.         if(response && listitem > 0)
  561.         {
  562.             new
  563.                 string[128],
  564.                 clubid = -1;
  565.  
  566.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  567.  
  568.             if(listitem == 1)
  569.             {
  570.                 if(PlayerDB[playerid][Credits] < CLUB_SERVICE_CREDITS) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
  571.                 SetPVarInt(playerid, "ChoosenPayment", 1);
  572.  
  573.                 format(string, sizeof string,
  574.                     "Dabartinis vyriškas skin: %d. Keitimo kaina %d kreditų\nĮveskite naujo skin ID.",
  575.                     Klubai[clubid][clubMenSkin], CLUB_SERVICE_CREDITS
  576.                 );
  577.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_VSKIN_1, DIALOG_STYLE_INPUT, "Klubo skin", string, "Keisti", "Atšaukti");
  578.             }
  579.             if(listitem == 2)
  580.             {
  581.                 if(GetPlayerMoneyA(playerid) < CLUB_SERVICE_MONEY) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
  582.                 SetPVarInt(playerid, "ChoosenPayment", 2);
  583.  
  584.                 format(string, sizeof string,
  585.                     "Dabartinis vyriškas skin: %d. Keitimo kaina %s €\nĮveskite naujo skin ID.",
  586.                     Klubai[clubid][clubMenSkin], AddPoints(CLUB_SERVICE_CREDITS)
  587.                 );
  588.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_VSKIN_1, DIALOG_STYLE_INPUT, "Klubo skin", string, "Keisti", "Atšaukti");
  589.             }
  590.         }
  591.         return 1;
  592.     }
  593.     if(dialogid == DIALOG_KLUBAS_VSKIN_1)
  594.     {
  595.         if(response && IsNumeric(inputtext))
  596.         {
  597.             new
  598.                 input = strval(inputdialogtext),
  599.                 clubid = -1,
  600.                 typeee = GetPVarInt(playerid, "ChoosenPayment");
  601.  
  602.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  603.             if(input == Klubai[clubid][clubMenSkin]) return SendClientMessage(playerid, RED, "* Šis skin yra dabartinis.");
  604.  
  605.             for(new i = 0; i < MAX_SKINS; i++)
  606.             {
  607.                 if(bannedSkins[i] == input)
  608.                 {
  609.                     SendClientMessage(playerid, RED, "* Šis skin yra uždraustas.");
  610.                     return 1;
  611.                 }
  612.             }
  613.            
  614.             if(typeee == 1) PlayerDB[playerid][Credits] -= CLUB_SERVICE_CREDITS;
  615.             if(typeee == 2) GivePlayerMoneyA(playerid, -CLUB_SERVICE_MONEY);
  616.            
  617.             Klubai[clubid][clubMenSkin] = input;
  618.            
  619.             foreach(new i : Player)
  620.             {
  621.                 if(ClubDB[i][club] == clubid && PlayerDB[i][AprangosTipas] == PLAYER_CLOTHES_CLUB && PlayerDB[i][Sex] == 1)
  622.                 {
  623.                     SetPlayerSkin(i, Klubai[clubid][clubMenSkin]);
  624.                 }
  625.             }
  626.            
  627.             SaveClubInfo(clubid);
  628.         }
  629.         return 1;
  630.     }
  631.     if(dialogid == DIALOG_KLUBAS_MSKIN)
  632.     {
  633.         if(response && listitem > 0)
  634.         {
  635.             new
  636.                 string[128],
  637.                 clubid = -1;
  638.  
  639.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  640.  
  641.             if(listitem == 1)
  642.             {
  643.                 if(PlayerDB[playerid][Credits] < CLUB_SERVICE_CREDITS) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
  644.                 SetPVarInt(playerid, "ChoosenPayment", 1);
  645.  
  646.                 format(string, sizeof string,
  647.                     "Dabartinis moteriškas skin: %d. Keitimo kaina %d kreditų\nĮveskite naujo skin ID.",
  648.                     Klubai[clubid][clubWomenSkin], CLUB_SERVICE_CREDITS
  649.                 );
  650.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_MSKIN_1, DIALOG_STYLE_INPUT, "Klubo moters skin", string, "Keisti", "Atšaukti");
  651.             }
  652.             if(listitem == 2)
  653.             {
  654.                 if(GetPlayerMoneyA(playerid) < CLUB_SERVICE_MONEY) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
  655.                 SetPVarInt(playerid, "ChoosenPayment", 2);
  656.  
  657.                 format(string, sizeof string,
  658.                     "Dabartinis moteriškas skin: %d. Keitimo kaina %s €\nĮveskite naujo skin ID.",
  659.                     Klubai[clubid][clubWomenSkin], AddPoints(CLUB_SERVICE_MONEY)
  660.                 );
  661.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_MSKIN_1, DIALOG_STYLE_INPUT, "Klubo moters skin", string, "Keisti", "Atšaukti");
  662.             }
  663.         }
  664.         return 1;
  665.     }
  666.     if(dialogid == DIALOG_KLUBAS_MSKIN_1)
  667.     {
  668.         if(response && IsNumeric(inputtext))
  669.         {
  670.             new
  671.                 input = strval(inputdialogtext),
  672.                 clubid = -1,
  673.                 types = GetPVarInt(playerid, "ChoosenPayment");
  674.  
  675.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  676.             if(input == Klubai[clubid][clubMenSkin]) return SendClientMessage(playerid, RED, "* Šis skin yra dabartinis.");
  677.  
  678.             for(new i = 0; i < MAX_SKINS; i++)
  679.             {
  680.                 if(bannedSkins[i] == input)
  681.                 {
  682.                     SendClientMessage(playerid, RED, "* Šis skin yra uždraustas.");
  683.                     return 1;
  684.                 }
  685.             }
  686.  
  687.             if(types == 1) PlayerDB[playerid][Credits] -= CLUB_SERVICE_CREDITS;
  688.             if(types == 2) GivePlayerMoneyA(playerid, -CLUB_SERVICE_MONEY);
  689.  
  690.             Klubai[clubid][clubWomenSkin] = input;
  691.  
  692.             foreach(new i : Player)
  693.             {
  694.                 if(ClubDB[i][club] == clubid && PlayerDB[i][AprangosTipas] == PLAYER_CLOTHES_CLUB && PlayerDB[i][Sex] == 2)
  695.                 {
  696.                     SetPlayerSkin(i, Klubai[clubid][clubWomenSkin]);
  697.                 }
  698.             }
  699.  
  700.             SaveClubInfo(clubid);
  701.         }
  702.         return 1;
  703.     }
  704.     if(dialogid == DIALOG_KLUBAS_CARCOLOR)
  705.     {
  706.         if(response && listitem > 0)
  707.         {
  708.             new
  709.                 string[128],
  710.                 clubid = -1;
  711.  
  712.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  713.  
  714.             if(listitem == 1)
  715.             {
  716.                 if(PlayerDB[playerid][Credits] < CLUB_SERVICE_CREDITS) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
  717.                 SetPVarInt(playerid, "ChoosenPayment", 1);
  718.  
  719.                 format(string, sizeof string,
  720.                     "Dabartinė transporto spalva: %d. Keitimo kaina %d kreditų\nĮveskite naujos spalvos ID.",
  721.                     Klubai[clubid][clubCarColor], CLUB_SERVICE_CREDITS
  722.                 );
  723.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_CARCOLOR_1, DIALOG_STYLE_INPUT, "Klubo mašinos spalva", string, "Keisti", "Atšaukti");
  724.             }
  725.             if(listitem == 2)
  726.             {
  727.                 if(GetPlayerMoneyA(playerid) < CLUB_SERVICE_MONEY) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
  728.                 SetPVarInt(playerid, "ChoosenPayment", 2);
  729.  
  730.                 format(string, sizeof string,
  731.                     "Dabartinė transporto spalva: %d. Keitimo kaina %s €\nĮveskite naujos spalvos ID.",
  732.                     Klubai[clubid][clubCarColor], AddPoints(CLUB_SERVICE_MONEY)
  733.                 );
  734.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_CARCOLOR_1, DIALOG_STYLE_INPUT, "Klubo mašinos spalva", string, "Keisti", "Atšaukti");
  735.             }
  736.         }
  737.         return 1;
  738.     }
  739.     if(dialogid == DIALOG_KLUBAS_CARCOLOR_1)
  740.     {
  741.         if(response && IsNumeric(inputtext))
  742.         {
  743.             new
  744.                 input = strval(inputdialogtext),
  745.                 clubid = -1,
  746.                 typess = GetPVarInt(playerid, "ChoosenPayment"),
  747.                 query[70];
  748.  
  749.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  750.             if(input == Klubai[clubid][clubCarColor]) return SendClientMessage(playerid, RED, "* Ši spalva yra dabartinė.");
  751.             if(input < 0 || input > 255) return SendClientMessage(playerid, RED, "* 0 - 255");
  752.  
  753.             if(typess == 1) PlayerDB[playerid][Credits] -= CLUB_SERVICE_CREDITS;
  754.             if(typess == 2)
  755.             {
  756.                 GivePlayerMoneyA(playerid, -CLUB_SERVICE_MONEY);
  757.             }
  758.  
  759.             Klubai[clubid][clubCarColor] = input;
  760.            
  761.             SaveClubInfo(clubid);
  762.            
  763.             for(new vehicleid = 0; vehicleid < MAX_VEHICLES; vehicleid++)
  764.             {
  765.                 if(VehicleDB[vehicleid][vehicleClub] == clubid)
  766.                     DestroyVehicle(vehicleid);
  767.             }
  768.            
  769.             mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_CARS"` WHERE `clubid` = %d", clubid);
  770.             mysql_tquery(connectionHandle, query, "OnLoadClubCars");
  771.         }
  772.         return 1;
  773.     }
  774.     if(dialogid == DIALOG_KLUBAS_RENT)
  775.     {
  776.         if(response && listitem > 0)
  777.         {
  778.             new
  779.                 string[128],
  780.                 clubid = -1;
  781.  
  782.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  783.  
  784.             if(listitem == 1)
  785.             {
  786.                 if(PlayerDB[playerid][Credits] < Klubai[clubid][clubPriceCredits]) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
  787.                 SetPVarInt(playerid, "ChoosenPayment", 1);
  788.  
  789.                 format(string, sizeof string,
  790.                     "Ar tikrai norite pratęsti „%s“ klubo galiojimo laiką už %d kreditų arba %s € 30 dienų",
  791.                     Klubai[clubid][clubName], Klubai[clubid][clubPriceCredits], AddPoints(Klubai[clubid][clubPriceMoney])
  792.                 );
  793.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_RENT_1, DIALOG_STYLE_MSGBOX, "Klubo pratęsimas", string, "Pratęsti", "Atšaukti");
  794.             }
  795.             if(listitem == 2)
  796.             {
  797.                 if(GetPlayerMoneyA(playerid) < Klubai[clubid][clubPriceMoney]) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
  798.                 SetPVarInt(playerid, "ChoosenPayment", 2);
  799.  
  800.                 format(string, sizeof string,
  801.                     "Ar tikrai norite pratęsti „%s“ klubo galiojimo laiką už %d kreditų arba %s € 30 dienų",
  802.                     Klubai[clubid][clubName], Klubai[clubid][clubPriceCredits], AddPoints(Klubai[clubid][clubPriceMoney])
  803.                 );
  804.                 ShowPlayerDialog(playerid, DIALOG_KLUBAS_RENT_1, DIALOG_STYLE_MSGBOX, "Klubo pratęsimas", string, "Pratęsti", "Atšaukti");
  805.             }
  806.         }
  807.         return 1;
  808.     }
  809.     if(dialogid == DIALOG_KLUBAS_RENT_1)
  810.     {
  811.         if(response)
  812.         {
  813.             new
  814.                 typess = GetPVarInt(playerid, "ChoosenPayment"),
  815.                 clubid = -1;
  816.                
  817.             if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  818.  
  819.             if(typess == 1) PlayerDB[playerid][Credits] -= Klubai[clubid][clubPriceCredits];
  820.             if(typess == 2) GivePlayerMoneyA(playerid, -Klubai[clubid][clubPriceMoney]);
  821.  
  822.             Klubai[clubid][clubLast] = Klubai[clubid][clubLast] + 2592000;
  823.             SendClientMessage(playerid, YELLOW, "* Klubo galiojimas pratęstas 30 dienų.");
  824.  
  825.             SaveClubInfo(clubid);
  826.         }
  827.         return 1;
  828.     }
  829.     return 1;
  830. }
  831.  
  832. hook OnPlayerPickUpPickup(playerid, pickupid)
  833. {
  834.     for(new i = 0; i < MAX_CLUBS; i++)
  835.     {
  836.         if(pickupid == Klubai[i][clubJoinPickup])
  837.         {
  838.             if(ClubDB[playerid][club] != Klubai[i][clubId] && ClubDB[playerid][club] != -1)
  839.                 return SendClientMessage(playerid, RED, "* Jūs esate kitame klube. Naudok {db881a}/paliktikluba");
  840.             if(ClubDB[playerid][clubInvitation] != Klubai[i][clubId] && ClubDB[playerid][club] == -1)
  841.                 return SendClientMessage(playerid, RED, "* Jūs nesate pakviestas į šį klubą.");
  842.                
  843.             if(ClubDB[playerid][club] == -1)
  844.             {
  845.                 ClubDB[playerid][clubInvitation] = -1;
  846.                 ClubDB[playerid][club] = Klubai[i][clubId];
  847.  
  848.                 if(Klubai[i][clubMenSkin] != 1)
  849.                 {
  850.                     if(PlayerDB[playerid][Sex] == 1)
  851.                         SetPlayerSkin(playerid, Klubai[i][clubMenSkin]);
  852.                 }
  853.                 if(Klubai[i][clubWomenSkin] != 1)
  854.                 {
  855.                     if(PlayerDB[playerid][Sex] == 2)
  856.                         SetPlayerSkin(playerid, Klubai[i][clubWomenSkin]);
  857.                 }
  858.  
  859.                 PlayerDB[playerid][AprangosTipas] = PLAYER_CLOTHES_CLUB;
  860.  
  861.                 SendClientMessage(playerid, GREEN_CLUBS, "* Sėkmingai įstojote į klubą.");
  862.  
  863.                 new
  864.                     string[64];
  865.                    
  866.                 format(string, sizeof string, "[klubo racija] %s įstojo į klubą", Vardas(playerid));
  867.                 SendClubMessage(ClubDB[playerid][club], AQUA_CLUBS, string);
  868.  
  869.                 SavePlayerClubData(playerid);
  870.  
  871.                 break;
  872.             }
  873.         }
  874.     }
  875.     return 1;
  876. }
  877.  
  878. hook OnPlayerStateChange(playerid, newstate, oldstate)
  879. {
  880.     if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
  881.     {
  882.         new vehicleid = GetPlayerVehicleID(playerid);
  883.         if(VehicleDB[vehicleid][vehicleClub] != -1 && ClubDB[playerid][club] != VehicleDB[vehicleid][vehicleClub])
  884.         {
  885.             SendClientMessage(playerid, RED, "* Ši tr. priemonė nepriklauso jūsų klubui.");
  886.             RemovePlayerFromVehicle(playerid);
  887.         }
  888.     }
  889.     return 1;
  890. }
  891.  
  892. forward OnLoadClubs();
  893. public OnLoadClubs()
  894. {
  895.     if(cache_get_row_count() == 0) print("[KLUBAI] Nerasta klubu MySQL lenteleje.");
  896.     else
  897.     {
  898.         for(new row = 0; row < cache_get_row_count(); row++)
  899.         {
  900.             Klubai[row][clubId] = cache_get_field_content_int(row, "clubId");
  901.  
  902.             cache_get_field_content(row, "clubName", Klubai[row][clubName], connectionHandle, 32);
  903.             cache_get_field_content(row, "clubOwner", Klubai[row][clubOwner], connectionHandle, 24);
  904.             cache_get_field_content(row, "clubCoOwner", Klubai[row][clubCoOwner], connectionHandle, 24);
  905.  
  906.             Klubai[row][clubLast] = cache_get_field_content_int(row, "clubLast");
  907.             Klubai[row][clubPriceCredits] = cache_get_field_content_int(row, "clubPriceCredits");
  908.             Klubai[row][clubPriceMoney] = cache_get_field_content_int(row, "clubPriceMoney");
  909.             Klubai[row][clubCarColor] = cache_get_field_content_int(row, "clubCarColor");
  910.             Klubai[row][clubMenSkin] = cache_get_field_content_int(row, "clubMenSkin");
  911.             Klubai[row][clubWomenSkin] = cache_get_field_content_int(row, "clubWomenSkin");
  912.             Klubai[row][clubMoney] = cache_get_field_content_int(row, "clubMoney");
  913.  
  914.             Klubai[row][posX] = cache_get_field_content_float(row, "posX");
  915.             Klubai[row][posY] = cache_get_field_content_float(row, "posY");
  916.             Klubai[row][posZ] = cache_get_field_content_float(row, "posZ");
  917.            
  918.             Klubai[row][uzimtiX] = cache_get_field_content_float(row, "uzimtiX");
  919.             Klubai[row][uzimtiY] = cache_get_field_content_float(row, "uzimtiY");
  920.             Klubai[row][uzimtiZ] = cache_get_field_content_float(row, "uzimtiZ");
  921.  
  922.             Klubai[row][clubJoinPickup] = CreatePickup(1314, 2, Klubai[row][posX], Klubai[row][posY], Klubai[row][posZ]);
  923.            
  924.             new Label[90];
  925.            
  926.             format(Label, sizeof Label, "Įstojimas į „%s“ klubą", Klubai[row][clubName]);
  927.             Klubai[row][clubJoinLabel] = CreateDynamic3DTextLabel(Label, GRAY, Klubai[row][posX], Klubai[row][posY], Klubai[row][posZ], 30, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
  928.  
  929.             format(Label, sizeof Label, "Klubo užėmimas\n{db881a}/kuzimti{b4b5b7}\n \n \n \nGaunamas XP kol matoma ši žinutė");
  930.             Klubai[row][clubAttackLabel] = CreateDynamic3DTextLabel(Label, GRAY, Klubai[row][uzimtiX], Klubai[row][uzimtiY], Klubai[row][uzimtiZ], 10, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
  931.  
  932.             if(Klubai[row][clubId] == 0)
  933.             {
  934.                 Klubai[row][clubGatesPosZ] = 17.01850;
  935.                
  936.                 Klubai[row][clubGates][0] = CreateDynamicObject(19912, -1813.82178, 1292.36328, 17.01850, 0.00000, 0.00000, 0.00000);
  937.                 Klubai[row][clubGates][1] = CreateDynamicObject(19912, -1802.25171, 1292.29187, 17.01850, 0.00000, 0.00000, 0.00000);
  938.                 Klubai[row][clubGatesState] = 1;
  939.             }
  940.             if(Klubai[row][clubId] == 1)
  941.             {
  942.                 Klubai[row][clubGatesPosZ] = 60.54100;
  943.                
  944.                 Klubai[row][clubGates][0] = CreateDynamicObject(19912, 1268.49377, -2046.12292, 60.54100, 0.00000, 0.00000, -3.12000);
  945.                 Klubai[row][clubGates][1] = CreateDynamicObject(19912, 1251.49377, -2046.12292, 60.54100, 0.00000, 0.00000, -3.12000);
  946.                 Klubai[row][clubGatesState] = 1;
  947.             }
  948.            
  949.             Klubai[row][clubGatesLocked] = true;
  950.             Klubai[row][underAttack] = -1;
  951.             Klubai[row][attackingClub] = -1;
  952.         }
  953.         printf("[KLUBAI] Uzkrauta %d klubu.", cache_get_row_count());
  954.     }
  955.     return true;
  956. }
  957.  
  958. forward OnLoadClubCars();
  959. public OnLoadClubCars()
  960. {
  961.  
  962.     if(cache_get_row_count() == 0) print("[KLUBAI] Nerasta klubu masinu MySQL lenteleje.");
  963.     else
  964.     {
  965.         for(new row = 0; row < cache_get_row_count(); row++)
  966.         {
  967.             if(Klubai[row][UzkrautosMasinos]==true)SunaikintKlubuMasinas(row);
  968.             new carPos[128];
  969.            
  970.             //Sultan
  971.             cache_get_field_content(row, "560car1", carPos, connectionHandle, 128);
  972.             sscanf(carPos, "ffff", Klubai[row][car560_1][0], Klubai[row][car560_1][1], Klubai[row][car560_1][2], Klubai[row][car560_1][3]);
  973.             Klubai[row][Masinos][1]=CreateClubVehicle(560, Klubai[row][car560_1][0], Klubai[row][car560_1][1], Klubai[row][car560_1][2], Klubai[row][car560_1][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  974.  
  975.             cache_get_field_content(row, "560car2", carPos, connectionHandle, 128);
  976.             sscanf(carPos, "ffff", Klubai[row][car560_2][0], Klubai[row][car560_2][1], Klubai[row][car560_2][2], Klubai[row][car560_2][3]);
  977.             Klubai[row][Masinos][2]=CreateClubVehicle(560, Klubai[row][car560_2][0], Klubai[row][car560_2][1], Klubai[row][car560_2][2], Klubai[row][car560_2][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  978.  
  979.             cache_get_field_content(row, "560car3", carPos, connectionHandle, 128);
  980.             sscanf(carPos, "ffff", Klubai[row][car560_3][0], Klubai[row][car560_3][1], Klubai[row][car560_3][2], Klubai[row][car560_3][3]);
  981.             Klubai[row][Masinos][3]=CreateClubVehicle(560, Klubai[row][car560_3][0], Klubai[row][car560_3][1], Klubai[row][car560_3][2], Klubai[row][car560_3][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  982.            
  983.             cache_get_field_content(row, "560car4", carPos, connectionHandle, 128);
  984.             sscanf(carPos, "ffff", Klubai[row][car560_4][0], Klubai[row][car560_4][1], Klubai[row][car560_4][2], Klubai[row][car560_4][3]);
  985.             Klubai[row][Masinos][4]=CreateClubVehicle(560, Klubai[row][car560_4][0], Klubai[row][car560_4][1], Klubai[row][car560_4][2], Klubai[row][car560_4][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  986.  
  987.             //NRG-500
  988.             cache_get_field_content(row, "522car1", carPos, connectionHandle, 128);
  989.             sscanf(carPos, "ffff", Klubai[row][car522_1][0], Klubai[row][car522_1][1], Klubai[row][car522_1][2], Klubai[row][car522_1][3]);
  990.             Klubai[row][Masinos][5]=CreateClubVehicle(522, Klubai[row][car522_1][0], Klubai[row][car522_1][1], Klubai[row][car522_1][2], Klubai[row][car522_1][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  991.  
  992.             cache_get_field_content(row, "522car2", carPos, connectionHandle, 128);
  993.             sscanf(carPos, "ffff", Klubai[row][car522_2][0], Klubai[row][car522_2][1], Klubai[row][car522_2][2], Klubai[row][car522_2][3]);
  994.             Klubai[row][Masinos][6]=CreateClubVehicle(522, Klubai[row][car522_2][0], Klubai[row][car522_2][1], Klubai[row][car522_2][2], Klubai[row][car522_2][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  995.  
  996.             cache_get_field_content(row, "522car3", carPos, connectionHandle, 128);
  997.             sscanf(carPos, "ffff", Klubai[row][car522_3][0], Klubai[row][car522_3][1], Klubai[row][car522_3][2], Klubai[row][car522_3][3]);
  998.             Klubai[row][Masinos][7]=CreateClubVehicle(522, Klubai[row][car522_3][0], Klubai[row][car522_3][1], Klubai[row][car522_3][2], Klubai[row][car522_3][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  999.  
  1000.             cache_get_field_content(row, "522car4", carPos, connectionHandle, 128);
  1001.             sscanf(carPos, "ffff", Klubai[row][car522_4][0], Klubai[row][car522_4][1], Klubai[row][car522_4][2], Klubai[row][car522_4][3]);
  1002.             Klubai[row][Masinos][8]=CreateClubVehicle(522, Klubai[row][car522_4][0], Klubai[row][car522_4][1], Klubai[row][car522_4][2], Klubai[row][car522_4][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  1003.  
  1004.             cache_get_field_content(row, "522car5", carPos, connectionHandle, 128);
  1005.             sscanf(carPos, "ffff", Klubai[row][car522_5][0], Klubai[row][car522_5][1], Klubai[row][car522_5][2], Klubai[row][car522_5][3]);
  1006.             Klubai[row][Masinos][9]=CreateClubVehicle(522, Klubai[row][car522_5][0], Klubai[row][car522_5][1], Klubai[row][car522_5][2], Klubai[row][car522_5][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  1007.  
  1008.             cache_get_field_content(row, "522car6", carPos, connectionHandle, 128);
  1009.             sscanf(carPos, "ffff", Klubai[row][car522_6][0], Klubai[row][car522_6][1], Klubai[row][car522_6][2], Klubai[row][car522_6][3]);
  1010.             Klubai[row][Masinos][10]=CreateClubVehicle(522, Klubai[row][car522_6][0], Klubai[row][car522_6][1], Klubai[row][car522_6][2], Klubai[row][car522_6][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  1011.  
  1012.             cache_get_field_content(row, "522car7", carPos, connectionHandle, 128);
  1013.             sscanf(carPos, "ffff", Klubai[row][car522_7][0], Klubai[row][car522_7][1], Klubai[row][car522_7][2], Klubai[row][car522_7][3]);
  1014.             Klubai[row][Masinos][11]=CreateClubVehicle(522, Klubai[row][car522_7][0], Klubai[row][car522_7][1], Klubai[row][car522_7][2], Klubai[row][car522_7][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  1015.  
  1016.             cache_get_field_content(row, "522car8", carPos, connectionHandle, 128);
  1017.             sscanf(carPos, "ffff", Klubai[row][car522_8][0], Klubai[row][car522_8][1], Klubai[row][car522_8][2], Klubai[row][car522_8][3]);
  1018.             Klubai[row][Masinos][12]=CreateClubVehicle(522, Klubai[row][car522_8][0], Klubai[row][car522_8][1], Klubai[row][car522_8][2], Klubai[row][car522_8][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  1019.  
  1020.             //Journey
  1021.             cache_get_field_content(row, "508car1", carPos, connectionHandle, 128);
  1022.             sscanf(carPos, "ffff", Klubai[row][car508][0], Klubai[row][car508][1], Klubai[row][car508][2], Klubai[row][car508][3]);
  1023.             Klubai[row][Masinos][13]=CreateClubVehicle(508, Klubai[row][car508][0], Klubai[row][car508][1], Klubai[row][car508][2], Klubai[row][car508][3], Klubai[row][clubCarColor], Klubai[row][clubId]);
  1024.             Klubai[row][UzkrautosMasinos]=true;
  1025.         }
  1026.         printf("[KLUBAI] Transportas uzkrautas.");
  1027.  
  1028.     }
  1029.     return true;
  1030. }
  1031.  
  1032. stock SunaikintKlubuMasinas(cId)
  1033. {
  1034.     for(new q=1;q<=13;q++)
  1035.     {
  1036.         DestroyVehicle(Klubai[cId][Masinos][q]);
  1037.     }
  1038.     return 1;
  1039. }
  1040. forward OnLoadUserClubData(playerid);
  1041. public OnLoadUserClubData(playerid)
  1042. {
  1043.     new
  1044.         query[90 + MAX_PLAYER_NAME];
  1045.  
  1046.     new years, month, days;
  1047.     getdate(years, month, days);
  1048.  
  1049.     new Valandos, Minutes;
  1050.     gettime(Valandos, Minutes);
  1051.        
  1052.     if(cache_get_row_count() == 0)
  1053.     {
  1054.         mysql_format(connectionHandle, query, sizeof query, "INSERT INTO `"MYSQL_KLUBAI_USERS"` (`Name`) VALUES ('%e')", Vardas(playerid));
  1055.         mysql_tquery(connectionHandle, query);
  1056.        
  1057.         format(ClubDB[playerid][loginDate], 32, "%d-%02d-%02d %02d:%02d", years, month, days, Valandos, Minutes);
  1058.         mysql_format(connectionHandle, query, sizeof query, "UPDATE `"MYSQL_KLUBAI_USERS"` SET `loginDate` = '%e' WHERE `Name` = '%e'", ClubDB[playerid][loginDate], Vardas(playerid));
  1059.         mysql_tquery(connectionHandle, query);
  1060.     }
  1061.     else
  1062.     {
  1063.         ClubDB[playerid][clubOwner] = cache_get_field_content_int(0, "clubOwner");
  1064.         ClubDB[playerid][clubCoOwner] = cache_get_field_content_int(0, "clubCoOwner");
  1065.         ClubDB[playerid][club] = cache_get_field_content_int(0, "club");
  1066.         ClubDB[playerid][clubXP] = cache_get_field_content_int(0, "ClubXP");
  1067.  
  1068.         printf("Kraunama žaidėjo %s klubų info: Owner: %i, CoOwner:%i, Club:%i",ClubDB[playerid][clubOwner],ClubDB[playerid][clubCoOwner],ClubDB[playerid][club]);
  1069.         format(ClubDB[playerid][loginDate], 32, "%d-%02d-%02d %02d:%02d", years, month, days, Valandos, Minutes);
  1070.         mysql_format(connectionHandle, query, sizeof query, "UPDATE `"MYSQL_KLUBAI_USERS"` SET `loginDate` = '%e' WHERE `Name` = '%e'", ClubDB[playerid][loginDate], Vardas(playerid));
  1071.         mysql_tquery(connectionHandle, query);
  1072.     }
  1073.     return true;
  1074. }
  1075.  
  1076. forward CheckClub();
  1077. public CheckClub()
  1078. {
  1079.     for(new i = 0; i < MAX_CLUBS; i++)
  1080.     {
  1081.         if(Klubai[i][clubLast] <= gettime() && !isnull(Klubai[i][clubOwner]))
  1082.         {
  1083.             ResetClubData(i);
  1084.         }
  1085.         SaveClubInfo(i);
  1086.     }
  1087.     return 1;
  1088. }
  1089.  
  1090. forward ClubAttack(playerid, clubid, cId);
  1091. public ClubAttack(playerid, clubid, cId)
  1092. {
  1093.     ClubOnAttack = true;
  1094.  
  1095.     new
  1096.         Label[256]
  1097.     ;
  1098.    
  1099.     foreach(new i : Player)
  1100.     {
  1101.         if(ClubDB[i][club] == clubid)
  1102.         {
  1103.             if(IsPlayerInRangeOfPoint(i, 10.0, Klubai[cId][uzimtiX], Klubai[cId][uzimtiY], Klubai[cId][uzimtiZ]))
  1104.             {
  1105.                 counter = 10;
  1106.                 xpCounter++;
  1107.             }
  1108.             else
  1109.                 counter--;
  1110.                
  1111.             if(xpCounter > 59)
  1112.             {
  1113.                 ClubDB[i][clubXP] ++;
  1114.                 xpCounter = 0;
  1115.             }
  1116.         }
  1117.     }
  1118.    
  1119.     if(counter < 10 && counter >= 1)
  1120.     {
  1121.         format(Label, sizeof Label,
  1122.             "Klubo užėmimas\nKlubas užimtas {db881a}„%s“ {b4b5b7}klubo\n\
  1123.             Užimta nuo: {db881a}%s{b4b5b7}\nLaikoma: {db881a}%02d:%02d:%02d\n\
  1124.             Bus apginta po: {00FF00}%ds\n{b4b5b7}Gaunamas XP kol matoma ši žinutė",
  1125.             Klubai[clubid][clubName], Klubai[clubid][attackDate], Klubai[clubid][attackTimeHours],
  1126.             Klubai[clubid][attackTimeMinutes], Klubai[clubid][attackTime],
  1127.             counter
  1128.         );
  1129.         UpdateDynamic3DTextLabelText(Klubai[cId][clubAttackLabel], GRAY, Label);
  1130.     }
  1131.     if(counter < 1)
  1132.     {
  1133.         Klubai[clubid][stolenMoney] = 0;
  1134.         Klubai[clubid][attackTime] = 0;
  1135.         Klubai[clubid][attackTimeMinutes] = 0;
  1136.         Klubai[clubid][attackTimeHours] = 0;
  1137.        
  1138.         Klubai[clubid][attackDelay] = gettime() + 1800;
  1139.         format(Klubai[clubid][attackDate], 24, "");
  1140.        
  1141.         KillTimer(Klubai[clubid][secondTimer]);
  1142.        
  1143.         Klubai[cId][underAttack] = -1;
  1144.         Klubai[clubid][attackingClub] = -1;
  1145.  
  1146.         UpdateDynamic3DTextLabelText(Klubai[cId][clubAttackLabel], GRAY,
  1147.             "Klubo užėmimas\n{db881a}/kuzimti{b4b5b7}\n \n \n \nGaunamas XP kol matoma ši žinutė");
  1148.            
  1149.         SendClubMessage(cId, YELLOW, "* Klubo zona apginta.");
  1150.        
  1151.         foreach(new i : Player)
  1152.         {
  1153.             if(ClubDB[i][club] == cId)
  1154.                 GameTextForPlayer(i, "~g~Klubo zona apginta", 2000, 3);
  1155.         }
  1156.        
  1157.         SendClubMessage(clubid, YELLOW, "* Puolamas klubas apsigynė.");
  1158.         ClubOnAttack = false;
  1159.        
  1160.         ResetClubAttack();
  1161.         return 1;
  1162.     }
  1163.  
  1164.     Klubai[clubid][stolenMoney] ++;
  1165.     Klubai[clubid][attackTime] ++;
  1166.    
  1167.     Klubai[clubid][clubMoney] += MONEY_PER_SECOND;
  1168.     Klubai[cId][clubMoney] -= MONEY_PER_SECOND;
  1169.  
  1170.     if(Klubai[clubid][attackTime] > 59)
  1171.     {
  1172.         Klubai[clubid][attackTime] = 0;
  1173.         Klubai[clubid][attackTimeMinutes] ++;
  1174.        
  1175.         SaveClubInfo(clubid);
  1176.         SaveClubInfo(cId);
  1177.     }
  1178.     if(Klubai[clubid][attackTimeMinutes] > 59)
  1179.     {
  1180.         Klubai[clubid][attackTimeMinutes] = 0;
  1181.         Klubai[clubid][attackTimeHours] ++;
  1182.     }
  1183.  
  1184.     if(counter > 9)
  1185.     {
  1186.         format(Label, sizeof Label,
  1187.             "Klubo užėmimas\nKlubas užimtas {db881a}„%s“ {b4b5b7}klubo\n\
  1188.             Užimta nuo: {db881a}%s{b4b5b7}\nLaikoma: {db881a}%02d:%02d:%02d\n\
  1189.             Pagrobė: {FF0000}%s€\n{b4b5b7}Gaunamas XP kol matoma ši žinutė",
  1190.             Klubai[clubid][clubName], Klubai[clubid][attackDate], Klubai[clubid][attackTimeHours],
  1191.             Klubai[clubid][attackTimeMinutes], Klubai[clubid][attackTime],
  1192.             AddPoints(Klubai[clubid][stolenMoney] * MONEY_PER_SECOND)
  1193.         );
  1194.         UpdateDynamic3DTextLabelText(Klubai[cId][clubAttackLabel], GRAY, Label);
  1195.     }
  1196.     return 1;
  1197. }
  1198.  
  1199. forward ResetInvitation(id);
  1200. public ResetInvitation(id)
  1201. {
  1202.     ClubDB[id][clubInvitation] = -1;
  1203.     return 1;
  1204. }
  1205.  
  1206. // BENDROS KOMANDOS
  1207. CMD:pirktikluba(playerid)
  1208. {
  1209.     new
  1210.         String[128],
  1211.         Dialog[256]
  1212.     ;
  1213.  
  1214.     strcat(Dialog, "Šiuo metu parduodami klubai, kainos nurodytos 30 dienų\n");
  1215.  
  1216.     for(new i = 0; i < MAX_CLUBS; i++)
  1217.     {
  1218.         if(Klubai[i][clubLast] < 1)
  1219.         {
  1220.             format(String, sizeof String,
  1221.                 "%d. „%s“ klubas %d kreditų arba %s €\n",
  1222.                 Klubai[i][clubId], Klubai[i][clubName], Klubai[i][clubPriceCredits], AddPoints(Klubai[i][clubPriceMoney]));
  1223.             strcat(Dialog, String);
  1224.         }
  1225.     }
  1226.     strcat(Dialog, "\nNorėdami pirkti klubą apačioje įveskite jo numerį");
  1227.  
  1228.     ShowPlayerDialog(playerid, DIALOG_KLUBAS_PIRKTI, DIALOG_STYLE_INPUT, "Klubo pirkimas", Dialog, "Pirkti", "Atšaukti");
  1229.     return 1;
  1230. }
  1231.  
  1232. CMD:klubai(playerid)
  1233. {
  1234.     new
  1235.         String[128],
  1236.         Dialog[256]
  1237.     ;
  1238.  
  1239.     strcat(Dialog, "Pavadinimas\tGalioja (d.)\tKaina (kreditų/30d.)\tKaina (€/30d.)\n");
  1240.    
  1241.     for(new i = 0; i < MAX_CLUBS; i++)
  1242.     {
  1243.         new galiojimas = (Klubai[i][clubLast] - gettime()) / 86400;
  1244.         if(galiojimas < 1) galiojimas = 0;
  1245.         format(String, sizeof String,
  1246.             "{ffffff}%d. „%s“\t%d\t%d\t%s\n",
  1247.             Klubai[i][clubId] + 1, Klubai[i][clubName], galiojimas, Klubai[i][clubPriceCredits], AddPoints(Klubai[i][clubPriceMoney]));
  1248.         strcat(Dialog, String);
  1249.     }
  1250.  
  1251.     ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_TABLIST_HEADERS, "Klubai", Dialog, "Gerai", "");
  1252.     return 1;
  1253. }
  1254.  
  1255. CMD:kdirektoriai(playerid)
  1256. {
  1257.     new
  1258.         String[128],
  1259.         Dialog[512]
  1260.     ;
  1261.  
  1262.     strcat(Dialog, "Klubas\tDirektorius\tPavaduotojas\n");
  1263.  
  1264.     for(new i = 0; i < MAX_CLUBS; i++)
  1265.     {
  1266.         format(String, sizeof String,
  1267.             "{ffffff}%s\t%s\t%s\n", Klubai[i][clubName], GetKDirektoriusName(i), GetKPavaduotojasName(i));
  1268.         strcat(Dialog, String);
  1269.     }
  1270.  
  1271.     ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_TABLIST_HEADERS, "Klubų direktoriai", Dialog, "Gerai", "");
  1272.     return 1;
  1273. }
  1274.  
  1275. // Klubo narių komandos
  1276. CMD:klubieciai(playerid)
  1277. {
  1278.     if(ClubDB[playerid][club] == -1) return 0;
  1279.    
  1280.     new
  1281.         string[32],
  1282.         info[256];
  1283.    
  1284.     strcat(string, "Šiuo metu prisijungę klubiečiai:\n");
  1285.    
  1286.     foreach(new i : Player)
  1287.     {
  1288.         if(i == playerid) continue;
  1289.        
  1290.         if(ClubDB[i][club] == ClubDB[playerid][club])
  1291.         {
  1292.             format(string, sizeof string, "%i. %s\n", i+1, Vardas(i));
  1293.             strcat(info, string);
  1294.         }
  1295.     }
  1296.     ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Klubiečiai", info, "Gerai", "");
  1297.    
  1298.     return 1;
  1299. }
  1300. CMD:rc(playerid, params[])
  1301. {
  1302.     if(ClubDB[playerid][club] == -1) return 0;
  1303.    
  1304.     new
  1305.         message[128],
  1306.         string[148]
  1307.     ;
  1308.  
  1309.     if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, GREEN_CLUBS, "* /rc [tekstas]");
  1310.    
  1311.     format(string, sizeof string, "[klubo racija] %s: %s", Vardas(playerid), message);
  1312.     SendClubMessage(ClubDB[playerid][club], AQUA_CLUBS, string);
  1313.    
  1314.     return 1;
  1315. }
  1316. CMD:kdrabuziai(playerid)
  1317. {
  1318.     if(ClubDB[playerid][club] == -1) return 0;
  1319.    
  1320.     new
  1321.         clubid = ClubDB[playerid][club];
  1322.        
  1323.     //Patriktint lytį
  1324.     if(PlayerDB[playerid][Sex] == 1)
  1325.         SetPlayerSkin(playerid, Klubai[clubid][clubMenSkin]);
  1326.     else
  1327.         SetPlayerSkin(playerid, Klubai[clubid][clubWomenSkin]);
  1328.    
  1329.     PlayerDB[playerid][AprangosTipas] = PLAYER_CLOTHES_CLUB;
  1330.     return 1;
  1331. }
  1332. CMD:paliktikluba(playerid, params[])
  1333. {
  1334.     if(ClubDB[playerid][club] == -1) return 0;
  1335.  
  1336.     new
  1337.         message[32],
  1338.         string[148]
  1339.     ;
  1340.  
  1341.     if(sscanf(params, "s[32]", message)) return SendClientMessage(playerid, GREEN_CLUBS, "* /paliktikluba [priežastis]");
  1342.  
  1343.     format(string, sizeof string, "[klubo racija] %s paliko klubą dėl: %s", Vardas(playerid), message);
  1344.     SendClubMessage(ClubDB[playerid][club], AQUA_CLUBS, string);
  1345.    
  1346.     //Atstatom skiną.
  1347.     //SetPlayerSkin(playerid, PlayerDB[playerid][Drabuziai]);
  1348.  
  1349.     new Years, Month, Day;
  1350.     getdate(Years, Month, Day);
  1351.  
  1352.     mysql_format(connectionHandle, string, sizeof string,
  1353.         "INSERT INTO `"MYSQL_KLUBAI_LEFT"` (`Name`, `Date`, `Reason`, `clubId`) VALUES ('%e', '%d-%02d-%02d', '%e', '%d')", Vardas(playerid), Years, Month, Day, message, ClubDB[playerid][club]);
  1354.     mysql_tquery(connectionHandle, string);
  1355.    
  1356.     ClubDB[playerid][club] = -1;
  1357.     ClubDB[playerid][clubInvitation] = -1;
  1358.    
  1359.     SavePlayerClubData(playerid);
  1360.    
  1361.     return 1;
  1362. }
  1363. CMD:katsisakyti(playerid)
  1364. {
  1365.     if(ClubDB[playerid][clubCoOwner] == -1) return 0;
  1366.     new
  1367.         query[256],
  1368.         clubid
  1369.     ;
  1370.     clubid = ClubDB[playerid][clubCoOwner];
  1371.     mysql_format(connectionHandle, query, sizeof query,
  1372.         "UPDATE `"MYSQL_KLUBAI"` SET \
  1373.         `clubCoOwner` = '%s', \
  1374.         WHERE `clubId` = '%d'",Vardas(playerid),clubid);
  1375.     mysql_tquery(connectionHandle, query);
  1376.     ClubDB[playerid][clubCoOwner] = -1;
  1377.     SendClientMessage(playerid, RED_CLUBS, "* Atsisakėte klubo pavaduotojo posto.");
  1378.    
  1379.     return 1;
  1380. }
  1381. CMD:kispirka(playerid)
  1382. {
  1383.     new
  1384.         cId = -1;
  1385.        
  1386.     for(new i = 0; i < MAX_CLUBS; i++)
  1387.     {
  1388.         if(Klubai[i][underAttack] != -1)
  1389.         {
  1390.             cId = i;
  1391.             break;
  1392.         }
  1393.     }
  1394.  
  1395.     if(cId != -1)
  1396.     {
  1397.         new
  1398.             string[128];
  1399.            
  1400.         format(string, sizeof string,
  1401.             "{ffffff}„%s“ užimtas „%s“ nuo %s, išpirka %s €",
  1402.             Klubai[cId][clubName], Klubai[Klubai[cId][underAttack]][clubName], Klubai[Klubai[cId][underAttack]][attackDate],
  1403.             AddPoints(Klubai[cId][clubAttackPrice])
  1404.         );
  1405.         ShowPlayerDialog(playerid, DIALOG_CLUB_ISPIRKA, DIALOG_STYLE_LIST, "Klubų išpirkos", string, "Toliau", "Atšaukti");
  1406.     }
  1407.     else ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Klubų išpirkos", "Nėra užimtų klubų", "Gerai", "Atšaukti");
  1408.     return 1;
  1409. }
  1410.  
  1411. // DIREKTORIŲ / PAVADUOTOJŲ KOMANDOS
  1412. CMD:klubas(playerid)
  1413. {
  1414.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1415.  
  1416.     SendClientMessage(playerid, ORANGE_CLUBS, "*<<KOMANDOS>>");
  1417.     SendClientMessage(playerid, YELLOW, "*/kpriimti | Priimti į savo klubą žmogų");
  1418.     SendClientMessage(playerid, YELLOW, "*/kismesti | Išmesti žmogų iš savo klubo");
  1419.     SendClientMessage(playerid, YELLOW, "*/kismestioff | Išmesti žmogų iš savo klubo, kuris neprisijungęs");
  1420.     SendClientMessage(playerid, YELLOW, "*/kismestivisus | Išmesti visus iš klubo (NEVEIKIA PAVADUOTOJUI)");
  1421.     SendClientMessage(playerid, YELLOW, "*/nariai | Parodo prisijungusius klubo narius");
  1422.     SendClientMessage(playerid, YELLOW, "*/visinariai | Parodo visus klubo narius");
  1423.     SendClientMessage(playerid, YELLOW, "*/kismete /kpaliko | Parodo išmestus ir palikusius klubo narius");
  1424.     SendClientMessage(playerid, YELLOW, "*/kvartai | Įjungia/išjungia klubo vartų darinėjimą");
  1425.     SendClientMessage(playerid, YELLOW, "*/k [tekstas] | Parašo, kad visi matytų (naudojamas atrankoms ir užpuolimams pranešti)");
  1426.     SendClientMessage(playerid, YELLOW, "*/kpavaduotojas | Skirti klubo pavaduotoją");
  1427.     SendClientMessage(playerid, YELLOW, "*/kpremija | /kpremijav | išdalinti tam tikrą pinigų sumą (esantiems šalia | visiems prisijungusiems klubo nariams)");
  1428.     SendClientMessage(playerid, YELLOW, "*/kfondas /kisimti /kideti | klubo fondo komandos");
  1429.     SendClientMessage(playerid, YELLOW, "*/kinfo | galimybė sužinoti klubo galiojimą, keisti skin, mašinas...");
  1430.     SendClientMessage(playerid, YELLOW, "*/krespawn | atstato nenaudojamas tr. priemones");
  1431.     return 1;
  1432. }
  1433. CMD:kuzimti(playerid)
  1434. {
  1435.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1436.  
  1437.     new
  1438.         clubid,
  1439.         bool:nearLabel = false,
  1440.         cId = -1
  1441.     ;
  1442.  
  1443.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1444.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1445.     if(Klubai[clubid][attackDelay] > gettime()) return SendClientMessage(playerid, RED, "* Dar nepraėjo 30 minučių po paskutinio užėmimo.");
  1446.     if(ClubOnAttack) return SendClientMessage(playerid, RED, "* Šiuo metu negalima.");
  1447.    
  1448.     for(new i = 0; i < MAX_CLUBS; i++)
  1449.     {
  1450.         if(i == clubid) continue;
  1451.        
  1452.         if(IsPlayerInRangeOfPoint(playerid, 10.0, Klubai[i][uzimtiX], Klubai[i][uzimtiY], Klubai[i][uzimtiZ]))
  1453.         {
  1454.             if(!isnull(Klubai[i][clubOwner]))
  1455.             {
  1456.                 nearLabel = true;
  1457.                 cId = i;
  1458.                 break;
  1459.             }
  1460.         }
  1461.     }
  1462.     if(!nearLabel) return SendClientMessage(playerid, RED, "* Nesate prie užėmimo vietos.");
  1463.  
  1464.     for(new i = 0; i < MAX_CLUBS; i++)
  1465.     {
  1466.         if(i == clubid) continue;
  1467.        
  1468.         if(Klubai[i][underAttack] != -1)
  1469.         {
  1470.             SendClientMessage(playerid, RED, "* Šiuo metu negalima.");
  1471.             return 1;
  1472.         }
  1473.        
  1474.         if(Klubai[i][clubShield] > gettime())
  1475.         {
  1476.             SendClientMessage(playerid, RED, "* Klubas šiuo metu vykdo atranką.");
  1477.             return 1;
  1478.         }
  1479.     }
  1480.  
  1481.     /*new memberCount = 0;
  1482.     foreach(new i : Player)
  1483.     {
  1484.         if(ClubDB[i][club] == cId)
  1485.         {
  1486.             memberCount++;
  1487.             printf("3. %d", memberCount);
  1488.         }
  1489.     }
  1490.    
  1491.     if(memberCount < 2) return SendClientMessage(playerid, RED, "* Puolamas klubas neturi 2 aktyvių klubiečių.");*/
  1492.    
  1493.     if(nearLabel)
  1494.     {
  1495.         new
  1496.             string[64];
  1497.            
  1498.         format(string, sizeof string, "Jūsų klubas užpuolė {db881a}„%s“", Klubai[cId][clubName]);
  1499.         SendClubMessage(clubid, YELLOW, string);
  1500.        
  1501.         foreach(new i : Player)
  1502.         {
  1503.             if(ClubDB[i][club] == clubid)
  1504.                 GameTextForPlayer(playerid,"~g~Jusu klubas uzpuole kita kluba", 000, 3);
  1505.         }
  1506.        
  1507.         format(string, sizeof string, "Jūsų klubą užpuolė {db881a}„%s“", Klubai[clubid][clubName]);
  1508.         SendClubMessage(cId, YELLOW, string);
  1509.        
  1510.         format(Klubai[clubid][attackDate], 24, GetHoursDate());
  1511.        
  1512.         Klubai[clubid][secondTimer] = SetTimerEx("ClubAttack", 1000, true, "iii", playerid, clubid, cId);
  1513.         Klubai[clubid][attackingClub] = cId;
  1514.         Klubai[clubid][underAttack] = -1;
  1515.        
  1516.         printf("1. %d", Klubai[clubid][underAttack]);
  1517.        
  1518.         Klubai[cId][clubAttackPrice] = 0;
  1519.         Klubai[cId][underAttack] = clubid;
  1520.     }
  1521.    
  1522.     return 1;
  1523. }
  1524. CMD:kpriimti(playerid, params[])
  1525. {
  1526.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1527.    
  1528.     new
  1529.         id,
  1530.         clubid,
  1531.         string[128]
  1532.     ;
  1533.    
  1534.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1535.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1536.    
  1537.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, RED, "* Priimti žaidėją į klubą: /kpriimti [vardo dalis]");
  1538.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "* Tokio žaidėjo nėra.");
  1539.     if(ClubDB[id][club] == clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas jau yra jūsų klube.");
  1540.     if(ClubDB[id][clubInvitation] == clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas jau yra gavęs pakvietimą.");
  1541.    
  1542.     ClubDB[id][clubInvitation] = clubid;
  1543.    
  1544.     SetTimerEx("ResetInvitation", 1000 * 60 * 5, false, "i", id);
  1545.    
  1546.     format(string, sizeof string, "* Pakvietete {FFA500}%s{34A936} įstoti į klubą.", Vardas(id));
  1547.     SendClientMessage(playerid, GREEN_CLUBS, string);
  1548.    
  1549.     format(string, sizeof string, "* Jūs kviečiamas įstoti į {FFA500}%s{34A936} klubą.", Klubai[clubid][clubName]);
  1550.     SendClientMessage(id, GREEN_CLUBS, string);
  1551.    
  1552.     return 1;
  1553. }
  1554. CMD:kismesti(playerid, params[])
  1555. {
  1556.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1557.  
  1558.     new
  1559.         id,
  1560.         clubid,
  1561.         string[128]
  1562.     ;
  1563.  
  1564.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1565.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1566.  
  1567.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, GREEN_CLUBS, "* Išmesti žaidėją iš klubo: /kismesti [vardo dalis]");
  1568.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "* Tokio žaidėjo nėra.");
  1569.     if(ClubDB[id][club] != clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas nėra jūsų klube.");
  1570.  
  1571.     ClearPlayerInfo(id);
  1572.  
  1573.     format(string, sizeof string, "* Išmetėtė {FFA500}%s{34A936} iš klubo.", Vardas(id));
  1574.     SendClientMessage(playerid, GREEN_CLUBS, string);
  1575.  
  1576.     SendClientMessage(id, GREEN_CLUBS, "* Jūs išmestas iš klubo.");
  1577.     SetPlayerSkin(id, 0);
  1578.     return 1;
  1579. }
  1580. CMD:kismestioff(playerid, params[])
  1581. {
  1582.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1583.  
  1584.     new
  1585.         clubid,
  1586.         query[110 + MAX_PLAYER_NAME],
  1587.         name[MAX_PLAYER_NAME]
  1588.     ;
  1589.  
  1590.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1591.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1592.  
  1593.     if(sscanf(params, "s[24]", name)) return SendClientMessage(playerid, GREEN_CLUBS, "* /kismestioff [Vardas_Pavardė]");
  1594.  
  1595.     mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_USERS"` WHERE `club` = %d", clubid);
  1596.     new Cache:result = mysql_query(connectionHandle, query);
  1597.    
  1598.     if(cache_get_row_count() != 0)
  1599.     {
  1600.         cache_get_field_content(0, "Name", name, connectionHandle, 24);
  1601.     } else return SendClientMessage(playerid, RED, "* Tokio žaidėjo nėra, arba jis nėra jūsų klubo narys.");
  1602.    
  1603.     if(GetPlayeridMid(name) != INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "* Šis žaidėjas šiuo metu prisijungęs.");
  1604.    
  1605.     mysql_format(connectionHandle, query, sizeof query, "UPDATE `"MYSQL_KLUBAI_USERS"` SET `club` = -1, `clubOwner` = -1, `clubCoOwner` = -1 WHERE `Name` = '%e'", name);
  1606.     mysql_tquery(connectionHandle, query);
  1607.    
  1608.     cache_delete(result);
  1609.     return 1;
  1610. }
  1611. CMD:kismestivisus(playerid, params[])
  1612. {
  1613.     if(ClubDB[playerid][clubOwner] == -1) return 0;
  1614.  
  1615.     new
  1616.         clubid,
  1617.         query[75]
  1618.     ;
  1619.  
  1620.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1621.    
  1622.     foreach(new i : Player)
  1623.     {
  1624.         if(i == playerid) continue;
  1625.         if(ClubDB[i][clubCoOwner] == clubid) continue;
  1626.        
  1627.         if(ClubDB[i][club] == clubid)
  1628.         {
  1629.             SendClientMessage(i, RED, "* Jūs buvote išmestas iš klubo.");
  1630.             ClearPlayerInfo(i);
  1631.         }
  1632.     }
  1633.    
  1634.     mysql_format(connectionHandle, query, sizeof query, "UPDATE `"MYSQL_KLUBAI_USERS"` SET `club` = -1 WHERE `club` = %d", clubid);
  1635.     mysql_query(connectionHandle, query);
  1636.    
  1637.     SendClientMessage(playerid, GREEN_CLUBS, "* Visi nariai išmesti iš klubo.");
  1638.    
  1639.     return 1;
  1640. }
  1641. CMD:nariai(playerid, params[])
  1642. {
  1643.     //Parodo prisijungusius klubo narius
  1644.     //SendClientMessage(playerid, orange, "1. Nick_Name | AFK");
  1645.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1646.  
  1647.     new
  1648.         clubid,
  1649.         string[32]
  1650.     ;
  1651.  
  1652.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1653.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1654.    
  1655.     foreach(new i : Player)
  1656.     {
  1657.         if(ClubDB[i][club] == clubid)
  1658.         {
  1659.             format(string, sizeof string, "%d. %s", i+1, Vardas(i));
  1660.             SendClientMessage(playerid, ORANGE_CLUBS, string);
  1661.         }
  1662.     }
  1663.     return 1;
  1664. }
  1665. CMD:visinariai(playerid, params[])
  1666. {
  1667.     //Parodo visus klubo narius
  1668.     //SendClientMessage(playerid, orange, "1. Nick_Name Prisijungė 2019-07-20 17:56");
  1669.     //Dialogas: TabListas: Nr. Vardas_Pavardė Paskutinis prisijungimas
  1670.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1671.  
  1672.     new
  1673.         clubid,
  1674.         query[110 + MAX_PLAYER_NAME],
  1675.         name[MAX_PLAYER_NAME],
  1676.         logindate[32],
  1677.         dialog[256]
  1678.     ;
  1679.  
  1680.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1681.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1682.  
  1683.     mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_USERS"` WHERE `club` = %d", clubid);
  1684.     new Cache:result = mysql_query(connectionHandle, query);
  1685.  
  1686.     if(cache_get_row_count() != 0)
  1687.     {
  1688.         strcat(dialog, "Nr.\tVardas_Pavardė\tPaskutinis prisijungimas\n");
  1689.  
  1690.         for(new i = 0; i < cache_get_row_count(); i++)
  1691.         {
  1692.             cache_get_field_content(i, "Name", name, connectionHandle, 24);
  1693.             cache_get_field_content(i, "loginDate", logindate, connectionHandle, 32);
  1694.            
  1695.             format(query, sizeof query, "%d. %s Prisijungė %s", i+1, name, logindate);
  1696.             SendClientMessage(playerid, ORANGE_CLUBS, query);
  1697.  
  1698.             format(query, sizeof query, "%d.\t%s\t%s\n", i+1, name, logindate);
  1699.             strcat(dialog, query);
  1700.         }
  1701.     }
  1702.     ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_TABLIST_HEADERS, "Visi nariai", dialog, "Gerai", "");
  1703.    
  1704.     cache_delete(result);
  1705.     return 1;
  1706. }
  1707. /*CMD:kismete(playerid, params[])
  1708. {
  1709.     //Parodo išmestus narius
  1710.     //reason(2019-07-20)(Robis_Nesas)
  1711.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1712.  
  1713.     new
  1714.         clubid
  1715.     ;
  1716.  
  1717.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1718.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1719.    
  1720.     return 1;
  1721. }*/
  1722. CMD:kpaliko(playerid, params[])
  1723. {
  1724.     //Parodo palikusius narius
  1725.     //Robis_Nesas(2019-07-20) gg
  1726.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1727.  
  1728.     new
  1729.         clubid,
  1730.         query[60],
  1731.         dialog[256],
  1732.         name[MAX_PLAYER_NAME],
  1733.         leftDate[12],
  1734.         leftReason[32]
  1735.     ;
  1736.  
  1737.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1738.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1739.    
  1740.     mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_LEFT"` WHERE `clubId` = %d", clubid);
  1741.     new Cache:result = mysql_query(connectionHandle, query);
  1742.    
  1743.     if(cache_get_row_count() != 0)
  1744.     {
  1745.         for(new i = 0; i < cache_get_row_count(); i++)
  1746.         {
  1747.             cache_get_field_content(0, "Name", name, connectionHandle, 24);
  1748.             cache_get_field_content(0, "Date", leftDate, connectionHandle, 12);
  1749.             cache_get_field_content(0, "Reason", leftReason, connectionHandle, 32);
  1750.            
  1751.             format(query, sizeof query, "%s(%s) %s\n", name, leftDate, leftReason);
  1752.             strcat(dialog, query);
  1753.         }
  1754.     } else strcat(dialog, "Nėra įrašų");
  1755.    
  1756.     ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Paliko klubą", dialog, "Gerai", "");
  1757.     cache_delete(result);
  1758.    
  1759.     return 1;
  1760. }
  1761. CMD:kvartai(playerid, params[])
  1762. {
  1763.     //Įjungia/išjungia klubo vartų darinėjimą
  1764.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1765.  
  1766.     new
  1767.         clubid
  1768.     ;
  1769.  
  1770.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1771.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1772.    
  1773.     if(Klubai[clubid][clubGatesLocked])
  1774.     {
  1775.         SendClientMessage(playerid, RED, "* Klubo vartai išjungti.");
  1776.         Klubai[clubid][clubGatesLocked] = false;
  1777.     }
  1778.     else
  1779.     {
  1780.         SendClientMessage(playerid, GREEN_CLUBS, "* Klubo vartai įjungti.");
  1781.         Klubai[clubid][clubGatesLocked] = true;
  1782.     }
  1783.    
  1784.     return 1;
  1785. }
  1786. CMD:k(playerid, params[])
  1787. {
  1788.     //*„%s“ klubo pavaduotojas Robis_Nasas:
  1789.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1790.    
  1791.  
  1792.     new
  1793.         clubid,
  1794.         message[128],
  1795.         ownerShip[13],
  1796.         string[200]
  1797.     ;
  1798.    
  1799.     if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, GREEN_CLUBS, "* /k [tekstas]");
  1800.    
  1801.     if(ClubDB[playerid][clubOwner] > -1)
  1802.     {
  1803.         clubid = ClubDB[playerid][clubOwner];
  1804.         format(ownerShip, sizeof ownerShip, "lyderis");
  1805.     }
  1806.     if(ClubDB[playerid][clubCoOwner] > -1)
  1807.     {
  1808.         clubid = ClubDB[playerid][clubCoOwner];
  1809.         format(ownerShip, sizeof ownerShip, "pavaduotojas");
  1810.     }
  1811.     if(Klubai[clubid][SkelbTim] > gettime()) return SendClientMessage(playerid, RAUDONA, "* Tik kas 30 sekundžių");
  1812.     format(string, sizeof string, "*„%s“ klubo %s %s: %s", Klubai[clubid][clubName], ownerShip, Vardas(playerid), message);
  1813.     SendClientMessageToAll(RED_CLUBS, string);
  1814.  
  1815.     Klubai[clubid][SkelbTim] = gettime() + 30;
  1816.    
  1817.     return 1;
  1818. }
  1819. CMD:kpavaduotojas(playerid, params[])
  1820. {
  1821.     //Skirti klubo pavaduotoją
  1822.     if(ClubDB[playerid][clubOwner] == -1) return 0;
  1823.  
  1824.     new
  1825.         clubid,
  1826.         id,
  1827.         string[60 + MAX_PLAYER_NAME]
  1828.     ;
  1829.  
  1830.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1831.    
  1832.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, RED, "* /kpavaduotojas [vardo dalis]");
  1833.    
  1834.     if(ClubDB[id][club] != clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas nėra jūsų klubo narys.");
  1835.     if(ClubDB[id][clubCoOwner] == clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas jau yra jūsų klubo pavaduotojas.");
  1836.     if(ClubDB[id][clubCoOwner] != -1 && ClubDB[id][clubCoOwner] != clubid) return SendClientMessage(playerid, RED, "* Žaidėjas kito klubo pavaduotojas. Jeigu jis nori jo atsisakyti, tegul parašo /katsisakyti");
  1837.    
  1838.     ClubDB[id][clubCoOwner] = clubid;
  1839.  
  1840.     new
  1841.         query[256]
  1842.     ;
  1843.  
  1844.     mysql_format(connectionHandle, query, sizeof query,
  1845.         "UPDATE `"MYSQL_KLUBAI"` SET \
  1846.         `clubCoOwner` = '%s' \
  1847.         WHERE `clubId` = '%d'",Vardas(id),clubid);
  1848.     mysql_tquery(connectionHandle, query);
  1849.  
  1850.  
  1851.     SendClientMessage(id, YELLOW, "* /klubas - visos klubo lyderio komandos");
  1852.     format(string, sizeof string, "* Sveikiname, jūs paskirtas naujuoju %s pavaduotoju.", Klubai[clubid][clubName]);
  1853.     SendClientMessage(id, GREEN_CLUBS, string);
  1854.  
  1855.     format(string, sizeof string, "* Paskyrėte %s[%d] naujuoju %s klubo pavaduotoju.", Vardas(id), id, Klubai[clubid][clubName]);
  1856.     SendClientMessage(playerid, ZYDRA, string);
  1857.  
  1858.     format(Klubai[clubid][clubCoOwner], 24, "%s", Vardas(id));
  1859.     SaveClubInfo(clubid);
  1860.  
  1861.     return 1;
  1862. }
  1863. CMD:kpremija(playerid, params[])
  1864. {
  1865.     //Išdalinti tam tikrą pinigų sumą (esantiems šalia)
  1866.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1867.  
  1868.     new
  1869.         clubid,
  1870.         amount
  1871.     ;
  1872.  
  1873.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1874.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1875.    
  1876.     if(sscanf(params, "i", amount)) return SendClientMessage(playerid, ZYDRA, "* Išdalinti premiją esantiems šalia: /kpremija [suma]");
  1877.     if(amount < 1 || amount > 999999999) return SendClientMessage(playerid, RED, "* Bloga suma.");
  1878.     if(amount > GetPlayerMoneyA(playerid)) return SendClientMessage(playerid, RED, "* Neturite tiek pinigų.");
  1879.     if(amount < 1000) return SendClientMessage(playerid, RED, "* Dalinate per mažą sumą.");
  1880.  
  1881.     new
  1882.         count,
  1883.         Float:pposX,
  1884.         Float:pposY,
  1885.         Float:pposZ,
  1886.         string[64],
  1887.         string2[64]
  1888.     ;
  1889.    
  1890.     GetPlayerPos(playerid, pposX, pposY, pposZ);
  1891.    
  1892.     foreach(new i : Player)
  1893.     {
  1894.         if(i == playerid) continue;
  1895.  
  1896.         if(ClubDB[i][club] == clubid)
  1897.         {
  1898.             if(IsPlayerInRangeOfPoint(i, 15, pposX, pposY, pposZ))
  1899.             {
  1900.                 count++;
  1901.             }
  1902.         }
  1903.     }
  1904.     if(count < 1) return SendClientMessage(playerid, RED, "* Prie jūsų nėra klubo narių.");
  1905.  
  1906.     if(amount % count == 0)
  1907.     {
  1908.         format(string, sizeof string, "***Gavote {db881a}%s{33ccff} iš {db881a}klubo lyderio", AddPoints(amount / count));
  1909.  
  1910.         foreach(new i : Player)
  1911.         {
  1912.             if(ClubDB[i][club] == clubid)
  1913.             {
  1914.                 if(IsPlayerInRangeOfPoint(i, 15, pposX, pposY, pposZ))
  1915.                 {
  1916.                     if(i != playerid)
  1917.                     {
  1918.                         GivePlayerMoneyA(i, amount / count);
  1919.                         SendClientMessage(i, ZYDRA, string);
  1920.                     }
  1921.                     format(string2, sizeof string2, "***Davėte {db881a}%s{33ccff} € {db881a}%s", AddPoints(amount / count), Vardas(i));
  1922.                     SendClientMessage(playerid, ZYDRA, string2);
  1923.                 }
  1924.             }
  1925.         }
  1926.         GivePlayerMoneyA(playerid, -amount);
  1927.     }
  1928.     else
  1929.     {
  1930.         amount -= (amount % count);
  1931.        
  1932.         format(string, sizeof string, "***Gavote {db881a}%s{33ccff} iš {db881a}klubo lyderio", AddPoints(amount / count));
  1933.  
  1934.         foreach(new i : Player)
  1935.         {
  1936.             if(ClubDB[i][club] == clubid)
  1937.             {
  1938.                 if(IsPlayerInRangeOfPoint(i, 15, pposX, pposY, pposZ))
  1939.                 {
  1940.                     if(i != playerid)
  1941.                     {
  1942.                         GivePlayerMoneyA(i, amount / count);
  1943.                         SendClientMessage(i, ZYDRA, string);
  1944.                     }
  1945.                     format(string2, sizeof string2, "***Davėte {db881a}%s{33ccff} € {db881a}%s", AddPoints(amount / count), Vardas(i));
  1946.                     SendClientMessage(playerid, ZYDRA, string2);
  1947.                 }
  1948.             }
  1949.         }
  1950.  
  1951.         GivePlayerMoneyA(playerid, -amount);
  1952.     }
  1953.     return 1;
  1954. }
  1955.  
  1956. CMD:kpremijav(playerid, params[])
  1957. {
  1958.     //Išdalinti tam tikrą pinigų sumą (visiems prisijungusiems klubo nariams)
  1959.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  1960.  
  1961.     new
  1962.         clubid,
  1963.         amount,
  1964.         count,
  1965.         string[64],
  1966.         string2[64]
  1967.     ;
  1968.  
  1969.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  1970.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  1971.    
  1972.     if(sscanf(params, "i", amount)) return SendClientMessage(playerid, ZYDRA, "* Išdalinti premiją prisijungusiems žaidėjams: /kpremijav [suma]");
  1973.     if(amount < 1 || amount > 999999999) return SendClientMessage(playerid, RED, "* Bloga suma.");
  1974.     if(amount > GetPlayerMoneyA(playerid)) return SendClientMessage(playerid, RED, "* Neturite tiek pinigų.");
  1975.     if(amount < 1000) return SendClientMessage(playerid, RED, "* Dalinate per mažą sumą.");
  1976.    
  1977.     foreach(new i : Player)
  1978.     {
  1979.         if(i == playerid) continue;
  1980.  
  1981.         if(ClubDB[i][club] == clubid)
  1982.         {
  1983.             count++;
  1984.         }
  1985.     }
  1986.     if(count < 1) return SendClientMessage(playerid, RED, "* Prie jūsų nėra klubo narių.");
  1987.    
  1988.     if(amount % count == 0)
  1989.     {
  1990.         format(string, sizeof string, "***Gavote {db881a}%s{33ccff} iš {db881a}klubo lyderio", AddPoints(amount / count));
  1991.  
  1992.         foreach(new i : Player)
  1993.         {
  1994.             if(ClubDB[i][club] == clubid)
  1995.             {
  1996.                 if(i != playerid)
  1997.                 {
  1998.                     GivePlayerMoneyA(i, amount / count);
  1999.                     SendClientMessage(i, ZYDRA, string);
  2000.                 }
  2001.                 format(string2, sizeof string2, "***Davėte {db881a}%s{33ccff} € {db881a}%s", AddPoints(amount / count), Vardas(i));
  2002.                 SendClientMessage(playerid, ZYDRA, string2);
  2003.             }
  2004.         }
  2005.         GivePlayerMoneyA(playerid, -amount);
  2006.     }
  2007.     else
  2008.     {
  2009.         amount -= (amount % count);
  2010.  
  2011.         format(string, sizeof string, "***Gavote {db881a}%s{33ccff} iš {db881a}klubo lyderio", AddPoints(amount / count));
  2012.  
  2013.         foreach(new i : Player)
  2014.         {
  2015.             if(ClubDB[i][club] == clubid)
  2016.             {
  2017.                 if(i != playerid)
  2018.                 {
  2019.                     GivePlayerMoneyA(i, amount / count);
  2020.                     SendClientMessage(i, ZYDRA, string);
  2021.                 }
  2022.                 format(string2, sizeof string2, "***Davėte {db881a}%s{33ccff} € {db881a}%s", AddPoints(amount / count), Vardas(i));
  2023.                 SendClientMessage(playerid, ZYDRA, string2);
  2024.             }
  2025.         }
  2026.         GivePlayerMoneyA(playerid, -amount);
  2027.     }
  2028.     return 1;
  2029. }
  2030. CMD:kfondas(playerid, params[])
  2031. {
  2032.     //klubo fondo komandos
  2033.     //*** Klubo fonde yra {db881a}0 €
  2034.     if(ClubDB[playerid][club] == -1) return 0;
  2035.  
  2036.     new
  2037.         clubid,
  2038.         string[41 + 11]
  2039.     ;
  2040.  
  2041.     clubid = ClubDB[playerid][club];
  2042.  
  2043.     format(string, sizeof string, "*** Klubo fonde yra {db881a}%s{33ccff} €", AddPoints(Klubai[clubid][clubMoney]));
  2044.     SendClientMessage(playerid, ZYDRA, string);
  2045.  
  2046.     return 1;
  2047. }
  2048. CMD:kisimti(playerid, params[])
  2049. {
  2050.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  2051.  
  2052.     new
  2053.         clubid,
  2054.         amount,
  2055.         string[49 + 13]
  2056.     ;
  2057.  
  2058.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  2059.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  2060.    
  2061.     if(sscanf(params, "d", amount)) return SendClientMessage(playerid, RED, "* /kisimti [suma]");
  2062.     if(amount < 1 || amount > 999999999) return SendClientMessage(playerid, RED, "* Blogai įvesta suma.");
  2063.     if(amount > Klubai[clubid][clubMoney]) return SendClientMessage(playerid, RED, "* Klubo fonde tiek pinigų nėra.");
  2064.  
  2065.     GivePlayerMoneyA(playerid, amount);
  2066.     Klubai[clubid][clubMoney] -= amount;
  2067.    
  2068.     format(string, sizeof string, "*** Pasiėmėte {db881a}%s{33ccff} € iš klubo fondo", AddPoints(amount));
  2069.     SendClientMessage(playerid, ZYDRA, string);
  2070.  
  2071.     SaveClubInfo(clubid);
  2072.     return 1;
  2073. }
  2074. CMD:kideti(playerid, params[])
  2075. {
  2076.     if(ClubDB[playerid][club] == -1) return 0;
  2077.  
  2078.     new
  2079.         clubid = ClubDB[playerid][club],
  2080.         amount,
  2081.         string[80]
  2082.     ;
  2083.    
  2084.     if(sscanf(params, "i", amount)) return SendClientMessage(playerid, RED, "* /kideti [suma]");
  2085.  
  2086.     if(GetPlayerMoneyA(playerid) < amount) return SendClientMessage(playerid, RED, "* Neturite tiek pinigų.");
  2087.     if(amount < 1 || amount > 999999999) return SendClientMessage(playerid, RED, "* Blogai įvesta suma.");
  2088.    
  2089.     GivePlayerMoneyA(playerid, -amount);
  2090.     Klubai[clubid][clubMoney] += amount;
  2091.    
  2092.     format(string, sizeof string, "*** Įdėjote {db881a}%s{33ccff} € į klubo fondą.", AddPoints(amount));
  2093.     SendClientMessage(playerid, ZYDRA, string);
  2094.    
  2095.     foreach(new i : Player)
  2096.     {
  2097.         if(i == playerid) continue;
  2098.        
  2099.         if(ClubDB[i][club] == clubid)
  2100.         {
  2101.             SendClientMessage(i, ZYDRA, string);
  2102.         }
  2103.     }
  2104.    
  2105.     SaveClubInfo(clubid);
  2106.    
  2107.     return 1;
  2108. }
  2109. CMD:kinfo(playerid, params[])
  2110. {
  2111.     //galimybė sužinoti klubo galiojimą, keisti skin, mašinas
  2112.    
  2113.     //Klubo pavadinimas: „Rinktinė“ (/kpavadinimas | 200kr | 12.000.000€)
  2114.     //Klubo vyro išvaizda: 208 (/kvskin | 100kr. | 6.000.000€)
  2115.     //Klubo moters išvaizda: 85 (/kmskin | 100kr. | 6.000.000€)
  2116.     //Mašinų spalva: 6 (/kspalva | 100kr. | 6.000.000€)
  2117.     //Sąjunga: „Rinktinė“ (/ksajunga | /kpsajunga (panaikinti))
  2118.     //Fonde: -2763€ (/kisimti | /kideti)
  2119.     //Galioja: 6 (/kpratesti | 1000kr. | 60.000.000€)
  2120.     //Neleisti užimti klubo 15min. (/katranka)
  2121.     if(ClubDB[playerid][clubOwner] == -1) return 0;
  2122.  
  2123.     new
  2124.         clubid,
  2125.         string[128],
  2126.         dialog[512]
  2127.     ;
  2128.  
  2129.     //21e790
  2130.  
  2131.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  2132.  
  2133.     format(string, sizeof string, "{1ab873}Klubo pavadinimas: {ffffff}„%s“ (/kpavadinimas | 100kr | 1.000.000€)\n", Klubai[clubid][clubName]);
  2134.     strcat(dialog, string);
  2135.     format(string, sizeof string, "{1ab873}Klubo vyro išvaizda: {ffffff}%d (/kvskin | 100kr. | 1.000.000€)\n", Klubai[clubid][clubMenSkin]);
  2136.     strcat(dialog, string);
  2137.     format(string, sizeof string, "{1ab873}Klubo moters išvaizda: {ffffff}%d (/kmskin | 100kr. | 1.000.000€)\n", Klubai[clubid][clubWomenSkin]);
  2138.     strcat(dialog, string);
  2139.     format(string, sizeof string, "{1ab873}Mašinų spalva: {ffffff}%d (/kspalva | 100kr. | 1.000.000€)\n", Klubai[clubid][clubCarColor]);
  2140.     strcat(dialog, string);
  2141.     /*format(string, 72, "{21e790}Mašinų spalva: %d (/kspalva | 100kr. | 6.000.000€)\n", Klubai[clubid][clubCarColor]);
  2142.     strcat(string, string);*/
  2143.     format(string, sizeof string, "{1ab873}Fonde: {ffffff}%d€ (/kisimti | /kideti)\n", Klubai[clubid][clubMoney]);
  2144.     strcat(dialog, string);
  2145.     new galiojimas = (Klubai[clubid][clubLast] - gettime()) / 86400;
  2146.     format(string, sizeof string, "{1ab873}Galioja: {ffffff}%d (/kpratesti | %dkr. | %s€)\n", galiojimas, Klubai[clubid][clubPriceCredits], AddPoints(Klubai[clubid][clubPriceMoney]));
  2147.     strcat(dialog, string);
  2148.     format(string, sizeof string, "{1ab873}Neleisti užimti klubo 15min. {ffffff}(/katranka)", galiojimas);
  2149.     strcat(dialog, string);
  2150.  
  2151.     ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Klubo komandos", dialog, "Gerai", "");
  2152.  
  2153.     return 1;
  2154. }
  2155. CMD:kpavadinimas(playerid)
  2156. {
  2157.     if(ClubDB[playerid][clubOwner] == -1) return 0;
  2158.  
  2159.     ShowPlayerDialog(playerid, DIALOG_KLUBAS_NAME, DIALOG_STYLE_LIST, "Klubo pavadinimas", "\n \nUž kreditus\nUž pinigus", "Toliau", "Atšaukti");
  2160.  
  2161.     return 1;
  2162. }
  2163. CMD:kvskin(playerid)
  2164. {
  2165.     if(ClubDB[playerid][clubOwner] == -1) return 0;
  2166.  
  2167.     ShowPlayerDialog(playerid, DIALOG_KLUBAS_VSKIN, DIALOG_STYLE_LIST, "Klubo skin", "\n \nUž kreditus\nUž pinigus", "Toliau", "Atšaukti");
  2168.  
  2169.     return 1;
  2170. }
  2171. CMD:kmskin(playerid)
  2172. {
  2173.     if(ClubDB[playerid][clubOwner] == -1) return 0;
  2174.  
  2175.     ShowPlayerDialog(playerid, DIALOG_KLUBAS_MSKIN, DIALOG_STYLE_LIST, "Klubo moters skin", "\n \nUž kreditus\nUž pinigus", "Toliau", "Atšaukti");
  2176.  
  2177.     return 1;
  2178. }
  2179. CMD:kspalva(playerid)
  2180. {
  2181.     if(ClubDB[playerid][clubOwner] == -1) return 0;
  2182.  
  2183.     ShowPlayerDialog(playerid, DIALOG_KLUBAS_CARCOLOR, DIALOG_STYLE_LIST, "Klubo mašinos spalva", "\n \nUž kreditus\nUž pinigus", "Toliau", "Atšaukti");
  2184.  
  2185.     return 1;
  2186. }
  2187. CMD:kpratesti(playerid)
  2188. {
  2189.     if(ClubDB[playerid][clubOwner] == -1) return 0;
  2190.  
  2191.     ShowPlayerDialog(playerid, DIALOG_KLUBAS_RENT, DIALOG_STYLE_LIST, "Klubo pratęsimas", "\n \nKlubo pratęsimas už kreditus\nKlubo pratęsimas už pinigus", "Pirkti", "Atšaukti");
  2192.  
  2193.     return 1;
  2194. }
  2195. CMD:katranka(playerid)
  2196. {
  2197.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  2198.  
  2199.     new
  2200.         clubid
  2201.     ;
  2202.  
  2203.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  2204.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  2205.     if(Klubai[clubid][clubShield] > gettime()) return SendClientMessage(playerid, RED, "* Jūs jau esate pradėjęs atranką.");
  2206.  
  2207.     Klubai[clubid][clubShield] = gettime() + 900;
  2208.     SendClientMessage(playerid, GREEN_CLUBS, "* Jūsų klubo negalės užpulti 15 minučių.");
  2209.    
  2210.     return 1;
  2211. }
  2212. CMD:krespawn(playerid, params[])
  2213. {
  2214.     //atsatato nenaudojamas tr. priemones
  2215.     if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
  2216.  
  2217.     new
  2218.         clubid
  2219.     ;
  2220.  
  2221.     if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
  2222.     if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
  2223.    
  2224.     for(new i = 0, j = GetVehiclePoolSize(); i < j; i++)
  2225.     {
  2226.         if(IsPlayersInVehicle(i)) continue;
  2227.         if(VehicleDB[i][vehicleClub] == clubid)
  2228.             SetVehicleToRespawn(i);
  2229.     }
  2230.    
  2231.     SendClientMessage(playerid, GREEN_CLUBS, "* Atsatėtė klubo transportą.");
  2232.     return 1;
  2233. }
  2234.  
  2235. ///
  2236. stock ClearPlayerInfo(playerid)
  2237. {
  2238.     ClubDB[playerid][clubOwner] = -1;
  2239.     ClubDB[playerid][clubCoOwner] = -1;
  2240.     ClubDB[playerid][club] = -1;
  2241.     ClubDB[playerid][clubInvitation] = -1;
  2242. }
  2243.  
  2244. stock GetKDirektoriusName(cId)
  2245. {
  2246.     new query[64], name[28];
  2247.    
  2248.     mysql_format(connectionHandle, query, sizeof query, "SELECT `clubOwner` FROM `"MYSQL_KLUBAI"` WHERE `clubId` = %d", cId);
  2249.     new Cache:result = mysql_query(connectionHandle, query);
  2250.  
  2251.     if(cache_get_row_count() == 1)
  2252.     {
  2253.         cache_get_field_content(0, "clubOwner", name, connectionHandle, 24);
  2254.     }
  2255.     cache_delete(result);
  2256.  
  2257.     if(GetPlayeridMid(name) != INVALID_PLAYER_ID) format(name, sizeof name, "{00FF00}%s", name);
  2258.     else format(name, sizeof(name), "{FF0000}%s", name);
  2259.     return name;
  2260. }
  2261.  
  2262. stock GetKPavaduotojasName(cId)
  2263. {
  2264.     new query[64], name[28];
  2265.    
  2266.     mysql_format(connectionHandle, query, sizeof query, "SELECT `clubCoOwner` FROM `"MYSQL_KLUBAI"` WHERE `clubId` = %d", cId);
  2267.     new Cache:result = mysql_query(connectionHandle, query);
  2268.  
  2269.     if(cache_get_row_count() == 1)
  2270.     {
  2271.         cache_get_field_content(0, "clubCoOwner", name, connectionHandle, 24);
  2272.     }
  2273.     cache_delete(result);
  2274.  
  2275.     if(GetPlayeridMid(name) != INVALID_PLAYER_ID) format(name, sizeof name, "{00FF00}%s", name);
  2276.     else format(name, sizeof(name), "{FF0000}%s", name);
  2277.     return name;
  2278. }
  2279.  
  2280. stock SaveClubInfo(cId)
  2281. {
  2282.     new
  2283.         query[256]
  2284.     ;
  2285.  
  2286.     mysql_format(connectionHandle, query, sizeof query,
  2287.         "UPDATE `"MYSQL_KLUBAI"` SET \
  2288.         `clubName` = '%s', \
  2289.         `clubOwner` = '%s', \
  2290.         `clubLast` = '%i', \
  2291.         `clubCarColor` = '%i', \
  2292.         `clubMenSkin` = '%i', \
  2293.         `clubWomenSkin` = '%i', \
  2294.         `clubMoney` = '%i' \
  2295.         WHERE `clubId` = '%d'",
  2296.         Klubai[cId][clubName],
  2297.         Klubai[cId][clubOwner],
  2298.         Klubai[cId][clubLast],
  2299.         Klubai[cId][clubCarColor],
  2300.         Klubai[cId][clubMenSkin],
  2301.         Klubai[cId][clubWomenSkin],
  2302.         Klubai[cId][clubMoney],
  2303.         cId
  2304.     );
  2305.     mysql_tquery(connectionHandle, query);
  2306.    
  2307.     return 1;
  2308. }
  2309.  
  2310. stock ResetClubData(cId)
  2311. {
  2312.     mysql_tquery(connectionHandle,
  2313.         "UPDATE `"MYSQL_KLUBAI_USERS"` SET `clubOwner` = -1, `clubCoOwner` = -1, `club` = -1 WHERE `club` = %d", "", "d", cId);
  2314.  
  2315.     foreach(new i : Player)
  2316.     {
  2317.         if(ClubDB[i][clubOwner] == cId || ClubDB[i][clubCoOwner] == cId || ClubDB[i][club] == cId)
  2318.         {
  2319.             ClubDB[i][clubOwner] = -1;
  2320.             ClubDB[i][clubCoOwner] = -1;
  2321.             ClubDB[i][club] = -1;
  2322.         }
  2323.     }
  2324.  
  2325.     format(Klubai[cId][clubOwner], 24, "");
  2326.     format(Klubai[cId][clubCoOwner], 24, "");
  2327.  
  2328.     Klubai[cId][clubLast] = 0;
  2329.    
  2330.     SaveClubInfo(cId);
  2331. }
  2332.  
  2333. stock CreateClubVehicle(modelid, Float:x, Float:y, Float:z, Float:r, color1, cId)
  2334. {
  2335.     new vehicleid;
  2336.     vehicleid = AddStaticVehicleEx(modelid, x, y, z, r, color1, color1, 900, 0);
  2337.    
  2338.     format(VehicleDB[vehicleid][LastDriverName],24,"Nėra");
  2339.     VehicleDB[vehicleid][VehicleEngineState] = 0;
  2340.     VehicleDB[vehicleid][VehicleLights] = 0;
  2341.     VehicleDB[vehicleid][VRibotuvas] = 0;
  2342.     VehicleDB[vehicleid][VehicleDedicatedForEvent] = 0;
  2343.     VehicleDB[vehicleid][TURGUS] = 0;
  2344.     VehicleDB[vehicleid][Rida] = 0;
  2345.     VehicleDB[vehicleid][Bendzinas] = DegaluTalpa[modelid-400];
  2346.     VehicleDB[vehicleid][Dujos] = 0;
  2347.     VehicleDB[vehicleid][FuelType] = 0;
  2348.     VehicleDB[vehicleid][VMMasina] = 0;
  2349.     VehicleDB[vehicleid][DARBOMASINA] = false;
  2350.     VehicleDB[vehicleid][DARBOID] = 0;
  2351.     VehicleDB[vehicleid][VehicleOwnerID] = -1;
  2352.     format(VehicleDB[vehicleid][VehicleNumbers],8,"Nėra");
  2353.     VehicleDB[vehicleid][VehicleNumReg] = 0;
  2354.     VehicleDB[vehicleid][VehicleColor1] = 0;
  2355.     VehicleDB[vehicleid][VehicleColor2] = 0;
  2356.     VehicleDB[vehicleid][VehicleDatabaseID] = -1;
  2357.     VehicleDB[vehicleid][VehicleWithOwner] = false;
  2358.     VehicleDB[vehicleid][VehicleLocked] = true;
  2359.     VehicleDB[vehicleid][VehicleSuSignalizacija] = false;
  2360.     VehicleDB[vehicleid][VehicleAlarmStatus] = false;
  2361.     VehicleDB[vehicleid][VehicleDauztumas] = 0;
  2362.     VehicleDB[vehicleid][DujuIranga] = 0;
  2363.     VehicleDB[vehicleid][AdminMasina] = false;
  2364.     VehicleDB[vehicleid][VIPMasina] = false;
  2365.     VehicleDB[vehicleid][vehicleClub] = cId;
  2366.    
  2367.     return vehicleid;
  2368. }
  2369.  
  2370. stock SendClubMessage(cId, color, text[])
  2371. {
  2372.     foreach(new i : Player)
  2373.     {
  2374.         if(ClubDB[i][club] == cId)
  2375.         {
  2376.             SendClientMessage(i, color, text);
  2377.         }
  2378.     }
  2379. }
  2380.  
  2381. stock SavePlayerClubData(playerid)
  2382. {
  2383.     new
  2384.         query[150 + MAX_PLAYER_NAME]
  2385.     ;
  2386.  
  2387.     mysql_format(connectionHandle, query, sizeof query,
  2388.         "UPDATE `"MYSQL_KLUBAI_USERS"` SET \
  2389.         `clubOwner` = %i, \
  2390.         `clubCoOwner` = %i, \
  2391.         `club` = %i, \
  2392.         `clubXP` = %i \
  2393.         WHERE `Name` = '%e'",
  2394.         ClubDB[playerid][clubOwner],
  2395.         ClubDB[playerid][clubCoOwner],
  2396.         ClubDB[playerid][club],
  2397.         ClubDB[playerid][clubXP],
  2398.         Vardas(playerid)
  2399.     );
  2400.     mysql_tquery(connectionHandle, query);
  2401.     return 1;
  2402. }
  2403.  
  2404. ResetClubAttack()
  2405. {
  2406.     for(new i = 0; i < MAX_CLUBS; i++)
  2407.     {
  2408.         KillTimer(Klubai[i][secondTimer]);
  2409.        
  2410.         Klubai[i][stolenMoney] = 0;
  2411.         Klubai[i][underAttack] = -1;
  2412.         Klubai[i][attackingClub] = -1;
  2413.         format(Klubai[i][attackDate], 24, "");
  2414.         Klubai[i][clubAttackPrice] = 0;
  2415.        
  2416.         Klubai[i][attackTime] = 0;
  2417.         Klubai[i][attackTimeMinutes] = 0;
  2418.         Klubai[i][attackTimeHours] = 0;
  2419.        
  2420.         UpdateDynamic3DTextLabelText(Klubai[i][clubAttackLabel], GRAY,
  2421.             "Klubo užėmimas\n{db881a}/kuzimti{b4b5b7}\n \n \n \nGaunamas XP kol matoma ši žinutė");
  2422.            
  2423.         SaveClubInfo(i);
  2424.     }
  2425.     counter = 10;
  2426.     ClubOnAttack = false;
  2427.     return 1;
  2428. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement