Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -------------------------------------
- [#] KLUBŲ SISTEMA [#]
- [#] Autorius: mariusqw [#]
- [#] Discord: Jukyli#1107 [#]
- -------------------------------------
- MYSQL_KLUBAI Klubų lentelės pavadinimas.
- -------------------------------------
- */
- #include <YSI\y_hooks>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 100
- #define MAX_CLUBS 2
- #define MONEY_PER_SECOND 10
- #define MAX_ISPIRKA 1000000
- #define MIN_ISPIRKA 100000
- #define MIN_ISPIRKA_A "100000"
- #define MAX_ISPIRKA_A "1000000"
- #define CLUB_SERVICE_CREDITS 100
- #define CLUB_SERVICE_MONEY 1000000
- #define PLAYER_CLOTHES_CLUB 3
- #define DIALOG_NONE 0
- #define DIALOG_KLUBAS_PIRKTI 243
- #define DIALOG_KLUBAS_PIRKTI_1 244
- #define DIALOG_CLUB_ISPIRKA 245
- #define DIALOG_CLUB_ISPIRKA_CHANGE 246
- #define DIALOG_CLUB_ISPIRKA_PAY 247
- #define DIALOG_KLUBAS_NAME 248
- #define DIALOG_KLUBAS_NAME_1 249
- #define DIALOG_KLUBAS_VSKIN 250
- #define DIALOG_KLUBAS_VSKIN_1 251
- #define DIALOG_KLUBAS_MSKIN 252
- #define DIALOG_KLUBAS_MSKIN_1 253
- #define DIALOG_KLUBAS_CARCOLOR 254
- #define DIALOG_KLUBAS_CARCOLOR_1 255
- #define DIALOG_KLUBAS_RENT 256
- #define DIALOG_KLUBAS_RENT_1 257
- #define RED 0xFF0000FF
- #define YELLOW 0xFFFF00AA
- #define GRAY 0xb4b5b7FF
- #define ZYDRA 0x33ccffFF
- #define ORANGE_CLUBS 0xdb881aFF //db881a
- #define GREEN_CLUBS 0x34A936FF
- #define RED_CLUBS 0xbe5441FF //be5441
- #define AQUA_CLUBS 0x36c9baFF //36c9ba
- #define MYSQL_KLUBAI "Klubai"
- #define MYSQL_KLUBAI_CARS "KlubaiCars"
- #define MYSQL_KLUBAI_USERS "KlubaiUsers"
- #define MYSQL_KLUBAI_LEFT "KlubaiPaliko"
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- #if !defined isnull
- #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
- #endif
- enum K_DATA
- {
- clubId,
- clubName[32],
- clubOwner[24],
- clubCoOwner[24],
- Float:posX,
- Float:posY,
- Float:posZ,
- clubLast,
- clubPriceCredits,
- clubPriceMoney,
- clubJoinPickup,
- Text3D:clubJoinLabel,
- clubCarColor,
- clubMenSkin,
- clubWomenSkin,
- Masinos[14],
- Float:car560_1[4],
- Float:car560_2[4],
- Float:car560_3[4],
- Float:car560_4[4],
- Float:car522_1[4],
- Float:car522_2[4],
- Float:car522_3[4],
- Float:car522_4[4],
- Float:car522_5[4],
- Float:car522_6[4],
- Float:car522_7[4],
- Float:car522_8[4],
- Float:car508[4],
- clubGates[2],
- Float:clubGatesPosZ,
- clubGatesState,
- clubMoney,
- bool:clubGatesLocked,
- Float:uzimtiX,
- Float:uzimtiY,
- Float:uzimtiZ,
- Text3D:clubAttackLabel,
- secondTimer,
- stolenMoney,
- attackTime,
- attackTimeMinutes,
- attackTimeHours,
- underAttack,
- attackingClub,
- attackDelay,
- attackDate[24],
- clubAttackPrice,
- SkelbTim,
- clubShield,
- bool:UzkrautosMasinos
- };
- new Klubai[MAX_CLUBS][K_DATA];
- enum P_DATA
- {
- clubOwner,
- clubCoOwner,
- club,
- clubInvitation,
- clubXP,
- loginDate[32]
- }
- new ClubDB[MAX_PLAYERS][P_DATA];
- #define MAX_SKINS sizeof bannedSkins
- new bannedSkins[] = {
- 165,
- 166,
- 280,
- 281,
- 282,
- 283,
- 284,
- 285,
- 286,
- 287,
- 288,
- 300,
- 301,
- 302,
- 306,
- 307,
- 309,
- 310,
- 311,
- 277,
- 278,
- 279,
- 274,
- 275,
- 276,
- 308,
- 163,
- 164,
- 0
- };
- new
- LastVehicle[MAX_PLAYERS] = INVALID_VEHICLE_ID,
- counter = 10,
- xpCounter,
- bool:ClubOnAttack = false;
- hook OnGameModeInit()
- {
- SetTimer("CheckClub", 60000 * 10, true);
- LoadObjects();
- printf("[KLUBAI] Klubu sistema - mariusqw");
- mysql_tquery(connectionHandle, "SELECT * FROM `"MYSQL_KLUBAI"`;", "OnLoadClubs");
- mysql_tquery(connectionHandle, "SELECT * FROM `"MYSQL_KLUBAI_CARS"`;", "OnLoadClubCars");
- return 1;
- }
- hook OnGameModeExit()
- {
- for(new x = 0; x < MAX_CLUBS; x++)
- SaveClubInfo(x);
- return 1;
- }
- hook OnPlayerConnect(playerid)
- {
- ClearPlayerInfo(playerid);
- RemoveObjects(playerid);
- return 1;
- }
- hook OnPlayerSpawn(playerid)
- {
- new
- query[86];
- if(PlayerDB[playerid][Loaded] == 0)
- {
- mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_USERS"` WHERE `Name` = '%e'", Vardas(playerid));
- mysql_tquery(connectionHandle, query, "OnLoadUserClubData", "d", playerid);
- }
- return 1;
- }
- hook OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(ispassenger == 1)
- {
- if(VehicleDB[vehicleid][vehicleClub] != -1 && GetVehicleModel(vehicleid) == 508)
- {
- SetPlayerInterior(playerid, 2);
- SetPlayerVirtualWorld(playerid, vehicleid + 1);
- SetPlayerPos(playerid, 267.2381, 304.8850, 999.148437);
- LastVehicle[playerid] = vehicleid;
- }
- }
- return 1;
- }
- hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PRESSED(KEY_SECONDARY_ATTACK) && GetPlayerInterior(playerid) == 2)
- {
- new Float:vehx, Float:vehy, Float:vehz;
- GetVehiclePos(LastVehicle[playerid], vehx, vehy, vehz);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, vehx + 1, vehy, vehz + 1);
- LastVehicle[playerid] = INVALID_PLAYER_ID;
- }
- if(PRESSED(KEY_HANDBRAKE) || PRESSED(KEY_CTRL_BACK))
- {
- new
- Float:ObjPosX,
- Float:ObjPosY,
- Float:ObjPosZ,
- cId = -1
- ;
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- GetDynamicObjectPos(Klubai[i][clubGates][0], ObjPosX, ObjPosY, ObjPosZ);
- if(IsPlayerInRangeOfPoint(playerid, 10.0, ObjPosX, ObjPosY, ObjPosZ))
- {
- cId = i;
- break;
- }
- }
- if(cId != -1 && ClubDB[playerid][club] == cId || cId != -1 && ClubDB[playerid][clubInvitation] == cId)
- {
- if(Klubai[cId][clubGatesLocked] && ClubDB[playerid][clubOwner] == cId)
- {
- } else return 0;
- if(Klubai[cId][clubGatesState] == 1)
- {
- MoveDynamicObject(Klubai[cId][clubGates][0], ObjPosX, ObjPosY, Klubai[cId][clubGatesPosZ] - 7, 4);
- if(IsValidDynamicObject(Klubai[cId][clubGates][1]))
- {
- new
- Float:ObjPosX1,
- Float:ObjPosY1,
- Float:ObjPosZ1
- ;
- GetDynamicObjectPos(Klubai[cId][clubGates][1], ObjPosX1, ObjPosY1, ObjPosZ1);
- MoveDynamicObject(Klubai[cId][clubGates][1], ObjPosX1, ObjPosY1, Klubai[cId][clubGatesPosZ] - 7, 4);
- }
- Klubai[cId][clubGatesState] = 0;
- GameTextForPlayer(playerid,"~g~Atidaroma", 1000, 3);
- }
- else
- {
- MoveDynamicObject(Klubai[cId][clubGates][0], ObjPosX, ObjPosY, Klubai[cId][clubGatesPosZ], 4);
- if(IsValidDynamicObject(Klubai[cId][clubGates][1]))
- {
- new
- Float:ObjPosX1,
- Float:ObjPosY1,
- Float:ObjPosZ1
- ;
- GetDynamicObjectPos(Klubai[cId][clubGates][1], ObjPosX1, ObjPosY1, ObjPosZ1);
- MoveDynamicObject(Klubai[cId][clubGates][1], ObjPosX1, ObjPosY1, Klubai[cId][clubGatesPosZ], 4);
- }
- Klubai[cId][clubGatesState] = 1;
- GameTextForPlayer(playerid,"~r~Uzdaroma", 1000, 3);
- }
- }
- }
- return 1;
- }
- hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new
- inputdialogtext[1000];
- format(inputdialogtext, sizeof inputdialogtext, "%s", inputtext);
- strreplace(inputdialogtext, "%", "%%", true);
- if(dialogid == DIALOG_KLUBAS_PIRKTI)
- {
- if(response)
- {
- if(IsNumeric(inputtext))
- {
- new
- inputId = strval(inputdialogtext);
- if(Klubai[inputId][clubLast] > 1 || inputId > MAX_CLUBS) return SendClientMessage(playerid, RED, "* Šio klubo pirkti negali.");
- if(ClubDB[playerid][clubOwner] != -1 || ClubDB[playerid][clubCoOwner] != -1) return SendClientMessage(playerid, RED, "* Šiuo metu jūs turite klubą.");
- SetPVarInt(playerid, "selectedClubId", inputId);
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_PIRKTI_1, DIALOG_STYLE_LIST, "Klubo pirkimas", "\n \nPirkti už kreditus\nPirkti už pinigus", "Pirkti", "Atšaukti");
- } else return cmd_pirktikluba(playerid);
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_PIRKTI_1)
- {
- if(response && listitem > 0)
- {
- new
- inputId = GetPVarInt(playerid, "selectedClubId");
- if(listitem == 1)
- {
- if(PlayerDB[playerid][Credits] < Klubai[inputId][clubPriceCredits]) return SendClientMessage(playerid, RED, "* Neturi tiek kreditų.");
- PlayerDB[playerid][Credits] -= Klubai[inputId][clubPriceCredits];
- SendClientMessage(playerid, GREEN_CLUBS, "* Sėkmingai nusipirkai klubą.");
- ClubDB[playerid][clubOwner] = inputId;
- Klubai[inputId][clubLast] = gettime() + 2592000;
- format(Klubai[inputId][clubOwner], 24, "%s", Vardas(playerid));
- SaveClubInfo(Klubai[inputId][clubId]);
- }
- if(listitem == 2)
- {
- if(GetPlayerMoneyA(playerid) < Klubai[inputId][clubPriceMoney]) return SendClientMessage(playerid, RED, "* Neturi tiek pinigų.");
- GivePlayerMoneyA(playerid, -Klubai[inputId][clubPriceMoney]);
- SendClientMessage(playerid, GREEN_CLUBS, "* Sėkmingai nusipirkai klubą.");
- ClubDB[playerid][clubOwner] = inputId;
- Klubai[inputId][clubLast] = gettime() + 2592000;
- format(Klubai[inputId][clubOwner], 24, "%s", Vardas(playerid));
- SaveClubInfo(Klubai[inputId][clubId]);
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_CLUB_ISPIRKA)
- {
- if(response)
- {
- new
- string[180],
- cId = -1,
- clubid = -1
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(clubid != -1 && Klubai[clubid][underAttack] == -1)
- {
- cId = Klubai[clubid][attackingClub];
- format(string, sizeof string,
- "{ffffff}Užimtas klubas: {00ff00}„%s“\n\
- {ffffff}Dabartinė išpirkos suma: {00ff00}%s€\n\
- {ffffff}Įveskite naują išpirkos sumą",
- Klubai[cId][clubName],
- AddPoints(Klubai[cId][clubAttackPrice])
- );
- ShowPlayerDialog(playerid, DIALOG_CLUB_ISPIRKA_CHANGE, DIALOG_STYLE_INPUT, "Klubo išpirka", string, "Pasirinkti", "Atšaukti");
- }
- else
- {
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- if(Klubai[i][underAttack] != -1)
- {
- cId = i;
- break;
- }
- }
- new
- price = Klubai[cId][clubAttackPrice];
- SetPVarInt(playerid, "selectedClub", cId);
- SetPVarInt(playerid, "selectedClubPrice", price);
- format(string, sizeof string, "Ar tikrai norite sumokėti: %s € išpirką?", AddPoints(price));
- ShowPlayerDialog(playerid, DIALOG_CLUB_ISPIRKA_PAY, DIALOG_STYLE_MSGBOX, "Išpirkos mokėjimas", string, "Gerai", "Atšaukti");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_CLUB_ISPIRKA_CHANGE)
- {
- if(response && IsNumeric(inputtext))
- {
- new
- string[40],
- clubid = -1,
- cId = -1,
- input = strval(inputdialogtext)
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(input < MIN_ISPIRKA || input > MAX_ISPIRKA) return SendClientMessage(playerid, RED, "* Intervalas: "MIN_ISPIRKA_A" - "MAX_ISPIRKA_A"");
- if(clubid != -1)
- {
- cId = Klubai[clubid][attackingClub];
- Klubai[cId][clubAttackPrice] = input;
- format(string, sizeof string, "* Pakeista išpirkos kaina: %s €", AddPoints(input));
- SendClubMessage(cId, YELLOW, string);
- }
- SendClientMessage(playerid, GREEN_CLUBS, "* Išpirkos suma uždėta.");
- }
- return 1;
- }
- if(dialogid == DIALOG_CLUB_ISPIRKA_PAY)
- {
- if(response)
- {
- new
- price = GetPVarInt(playerid, "selectedClubPrice"),
- cId = GetPVarInt(playerid, "selectedClub"),
- string[46]
- ;
- if(price < MIN_ISPIRKA) return SendClientMessage(playerid, RED, "* Išpirka dar nenustatyta.");
- if(price > GetPlayerMoneyA(playerid)) return SendClientMessage(playerid, RED, "* Neturite tiek pinigų.");
- GivePlayerMoneyA(playerid, -price);
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == Klubai[cId][underAttack])
- {
- GameTextForPlayer(i, "~g~puolamas klubas sumokejo\nispirka", 2000, 3);
- }
- }
- Klubai[Klubai[cId][underAttack]][clubMoney] += price;
- Klubai[Klubai[cId][underAttack]][attackDelay] = gettime() + 1800;
- format(string, sizeof string, "* %s sumokėjo išpirką %s €", Vardas(playerid), AddPoints(price));
- SendClubMessage(Klubai[cId][underAttack], YELLOW, string);
- ResetClubAttack();
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_NAME)
- {
- if(response && listitem > 0)
- {
- new
- string[128],
- clubid = -1;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(listitem == 1)
- {
- if(PlayerDB[playerid][Credits] < CLUB_SERVICE_CREDITS) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
- SetPVarInt(playerid, "ChoosenPayment", 1);
- format(string, sizeof string,
- "Dabartinis klubo pavadinimas: %s. Keitimo kaina %d kreditų\nĮveskite klubo pavadinimą apačioje.",
- Klubai[clubid][clubName], CLUB_SERVICE_CREDITS
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_NAME_1, DIALOG_STYLE_INPUT, "Klubo pavadinimas", string, "Keisti", "Atšaukti");
- }
- if(listitem == 2)
- {
- if(GetPlayerMoneyA(playerid) < CLUB_SERVICE_MONEY) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
- SetPVarInt(playerid, "ChoosenPayment", 2);
- format(string, sizeof string,
- "Dabartinis klubo pavadinimas: %s. Keitimo kaina %s €\nĮveskite klubo pavadinimą apačioje.",
- Klubai[clubid][clubName], AddPoints(CLUB_SERVICE_MONEY)
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_NAME_1, DIALOG_STYLE_INPUT, "Klubo pavadinimas", string, "Keisti", "Atšaukti");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_NAME_1)
- {
- if(response)
- {
- if(strlen(inputdialogtext) < 3 || strlen(inputdialogtext) > 13) return SendClientMessage(playerid, RED, "* Intervalas: 3 - 13.");
- new
- string[64],
- clubid = -1,
- typee = GetPVarInt(playerid, "ChoosenPayment");
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(typee == 1) PlayerDB[playerid][Credits] -= CLUB_SERVICE_CREDITS;
- if(typee == 2) GivePlayerMoneyA(playerid, -CLUB_SERVICE_MONEY);
- format(Klubai[clubid][clubName], 32, "%s", inputdialogtext);
- format(string, sizeof string, "* Naujas klubo pavadinimas: {db881a}%s", Klubai[clubid][clubName]);
- SendClientMessage(playerid, YELLOW, string);
- format(string, sizeof string, "Įstojimas į „%s“ klubą", Klubai[clubid][clubName]);
- UpdateDynamic3DTextLabelText(Klubai[clubid][clubJoinLabel], GRAY, string);
- SaveClubInfo(clubid);
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_VSKIN)
- {
- if(response && listitem > 0)
- {
- new
- string[128],
- clubid = -1;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(listitem == 1)
- {
- if(PlayerDB[playerid][Credits] < CLUB_SERVICE_CREDITS) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
- SetPVarInt(playerid, "ChoosenPayment", 1);
- format(string, sizeof string,
- "Dabartinis vyriškas skin: %d. Keitimo kaina %d kreditų\nĮveskite naujo skin ID.",
- Klubai[clubid][clubMenSkin], CLUB_SERVICE_CREDITS
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_VSKIN_1, DIALOG_STYLE_INPUT, "Klubo skin", string, "Keisti", "Atšaukti");
- }
- if(listitem == 2)
- {
- if(GetPlayerMoneyA(playerid) < CLUB_SERVICE_MONEY) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
- SetPVarInt(playerid, "ChoosenPayment", 2);
- format(string, sizeof string,
- "Dabartinis vyriškas skin: %d. Keitimo kaina %s €\nĮveskite naujo skin ID.",
- Klubai[clubid][clubMenSkin], AddPoints(CLUB_SERVICE_CREDITS)
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_VSKIN_1, DIALOG_STYLE_INPUT, "Klubo skin", string, "Keisti", "Atšaukti");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_VSKIN_1)
- {
- if(response && IsNumeric(inputtext))
- {
- new
- input = strval(inputdialogtext),
- clubid = -1,
- typeee = GetPVarInt(playerid, "ChoosenPayment");
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(input == Klubai[clubid][clubMenSkin]) return SendClientMessage(playerid, RED, "* Šis skin yra dabartinis.");
- for(new i = 0; i < MAX_SKINS; i++)
- {
- if(bannedSkins[i] == input)
- {
- SendClientMessage(playerid, RED, "* Šis skin yra uždraustas.");
- return 1;
- }
- }
- if(typeee == 1) PlayerDB[playerid][Credits] -= CLUB_SERVICE_CREDITS;
- if(typeee == 2) GivePlayerMoneyA(playerid, -CLUB_SERVICE_MONEY);
- Klubai[clubid][clubMenSkin] = input;
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid && PlayerDB[i][AprangosTipas] == PLAYER_CLOTHES_CLUB && PlayerDB[i][Sex] == 1)
- {
- SetPlayerSkin(i, Klubai[clubid][clubMenSkin]);
- }
- }
- SaveClubInfo(clubid);
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_MSKIN)
- {
- if(response && listitem > 0)
- {
- new
- string[128],
- clubid = -1;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(listitem == 1)
- {
- if(PlayerDB[playerid][Credits] < CLUB_SERVICE_CREDITS) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
- SetPVarInt(playerid, "ChoosenPayment", 1);
- format(string, sizeof string,
- "Dabartinis moteriškas skin: %d. Keitimo kaina %d kreditų\nĮveskite naujo skin ID.",
- Klubai[clubid][clubWomenSkin], CLUB_SERVICE_CREDITS
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_MSKIN_1, DIALOG_STYLE_INPUT, "Klubo moters skin", string, "Keisti", "Atšaukti");
- }
- if(listitem == 2)
- {
- if(GetPlayerMoneyA(playerid) < CLUB_SERVICE_MONEY) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
- SetPVarInt(playerid, "ChoosenPayment", 2);
- format(string, sizeof string,
- "Dabartinis moteriškas skin: %d. Keitimo kaina %s €\nĮveskite naujo skin ID.",
- Klubai[clubid][clubWomenSkin], AddPoints(CLUB_SERVICE_MONEY)
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_MSKIN_1, DIALOG_STYLE_INPUT, "Klubo moters skin", string, "Keisti", "Atšaukti");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_MSKIN_1)
- {
- if(response && IsNumeric(inputtext))
- {
- new
- input = strval(inputdialogtext),
- clubid = -1,
- types = GetPVarInt(playerid, "ChoosenPayment");
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(input == Klubai[clubid][clubMenSkin]) return SendClientMessage(playerid, RED, "* Šis skin yra dabartinis.");
- for(new i = 0; i < MAX_SKINS; i++)
- {
- if(bannedSkins[i] == input)
- {
- SendClientMessage(playerid, RED, "* Šis skin yra uždraustas.");
- return 1;
- }
- }
- if(types == 1) PlayerDB[playerid][Credits] -= CLUB_SERVICE_CREDITS;
- if(types == 2) GivePlayerMoneyA(playerid, -CLUB_SERVICE_MONEY);
- Klubai[clubid][clubWomenSkin] = input;
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid && PlayerDB[i][AprangosTipas] == PLAYER_CLOTHES_CLUB && PlayerDB[i][Sex] == 2)
- {
- SetPlayerSkin(i, Klubai[clubid][clubWomenSkin]);
- }
- }
- SaveClubInfo(clubid);
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_CARCOLOR)
- {
- if(response && listitem > 0)
- {
- new
- string[128],
- clubid = -1;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(listitem == 1)
- {
- if(PlayerDB[playerid][Credits] < CLUB_SERVICE_CREDITS) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
- SetPVarInt(playerid, "ChoosenPayment", 1);
- format(string, sizeof string,
- "Dabartinė transporto spalva: %d. Keitimo kaina %d kreditų\nĮveskite naujos spalvos ID.",
- Klubai[clubid][clubCarColor], CLUB_SERVICE_CREDITS
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_CARCOLOR_1, DIALOG_STYLE_INPUT, "Klubo mašinos spalva", string, "Keisti", "Atšaukti");
- }
- if(listitem == 2)
- {
- if(GetPlayerMoneyA(playerid) < CLUB_SERVICE_MONEY) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
- SetPVarInt(playerid, "ChoosenPayment", 2);
- format(string, sizeof string,
- "Dabartinė transporto spalva: %d. Keitimo kaina %s €\nĮveskite naujos spalvos ID.",
- Klubai[clubid][clubCarColor], AddPoints(CLUB_SERVICE_MONEY)
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_CARCOLOR_1, DIALOG_STYLE_INPUT, "Klubo mašinos spalva", string, "Keisti", "Atšaukti");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_CARCOLOR_1)
- {
- if(response && IsNumeric(inputtext))
- {
- new
- input = strval(inputdialogtext),
- clubid = -1,
- typess = GetPVarInt(playerid, "ChoosenPayment"),
- query[70];
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(input == Klubai[clubid][clubCarColor]) return SendClientMessage(playerid, RED, "* Ši spalva yra dabartinė.");
- if(input < 0 || input > 255) return SendClientMessage(playerid, RED, "* 0 - 255");
- if(typess == 1) PlayerDB[playerid][Credits] -= CLUB_SERVICE_CREDITS;
- if(typess == 2)
- {
- GivePlayerMoneyA(playerid, -CLUB_SERVICE_MONEY);
- }
- Klubai[clubid][clubCarColor] = input;
- SaveClubInfo(clubid);
- for(new vehicleid = 0; vehicleid < MAX_VEHICLES; vehicleid++)
- {
- if(VehicleDB[vehicleid][vehicleClub] == clubid)
- DestroyVehicle(vehicleid);
- }
- mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_CARS"` WHERE `clubid` = %d", clubid);
- mysql_tquery(connectionHandle, query, "OnLoadClubCars");
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_RENT)
- {
- if(response && listitem > 0)
- {
- new
- string[128],
- clubid = -1;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(listitem == 1)
- {
- if(PlayerDB[playerid][Credits] < Klubai[clubid][clubPriceCredits]) return SendClientMessage(playerid, RED, "* Neturite pakankamai kreditų.");
- SetPVarInt(playerid, "ChoosenPayment", 1);
- format(string, sizeof string,
- "Ar tikrai norite pratęsti „%s“ klubo galiojimo laiką už %d kreditų arba %s € 30 dienų",
- Klubai[clubid][clubName], Klubai[clubid][clubPriceCredits], AddPoints(Klubai[clubid][clubPriceMoney])
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_RENT_1, DIALOG_STYLE_MSGBOX, "Klubo pratęsimas", string, "Pratęsti", "Atšaukti");
- }
- if(listitem == 2)
- {
- if(GetPlayerMoneyA(playerid) < Klubai[clubid][clubPriceMoney]) return SendClientMessage(playerid, RED, "* Neturite pakankamai pinigų.");
- SetPVarInt(playerid, "ChoosenPayment", 2);
- format(string, sizeof string,
- "Ar tikrai norite pratęsti „%s“ klubo galiojimo laiką už %d kreditų arba %s € 30 dienų",
- Klubai[clubid][clubName], Klubai[clubid][clubPriceCredits], AddPoints(Klubai[clubid][clubPriceMoney])
- );
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_RENT_1, DIALOG_STYLE_MSGBOX, "Klubo pratęsimas", string, "Pratęsti", "Atšaukti");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_KLUBAS_RENT_1)
- {
- if(response)
- {
- new
- typess = GetPVarInt(playerid, "ChoosenPayment"),
- clubid = -1;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(typess == 1) PlayerDB[playerid][Credits] -= Klubai[clubid][clubPriceCredits];
- if(typess == 2) GivePlayerMoneyA(playerid, -Klubai[clubid][clubPriceMoney]);
- Klubai[clubid][clubLast] = Klubai[clubid][clubLast] + 2592000;
- SendClientMessage(playerid, YELLOW, "* Klubo galiojimas pratęstas 30 dienų.");
- SaveClubInfo(clubid);
- }
- return 1;
- }
- return 1;
- }
- hook OnPlayerPickUpPickup(playerid, pickupid)
- {
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- if(pickupid == Klubai[i][clubJoinPickup])
- {
- if(ClubDB[playerid][club] != Klubai[i][clubId] && ClubDB[playerid][club] != -1)
- return SendClientMessage(playerid, RED, "* Jūs esate kitame klube. Naudok {db881a}/paliktikluba");
- if(ClubDB[playerid][clubInvitation] != Klubai[i][clubId] && ClubDB[playerid][club] == -1)
- return SendClientMessage(playerid, RED, "* Jūs nesate pakviestas į šį klubą.");
- if(ClubDB[playerid][club] == -1)
- {
- ClubDB[playerid][clubInvitation] = -1;
- ClubDB[playerid][club] = Klubai[i][clubId];
- if(Klubai[i][clubMenSkin] != 1)
- {
- if(PlayerDB[playerid][Sex] == 1)
- SetPlayerSkin(playerid, Klubai[i][clubMenSkin]);
- }
- if(Klubai[i][clubWomenSkin] != 1)
- {
- if(PlayerDB[playerid][Sex] == 2)
- SetPlayerSkin(playerid, Klubai[i][clubWomenSkin]);
- }
- PlayerDB[playerid][AprangosTipas] = PLAYER_CLOTHES_CLUB;
- SendClientMessage(playerid, GREEN_CLUBS, "* Sėkmingai įstojote į klubą.");
- new
- string[64];
- format(string, sizeof string, "[klubo racija] %s įstojo į klubą", Vardas(playerid));
- SendClubMessage(ClubDB[playerid][club], AQUA_CLUBS, string);
- SavePlayerClubData(playerid);
- break;
- }
- }
- }
- return 1;
- }
- hook OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(VehicleDB[vehicleid][vehicleClub] != -1 && ClubDB[playerid][club] != VehicleDB[vehicleid][vehicleClub])
- {
- SendClientMessage(playerid, RED, "* Ši tr. priemonė nepriklauso jūsų klubui.");
- RemovePlayerFromVehicle(playerid);
- }
- }
- return 1;
- }
- forward OnLoadClubs();
- public OnLoadClubs()
- {
- if(cache_get_row_count() == 0) print("[KLUBAI] Nerasta klubu MySQL lenteleje.");
- else
- {
- for(new row = 0; row < cache_get_row_count(); row++)
- {
- Klubai[row][clubId] = cache_get_field_content_int(row, "clubId");
- cache_get_field_content(row, "clubName", Klubai[row][clubName], connectionHandle, 32);
- cache_get_field_content(row, "clubOwner", Klubai[row][clubOwner], connectionHandle, 24);
- cache_get_field_content(row, "clubCoOwner", Klubai[row][clubCoOwner], connectionHandle, 24);
- Klubai[row][clubLast] = cache_get_field_content_int(row, "clubLast");
- Klubai[row][clubPriceCredits] = cache_get_field_content_int(row, "clubPriceCredits");
- Klubai[row][clubPriceMoney] = cache_get_field_content_int(row, "clubPriceMoney");
- Klubai[row][clubCarColor] = cache_get_field_content_int(row, "clubCarColor");
- Klubai[row][clubMenSkin] = cache_get_field_content_int(row, "clubMenSkin");
- Klubai[row][clubWomenSkin] = cache_get_field_content_int(row, "clubWomenSkin");
- Klubai[row][clubMoney] = cache_get_field_content_int(row, "clubMoney");
- Klubai[row][posX] = cache_get_field_content_float(row, "posX");
- Klubai[row][posY] = cache_get_field_content_float(row, "posY");
- Klubai[row][posZ] = cache_get_field_content_float(row, "posZ");
- Klubai[row][uzimtiX] = cache_get_field_content_float(row, "uzimtiX");
- Klubai[row][uzimtiY] = cache_get_field_content_float(row, "uzimtiY");
- Klubai[row][uzimtiZ] = cache_get_field_content_float(row, "uzimtiZ");
- Klubai[row][clubJoinPickup] = CreatePickup(1314, 2, Klubai[row][posX], Klubai[row][posY], Klubai[row][posZ]);
- new Label[90];
- format(Label, sizeof Label, "Įstojimas į „%s“ klubą", Klubai[row][clubName]);
- 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);
- format(Label, sizeof Label, "Klubo užėmimas\n{db881a}/kuzimti{b4b5b7}\n \n \n \nGaunamas XP kol matoma ši žinutė");
- 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);
- if(Klubai[row][clubId] == 0)
- {
- Klubai[row][clubGatesPosZ] = 17.01850;
- Klubai[row][clubGates][0] = CreateDynamicObject(19912, -1813.82178, 1292.36328, 17.01850, 0.00000, 0.00000, 0.00000);
- Klubai[row][clubGates][1] = CreateDynamicObject(19912, -1802.25171, 1292.29187, 17.01850, 0.00000, 0.00000, 0.00000);
- Klubai[row][clubGatesState] = 1;
- }
- if(Klubai[row][clubId] == 1)
- {
- Klubai[row][clubGatesPosZ] = 60.54100;
- Klubai[row][clubGates][0] = CreateDynamicObject(19912, 1268.49377, -2046.12292, 60.54100, 0.00000, 0.00000, -3.12000);
- Klubai[row][clubGates][1] = CreateDynamicObject(19912, 1251.49377, -2046.12292, 60.54100, 0.00000, 0.00000, -3.12000);
- Klubai[row][clubGatesState] = 1;
- }
- Klubai[row][clubGatesLocked] = true;
- Klubai[row][underAttack] = -1;
- Klubai[row][attackingClub] = -1;
- }
- printf("[KLUBAI] Uzkrauta %d klubu.", cache_get_row_count());
- }
- return true;
- }
- forward OnLoadClubCars();
- public OnLoadClubCars()
- {
- if(cache_get_row_count() == 0) print("[KLUBAI] Nerasta klubu masinu MySQL lenteleje.");
- else
- {
- for(new row = 0; row < cache_get_row_count(); row++)
- {
- if(Klubai[row][UzkrautosMasinos]==true)SunaikintKlubuMasinas(row);
- new carPos[128];
- //Sultan
- cache_get_field_content(row, "560car1", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car560_1][0], Klubai[row][car560_1][1], Klubai[row][car560_1][2], Klubai[row][car560_1][3]);
- 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]);
- cache_get_field_content(row, "560car2", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car560_2][0], Klubai[row][car560_2][1], Klubai[row][car560_2][2], Klubai[row][car560_2][3]);
- 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]);
- cache_get_field_content(row, "560car3", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car560_3][0], Klubai[row][car560_3][1], Klubai[row][car560_3][2], Klubai[row][car560_3][3]);
- 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]);
- cache_get_field_content(row, "560car4", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car560_4][0], Klubai[row][car560_4][1], Klubai[row][car560_4][2], Klubai[row][car560_4][3]);
- 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]);
- //NRG-500
- cache_get_field_content(row, "522car1", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car522_1][0], Klubai[row][car522_1][1], Klubai[row][car522_1][2], Klubai[row][car522_1][3]);
- 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]);
- cache_get_field_content(row, "522car2", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car522_2][0], Klubai[row][car522_2][1], Klubai[row][car522_2][2], Klubai[row][car522_2][3]);
- 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]);
- cache_get_field_content(row, "522car3", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car522_3][0], Klubai[row][car522_3][1], Klubai[row][car522_3][2], Klubai[row][car522_3][3]);
- 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]);
- cache_get_field_content(row, "522car4", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car522_4][0], Klubai[row][car522_4][1], Klubai[row][car522_4][2], Klubai[row][car522_4][3]);
- 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]);
- cache_get_field_content(row, "522car5", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car522_5][0], Klubai[row][car522_5][1], Klubai[row][car522_5][2], Klubai[row][car522_5][3]);
- 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]);
- cache_get_field_content(row, "522car6", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car522_6][0], Klubai[row][car522_6][1], Klubai[row][car522_6][2], Klubai[row][car522_6][3]);
- 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]);
- cache_get_field_content(row, "522car7", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car522_7][0], Klubai[row][car522_7][1], Klubai[row][car522_7][2], Klubai[row][car522_7][3]);
- 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]);
- cache_get_field_content(row, "522car8", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car522_8][0], Klubai[row][car522_8][1], Klubai[row][car522_8][2], Klubai[row][car522_8][3]);
- 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]);
- //Journey
- cache_get_field_content(row, "508car1", carPos, connectionHandle, 128);
- sscanf(carPos, "ffff", Klubai[row][car508][0], Klubai[row][car508][1], Klubai[row][car508][2], Klubai[row][car508][3]);
- 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]);
- Klubai[row][UzkrautosMasinos]=true;
- }
- printf("[KLUBAI] Transportas uzkrautas.");
- }
- return true;
- }
- stock SunaikintKlubuMasinas(cId)
- {
- for(new q=1;q<=13;q++)
- {
- DestroyVehicle(Klubai[cId][Masinos][q]);
- }
- return 1;
- }
- forward OnLoadUserClubData(playerid);
- public OnLoadUserClubData(playerid)
- {
- new
- query[90 + MAX_PLAYER_NAME];
- new years, month, days;
- getdate(years, month, days);
- new Valandos, Minutes;
- gettime(Valandos, Minutes);
- if(cache_get_row_count() == 0)
- {
- mysql_format(connectionHandle, query, sizeof query, "INSERT INTO `"MYSQL_KLUBAI_USERS"` (`Name`) VALUES ('%e')", Vardas(playerid));
- mysql_tquery(connectionHandle, query);
- format(ClubDB[playerid][loginDate], 32, "%d-%02d-%02d %02d:%02d", years, month, days, Valandos, Minutes);
- mysql_format(connectionHandle, query, sizeof query, "UPDATE `"MYSQL_KLUBAI_USERS"` SET `loginDate` = '%e' WHERE `Name` = '%e'", ClubDB[playerid][loginDate], Vardas(playerid));
- mysql_tquery(connectionHandle, query);
- }
- else
- {
- ClubDB[playerid][clubOwner] = cache_get_field_content_int(0, "clubOwner");
- ClubDB[playerid][clubCoOwner] = cache_get_field_content_int(0, "clubCoOwner");
- ClubDB[playerid][club] = cache_get_field_content_int(0, "club");
- ClubDB[playerid][clubXP] = cache_get_field_content_int(0, "ClubXP");
- printf("Kraunama žaidėjo %s klubų info: Owner: %i, CoOwner:%i, Club:%i",ClubDB[playerid][clubOwner],ClubDB[playerid][clubCoOwner],ClubDB[playerid][club]);
- format(ClubDB[playerid][loginDate], 32, "%d-%02d-%02d %02d:%02d", years, month, days, Valandos, Minutes);
- mysql_format(connectionHandle, query, sizeof query, "UPDATE `"MYSQL_KLUBAI_USERS"` SET `loginDate` = '%e' WHERE `Name` = '%e'", ClubDB[playerid][loginDate], Vardas(playerid));
- mysql_tquery(connectionHandle, query);
- }
- return true;
- }
- forward CheckClub();
- public CheckClub()
- {
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- if(Klubai[i][clubLast] <= gettime() && !isnull(Klubai[i][clubOwner]))
- {
- ResetClubData(i);
- }
- SaveClubInfo(i);
- }
- return 1;
- }
- forward ClubAttack(playerid, clubid, cId);
- public ClubAttack(playerid, clubid, cId)
- {
- ClubOnAttack = true;
- new
- Label[256]
- ;
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid)
- {
- if(IsPlayerInRangeOfPoint(i, 10.0, Klubai[cId][uzimtiX], Klubai[cId][uzimtiY], Klubai[cId][uzimtiZ]))
- {
- counter = 10;
- xpCounter++;
- }
- else
- counter--;
- if(xpCounter > 59)
- {
- ClubDB[i][clubXP] ++;
- xpCounter = 0;
- }
- }
- }
- if(counter < 10 && counter >= 1)
- {
- format(Label, sizeof Label,
- "Klubo užėmimas\nKlubas užimtas {db881a}„%s“ {b4b5b7}klubo\n\
- Užimta nuo: {db881a}%s{b4b5b7}\nLaikoma: {db881a}%02d:%02d:%02d\n\
- Bus apginta po: {00FF00}%ds\n{b4b5b7}Gaunamas XP kol matoma ši žinutė",
- Klubai[clubid][clubName], Klubai[clubid][attackDate], Klubai[clubid][attackTimeHours],
- Klubai[clubid][attackTimeMinutes], Klubai[clubid][attackTime],
- counter
- );
- UpdateDynamic3DTextLabelText(Klubai[cId][clubAttackLabel], GRAY, Label);
- }
- if(counter < 1)
- {
- Klubai[clubid][stolenMoney] = 0;
- Klubai[clubid][attackTime] = 0;
- Klubai[clubid][attackTimeMinutes] = 0;
- Klubai[clubid][attackTimeHours] = 0;
- Klubai[clubid][attackDelay] = gettime() + 1800;
- format(Klubai[clubid][attackDate], 24, "");
- KillTimer(Klubai[clubid][secondTimer]);
- Klubai[cId][underAttack] = -1;
- Klubai[clubid][attackingClub] = -1;
- UpdateDynamic3DTextLabelText(Klubai[cId][clubAttackLabel], GRAY,
- "Klubo užėmimas\n{db881a}/kuzimti{b4b5b7}\n \n \n \nGaunamas XP kol matoma ši žinutė");
- SendClubMessage(cId, YELLOW, "* Klubo zona apginta.");
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == cId)
- GameTextForPlayer(i, "~g~Klubo zona apginta", 2000, 3);
- }
- SendClubMessage(clubid, YELLOW, "* Puolamas klubas apsigynė.");
- ClubOnAttack = false;
- ResetClubAttack();
- return 1;
- }
- Klubai[clubid][stolenMoney] ++;
- Klubai[clubid][attackTime] ++;
- Klubai[clubid][clubMoney] += MONEY_PER_SECOND;
- Klubai[cId][clubMoney] -= MONEY_PER_SECOND;
- if(Klubai[clubid][attackTime] > 59)
- {
- Klubai[clubid][attackTime] = 0;
- Klubai[clubid][attackTimeMinutes] ++;
- SaveClubInfo(clubid);
- SaveClubInfo(cId);
- }
- if(Klubai[clubid][attackTimeMinutes] > 59)
- {
- Klubai[clubid][attackTimeMinutes] = 0;
- Klubai[clubid][attackTimeHours] ++;
- }
- if(counter > 9)
- {
- format(Label, sizeof Label,
- "Klubo užėmimas\nKlubas užimtas {db881a}„%s“ {b4b5b7}klubo\n\
- Užimta nuo: {db881a}%s{b4b5b7}\nLaikoma: {db881a}%02d:%02d:%02d\n\
- Pagrobė: {FF0000}%s€\n{b4b5b7}Gaunamas XP kol matoma ši žinutė",
- Klubai[clubid][clubName], Klubai[clubid][attackDate], Klubai[clubid][attackTimeHours],
- Klubai[clubid][attackTimeMinutes], Klubai[clubid][attackTime],
- AddPoints(Klubai[clubid][stolenMoney] * MONEY_PER_SECOND)
- );
- UpdateDynamic3DTextLabelText(Klubai[cId][clubAttackLabel], GRAY, Label);
- }
- return 1;
- }
- forward ResetInvitation(id);
- public ResetInvitation(id)
- {
- ClubDB[id][clubInvitation] = -1;
- return 1;
- }
- // BENDROS KOMANDOS
- CMD:pirktikluba(playerid)
- {
- new
- String[128],
- Dialog[256]
- ;
- strcat(Dialog, "Šiuo metu parduodami klubai, kainos nurodytos 30 dienų\n");
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- if(Klubai[i][clubLast] < 1)
- {
- format(String, sizeof String,
- "%d. „%s“ klubas %d kreditų arba %s €\n",
- Klubai[i][clubId], Klubai[i][clubName], Klubai[i][clubPriceCredits], AddPoints(Klubai[i][clubPriceMoney]));
- strcat(Dialog, String);
- }
- }
- strcat(Dialog, "\nNorėdami pirkti klubą apačioje įveskite jo numerį");
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_PIRKTI, DIALOG_STYLE_INPUT, "Klubo pirkimas", Dialog, "Pirkti", "Atšaukti");
- return 1;
- }
- CMD:klubai(playerid)
- {
- new
- String[128],
- Dialog[256]
- ;
- strcat(Dialog, "Pavadinimas\tGalioja (d.)\tKaina (kreditų/30d.)\tKaina (€/30d.)\n");
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- new galiojimas = (Klubai[i][clubLast] - gettime()) / 86400;
- if(galiojimas < 1) galiojimas = 0;
- format(String, sizeof String,
- "{ffffff}%d. „%s“\t%d\t%d\t%s\n",
- Klubai[i][clubId] + 1, Klubai[i][clubName], galiojimas, Klubai[i][clubPriceCredits], AddPoints(Klubai[i][clubPriceMoney]));
- strcat(Dialog, String);
- }
- ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_TABLIST_HEADERS, "Klubai", Dialog, "Gerai", "");
- return 1;
- }
- CMD:kdirektoriai(playerid)
- {
- new
- String[128],
- Dialog[512]
- ;
- strcat(Dialog, "Klubas\tDirektorius\tPavaduotojas\n");
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- format(String, sizeof String,
- "{ffffff}%s\t%s\t%s\n", Klubai[i][clubName], GetKDirektoriusName(i), GetKPavaduotojasName(i));
- strcat(Dialog, String);
- }
- ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_TABLIST_HEADERS, "Klubų direktoriai", Dialog, "Gerai", "");
- return 1;
- }
- // Klubo narių komandos
- CMD:klubieciai(playerid)
- {
- if(ClubDB[playerid][club] == -1) return 0;
- new
- string[32],
- info[256];
- strcat(string, "Šiuo metu prisijungę klubiečiai:\n");
- foreach(new i : Player)
- {
- if(i == playerid) continue;
- if(ClubDB[i][club] == ClubDB[playerid][club])
- {
- format(string, sizeof string, "%i. %s\n", i+1, Vardas(i));
- strcat(info, string);
- }
- }
- ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Klubiečiai", info, "Gerai", "");
- return 1;
- }
- CMD:rc(playerid, params[])
- {
- if(ClubDB[playerid][club] == -1) return 0;
- new
- message[128],
- string[148]
- ;
- if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, GREEN_CLUBS, "* /rc [tekstas]");
- format(string, sizeof string, "[klubo racija] %s: %s", Vardas(playerid), message);
- SendClubMessage(ClubDB[playerid][club], AQUA_CLUBS, string);
- return 1;
- }
- CMD:kdrabuziai(playerid)
- {
- if(ClubDB[playerid][club] == -1) return 0;
- new
- clubid = ClubDB[playerid][club];
- //Patriktint lytį
- if(PlayerDB[playerid][Sex] == 1)
- SetPlayerSkin(playerid, Klubai[clubid][clubMenSkin]);
- else
- SetPlayerSkin(playerid, Klubai[clubid][clubWomenSkin]);
- PlayerDB[playerid][AprangosTipas] = PLAYER_CLOTHES_CLUB;
- return 1;
- }
- CMD:paliktikluba(playerid, params[])
- {
- if(ClubDB[playerid][club] == -1) return 0;
- new
- message[32],
- string[148]
- ;
- if(sscanf(params, "s[32]", message)) return SendClientMessage(playerid, GREEN_CLUBS, "* /paliktikluba [priežastis]");
- format(string, sizeof string, "[klubo racija] %s paliko klubą dėl: %s", Vardas(playerid), message);
- SendClubMessage(ClubDB[playerid][club], AQUA_CLUBS, string);
- //Atstatom skiną.
- //SetPlayerSkin(playerid, PlayerDB[playerid][Drabuziai]);
- new Years, Month, Day;
- getdate(Years, Month, Day);
- mysql_format(connectionHandle, string, sizeof string,
- "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]);
- mysql_tquery(connectionHandle, string);
- ClubDB[playerid][club] = -1;
- ClubDB[playerid][clubInvitation] = -1;
- SavePlayerClubData(playerid);
- return 1;
- }
- CMD:katsisakyti(playerid)
- {
- if(ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- query[256],
- clubid
- ;
- clubid = ClubDB[playerid][clubCoOwner];
- mysql_format(connectionHandle, query, sizeof query,
- "UPDATE `"MYSQL_KLUBAI"` SET \
- `clubCoOwner` = '%s', \
- WHERE `clubId` = '%d'",Vardas(playerid),clubid);
- mysql_tquery(connectionHandle, query);
- ClubDB[playerid][clubCoOwner] = -1;
- SendClientMessage(playerid, RED_CLUBS, "* Atsisakėte klubo pavaduotojo posto.");
- return 1;
- }
- CMD:kispirka(playerid)
- {
- new
- cId = -1;
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- if(Klubai[i][underAttack] != -1)
- {
- cId = i;
- break;
- }
- }
- if(cId != -1)
- {
- new
- string[128];
- format(string, sizeof string,
- "{ffffff}„%s“ užimtas „%s“ nuo %s, išpirka %s €",
- Klubai[cId][clubName], Klubai[Klubai[cId][underAttack]][clubName], Klubai[Klubai[cId][underAttack]][attackDate],
- AddPoints(Klubai[cId][clubAttackPrice])
- );
- ShowPlayerDialog(playerid, DIALOG_CLUB_ISPIRKA, DIALOG_STYLE_LIST, "Klubų išpirkos", string, "Toliau", "Atšaukti");
- }
- else ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Klubų išpirkos", "Nėra užimtų klubų", "Gerai", "Atšaukti");
- return 1;
- }
- // DIREKTORIŲ / PAVADUOTOJŲ KOMANDOS
- CMD:klubas(playerid)
- {
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- SendClientMessage(playerid, ORANGE_CLUBS, "*<<KOMANDOS>>");
- SendClientMessage(playerid, YELLOW, "*/kpriimti | Priimti į savo klubą žmogų");
- SendClientMessage(playerid, YELLOW, "*/kismesti | Išmesti žmogų iš savo klubo");
- SendClientMessage(playerid, YELLOW, "*/kismestioff | Išmesti žmogų iš savo klubo, kuris neprisijungęs");
- SendClientMessage(playerid, YELLOW, "*/kismestivisus | Išmesti visus iš klubo (NEVEIKIA PAVADUOTOJUI)");
- SendClientMessage(playerid, YELLOW, "*/nariai | Parodo prisijungusius klubo narius");
- SendClientMessage(playerid, YELLOW, "*/visinariai | Parodo visus klubo narius");
- SendClientMessage(playerid, YELLOW, "*/kismete /kpaliko | Parodo išmestus ir palikusius klubo narius");
- SendClientMessage(playerid, YELLOW, "*/kvartai | Įjungia/išjungia klubo vartų darinėjimą");
- SendClientMessage(playerid, YELLOW, "*/k [tekstas] | Parašo, kad visi matytų (naudojamas atrankoms ir užpuolimams pranešti)");
- SendClientMessage(playerid, YELLOW, "*/kpavaduotojas | Skirti klubo pavaduotoją");
- SendClientMessage(playerid, YELLOW, "*/kpremija | /kpremijav | išdalinti tam tikrą pinigų sumą (esantiems šalia | visiems prisijungusiems klubo nariams)");
- SendClientMessage(playerid, YELLOW, "*/kfondas /kisimti /kideti | klubo fondo komandos");
- SendClientMessage(playerid, YELLOW, "*/kinfo | galimybė sužinoti klubo galiojimą, keisti skin, mašinas...");
- SendClientMessage(playerid, YELLOW, "*/krespawn | atstato nenaudojamas tr. priemones");
- return 1;
- }
- CMD:kuzimti(playerid)
- {
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- bool:nearLabel = false,
- cId = -1
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(Klubai[clubid][attackDelay] > gettime()) return SendClientMessage(playerid, RED, "* Dar nepraėjo 30 minučių po paskutinio užėmimo.");
- if(ClubOnAttack) return SendClientMessage(playerid, RED, "* Šiuo metu negalima.");
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- if(i == clubid) continue;
- if(IsPlayerInRangeOfPoint(playerid, 10.0, Klubai[i][uzimtiX], Klubai[i][uzimtiY], Klubai[i][uzimtiZ]))
- {
- if(!isnull(Klubai[i][clubOwner]))
- {
- nearLabel = true;
- cId = i;
- break;
- }
- }
- }
- if(!nearLabel) return SendClientMessage(playerid, RED, "* Nesate prie užėmimo vietos.");
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- if(i == clubid) continue;
- if(Klubai[i][underAttack] != -1)
- {
- SendClientMessage(playerid, RED, "* Šiuo metu negalima.");
- return 1;
- }
- if(Klubai[i][clubShield] > gettime())
- {
- SendClientMessage(playerid, RED, "* Klubas šiuo metu vykdo atranką.");
- return 1;
- }
- }
- /*new memberCount = 0;
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == cId)
- {
- memberCount++;
- printf("3. %d", memberCount);
- }
- }
- if(memberCount < 2) return SendClientMessage(playerid, RED, "* Puolamas klubas neturi 2 aktyvių klubiečių.");*/
- if(nearLabel)
- {
- new
- string[64];
- format(string, sizeof string, "Jūsų klubas užpuolė {db881a}„%s“", Klubai[cId][clubName]);
- SendClubMessage(clubid, YELLOW, string);
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid)
- GameTextForPlayer(playerid,"~g~Jusu klubas uzpuole kita kluba", 000, 3);
- }
- format(string, sizeof string, "Jūsų klubą užpuolė {db881a}„%s“", Klubai[clubid][clubName]);
- SendClubMessage(cId, YELLOW, string);
- format(Klubai[clubid][attackDate], 24, GetHoursDate());
- Klubai[clubid][secondTimer] = SetTimerEx("ClubAttack", 1000, true, "iii", playerid, clubid, cId);
- Klubai[clubid][attackingClub] = cId;
- Klubai[clubid][underAttack] = -1;
- printf("1. %d", Klubai[clubid][underAttack]);
- Klubai[cId][clubAttackPrice] = 0;
- Klubai[cId][underAttack] = clubid;
- }
- return 1;
- }
- CMD:kpriimti(playerid, params[])
- {
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- id,
- clubid,
- string[128]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, RED, "* Priimti žaidėją į klubą: /kpriimti [vardo dalis]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "* Tokio žaidėjo nėra.");
- if(ClubDB[id][club] == clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas jau yra jūsų klube.");
- if(ClubDB[id][clubInvitation] == clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas jau yra gavęs pakvietimą.");
- ClubDB[id][clubInvitation] = clubid;
- SetTimerEx("ResetInvitation", 1000 * 60 * 5, false, "i", id);
- format(string, sizeof string, "* Pakvietete {FFA500}%s{34A936} įstoti į klubą.", Vardas(id));
- SendClientMessage(playerid, GREEN_CLUBS, string);
- format(string, sizeof string, "* Jūs kviečiamas įstoti į {FFA500}%s{34A936} klubą.", Klubai[clubid][clubName]);
- SendClientMessage(id, GREEN_CLUBS, string);
- return 1;
- }
- CMD:kismesti(playerid, params[])
- {
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- id,
- clubid,
- string[128]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, GREEN_CLUBS, "* Išmesti žaidėją iš klubo: /kismesti [vardo dalis]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "* Tokio žaidėjo nėra.");
- if(ClubDB[id][club] != clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas nėra jūsų klube.");
- ClearPlayerInfo(id);
- format(string, sizeof string, "* Išmetėtė {FFA500}%s{34A936} iš klubo.", Vardas(id));
- SendClientMessage(playerid, GREEN_CLUBS, string);
- SendClientMessage(id, GREEN_CLUBS, "* Jūs išmestas iš klubo.");
- SetPlayerSkin(id, 0);
- return 1;
- }
- CMD:kismestioff(playerid, params[])
- {
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- query[110 + MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(sscanf(params, "s[24]", name)) return SendClientMessage(playerid, GREEN_CLUBS, "* /kismestioff [Vardas_Pavardė]");
- mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_USERS"` WHERE `club` = %d", clubid);
- new Cache:result = mysql_query(connectionHandle, query);
- if(cache_get_row_count() != 0)
- {
- cache_get_field_content(0, "Name", name, connectionHandle, 24);
- } else return SendClientMessage(playerid, RED, "* Tokio žaidėjo nėra, arba jis nėra jūsų klubo narys.");
- if(GetPlayeridMid(name) != INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "* Šis žaidėjas šiuo metu prisijungęs.");
- mysql_format(connectionHandle, query, sizeof query, "UPDATE `"MYSQL_KLUBAI_USERS"` SET `club` = -1, `clubOwner` = -1, `clubCoOwner` = -1 WHERE `Name` = '%e'", name);
- mysql_tquery(connectionHandle, query);
- cache_delete(result);
- return 1;
- }
- CMD:kismestivisus(playerid, params[])
- {
- if(ClubDB[playerid][clubOwner] == -1) return 0;
- new
- clubid,
- query[75]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- foreach(new i : Player)
- {
- if(i == playerid) continue;
- if(ClubDB[i][clubCoOwner] == clubid) continue;
- if(ClubDB[i][club] == clubid)
- {
- SendClientMessage(i, RED, "* Jūs buvote išmestas iš klubo.");
- ClearPlayerInfo(i);
- }
- }
- mysql_format(connectionHandle, query, sizeof query, "UPDATE `"MYSQL_KLUBAI_USERS"` SET `club` = -1 WHERE `club` = %d", clubid);
- mysql_query(connectionHandle, query);
- SendClientMessage(playerid, GREEN_CLUBS, "* Visi nariai išmesti iš klubo.");
- return 1;
- }
- CMD:nariai(playerid, params[])
- {
- //Parodo prisijungusius klubo narius
- //SendClientMessage(playerid, orange, "1. Nick_Name | AFK");
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- string[32]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid)
- {
- format(string, sizeof string, "%d. %s", i+1, Vardas(i));
- SendClientMessage(playerid, ORANGE_CLUBS, string);
- }
- }
- return 1;
- }
- CMD:visinariai(playerid, params[])
- {
- //Parodo visus klubo narius
- //SendClientMessage(playerid, orange, "1. Nick_Name Prisijungė 2019-07-20 17:56");
- //Dialogas: TabListas: Nr. Vardas_Pavardė Paskutinis prisijungimas
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- query[110 + MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME],
- logindate[32],
- dialog[256]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_USERS"` WHERE `club` = %d", clubid);
- new Cache:result = mysql_query(connectionHandle, query);
- if(cache_get_row_count() != 0)
- {
- strcat(dialog, "Nr.\tVardas_Pavardė\tPaskutinis prisijungimas\n");
- for(new i = 0; i < cache_get_row_count(); i++)
- {
- cache_get_field_content(i, "Name", name, connectionHandle, 24);
- cache_get_field_content(i, "loginDate", logindate, connectionHandle, 32);
- format(query, sizeof query, "%d. %s Prisijungė %s", i+1, name, logindate);
- SendClientMessage(playerid, ORANGE_CLUBS, query);
- format(query, sizeof query, "%d.\t%s\t%s\n", i+1, name, logindate);
- strcat(dialog, query);
- }
- }
- ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_TABLIST_HEADERS, "Visi nariai", dialog, "Gerai", "");
- cache_delete(result);
- return 1;
- }
- /*CMD:kismete(playerid, params[])
- {
- //Parodo išmestus narius
- //reason(2019-07-20)(Robis_Nesas)
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- return 1;
- }*/
- CMD:kpaliko(playerid, params[])
- {
- //Parodo palikusius narius
- //Robis_Nesas(2019-07-20) gg
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- query[60],
- dialog[256],
- name[MAX_PLAYER_NAME],
- leftDate[12],
- leftReason[32]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- mysql_format(connectionHandle, query, sizeof query, "SELECT * FROM `"MYSQL_KLUBAI_LEFT"` WHERE `clubId` = %d", clubid);
- new Cache:result = mysql_query(connectionHandle, query);
- if(cache_get_row_count() != 0)
- {
- for(new i = 0; i < cache_get_row_count(); i++)
- {
- cache_get_field_content(0, "Name", name, connectionHandle, 24);
- cache_get_field_content(0, "Date", leftDate, connectionHandle, 12);
- cache_get_field_content(0, "Reason", leftReason, connectionHandle, 32);
- format(query, sizeof query, "%s(%s) %s\n", name, leftDate, leftReason);
- strcat(dialog, query);
- }
- } else strcat(dialog, "Nėra įrašų");
- ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Paliko klubą", dialog, "Gerai", "");
- cache_delete(result);
- return 1;
- }
- CMD:kvartai(playerid, params[])
- {
- //Įjungia/išjungia klubo vartų darinėjimą
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(Klubai[clubid][clubGatesLocked])
- {
- SendClientMessage(playerid, RED, "* Klubo vartai išjungti.");
- Klubai[clubid][clubGatesLocked] = false;
- }
- else
- {
- SendClientMessage(playerid, GREEN_CLUBS, "* Klubo vartai įjungti.");
- Klubai[clubid][clubGatesLocked] = true;
- }
- return 1;
- }
- CMD:k(playerid, params[])
- {
- //*„%s“ klubo pavaduotojas Robis_Nasas:
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- message[128],
- ownerShip[13],
- string[200]
- ;
- if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, GREEN_CLUBS, "* /k [tekstas]");
- if(ClubDB[playerid][clubOwner] > -1)
- {
- clubid = ClubDB[playerid][clubOwner];
- format(ownerShip, sizeof ownerShip, "lyderis");
- }
- if(ClubDB[playerid][clubCoOwner] > -1)
- {
- clubid = ClubDB[playerid][clubCoOwner];
- format(ownerShip, sizeof ownerShip, "pavaduotojas");
- }
- if(Klubai[clubid][SkelbTim] > gettime()) return SendClientMessage(playerid, RAUDONA, "* Tik kas 30 sekundžių");
- format(string, sizeof string, "*„%s“ klubo %s %s: %s", Klubai[clubid][clubName], ownerShip, Vardas(playerid), message);
- SendClientMessageToAll(RED_CLUBS, string);
- Klubai[clubid][SkelbTim] = gettime() + 30;
- return 1;
- }
- CMD:kpavaduotojas(playerid, params[])
- {
- //Skirti klubo pavaduotoją
- if(ClubDB[playerid][clubOwner] == -1) return 0;
- new
- clubid,
- id,
- string[60 + MAX_PLAYER_NAME]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, RED, "* /kpavaduotojas [vardo dalis]");
- if(ClubDB[id][club] != clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas nėra jūsų klubo narys.");
- if(ClubDB[id][clubCoOwner] == clubid) return SendClientMessage(playerid, RED, "* Šis žaidėjas jau yra jūsų klubo pavaduotojas.");
- 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");
- ClubDB[id][clubCoOwner] = clubid;
- new
- query[256]
- ;
- mysql_format(connectionHandle, query, sizeof query,
- "UPDATE `"MYSQL_KLUBAI"` SET \
- `clubCoOwner` = '%s' \
- WHERE `clubId` = '%d'",Vardas(id),clubid);
- mysql_tquery(connectionHandle, query);
- SendClientMessage(id, YELLOW, "* /klubas - visos klubo lyderio komandos");
- format(string, sizeof string, "* Sveikiname, jūs paskirtas naujuoju %s pavaduotoju.", Klubai[clubid][clubName]);
- SendClientMessage(id, GREEN_CLUBS, string);
- format(string, sizeof string, "* Paskyrėte %s[%d] naujuoju %s klubo pavaduotoju.", Vardas(id), id, Klubai[clubid][clubName]);
- SendClientMessage(playerid, ZYDRA, string);
- format(Klubai[clubid][clubCoOwner], 24, "%s", Vardas(id));
- SaveClubInfo(clubid);
- return 1;
- }
- CMD:kpremija(playerid, params[])
- {
- //Išdalinti tam tikrą pinigų sumą (esantiems šalia)
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- amount
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(sscanf(params, "i", amount)) return SendClientMessage(playerid, ZYDRA, "* Išdalinti premiją esantiems šalia: /kpremija [suma]");
- if(amount < 1 || amount > 999999999) return SendClientMessage(playerid, RED, "* Bloga suma.");
- if(amount > GetPlayerMoneyA(playerid)) return SendClientMessage(playerid, RED, "* Neturite tiek pinigų.");
- if(amount < 1000) return SendClientMessage(playerid, RED, "* Dalinate per mažą sumą.");
- new
- count,
- Float:pposX,
- Float:pposY,
- Float:pposZ,
- string[64],
- string2[64]
- ;
- GetPlayerPos(playerid, pposX, pposY, pposZ);
- foreach(new i : Player)
- {
- if(i == playerid) continue;
- if(ClubDB[i][club] == clubid)
- {
- if(IsPlayerInRangeOfPoint(i, 15, pposX, pposY, pposZ))
- {
- count++;
- }
- }
- }
- if(count < 1) return SendClientMessage(playerid, RED, "* Prie jūsų nėra klubo narių.");
- if(amount % count == 0)
- {
- format(string, sizeof string, "***Gavote {db881a}%s{33ccff} iš {db881a}klubo lyderio", AddPoints(amount / count));
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid)
- {
- if(IsPlayerInRangeOfPoint(i, 15, pposX, pposY, pposZ))
- {
- if(i != playerid)
- {
- GivePlayerMoneyA(i, amount / count);
- SendClientMessage(i, ZYDRA, string);
- }
- format(string2, sizeof string2, "***Davėte {db881a}%s{33ccff} € {db881a}%s", AddPoints(amount / count), Vardas(i));
- SendClientMessage(playerid, ZYDRA, string2);
- }
- }
- }
- GivePlayerMoneyA(playerid, -amount);
- }
- else
- {
- amount -= (amount % count);
- format(string, sizeof string, "***Gavote {db881a}%s{33ccff} iš {db881a}klubo lyderio", AddPoints(amount / count));
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid)
- {
- if(IsPlayerInRangeOfPoint(i, 15, pposX, pposY, pposZ))
- {
- if(i != playerid)
- {
- GivePlayerMoneyA(i, amount / count);
- SendClientMessage(i, ZYDRA, string);
- }
- format(string2, sizeof string2, "***Davėte {db881a}%s{33ccff} € {db881a}%s", AddPoints(amount / count), Vardas(i));
- SendClientMessage(playerid, ZYDRA, string2);
- }
- }
- }
- GivePlayerMoneyA(playerid, -amount);
- }
- return 1;
- }
- CMD:kpremijav(playerid, params[])
- {
- //Išdalinti tam tikrą pinigų sumą (visiems prisijungusiems klubo nariams)
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- amount,
- count,
- string[64],
- string2[64]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(sscanf(params, "i", amount)) return SendClientMessage(playerid, ZYDRA, "* Išdalinti premiją prisijungusiems žaidėjams: /kpremijav [suma]");
- if(amount < 1 || amount > 999999999) return SendClientMessage(playerid, RED, "* Bloga suma.");
- if(amount > GetPlayerMoneyA(playerid)) return SendClientMessage(playerid, RED, "* Neturite tiek pinigų.");
- if(amount < 1000) return SendClientMessage(playerid, RED, "* Dalinate per mažą sumą.");
- foreach(new i : Player)
- {
- if(i == playerid) continue;
- if(ClubDB[i][club] == clubid)
- {
- count++;
- }
- }
- if(count < 1) return SendClientMessage(playerid, RED, "* Prie jūsų nėra klubo narių.");
- if(amount % count == 0)
- {
- format(string, sizeof string, "***Gavote {db881a}%s{33ccff} iš {db881a}klubo lyderio", AddPoints(amount / count));
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid)
- {
- if(i != playerid)
- {
- GivePlayerMoneyA(i, amount / count);
- SendClientMessage(i, ZYDRA, string);
- }
- format(string2, sizeof string2, "***Davėte {db881a}%s{33ccff} € {db881a}%s", AddPoints(amount / count), Vardas(i));
- SendClientMessage(playerid, ZYDRA, string2);
- }
- }
- GivePlayerMoneyA(playerid, -amount);
- }
- else
- {
- amount -= (amount % count);
- format(string, sizeof string, "***Gavote {db881a}%s{33ccff} iš {db881a}klubo lyderio", AddPoints(amount / count));
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == clubid)
- {
- if(i != playerid)
- {
- GivePlayerMoneyA(i, amount / count);
- SendClientMessage(i, ZYDRA, string);
- }
- format(string2, sizeof string2, "***Davėte {db881a}%s{33ccff} € {db881a}%s", AddPoints(amount / count), Vardas(i));
- SendClientMessage(playerid, ZYDRA, string2);
- }
- }
- GivePlayerMoneyA(playerid, -amount);
- }
- return 1;
- }
- CMD:kfondas(playerid, params[])
- {
- //klubo fondo komandos
- //*** Klubo fonde yra {db881a}0 €
- if(ClubDB[playerid][club] == -1) return 0;
- new
- clubid,
- string[41 + 11]
- ;
- clubid = ClubDB[playerid][club];
- format(string, sizeof string, "*** Klubo fonde yra {db881a}%s{33ccff} €", AddPoints(Klubai[clubid][clubMoney]));
- SendClientMessage(playerid, ZYDRA, string);
- return 1;
- }
- CMD:kisimti(playerid, params[])
- {
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid,
- amount,
- string[49 + 13]
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(sscanf(params, "d", amount)) return SendClientMessage(playerid, RED, "* /kisimti [suma]");
- if(amount < 1 || amount > 999999999) return SendClientMessage(playerid, RED, "* Blogai įvesta suma.");
- if(amount > Klubai[clubid][clubMoney]) return SendClientMessage(playerid, RED, "* Klubo fonde tiek pinigų nėra.");
- GivePlayerMoneyA(playerid, amount);
- Klubai[clubid][clubMoney] -= amount;
- format(string, sizeof string, "*** Pasiėmėte {db881a}%s{33ccff} € iš klubo fondo", AddPoints(amount));
- SendClientMessage(playerid, ZYDRA, string);
- SaveClubInfo(clubid);
- return 1;
- }
- CMD:kideti(playerid, params[])
- {
- if(ClubDB[playerid][club] == -1) return 0;
- new
- clubid = ClubDB[playerid][club],
- amount,
- string[80]
- ;
- if(sscanf(params, "i", amount)) return SendClientMessage(playerid, RED, "* /kideti [suma]");
- if(GetPlayerMoneyA(playerid) < amount) return SendClientMessage(playerid, RED, "* Neturite tiek pinigų.");
- if(amount < 1 || amount > 999999999) return SendClientMessage(playerid, RED, "* Blogai įvesta suma.");
- GivePlayerMoneyA(playerid, -amount);
- Klubai[clubid][clubMoney] += amount;
- format(string, sizeof string, "*** Įdėjote {db881a}%s{33ccff} € į klubo fondą.", AddPoints(amount));
- SendClientMessage(playerid, ZYDRA, string);
- foreach(new i : Player)
- {
- if(i == playerid) continue;
- if(ClubDB[i][club] == clubid)
- {
- SendClientMessage(i, ZYDRA, string);
- }
- }
- SaveClubInfo(clubid);
- return 1;
- }
- CMD:kinfo(playerid, params[])
- {
- //galimybė sužinoti klubo galiojimą, keisti skin, mašinas
- //Klubo pavadinimas: „Rinktinė“ (/kpavadinimas | 200kr | 12.000.000€)
- //Klubo vyro išvaizda: 208 (/kvskin | 100kr. | 6.000.000€)
- //Klubo moters išvaizda: 85 (/kmskin | 100kr. | 6.000.000€)
- //Mašinų spalva: 6 (/kspalva | 100kr. | 6.000.000€)
- //Sąjunga: „Rinktinė“ (/ksajunga | /kpsajunga (panaikinti))
- //Fonde: -2763€ (/kisimti | /kideti)
- //Galioja: 6 (/kpratesti | 1000kr. | 60.000.000€)
- //Neleisti užimti klubo 15min. (/katranka)
- if(ClubDB[playerid][clubOwner] == -1) return 0;
- new
- clubid,
- string[128],
- dialog[512]
- ;
- //21e790
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- format(string, sizeof string, "{1ab873}Klubo pavadinimas: {ffffff}„%s“ (/kpavadinimas | 100kr | 1.000.000€)\n", Klubai[clubid][clubName]);
- strcat(dialog, string);
- format(string, sizeof string, "{1ab873}Klubo vyro išvaizda: {ffffff}%d (/kvskin | 100kr. | 1.000.000€)\n", Klubai[clubid][clubMenSkin]);
- strcat(dialog, string);
- format(string, sizeof string, "{1ab873}Klubo moters išvaizda: {ffffff}%d (/kmskin | 100kr. | 1.000.000€)\n", Klubai[clubid][clubWomenSkin]);
- strcat(dialog, string);
- format(string, sizeof string, "{1ab873}Mašinų spalva: {ffffff}%d (/kspalva | 100kr. | 1.000.000€)\n", Klubai[clubid][clubCarColor]);
- strcat(dialog, string);
- /*format(string, 72, "{21e790}Mašinų spalva: %d (/kspalva | 100kr. | 6.000.000€)\n", Klubai[clubid][clubCarColor]);
- strcat(string, string);*/
- format(string, sizeof string, "{1ab873}Fonde: {ffffff}%d€ (/kisimti | /kideti)\n", Klubai[clubid][clubMoney]);
- strcat(dialog, string);
- new galiojimas = (Klubai[clubid][clubLast] - gettime()) / 86400;
- format(string, sizeof string, "{1ab873}Galioja: {ffffff}%d (/kpratesti | %dkr. | %s€)\n", galiojimas, Klubai[clubid][clubPriceCredits], AddPoints(Klubai[clubid][clubPriceMoney]));
- strcat(dialog, string);
- format(string, sizeof string, "{1ab873}Neleisti užimti klubo 15min. {ffffff}(/katranka)", galiojimas);
- strcat(dialog, string);
- ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Klubo komandos", dialog, "Gerai", "");
- return 1;
- }
- CMD:kpavadinimas(playerid)
- {
- if(ClubDB[playerid][clubOwner] == -1) return 0;
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_NAME, DIALOG_STYLE_LIST, "Klubo pavadinimas", "\n \nUž kreditus\nUž pinigus", "Toliau", "Atšaukti");
- return 1;
- }
- CMD:kvskin(playerid)
- {
- if(ClubDB[playerid][clubOwner] == -1) return 0;
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_VSKIN, DIALOG_STYLE_LIST, "Klubo skin", "\n \nUž kreditus\nUž pinigus", "Toliau", "Atšaukti");
- return 1;
- }
- CMD:kmskin(playerid)
- {
- if(ClubDB[playerid][clubOwner] == -1) return 0;
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_MSKIN, DIALOG_STYLE_LIST, "Klubo moters skin", "\n \nUž kreditus\nUž pinigus", "Toliau", "Atšaukti");
- return 1;
- }
- CMD:kspalva(playerid)
- {
- if(ClubDB[playerid][clubOwner] == -1) return 0;
- ShowPlayerDialog(playerid, DIALOG_KLUBAS_CARCOLOR, DIALOG_STYLE_LIST, "Klubo mašinos spalva", "\n \nUž kreditus\nUž pinigus", "Toliau", "Atšaukti");
- return 1;
- }
- CMD:kpratesti(playerid)
- {
- if(ClubDB[playerid][clubOwner] == -1) return 0;
- 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");
- return 1;
- }
- CMD:katranka(playerid)
- {
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- if(Klubai[clubid][clubShield] > gettime()) return SendClientMessage(playerid, RED, "* Jūs jau esate pradėjęs atranką.");
- Klubai[clubid][clubShield] = gettime() + 900;
- SendClientMessage(playerid, GREEN_CLUBS, "* Jūsų klubo negalės užpulti 15 minučių.");
- return 1;
- }
- CMD:krespawn(playerid, params[])
- {
- //atsatato nenaudojamas tr. priemones
- if(ClubDB[playerid][clubOwner] == -1 && ClubDB[playerid][clubCoOwner] == -1) return 0;
- new
- clubid
- ;
- if(ClubDB[playerid][clubOwner] > -1) clubid = ClubDB[playerid][clubOwner];
- if(ClubDB[playerid][clubCoOwner] > -1) clubid = ClubDB[playerid][clubCoOwner];
- for(new i = 0, j = GetVehiclePoolSize(); i < j; i++)
- {
- if(IsPlayersInVehicle(i)) continue;
- if(VehicleDB[i][vehicleClub] == clubid)
- SetVehicleToRespawn(i);
- }
- SendClientMessage(playerid, GREEN_CLUBS, "* Atsatėtė klubo transportą.");
- return 1;
- }
- ///
- stock ClearPlayerInfo(playerid)
- {
- ClubDB[playerid][clubOwner] = -1;
- ClubDB[playerid][clubCoOwner] = -1;
- ClubDB[playerid][club] = -1;
- ClubDB[playerid][clubInvitation] = -1;
- }
- stock GetKDirektoriusName(cId)
- {
- new query[64], name[28];
- mysql_format(connectionHandle, query, sizeof query, "SELECT `clubOwner` FROM `"MYSQL_KLUBAI"` WHERE `clubId` = %d", cId);
- new Cache:result = mysql_query(connectionHandle, query);
- if(cache_get_row_count() == 1)
- {
- cache_get_field_content(0, "clubOwner", name, connectionHandle, 24);
- }
- cache_delete(result);
- if(GetPlayeridMid(name) != INVALID_PLAYER_ID) format(name, sizeof name, "{00FF00}%s", name);
- else format(name, sizeof(name), "{FF0000}%s", name);
- return name;
- }
- stock GetKPavaduotojasName(cId)
- {
- new query[64], name[28];
- mysql_format(connectionHandle, query, sizeof query, "SELECT `clubCoOwner` FROM `"MYSQL_KLUBAI"` WHERE `clubId` = %d", cId);
- new Cache:result = mysql_query(connectionHandle, query);
- if(cache_get_row_count() == 1)
- {
- cache_get_field_content(0, "clubCoOwner", name, connectionHandle, 24);
- }
- cache_delete(result);
- if(GetPlayeridMid(name) != INVALID_PLAYER_ID) format(name, sizeof name, "{00FF00}%s", name);
- else format(name, sizeof(name), "{FF0000}%s", name);
- return name;
- }
- stock SaveClubInfo(cId)
- {
- new
- query[256]
- ;
- mysql_format(connectionHandle, query, sizeof query,
- "UPDATE `"MYSQL_KLUBAI"` SET \
- `clubName` = '%s', \
- `clubOwner` = '%s', \
- `clubLast` = '%i', \
- `clubCarColor` = '%i', \
- `clubMenSkin` = '%i', \
- `clubWomenSkin` = '%i', \
- `clubMoney` = '%i' \
- WHERE `clubId` = '%d'",
- Klubai[cId][clubName],
- Klubai[cId][clubOwner],
- Klubai[cId][clubLast],
- Klubai[cId][clubCarColor],
- Klubai[cId][clubMenSkin],
- Klubai[cId][clubWomenSkin],
- Klubai[cId][clubMoney],
- cId
- );
- mysql_tquery(connectionHandle, query);
- return 1;
- }
- stock ResetClubData(cId)
- {
- mysql_tquery(connectionHandle,
- "UPDATE `"MYSQL_KLUBAI_USERS"` SET `clubOwner` = -1, `clubCoOwner` = -1, `club` = -1 WHERE `club` = %d", "", "d", cId);
- foreach(new i : Player)
- {
- if(ClubDB[i][clubOwner] == cId || ClubDB[i][clubCoOwner] == cId || ClubDB[i][club] == cId)
- {
- ClubDB[i][clubOwner] = -1;
- ClubDB[i][clubCoOwner] = -1;
- ClubDB[i][club] = -1;
- }
- }
- format(Klubai[cId][clubOwner], 24, "");
- format(Klubai[cId][clubCoOwner], 24, "");
- Klubai[cId][clubLast] = 0;
- SaveClubInfo(cId);
- }
- stock CreateClubVehicle(modelid, Float:x, Float:y, Float:z, Float:r, color1, cId)
- {
- new vehicleid;
- vehicleid = AddStaticVehicleEx(modelid, x, y, z, r, color1, color1, 900, 0);
- format(VehicleDB[vehicleid][LastDriverName],24,"Nėra");
- VehicleDB[vehicleid][VehicleEngineState] = 0;
- VehicleDB[vehicleid][VehicleLights] = 0;
- VehicleDB[vehicleid][VRibotuvas] = 0;
- VehicleDB[vehicleid][VehicleDedicatedForEvent] = 0;
- VehicleDB[vehicleid][TURGUS] = 0;
- VehicleDB[vehicleid][Rida] = 0;
- VehicleDB[vehicleid][Bendzinas] = DegaluTalpa[modelid-400];
- VehicleDB[vehicleid][Dujos] = 0;
- VehicleDB[vehicleid][FuelType] = 0;
- VehicleDB[vehicleid][VMMasina] = 0;
- VehicleDB[vehicleid][DARBOMASINA] = false;
- VehicleDB[vehicleid][DARBOID] = 0;
- VehicleDB[vehicleid][VehicleOwnerID] = -1;
- format(VehicleDB[vehicleid][VehicleNumbers],8,"Nėra");
- VehicleDB[vehicleid][VehicleNumReg] = 0;
- VehicleDB[vehicleid][VehicleColor1] = 0;
- VehicleDB[vehicleid][VehicleColor2] = 0;
- VehicleDB[vehicleid][VehicleDatabaseID] = -1;
- VehicleDB[vehicleid][VehicleWithOwner] = false;
- VehicleDB[vehicleid][VehicleLocked] = true;
- VehicleDB[vehicleid][VehicleSuSignalizacija] = false;
- VehicleDB[vehicleid][VehicleAlarmStatus] = false;
- VehicleDB[vehicleid][VehicleDauztumas] = 0;
- VehicleDB[vehicleid][DujuIranga] = 0;
- VehicleDB[vehicleid][AdminMasina] = false;
- VehicleDB[vehicleid][VIPMasina] = false;
- VehicleDB[vehicleid][vehicleClub] = cId;
- return vehicleid;
- }
- stock SendClubMessage(cId, color, text[])
- {
- foreach(new i : Player)
- {
- if(ClubDB[i][club] == cId)
- {
- SendClientMessage(i, color, text);
- }
- }
- }
- stock SavePlayerClubData(playerid)
- {
- new
- query[150 + MAX_PLAYER_NAME]
- ;
- mysql_format(connectionHandle, query, sizeof query,
- "UPDATE `"MYSQL_KLUBAI_USERS"` SET \
- `clubOwner` = %i, \
- `clubCoOwner` = %i, \
- `club` = %i, \
- `clubXP` = %i \
- WHERE `Name` = '%e'",
- ClubDB[playerid][clubOwner],
- ClubDB[playerid][clubCoOwner],
- ClubDB[playerid][club],
- ClubDB[playerid][clubXP],
- Vardas(playerid)
- );
- mysql_tquery(connectionHandle, query);
- return 1;
- }
- ResetClubAttack()
- {
- for(new i = 0; i < MAX_CLUBS; i++)
- {
- KillTimer(Klubai[i][secondTimer]);
- Klubai[i][stolenMoney] = 0;
- Klubai[i][underAttack] = -1;
- Klubai[i][attackingClub] = -1;
- format(Klubai[i][attackDate], 24, "");
- Klubai[i][clubAttackPrice] = 0;
- Klubai[i][attackTime] = 0;
- Klubai[i][attackTimeMinutes] = 0;
- Klubai[i][attackTimeHours] = 0;
- UpdateDynamic3DTextLabelText(Klubai[i][clubAttackLabel], GRAY,
- "Klubo užėmimas\n{db881a}/kuzimti{b4b5b7}\n \n \n \nGaunamas XP kol matoma ši žinutė");
- SaveClubInfo(i);
- }
- counter = 10;
- ClubOnAttack = false;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement