Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- KaLu (c) 2012 / 2013
- */
- #include <a_samp>
- #include <zcmd>
- #include <DOF2>
- #include <streamer>
- #include <a_mysql>
- #include <md5>
- #include <sscanf2>
- #include <foreach>
- #include <CTime>
- #include <a_npc>
- #define SAVE_PLAYER_BASIC 1
- #define SAVE_PLAYER_POS 2
- #define SAVE_PLAYER_CASH 4
- #define SAVE_PLAYER_ORG 8
- #define SAVE_PLAYER_GROUP 16
- #define SAVE_PLAYER_SKILLS 32
- #define GLOBAL_BLOCK_RUN 1
- #define GLOBAL_BLOCK_VEH 2
- #define GLOBAL_BLOCK_GUN 4
- #define GLOBAL_BLOCK_OOC 8
- #define TEAM_DEFAULT 1
- #define DAY_SECOND 86400
- #define INVALID_WEAPON_DATA -1
- #define SERVICE_PREMIUM_1 10
- #define SERVICE_PREMIUM_2 19
- #define SERVICE_PREMIUM_3 27
- #define SERVICE_PREMIUM_4 4
- #define SERVICE_PREMIUM_5 7
- #define SERVICE_PREMIUM_6 5
- #define SERVICE_PREMIUM_7 10
- #define SERVICE_PREMIUM_8 8
- #define SERVICE_PREMIUM_9 10
- #define SERVICE_PREMIUM_10 8
- #define SERVICE_PREMIUM_11 4
- #define SERVICE_PREMIUM_11 4
- #define SERVICE_PREMIUM_12 0
- #define SERVICE_B_PREMIUM_1 1 //Konto premium 7 dni
- #define SERVICE_B_PREMIUM_2 2 //Konto premium 14 dni
- #define SERVICE_B_PREMIUM_3 4 //Konto premium 31 dni
- #define SERVICE_B_PREMIUM_4 8 //Dowolny przedmiot SMS
- #define SERVICE_B_PREMIUM_5 16 //Blokada postaci
- #define SERVICE_B_PREMIUM_6 32 //Edycja kodu CSS / HTML
- #define SERVICE_B_PREMIUM_7 64 //Nowa grupa
- #define SERVICE_B_PREMIUM_8 128 //10 etykiet
- #define SERVICE_B_PREMIUM_9 256 //Zmiana tożsamości
- #define SERVICE_B_PREMIUM_10 512 //Usunięcie postaci
- #define SERVICE_B_PREMIUM_11 1024 //Własny interior
- #define SERVICE_B_PREMIUM_12 2048 //Pakiet obiektów
- main()
- {
- print("RolePlay, 2012 / 13");
- }
- //Definicje Harvest
- #define chrtolower(%1) \
- (((%1) > 0x40 && (%1) <= 0x5A) ? ((%1) | 0x20) : (%1))
- #define chrtoupper(%1) \
- (((%1) > 0x60 && (%1) <= 0x7A) ? ((%1) ^ 0x20) : (%1))
- #if !defined IsNull
- #define IsNull(%1) \
- ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
- #endif
- #define COLOR_PURPLE 0xC2A2DAFF
- #define COLOR_PURPLE2 0xE0EA64FF
- #define COLOR_DESC 0xC2A2DAFF
- #define COLOR_DO 0x9A9CCDFF
- #define CHAR_SEX_MALE 1
- #define CHAR_SEX_FEMALE 2
- //koniec definicji Harvest
- #define OFFER_VEHICLE 1
- #define OFFER_DOORS 2
- #define OFFER_WELCOME 3
- #define OFFER_REPAIR 7
- #define OFFER_REGISTER 8
- #define OFFER_MONTAGE 9
- #define OFFER_RESPRAY 9999
- #define GAMEMODE_TEXT "RolePlay ßeta"
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 100
- #define MAX_DRZWI 200
- #define Funkcja::%1(%2) forward %1(%2);public %1(%2)
- /* Makro definicje */
- #define Maska(%1) GetPVarInt(%1, "rpMaska")
- #define setMaska(%1,%2) SetPVarInt(%1, "rpMaska", %2)
- #define Status(%1) GetPVarInt(%1, "rpStatus")
- #define setStatus(%1,%2) SetPVarInt(%1, "rpStatus", %2)
- #define Sluzba(%1) GetPVarInt(%1, "rpDuty")
- #define setSluzba(%1,%2) SetPVarInt(%1, "rpDuty", %2)
- #define Rekawice(%1) GetPVarInt(%1, "rpRekawice");
- #define setRekawice(%1,%2) SetPVarInt(%1, "rpRekawice", %2)
- #define Login(%1) GetPVarInt(%1, "rpLogin")
- #define setLogin(%1,%2) SetPVarInt(%1, "rpLogin", %2)
- #define Obiekt(%1) GetPVarInt(%1, "rpObiekt")
- #define setObiekt(%1,%2) SetPVarInt(%1, "rpObiekt", %2)
- #define SQL_HOST "localhost"
- #define SQL_USER "root"
- #define SQL_DB "kalu"
- #define SQL_PASS ""
- #define DIALOG_ID 1
- #define tablename1 "1postacie"
- #define guidname1 "member_id"
- #define name1 "nick"
- #define player_uid1 "owneruid"
- #define Dialog(%1) GetPVarInt(%1, "Dialog")
- #define setDialog(%1,%2) SetPVarInt(%1, "Dialog", %2)
- #define ServName "{AAC5E3}SA:MP RolePlay {B3D341}»{AAC5E3} "
- #define Info(%1,%2) dShowPlayerDialog(%1, 9999, DIALOG_STYLE_MSGBOX, "{AAC5E3}SA:MP RolePlay {B3D341}»{AAC5E3} Informacja", %2, "Rozumiem", "")
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 100
- #define MAX_TEXTDRAW 25
- #define MAX_OBIEKT 5000
- #define KOL_NAME 0xFFFFFFBB
- #define KOL_DAMAGE 0xFF0000BB
- #define KOL_HEALTHUPDATE 0x368A1EBB
- #define KOL_ME 0x9378abFF
- #define KOL_DO 0x999cccFF
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define MAX_IP_SIZE 17
- #define MAX_ITEM 10000
- #define MAX_POJAZDY 5000
- #define DIALOG_ITEM_EDIT 5
- //sloty doczepianych obiektów
- #define ATTACH_SLOT_1 1//broń
- #define ATTACH_SLOT_2 2
- #define ATTACH_SLOT_3 3
- #define ATTACH_SLOT_4 4
- #define ATTACH_SLOT_5 5
- //
- #define OWNER_PLAYER 1
- #define OWNER_GROUP 2
- #define OWNER_NONE 3
- #define OWNER_VEHICLE 4
- #define EDIT_ITEM "1\tEdytuj nazwę przedmiotu\n2\tEdytuj wartości przedmiotu\n3\tEdytuj typ przedmiotu wedle listy\n4\tEdytuj właściciela przedmiotu\n5\tPokaż informacje o przedmiocie\n6\tUsuń przedmiot\n7\tEdytuj wagę przedmiotu\n8\tOflaguj przedmiot dla grupy"
- #define KILL_LIMIT 4 //Limit killów na sekunde
- #define MAX_GRUPY 200
- #define DOOR_OPTIONS "1\tPokaż informacje o drzwiach\n2\tZmień nazwę wyświetlaną\n3\tPrzepisz drzwi\n4\tZmień pozycję wewnętrzną\n5\tUkryj pickup\n6\tZajrzyj do schowka\n7\tSkasuj interior"
- //definicje ustawień
- new Random_Skin_Male[][1] = {
- {1},
- {2},
- {3},
- {4},
- {6},
- {7},
- {14},
- {15},
- {17},
- {18},
- {19},
- {20},
- {21},
- {23},
- {26},
- {29},
- {30},
- {32},
- {35},
- {37},
- {43},
- {44},
- {46},
- {47},
- {58},
- {59},
- {66},
- {67},
- {72},
- {73},
- {98},
- {147},
- {156},
- {177}
- };
- new Random_Skin_Female[][1] = {
- {9},
- {11},
- {12},
- {31}
- };
- new StatsObj, StatsDoor, StatsGroup, StatsItem, StatsVeh, StatsZone;
- new Float:VehicleLastPos[MAX_VEHICLES][4];
- new Serwer[2], restart = 0, Statystyki[5];
- /* Statystyki
- 0 Logowania
- 1 Gracze
- 2 Komendy
- 3 Kary
- 4 Online
- */
- //itemy
- new Text:ItemTD0[MAX_PLAYERS],
- Text:ItemTD1[MAX_PLAYERS],
- Text:ItemTD2[MAX_PLAYERS],
- Text:ItemTD3[MAX_PLAYERS],
- Text:ItemTD4[MAX_PLAYERS],
- Text:ItemTD5[MAX_PLAYERS],
- Text:ItemTD6[MAX_PLAYERS],
- Text:ItemTD7[MAX_PLAYERS],
- Text:ItemTD8[MAX_PLAYERS],
- Text:ItemTD9[MAX_PLAYERS],
- Text:ItemTD10[MAX_PLAYERS];
- //
- new Text:ImagenGift;
- new ImagesGift[][] = { "LOADSUK:loadsc1","LOADSUK:loadsc2","LOADSUK:loadsc3","LOADSUK:loadsc4","LOADSUK:loadsc5","LOADSUK:loadsc6","LOADSUK:loadsc7","LOADSUK:loadsc8","LOADSUK:loadsc9","LOADSUK:loadsc10","LOADSUK:loadsc11","LOADSUK:loadsc12","LOADSUK:loadsc13","LOADSUK:loadsc14" };
- new Text:Licznik0[MAX_PLAYERS], Text:Licznik1[MAX_PLAYERS], Text:Licznik2[MAX_PLAYERS], Text:Licznik3[MAX_PLAYERS];
- /*
- Typy przedmiotów:
- 1 - Broń
- 2 - Ubranie
- 3 - Żywność
- 4 - Brak typu
- 5 - Komponenty zewnętrzne - tuning
- 6 - Narkotyki
- 7 - Rękawiczki
- 8 - Maska
- 9 - Medykamenty
- 10 - Megafon
- 11 - Kajdanki
- 12 - Części / Akcesoria dające pojazdom HP
- 13 - Amunicja
- 14 - Torby / Plecaki - od wagi
- 15 - Ciało
- 16 - Telefon komórkowy
- 17 - torba prawdziwa
- 18 - klucze do pojazdu (wartość1 - UID, wartosc2 - 0)
- 19 - Wędka
- 20 - weksel na pojfazd
- 21 - Discman
- 22 - Teczka
- 23 - Plecak
- 24 - Kanister
- 25 - Gotówka
- Typy ownerów (Przedmiot):
- 1 - postać
- 2 - pojazd
- 3 - grupa
- 4 - paczka
- 5 - torba
- 6 - karton
- 7 - nikt
- 8 - komponent
- Typy ownerów (Drzwi):
- 1 - gracz
- 2 - grupa
- 3 - nikt
- Typy drzwi
- 1 - dom
- 2- biznes
- Typy ownerów (Pojazd):
- 1 - gracz
- 2 - grupa
- 3 - praca
- Typy grup:
- 0 - brak
- 1 - LSPD
- 2 - Hospital
- 3 - Rząd
- 4 - San News
- 5 - Warsztat / Stacja paliw
- 6 - Siłownia
- 7 - Sklep 24/7
- 8 - Firma kurierska
- 9 - Binco
- 10 - (Przestępcza) Gang
- 11 - (Przestępcza) Mafia
- 12 - (Przestępcza) Szajka
- Spawny (gracz)
- 0 - główny
- 1 - drzwi mieszkalne
- 2 - hotel
- */
- enum Globalne
- {
- ipb_ZoneShow, ipb_Grupa, ipb_GameScore, ipb_Premium, ipb_NoRUN, ipb_NoVEH, ipb_NoOOC, ipb_NoGUN, ipb_Ban, ipb_BanTime, ipb_Obiekty, ipb_PremiumScore, ipb_PremiumService, ipb_Object, ipb_3DText
- };
- new Text3D:Veh3DText[MAX_VEHICLES];
- //Strefy
- enum sGangZones
- {
- gAktywna, Float:gMinX, Float:gMinY, Float:gMaxX, Float:gMaxY,
- gColor, gOwner, gOwnerUID, gNazwa[64], gSpeed
- };
- new GangZoneInfo[MAX_GANG_ZONES][sGangZones], GangZone[MAX_GANG_ZONES];
- //Koniec stref
- enum zPlayer
- {
- pLastSkin, pDutyAll, pAchiv1, pAchiv2, pAchiv3, pSesja, pIP[MAX_IP_SIZE], pUID, pNick[256], pKonto, pAdmin, pOnline, pSkin, pFirstSkin, pGID, pInGame, pInGameOd, pMiasto[64], pStrefa, pGodziny, pLastLogin,
- pMayor, pName[64], pSalt[64], pPayDayGame, pAJ, pJail, pRadio, pBW, Float:pHP, pKasa, pDlug, pBank, pSex, pWiek, pSila, pSpawn, pSpawnID, pSpawnTyp, Float:pPosX, Float:pPosY, Float:pPosZ, pInt, pVir, pInvisible, pTelefon, pQuit, pQuitTime, pJob, Float:pWyjezdzone,
- Text3D:pNickName, Text3D:pOpis, Text3D:pAme, pPakiet, pLastDay, pNameNick[32], pHistoryList[32], pDescList[32], pControl
- };
- enum eObject
- {
- /*
- Typ 0 - Obiekt
- Typ 1 - Brama
- */
- oAktywny, oModel, oVir, oTyp, Float:oPosX, Float:oPosY, Float:oPosZ, Float:oRotX, Float:oRotY, Float:oRotZ,
- oMatIndex, oMatModel, oMatTxdname[64], oMatTexture[64], oGateStatus, oGate, Float:oGateX, Float:oGateY, Float:oGateZ, Float:oGateRotX , Float:oGateRotY, Float:oGateRotZ
- };
- enum ePrzedmiot
- {
- iAktywny, iNazwa[64], iWartosc1, iWartosc2, iWartosc3, iTyp, iOwner, iOwnerUID, iUsed, Float:iPosX, Float:iPosY, Float:iPosZ, iVir, iWaga, Float:iRotX, iFlaga, iFlagaUID, iPremiumPrice, iPrice, iMagazyn
- };
- enum eDrzwi
- {
- dAktywne, dOwner, dOwnerUID, dWewVir, dZewVir, dPickup, dObiekty, dNazwa[64],
- Float:dWewPosX, Float:dWewPosY, Float:dWewPosZ, Float:dZewPosX, Float:dZewPosY, Float:dZewPosZ, dStatus, dIntWew, dIntZew,
- dCreateTime, dCreatePrice, Float:dZewRot, Float:dWewRot
- };
- enum DeathEnum
- {
- time0,
- killed
- };
- new DeathInfo[MAX_PLAYERS][DeathEnum];
- enum eGrupa
- {
- gAktywna, gOwner, gPunkty, gPayDay, gTyp, gNazwa[64], gTag[64], gBank, gWirCash, gKolor, gKolorZone, gVehLimit, gVehLimitSpawn, gFlagPerm
- };
- //strefy
- //
- enum iPack
- {
- pAktywna, pTyp, pValue1, pValue2, pValue3, pPrice, pWaga, pIlosc, pNazwa[64], pOwner, pOwnerUID, pDoor, pFlaga, pFlagaUID, pDostarcza
- };
- new Paczka[MAX_ITEM][iPack];
- enum eCars
- {
- vAktywny, vModel, vOwner, vOwnerUID, vKolor1, vKolor2, Float:vPrzebieg, Float:vHP, Float:vPosX, Float:vPosY, Float:vPosZ, Float:vRot, vVir, vReje, vSpawn, vPanels, vDoors, vLights, vTires, vPaliwoTyp, Float:vPaliwo, Float:vPaliwoMax, vBlokada, vBlokadaText[64]
- };
- enum sOffer
- {
- oCustomerID,
- oType,
- oValue1,
- oValue2,
- oValue3,
- oItemUID,
- oControlUID,
- oGroupUID,
- oPrice,
- oBlock
- }
- new Offer[MAX_PLAYERS][sOffer];
- new Pojazd[MAX_POJAZDY][eCars], PojazdModel[MAX_VEHICLES], PojazdUID[MAX_VEHICLES], engine, lights, alarm, doors, bonnet, boot, objective;
- new pGrupa[MAX_PLAYERS][6], pGrupaPayDay[MAX_PLAYERS][6], pGrupaPerm[MAX_PLAYERS][6];
- new IPB[MAX_PLAYERS][Globalne], Player[MAX_PLAYERS][zPlayer],Obiekt[MAX_OBIEKT][eObject], LogData[50], LogStr[256], Dzien, Miesiac, Rok,
- globaluid[MAX_PLAYERS], playeruid[MAX_PLAYERS], String[250], MapObiekt[MAX_OBIEKT], Text:Doors[MAX_PLAYERS], Text:Informacja[MAX_PLAYERS],
- InfoWyswietla[MAX_PLAYERS], DrzwiTimer[MAX_PLAYERS], ItemObiekt[MAX_ITEM], Text:Tiper[MAX_PLAYERS], Przedmiot[MAX_ITEM][ePrzedmiot], Drzwi[MAX_DRZWI][eDrzwi], DrzwiPickup[MAX_DRZWI], Text:TDKara, bool:NapisUzywany, NapisTimer, ListItemTD[MAX_PLAYERS][100], ListItem[MAX_PLAYERS][MAX_ITEM / 50],
- Float:dHP[MAX_PLAYERS], Text:PasekSanNews[MAX_PLAYERS], Text:TDData, Grupa[MAX_GRUPY][eGrupa], Text:TDOffe[MAX_PLAYERS];
- new ItemTyp[24][32]={
- "Broń", "Ubranie", "Żywność", "Brak typu", "Komponenty tuningowe", "Narkotyki", "Rękawiczki", "Maska", "Medykamenty", "Megafon", "Kajdanki", "Części pojazdów (HP)", "Amunicja", "Torby", "Ciało",
- "Telefon komórkowy", "Klucze do pojazdu", "Wędka", "Weksel na pojazd", "Discman", "Teczka", "Plecak", "Kanister", "Gotówka"
- };
- new VehTune[MAX_POJAZDY][14];
- new nazwypojazdow[212][32]=
- {
- "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana",
- "Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat",
- "Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks",
- "Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral",
- "Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy",
- "Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Harley","RC Baron","RC Raider","Glendale","Oceanic",
- "Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR 350","Walton","Regina",
- "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher",
- "Virgo","Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa",
- "RC Goblin","Hotring Racer","Hotring Racer","Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike",
- "Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic","Buccaneer","Shamal","Hydra",
- "FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck","Willard","Forklift","Traktor",
- "Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover","Sadler",
- "Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor",
- "Monster","Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna",
- "Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley",
- "Stafford","BF-400","Newsvan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer","Trailer",
- "Andromeda","Dodo","RC Cam","Launch","LS Police-Car","SF Police-Car","LV Police-Car","Police Rancher","Picador","SWAT Van",
- "Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
- };
- new Float:IntArray[146][4] = {
- {2003.12,1015.19,33.01,351.58},
- {770.8,-0.7,1000.73,22.86},
- {974.02,-9.59,1001.15,22.6},
- {961.93,-51.91,1001.12,95.54},
- {830.6,5.94,1004.18,125.81},
- {1037.83,0.4,1001.28,353.93},
- {1212.15,-28.54,1000.95,170.57},
- {1290.41,1.95,1001.02,179.94},
- {1412.15,-2.28,1000.92,114.66},
- {1527.05,-12.02,1002.1,350.0},
- {1523.51,-47.82,1002.27,262.7},
- {612.22,-123.9,997.99,266.57},
- {512.93,-11.69,1001.57,198.77},
- {418.47,-80.46,1001.8,343.24},
- {386.53,173.64,1008.38,63.74},
- {288.47,170.06,1007.18,22.05},
- {206.46,-137.71,1003.09,10.93},
- {-100.27,-22.94,1000.72,17.29},
- {-201.22,-43.25,1002.27,45.86},
- {-202.94,-6.7,1002.27,204.27},
- {-25.72,-187.82,1003.55,5.08},
- {454.99,-107.25,999.44,309.02},
- {372.56,-131.36,1001.49,354.23},
- {378.03,-190.52,1000.63,141.02},
- {315.24,-140.89,999.6,7.42},
- {225.03,-9.18,1002.22,85.53},
- {611.35,-77.56,998.0,320.93},
- {246.07,108.97,1003.22,0.29},
- {6.09,-28.9,1003.55,5.04},
- {773.73,-74.7,1000.65,5.23},
- {621.45,-23.73,1000.92,15.68},
- {445.6,-6.98,1000.73,172.21},
- {285.84,-39.02,1001.52,0.75},
- {204.12,-46.8,1001.8,357.58},
- {245.23,304.76,999.15,273.44},
- {290.62,309.06,999.15,89.92},
- {322.5,303.69,999.15,8.17},
- {-2041.23,178.4,28.85,156.22},
- {-1402.66,106.39,1032.27,105.14},
- {-1403.01,-250.45,1043.53,355.86},
- {1204.67,-13.54,1000.92,350.02},
- {2016.12,1017.15,996.88,88.01},
- {-741.85,493.0,1371.98,71.78},
- {2447.87,-1704.45,1013.51,314.53},
- {2527.02,-1679.21,1015.5,260.97},
- {-1129.89,1057.54,1346.41,274.53},
- {2496.05,-1695.17,1014.74,179.22},
- {366.02,-73.35,1001.51,292.01},
- {2233.94,1711.8,1011.63,184.39},
- {269.64,305.95,999.15,215.66},
- {414.3,-18.8,1001.8,41.43},
- {1.19,-3.24,999.43,87.57},
- {-30.99,-89.68,1003.55,359.84},
- {161.4,-94.24,1001.8,0.79},
- {-2638.82,1407.34,906.46,94.68},
- {1267.84,-776.96,1091.91,231.34},
- {2536.53,-1294.84,1044.13,254.95},
- {2350.16,-1181.07,1027.98,99.19},
- {-2158.67,642.09,1052.38,86.54},
- {419.89,2537.12,10.0,67.65},
- {256.9,-41.65,1002.02,85.88},
- {204.17,-165.77,1000.52,181.76},
- {1133.35,-7.85,1000.68,165.85},
- {-1420.43,1616.92,1052.53,159.13},
- {493.14,-24.26,1000.68,356.99},
- {1727.29,-1642.95,20.23,172.42},
- {-202.84,-24.03,1002.27,252.82},
- {2233.69,-1112.81,1050.88,8.65},
- {1211.25,1049.02,359.94,170.93},
- {2319.13,-1023.96,1050.21,167.4},
- {2261.1,-1137.88,1050.63,266.88},
- {-944.24,1886.15,5.01,179.85},
- {-26.19,-140.92,1003.55,2.91},
- {2217.28,-1150.53,1025.8,273.73},
- {1.55,23.32,1199.59,359.91},
- {681.62,-451.89,-25.62,166.17},
- {234.61,1187.82,1080.26,349.48},
- {225.57,1240.06,1082.14,96.29},
- {224.29,1289.19,1082.14,359.87},
- {239.28,1114.2,1080.99,270.27},
- {207.52,-109.74,1005.13,358.62},
- {295.14,1473.37,1080.26,352.95},
- {-1417.89,932.45,1041.53,0.7},
- {446.32,509.97,1001.42,330.57},
- {2306.38,-15.24,26.75,274.49},
- {2331.9,6.78,26.5,100.24},
- {663.06,-573.63,16.34,264.98},
- {-227.57,1401.55,27.77,269.3},
- {-688.15,942.08,13.63,177.66},
- {-1916.13,714.86,46.56,152.28},
- {818.77,-1102.87,25.79,91.14},
- {255.21,-59.68,1.57,1.46},
- {446.63,1397.74,1084.3,343.96},
- {227.39,1114.66,1081.0,267.46},
- {227.76,1114.38,1080.99,266.26},
- {261.12,1287.22,1080.26,178.91},
- {291.76,-80.13,1001.52,290.22},
- {449.02,-88.99,999.55,89.66},
- {-27.84,-26.67,1003.56,184.31},
- {2135.2,-2276.28,20.67,318.59},
- {306.2,307.82,1003.3,203.14},
- {24.38,1341.18,1084.38,8.33},
- {963.06,2159.76,1011.03,175.31},
- {2548.48,2823.74,10.82,270.6},
- {215.15,1874.06,13.14,177.55},
- {221.68,1142.5,1082.61,184.96},
- {2323.71,-1147.65,1050.71,206.54},
- {345.0,307.18,999.16,193.64},
- {411.97,-51.92,1001.9,173.34},
- {-1421.56,-663.83,1059.56,170.93},
- {773.89,-47.77,1000.59,10.72},
- {246.67,65.8,1003.64,7.96},
- {-1864.94,55.73,1055.53,85.85},
- {-262.18,1456.62,1084.37,82.46},
- {22.86,1404.92,1084.43,349.62},
- {140.37,1367.88,1083.86,349.24},
- {1494.86,1306.48,1093.3,196.07},
- {-1813.21,-58.01,1058.96,335.32},
- {-1401.07,1265.37,1039.87,178.65},
- {234.28,1065.23,1084.21,4.39},
- {-68.51,1353.85,1080.21,3.57},
- {-2240.1,136.97,1035.41,269.1},
- {297.14,-109.87,1001.52,20.23},
- {316.5,-167.63,999.59,10.3},
- {-285.25,1471.2,1084.38,85.65},
- {-26.83,-55.58,1003.55,3.95},
- {442.13,-52.48,999.72,177.94},
- {2182.2,1628.58,1043.87,224.86},
- {748.46,1438.24,1102.95,0.61},
- {2807.36,-1171.7,1025.57,193.71},
- {366.0,-9.43,1001.85,160.53},
- {2216.13,-1076.31,1050.48,86.43},
- {2268.52,1647.77,1084.23,99.73},
- {2236.7,-1078.95,1049.02,2.57},
- {-2031.12,-115.83,1035.17,190.19},
- {2365.11,-1133.08,1050.88,177.39},
- {1168.51,1360.11,10.93,196.59},
- {315.45,976.6,1960.85,359.64},
- {1893.07,1017.9,31.88,86.1},
- {501.96,-70.56,998.76,171.57},
- {-42.53,1408.23,1084.43,172.07},
- {2283.31,1139.31,1050.9,19.7},
- {84.92,1324.3,1083.86,159.56},
- {260.74,1238.23,1084.26,84.31},
- {-1658.17,1215.0,7.25,103.91},
- {-1961.63,295.24,35.47,264.49}
- };
- new IntArray2[146][1] = {
- {11},
- {5},
- {3},
- {3},
- {3},
- {3},
- {3},
- {18},
- {1},
- {3},
- {2},
- {3},
- {3},
- {3},
- {3},
- {3},
- {3},
- {3},
- {3},
- {17},
- {17},
- {5},
- {5},
- {17},
- {7},
- {5},
- {2},
- {10},
- {10},
- {7},
- {1},
- {1},
- {1},
- {1},
- {1},
- {3},
- {5},
- {1},
- {1},
- {7},
- {2},
- {10},
- {1},
- {2},
- {1},
- {10},
- {3},
- {10},
- {1},
- {2},
- {2},
- {2},
- {18},
- {18},
- {3},
- {5},
- {2},
- {5},
- {1},
- {10},
- {14},
- {14},
- {12},
- {14},
- {17},
- {18},
- {16},
- {5},
- {6},
- {9},
- {10},
- {17},
- {16},
- {15},
- {1},
- {1},
- {3},
- {2},
- {1},
- {5},
- {15},
- {15},
- {15},
- {12},
- {0},
- {0},
- {0},
- {18},
- {0},
- {0},
- {0},
- {0},
- {2},
- {5},
- {5},
- {4},
- {4},
- {4},
- {4},
- {0},
- {4},
- {10},
- {1},
- {0},
- {0},
- {4},
- {12},
- {6},
- {12},
- {4},
- {6},
- {6},
- {14},
- {4},
- {5},
- {5},
- {3},
- {14},
- {16},
- {6},
- {6},
- {6},
- {6},
- {6},
- {15},
- {6},
- {6},
- {2},
- {6},
- {8},
- {9},
- {1},
- {1},
- {2},
- {3},
- {8},
- {0},
- {9},
- {10},
- {11},
- {8},
- {11},
- {9},
- {9},
- {0},
- {0}
- };
- new IntName[146][] = {
- "Four Dragons Managerial Suite",
- "Ganton Gym",
- "Brothel",
- "Brothel2",
- "Inside Track Betting",
- "Blastin Fools Records",
- "The Big Spread Ranch",
- "Warehouse1 ",
- "Warehouse2 ",
- "B Dup s Apartment",
- "B Dup s Crack Palace",
- "Wheel Arch Angels",
- "OG Loc s House",
- "Barber Shop",
- "Planning Department",
- "Las Venturas Police Department",
- "Pro-Laps",
- "Sex Shop",
- "Las Venturas Tattoo parlor",
- "Lost San Fierro Tattoo",
- "24/07/09 (version 1)",
- "Diner1 ",
- "Pizza Stack",
- "Rusty Brown s Donuts",
- "Ammu-nation",
- "Victim",
- "Loco Low Co",
- "San Fierro Police Department",
- "24/07/09 (version 2)",
- "Below The Belt Gym",
- "Transfenders",
- "World of Coq",
- "Ammu-nation (version 2)",
- "SubUrban",
- "Denise s Bedroom",
- "Helena s Barn",
- "Barbara s Love nest",
- "San Fierro Garage",
- "Oval Stadium",
- "8-Track Stadium",
- "The Pig Pen (strip",
- "Four Dragons",
- "Liberty City",
- "Ryder s house",
- "Sweet s House",
- "RC Battlefield",
- "The Johnson House",
- "Burger shot",
- "Caligula s Casino",
- "Katie s Lovenest",
- "Barber Shop2 (Reece s)",
- "Angel Pine Trailer",
- "24/07/09 (version 3)",
- "Zip",
- "The Pleasure Domes",
- "Madd Dogg s Mansion",
- "Big Smoke s Crack Palace",
- "Burning Desire Building",
- "Wu-Zi Mu s",
- "Abandoned AC tower",
- "Wardrobe/Changing room",
- "Didier Sachs",
- "Casino (Redsands West)",
- "Kickstart Stadium",
- "Club",
- "Atrium",
- "Los Santos Tattoo Parlor",
- "Safe House group1 ",
- "Safe House group2 ",
- "Safe House group3 ",
- "Safe House group4 ",
- "Sherman Dam",
- "24/07/09 (version 4)",
- "Jefferson Motel",
- "Jet Interior",
- "The Welcome Pump",
- "Burglary House X1",
- "Burglary House X2",
- "Burglary House X3",
- "Burglary House X4",
- "Binco",
- "4 Burglary houses",
- "Blood Bowl Stadium",
- "Budget Inn Motel Room",
- "Palamino Bank",
- "Palamino Diner",
- "Dillimore Gas Station",
- "Lil Probe Inn",
- "Torreno s Ranch",
- "Zombotech - lobby area",
- "Crypt in LS cemetery",
- "Blueberry Liquor Store",
- "Pair of Burglary Houses",
- "Crack Den",
- "Burglary House X11",
- "Burglary House X12",
- "Ammu-nation (version 3)",
- "Jay s Diner",
- "24/07/09 (version 5)",
- "Warehouse3 ",
- "Michelle s Love Nest*",
- "Burglary House X14",
- "Sindacco Abatoir",
- "K.A.C.C. Military Fuels Depot",
- "Area69 ",
- "Burglary House X13",
- "Unused Safe House",
- "Millie s Bedroom",
- "Barber Shop",
- "Dirtbike Stadium",
- "Cobra Gym",
- "Los Santos Police Department",
- "Los Santos Airport",
- "Burglary House X15",
- "Burglary House X16",
- "Burglary House X17",
- "Bike School",
- "Francis International Airport",
- "Vice Stadium",
- "Burglary House X18",
- "Burglary House X19",
- "Zero s RC Shop",
- "Ammu-nation (version 4)",
- "Ammu-nation (version 5)",
- "Burglary House X20",
- "24/07/09 (version 6)",
- "Secret Valley Diner",
- "Rosenberg s Office in Caligulas",
- "Fanny Batter s Whore House",
- "Colonel Furhberger s",
- "Cluckin Bell",
- "The Camel s Toe Safehouse",
- "Caligula s Roof",
- "Old Venturas Strip Casino",
- "Driving School",
- "Verdant Bluffs Safehouse",
- "Bike School",
- "Andromada",
- "Four Dragons Janitor s Office",
- "Bar",
- "Burglary House X21",
- "Willowfield Safehouse",
- "Burglary House X22",
- "Burglary House X23",
- "Otto s Autos",
- "Wang Cars"
- };
- enum saZone
- {
- zID, zOwner, zOwnerUID, zAktywna
- };
- new TypGrupy[26][32]={
- " ", "Nieokreślony", "24/7", "Gastronomia", "Stacja benzynowa", "Siłownia", "Salon samochodowy", "Firma taksówkarska", "Sklep odzieżowy", "Warsztat", "Hotel", "Bank", "Ochrona",
- "Police", "Government", "Medical", "Radio", "Armia", "Fire Department", "FBI", "Mafia", "Gang", "Rodzina", "Zmotoryzowana", "Szkoła jazdy", "Wypożyczalnia pojazdów"
- };
- new KategorieZamowien[26][32] =
- {
- " ", "Żywność / Napoje", "Sklep 24/7", "Bronie", "Akcesoria do pojazdów", "Sprzęt gaśniczy", "Akcesoria mafijne", "Używki", "Alkohole", "Sprzęt policyjny", "Sprzęt ochroniarski", "Sprzęd wojskowy", "Sprzęt reporterski",
- "Komponenty: Felgi", "Komponenty: Progi", "Komponenty: Spoilery", "Komponenty: Zderzaki", "Komponenty: Wloty", "Komponenty: Wydechy", "Komponenty: Low-Ridery", "Medykamenty", "Dodatki", "Amunicja", "Części broni", "Sprzęt FBI", "Pojazdy: Standardowe"
- };
- enum sampZamowienia
- {
- Produkt_Kategoria, Produkt_Nazwa[64], Produkt_Owner, Produkt_OwnerUID, Produkt_Typ, Produkt_Wartosc1, Produkt_Wartosc2, Produkt_Wartosc3, Produkt_Waga, Produkt_Price,
- Produkt_Flaga, Produkt_FlagaUID
- };
- static const Zamowienia[][sampZamowienia] =
- {
- //Produkt_Owner = 1 and Produkt_Owner = typ grupy -> przedmiot dostępny do grupy o danym typie
- //Produkt_Owner = 2 and Produkt_Owner = grupa -> przedmiot dostępny dla grupy o danym UID
- //oflagowanie -1 = dla grup
- //produkt_owneruid = -1 / amunicja dla wybranych typów
- //Produkty do zamówień dla sklepów 24/7
- {2, "Telefon", 1, 2, 18, 1, 1, 1, 200, 75, 0, 0},
- {2, "Sony A330", 1, 2, 1, 50, 50, 0, 650, 750, 0, 0},
- {1, "Chipsy", 1, 2, 3, 5, 10, 0, 105, 25, 0, 0},
- //Produkty do zamówień dla gastronomii
- {1, "Hot-Dog", 1, 3, 3, 15, -1, -1, 250, 7, 0, 0},
- {1, "Frytki", 1, 3, 3, 15, -1, -1, 250, 6, 0, 0},
- {1, "Taco", 1, 3, 3, 15, -1, -1, 250, 8, 0, 0},
- {1, "Hamburger", 1, 3, 3, 20, -1, -1, 250, 10, 0, 0},
- {1, "Pizza L", 1, 3, 3, 30, -1, -1, 250, 17, 0, 0},
- {1, "Pizza XL", 1, 3, 3, 40, -1, -1, 250, 23, 0, 0},
- {1, "Kebab", 1, 3, 3, 20, -1, -1, 250, 11, 0, 0},
- {1, "Zapiekanka", 1, 3, 3, 15, -1, -1, 250, 9, 0, 0},
- {1, "Kebab Rollo", 1, 3, 3, 15, -1, -1, 250, 12, 0, 0},
- {1, "Talarki", 1, 3, 3, 15, -1, -1, 250, 9, 0, 0},
- {1, "Sałatka Grecka", 1, 3, 3, 15, -1, -1, 250, 10, 0, 0},
- {1, "Sałatka Kurczak", 1, 3, 3, 15, -1, -1, 250, 11, 0, 0},
- {1, "Szarlotka", 1, 3, 3, 5, -1, -1, 250, 4, 0, 0},
- {1, "Pączek", 1, 3, 3, 5, -1, -1, 250, 4, 0, 0},
- {1, "Sernik", 1, 3, 3, 5, -1, -1, 250, 4, 0, 0},
- {1, "Ryba w cieście", 1, 3, 3, 25, -1, -1, 250, 15, 0, 0},
- {1, "Ryba wędzona", 1, 3, 3, 25, -1, -1, 250, 15, 0, 0},
- {1, "Kotlet schabowy", 1, 3, 3, 15, -1, -1, 250, 10, 0, 0},
- {1, "Skrzydełka", 1, 3, 3, 15, -1, -1, 250, 10, 0, 0},
- {1, "Coca Cola", 1, 3, 3, 15, -1, -1, 250, 10, 0, 0},
- {1, "Woda Mineralna", 1, 3, 3, 7, -1, -1, 250, 5, 0, 0},
- {1, "Pepsi", 1, 3, 3, 7, -1, -1, 250, 5, 0, 0},
- {1, "Kawa", 1, 3, 3, 7, -1, -1, 250, 5, 0, 0},
- {1, "Herbata", 1, 3, 3, 7, -1, -1, 250, 5, 0, 0},
- {8, "Whiskey", 1, 3, 3, 7, -1, -1, 250, 25, 0, 0},
- {8, "Wódka", 1, 3, 3, 7, -1, -1, 250, 17, 0, 0},
- {8, "Piwo Cytrynowe", 1, 3, 3, 7, -1, -1, 250, 9, 0, 0},
- {8, "Piwo Jabłkowe", 1, 3, 3, 7, -1, -1, 250, 9, 0, 0},
- {8, "Piwo Malinowe", 1, 3, 3, 7, -1, -1, 250, 9, 0, 0},
- {8, "Piwo Zwykłe", 1, 3, 3, 7, -1, -1, 250, 9, 0, 0},
- //Amunicja dla grup o typie "police"
- {22, "Amunicja Deagle", 1, 13, 15, 24, 25, 0, 150, 300, 0, 0},
- {22, "Amunicja Shotgun", 1, 13, 15, 25, 25, 0, 250, 400, 0, 0},
- {22, "Amunicja Glock", 1, 13, 15, 22, 50, 0, 150, 350, 0, 0},
- //amunicja dla grup o typie "Armia"
- {22, "Amunicja Deagle", 1, 17, 15, 24, 25, 0, 150, 300, 0, 0},
- {22, "Amunicja Shotgun", 1, 17, 15, 25, 25, 0, 250, 400, 0, 0},
- {22, "Amunicja Glock", 1, 17, 15, 22, 50, 0, 150, 350, 0, 0},
- {22, "Amunicja M4A1", 1, 17, 15, 31, 150, 0, 450, 750, 0, 0},
- //amunicja dla grup o typie "FBI"
- {22, "Amunicja Deagle", 1, 19, 15, 24, 25, 0, 150, 300, 0, 0},
- {22, "Amunicja Shotgun", 1, 19, 15, 25, 25, 0, 250, 400, 0, 0},
- {22, "Amunicja Glock", 1, 19, 15, 22, 50, 0, 150, 350, 0, 0},
- //amunicja dla grup o typie "zmotoryzowana"
- {22, "Amunicja Deagle", 1, 23, 15, 24, 25, 0, 150, 300, 0, 0},
- {22, "Amunicja Shotgun", 1, 23, 15, 25, 25, 0, 250, 400, 0, 0},
- {22, "Amunicja Glock", 1, 23, 15, 22, 50, 0, 150, 350, 0, 0},
- //Produkty do zamawiania przez LSPD
- {3, "(F) Desert Eagle", 2, 1, 1, 24, 20, 0, 950, 1250, 2, 1},
- {3, "(F) Shotgun", 2, 1, 1, 25, 20, 0, 950, 2250, 2, 1},
- {3, "(F) Glock", 2, 1, 1, 22, 40, 0, 950, 2250, 2, 1},
- {3, "(F) Tonfa", 2, 1, 1, 3, 1, 0, 450, 470, 2, 1},
- {3, "(F) Spadochron", 2, 1, 1, 46, 1, 0, 1500, 950, 2, 1},
- {9, "Kominiarka", 2, 1, 8, 5, 1, 0, 700, 250, 2, 1},
- {9, "Rękawiczki", 2, 1, 7, 5, 1, 0, 600, 250, 2, 1}
- };
- new Text:textdrawik;
- #define TIME_BW 10
- //Permy dla pracowników
- #define PERM_OFFER 1 // Oferowanie (/o)
- #define PERM_CARS 2 // Pojazdy
- #define PERM_DOORS 4 // Drzwi
- #define PERM_ORDER 8 // Zamawianie produktów
- #define PERM_CHAT 16 // Korzystanie z czatu OOC
- #define PERM_LEADER 32 // Lider
- #define PERM_MAYOR 64 // Burmistrz / Gubernator
- #define MAX_LEADER_PERM 127 // Maksymalna liczba
- //Permy dla administracji
- #define ADMIN_PERM_GM 1 // Ogólna maska uprawnień dla każdego Administratora
- #define ADMIN_PERM_CHAT 2 // Maska uprawnień dla korzystania z czatu
- #define ADMIN_PERM_VEHICLE 4 // Maska uprawnień do korzystania z komendy /av
- #define ADMIN_PERM_GROUP 8 // Maska uprawnień do korzystania z komendy /ag
- #define ADMIN_PERM_DOOR 16 // Maska uprawnień do korzystania z komendy /ad
- #define ADMIN_PERM_ITEM 32 // Maska uprawnień do korzystania z komendy /ap
- #define ADMIN_PERM_OBJECT 64 // Maska uprawnień do korzystania z systemu obiektów
- #define ADMIN_PERM_ZONE 128
- #define ADMIN_PERM_MAX 255 // Maksymalna liczba
- //Permy dla grup
- #define G_FLAG_IC 1 // Czat InCharacter
- #define G_FLAG_OOC 2 // Czat Out Of Character
- #define G_FLAG_COLOR 4 // Kolorowy nick na służbie
- #define G_FLAG_DEPARTMENT 8 // Tag grupy pod nickiem
- #define G_FLAG_SPAWN 16 // Spawn w budynku organizacji
- #define G_FLAG_ARREST 32 // Aresztowanie / przetrzymywanie
- #define G_FLAG_BLOCADE 64 // Stawianie blokad na drodze
- #define G_FLAG_WEAPONS 128 // Używanie oflagowanych broni
- #define G_FLAG_911 256 // Listowanie na 911
- #define G_FLAG_RACE 512 // Tworzenie wyścigów
- #define G_FLAG_LEAVE 1024 // Opuszczanie grupy
- #define G_FLAG_TAX 2048 // Podatek
- #define G_FLAG_MASK 4096 // Używanie kominiarek
- #define G_FLAG_SEARCHING 8192 // Przeszukiwanie
- #define G_FLAG_DRIVEBY 16384 // DriveBy
- public OnGameModeInit()
- {
- new tm[4];
- TimeFormat(3604 * 50, tm[0], tm[1], tm[2], tm[3]);
- printf("%d dni, %d godzin, %d minut, %d sekund", tm[0], tm[1], tm[2], tm[3]);
- textdrawik = TextDrawCreate(200.0, 220.0, "ArrowType2:MatArrows");
- TextDrawSetString(textdrawik, "ArrowType2:MatArrows");
- TextDrawFont(textdrawik, 4);
- ImagenGift = TextDrawCreate(-0.500, -0.500,"_");
- TextDrawFont(ImagenGift, 4);
- TextDrawTextSize(ImagenGift, 647.500, 457.000);
- TextDrawColor(ImagenGift, -1);
- for(new p = 0; p < MAX_PLAYERS; p++)
- {
- ItemTD0[p] = TextDrawCreate(18.000000, 133.000000, "~<~ Przedmioty (1) ~>~");
- TextDrawBackgroundColor(ItemTD0[p], 255);
- TextDrawFont(ItemTD0[p], 3);
- TextDrawLetterSize(ItemTD0[p], 0.649999, 1.800000);
- TextDrawColor(ItemTD0[p], -1);
- TextDrawSetOutline(ItemTD0[p], 1);
- TextDrawSetProportional(ItemTD0[p], 1);
- ItemTD1[p] = TextDrawCreate(42.000000, 158.000000, "01 Desert Eagle");
- TextDrawBackgroundColor(ItemTD1[p], 255);
- TextDrawFont(ItemTD1[p], 3);
- TextDrawLetterSize(ItemTD1[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD1[p], -1);
- TextDrawSetOutline(ItemTD1[p], 1);
- TextDrawSetProportional(ItemTD1[p], 1);
- ItemTD2[p] = TextDrawCreate(42.000000, 169.000000, "02 ~g~Desert Eagle");
- TextDrawBackgroundColor(ItemTD2[p], 255);
- TextDrawFont(ItemTD2[p], 3);
- TextDrawLetterSize(ItemTD2[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD2[p], -1);
- TextDrawSetOutline(ItemTD2[p], 1);
- TextDrawSetProportional(ItemTD2[p], 1);
- ItemTD3[p] = TextDrawCreate(42.000000, 180.000000, "03 Joint (1g)");
- TextDrawBackgroundColor(ItemTD3[p], 255);
- TextDrawFont(ItemTD3[p], 3);
- TextDrawLetterSize(ItemTD3[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD3[p], -1);
- TextDrawSetOutline(ItemTD3[p], 1);
- TextDrawSetProportional(ItemTD3[p], 1);
- ItemTD4[p] = TextDrawCreate(42.000000, 191.000000, "04 Weksel (Walton)");
- TextDrawBackgroundColor(ItemTD4[p], 255);
- TextDrawFont(ItemTD4[p], 3);
- TextDrawLetterSize(ItemTD4[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD4[p], -1);
- TextDrawSetOutline(ItemTD4[p], 1);
- TextDrawSetProportional(ItemTD4[p], 1);
- ItemTD5[p] = TextDrawCreate(42.000000, 202.000000, "05 Hamburger");
- TextDrawBackgroundColor(ItemTD5[p], 255);
- TextDrawFont(ItemTD5[p], 3);
- TextDrawLetterSize(ItemTD5[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD5[p], -1);
- TextDrawSetOutline(ItemTD5[p], 1);
- TextDrawSetProportional(ItemTD5[p], 1);
- ItemTD6[p] = TextDrawCreate(42.000000, 213.000000, "06 ~g~Okulary (RED)");
- TextDrawBackgroundColor(ItemTD6[p], 255);
- TextDrawFont(ItemTD6[p], 3);
- TextDrawLetterSize(ItemTD6[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD6[p], -1);
- TextDrawSetOutline(ItemTD6[p], 1);
- TextDrawSetProportional(ItemTD6[p], 1);
- ItemTD7[p] = TextDrawCreate(42.000000, 224.000000, "07 Glock");
- TextDrawBackgroundColor(ItemTD7[p], 255);
- TextDrawFont(ItemTD7[p], 3);
- TextDrawLetterSize(ItemTD7[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD7[p], -1);
- TextDrawSetOutline(ItemTD7[p], 1);
- TextDrawSetProportional(ItemTD7[p], 1);
- ItemTD8[p] = TextDrawCreate(42.000000, 235.000000, "08 Dowod osobisty");
- TextDrawBackgroundColor(ItemTD8[p], 255);
- TextDrawFont(ItemTD8[p], 3);
- TextDrawLetterSize(ItemTD8[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD8[p], -1);
- TextDrawSetOutline(ItemTD8[p], 1);
- TextDrawSetProportional(ItemTD8[p], 1);
- ItemTD9[p] = TextDrawCreate(42.000000, 246.000000, "09 Kajdanki");
- TextDrawBackgroundColor(ItemTD9[p], 255);
- TextDrawFont(ItemTD9[p], 3);
- TextDrawLetterSize(ItemTD9[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD9[p], -1);
- TextDrawSetOutline(ItemTD9[p], 1);
- TextDrawSetProportional(ItemTD9[p], 1);
- ItemTD10[p] = TextDrawCreate(42.000000, 257.000000, "10 Megafon");
- TextDrawBackgroundColor(ItemTD10[p], 255);
- TextDrawFont(ItemTD10[p], 3);
- TextDrawLetterSize(ItemTD10[p], 0.290000, 0.899999);
- TextDrawColor(ItemTD10[p], -1);
- TextDrawSetOutline(ItemTD10[p], 1);
- TextDrawSetProportional(ItemTD10[p], 1);
- /*
- Doors[p] = TextDrawCreate(324.000000, 325.000000, "Motel Idlewood~n~~n~~y~Aby wejsc, wcisnij jednoczesnie~n~~w~[~b~~h~~h~LALT + SHIFT~w~]");
- TextDrawAlignment(Doors[p], 2);
- TextDrawBackgroundColor(Doors[p], 255);
- TextDrawFont(Doors[p], 1);
- TextDrawLetterSize(Doors[p], 0.370000, 1.600000);
- TextDrawColor(Doors[p], -1);
- TextDrawSetOutline(Doors[p], 1);
- TextDrawSetProportional(Doors[p], 1);
- TextDrawUseBox(Doors[p], 1);
- TextDrawBoxColor(Doors[p], 50);
- TextDrawTextSize(Doors[p], 0.000000, 224.000000);
- */
- Doors[p] = TextDrawCreate(326.000000, 330.000000, "_");
- TextDrawAlignment(Doors[p], 2);
- TextDrawBackgroundColor(Doors[p], 255);
- TextDrawFont(Doors[p], 1);
- TextDrawLetterSize(Doors[p], 0.379999, 1.299999);
- TextDrawColor(Doors[p], -1);
- TextDrawSetOutline(Doors[p], 1);
- TextDrawSetProportional(Doors[p], 1);
- TextDrawUseBox(Doors[p], 1);
- TextDrawBoxColor(Doors[p], 68);
- TextDrawTextSize(Doors[p], 490.000000, 221.000000);
- Informacja[p] = TextDrawCreate(324.000000, 325.000000, "_");
- TextDrawAlignment(Informacja[p], 2);
- TextDrawBackgroundColor(Informacja[p], 255);
- TextDrawFont(Informacja[p], 1);
- TextDrawLetterSize(Informacja[p], 0.300000, 1.299998);
- TextDrawColor(Informacja[p], -1);
- TextDrawSetOutline(Informacja[p], 1);
- TextDrawSetProportional(Informacja[p], 1);
- Tiper[p] = TextDrawCreate(522.000000, 343.000000, "_");
- TextDrawAlignment(Tiper[p], 2);
- TextDrawBackgroundColor(Tiper[p], 255);
- TextDrawFont(Tiper[p], 1);
- TextDrawLetterSize(Tiper[p], 0.270000, 1.200000);
- TextDrawColor(Tiper[p], -1);
- TextDrawSetOutline(Tiper[p], 0);
- TextDrawSetProportional(Tiper[p], 1);
- TextDrawSetShadow(Tiper[p], 1);
- TextDrawUseBox(Tiper[p], 1);
- TextDrawBoxColor(Tiper[p], 40);
- TextDrawTextSize(Tiper[p], 466.000000, 208.000000);
- Licznik0[p] = TextDrawCreate(552.000000, 105.000000, "_");
- TextDrawAlignment(Licznik0[p], 2);
- TextDrawBackgroundColor(Licznik0[p], 255);
- TextDrawFont(Licznik0[p], 3);
- TextDrawLetterSize(Licznik0[p], 0.480000, 2.699999);
- TextDrawColor(Licznik0[p], -1);
- TextDrawSetOutline(Licznik0[p], 1);
- TextDrawSetProportional(Licznik0[p], 1);
- TextDrawUseBox(Licznik0[p], 1);
- TextDrawBoxColor(Licznik0[p], 40);
- TextDrawTextSize(Licznik0[p], -4.000000, 107.000000);
- Licznik3[p] = TextDrawCreate(520.250000, 134.000000, "_");
- TextDrawAlignment(Licznik3[p], 2);
- TextDrawBackgroundColor(Licznik3[p], 255);
- TextDrawFont(Licznik3[p], 3);
- TextDrawLetterSize(Licznik3[p], 0.420000, 1.400000);
- TextDrawColor(Licznik3[p], -1);
- TextDrawSetOutline(Licznik3[p], 1);
- TextDrawSetProportional(Licznik3[p], 1);
- TextDrawUseBox(Licznik3[p], 1);
- TextDrawBoxColor(Licznik3[p], 40);
- TextDrawTextSize(Licznik3[p], 1.000000, 11.000000);
- Licznik1[p] = TextDrawCreate(504.000000, 134.000000, "_");
- TextDrawAlignment(Licznik1[p], 2);
- TextDrawBackgroundColor(Licznik1[p], 255);
- TextDrawFont(Licznik1[p], 3);
- TextDrawLetterSize(Licznik1[p], 0.420000, 1.400000);
- TextDrawColor(Licznik1[p], -1);
- TextDrawSetOutline(Licznik1[p], 1);
- TextDrawSetProportional(Licznik1[p], 1);
- TextDrawUseBox(Licznik1[p], 1);
- TextDrawBoxColor(Licznik1[p], 40);
- TextDrawTextSize(Licznik1[p], 1.000000, 11.000000);
- Licznik2[p] = TextDrawCreate(568.500000, 134.000000, "_");
- TextDrawAlignment(Licznik2[p], 2);
- TextDrawBackgroundColor(Licznik2[p], 255);
- TextDrawFont(Licznik2[p], 3);
- TextDrawLetterSize(Licznik2[p], 0.420000, 1.400000);
- TextDrawColor(Licznik2[p], -1);
- TextDrawSetOutline(Licznik2[p], 1);
- TextDrawSetProportional(Licznik2[p], 1);
- TextDrawUseBox(Licznik2[p], 1);
- TextDrawBoxColor(Licznik2[p], -8388353);
- TextDrawTextSize(Licznik2[p], -3.000000, 74.000000);
- PasekSanNews[p] = TextDrawCreate(1.000000, 433.000000, " ~y~~h~K-69 Radio~w~ ~>~ Aktualnie nic nie jest nadawane na antenie.~n~");
- TextDrawBackgroundColor(PasekSanNews[p], 255);
- TextDrawFont(PasekSanNews[p], 1);
- TextDrawLetterSize(PasekSanNews[p], 0.270000, 1.100000);
- TextDrawColor(PasekSanNews[p], -1);
- TextDrawSetOutline(PasekSanNews[p], 0);
- TextDrawSetProportional(PasekSanNews[p], 1);
- TextDrawSetShadow(PasekSanNews[p], 1);
- TextDrawUseBox(PasekSanNews[p], 1);
- TextDrawBoxColor(PasekSanNews[p], 40);
- TextDrawTextSize(PasekSanNews[p], 673.000000, 17.000000);
- TDOffe[p] = TextDrawCreate(138.000000, 417.000000, "_");
- TextDrawBackgroundColor(TDOffe[p], 255);
- TextDrawFont(TDOffe[p], 3);
- TextDrawLetterSize(TDOffe[p], 0.350000, 1.100000);
- TextDrawColor(TDOffe[p], -1);
- TextDrawSetOutline(TDOffe[p], 1);
- TextDrawSetProportional(TDOffe[p], 1);
- //tworzymy 3dtexty nicku i opisu dla graczy
- Player[p][pAme] = CreateDynamic3DTextLabel(" ", COLOR_PURPLE, 0.0, 0.0, 0.3, 10.0, p, INVALID_VEHICLE_ID, 1);
- Player[p][pOpis] = CreateDynamic3DTextLabel(" ", COLOR_DESC, 0.0, 0.0, -0.6, 10.0, p, INVALID_VEHICLE_ID, 1);
- Player[p][pNickName] = CreateDynamic3DTextLabel(" ", KOL_NAME, 0.0, 0.0, 0.1, 10.0, p, INVALID_VEHICLE_ID, 1);
- }
- //tworzymy 3dtexty dla pojazdów
- for(new v = 0; v < MAX_VEHICLES; v++)
- {
- Veh3DText[v] = CreateDynamic3DTextLabel(" ", COLOR_DESC, 0.0, 0.0, 1.0, 10.0, INVALID_PLAYER_ID, v, 1);
- }
- TDData = TextDrawCreate(492.000000, 417.000000, "_");
- TextDrawBackgroundColor(TDData, 255);
- TextDrawFont(TDData, 3);
- TextDrawLetterSize(TDData, 0.350000, 1.100000);
- TextDrawColor(TDData, 0xAAC5E3FF);
- TextDrawSetOutline(TDData, 1);
- TextDrawSetProportional(TDData, 1);
- TDKara = TextDrawCreate(36.000000, 267.000000, "_");
- TextDrawBackgroundColor(TDKara, 255);
- TextDrawFont(TDKara, 1);
- TextDrawLetterSize(TDKara, 0.380000, 1.400000);
- TextDrawColor(TDKara, -13815041);
- TextDrawSetOutline(TDKara, 1);
- TextDrawSetProportional(TDKara, 1);
- AllowInteriorWeapons(true);
- DisableInteriorEnterExits();
- EnableStuntBonusForAll(false);
- ShowPlayerMarkers(0);
- ShowNameTags(false);
- SetNameTagDrawDistance(10);
- LimitGlobalChatRadius(6.0);
- ManualVehicleEngineAndLights();
- AddPlayerClass(1, 444.6531,-1729.9272,9.9767,2.8579, 0, 0, 0, 0, 0, 0); //
- SetGameModeText(GAMEMODE_TEXT);
- //connection mysql
- mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
- if(mysql_ping(1) == 1)
- print("[MySQL]: Połączono z bazą!"), mysql_free_result(), mysql_query_ex("UPDATE `1postacie` SET `ingame` = 0");
- else
- return print("[MySQL]: Utracono połaczenie z bazą danych!"), SetGameModeText("[MySQL] Failed Connect");
- mysql_debug(1);
- SetTimer("AntyCheat", 500, true);
- SetTimer("Sekundnik", 1000, true);
- SetTimer("Minutnik", 60000, true);
- SetTimer("DziesiecioMinutnik", 60000*10, true);
- //moduły
- new obj = GetTickCount();
- Wczytaj_Obiekty();
- printf("Moduł obiektów wczytany.\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - obj, StatsObj);
- new door = GetTickCount();
- Wczytaj_Drzwi();
- printf("Moduł drzwi wczytany.\t\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - door, StatsDoor);
- new group = GetTickCount();
- Wczytaj_Grupy();
- printf("Moduł grup wczytany.\t\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - group, StatsGroup);
- new item = GetTickCount();
- Wczytaj_Przedmioty();
- printf("Moduł przedmiotów wczytany.\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - item, StatsItem);
- new veh = GetTickCount();
- Wczytaj_Pojazdy();
- printf("Moduł pojazdów wczytany.\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - veh, StatsVeh);
- new zone = GetTickCount();
- Wczytaj_Strefy();
- printf("Moduł stref wczytany.\t\t[Czas wykonania:\t%dms.\tRekordy:\t%d]", GetTickCount() - zone, StatsZone);
- //dezaktywacja systemowych kar
- /* new LogUID, LogOwner, LogAdmin, LogAdd, LogTyp, LogText[128], LogExp, LogDez, LogChar, query[200], result[200], LogSys, LogAdm, LogAll;
- mysql_query_ex("SELECT * FROM `1logi`");
- mysql_store_result();
- while(mysql_fetch_row_format(result, "|") == 1)
- {
- sscanf(result, "p<|>ddddds[128]ddd", LogUID, LogOwner, LogAdmin, LogAdd, LogTyp, LogText, LogExp, LogDez, LogChar);
- if(LogExp < gettime())
- {
- if(LogDez != -1 && LogExp != -1 && LogExp != 999)
- {
- LogAll++;
- format(String, sizeof(query), "UPDATE `1logi` SET `expires`=-1, `dezprzez`=-1 WHERE `uid`=%d", LogUID);
- mysql_query_ex(query);
- if(LogAdmin == -1)
- LogSys++;
- else
- LogAdm++;
- if(LogTyp == 2)
- {
- format(query, sizeof(query), "UPDATE `members` SET `ban_time`=0, `ban_uid`=0 WHERE `member_id`=%d", LogOwner);
- mysql_query_ex(query);
- }
- else if(LogTyp == 3)
- {
- format(query, sizeof(query), "UPDATE `1postacie` SET `konto`=1 WHERE `uid`=%d", LogChar);
- mysql_query_ex(query);
- }
- }
- }
- }
- mysql_free_result();
- if(LogAll)
- printf("[System] Dezaktywowano %d kar (Sys: %d, Adm: %d).", LogAll, LogSys, LogAdm);
- new test = GetTickCount(), itemoff, itemon;
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1)
- {
- itemon++;
- }
- else
- {
- itemoff++;
- }
- }
- printf("Czas wykonania pętli itemów: %dms (%d/%d)", GetTickCount() - test, itemon, itemoff);
- */
- EnableVehicleFriendlyFire();
- LoadNPC("Policjant", "train_ls");
- return 1;
- }
- public OnGameModeExit()
- {
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Paczka[p][pAktywna] == 1)
- {
- new powtorzenia = 0;
- for(new nr = 1; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 0)
- {
- Przedmiot[nr][iAktywny] = 1;
- Przedmiot[nr][iTyp] = Paczka[p][pTyp];
- Przedmiot[nr][iWartosc1] = Paczka[p][pValue1];
- Przedmiot[nr][iWartosc2] = Paczka[p][pValue2];
- Przedmiot[nr][iWartosc3] = Paczka[p][pValue3];
- Przedmiot[nr][iOwner] = Paczka[p][pOwner];
- Przedmiot[nr][iOwnerUID] = Paczka[p][pOwnerUID];
- Przedmiot[nr][iWaga] = Paczka[p][pWaga];
- Przedmiot[nr][iUsed] = 0;
- Przedmiot[nr][iVir] = 0;
- Przedmiot[nr][iPrice] = Paczka[p][pPrice];
- Przedmiot[nr][iFlaga] = Paczka[p][pFlaga];
- Przedmiot[nr][iFlagaUID] = Paczka[p][pFlagaUID];
- strmid(Przedmiot[nr][iNazwa], Paczka[p][pNazwa], 0, 64, 64);
- ZapiszPrzedmiot(nr);
- powtorzenia++;
- if(powtorzenia == Paczka[p][pIlosc])
- {
- break;
- }
- Paczka[p][pAktywna] = 0;
- }
- }
- }
- }
- for(new v = 0; v < MAX_VEHICLES; v++)
- {
- if(Pojazd[v][vSpawn] == 1)
- {
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- ZapiszPojazd(veh);
- }
- }
- }
- }
- foreach(Player, p)
- {
- if(Login(p) == 1)
- {
- SavePlayerStats(p, SAVE_PLAYER_BASIC);
- SavePlayerStats(p, SAVE_PLAYER_POS);
- SavePlayerStats(p, SAVE_PLAYER_GROUP);
- }
- }
- for(new nr = 0; nr < MAX_OBIEKT; nr++){
- if(Obiekt[nr][oAktywny] == 1){
- ZapiszObiekt(nr);
- }
- }
- for(new nr = 0; nr < MAX_ITEM; nr++){
- if(Przedmiot[nr][iAktywny] == 1){
- ZapiszPrzedmiot(nr);
- if(Przedmiot[nr][iTyp] == 1 && Przedmiot[nr][iUsed] == 1)
- {
- Przedmiot[nr][iUsed] = 0;
- }
- }
- }
- mysql_query_ex("UPDATE `1postacie` SET `ingame` = 0");
- DOF2_Exit();
- mysql_close();
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- if(IsPlayerNPC(playerid))
- {
- UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pNickName], KOL_NAME, CharName3DText(playerid));
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- if(!strcmp(playername, "Policjant", false))
- {
- setLogin(playerid, 1);
- SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
- }
- return 1;
- }
- SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(IsPlayerNPC(playerid))
- return 1;
- Offer[playerid][oCustomerID] = INVALID_PLAYER_ID;
- Offer[playerid][oBlock] = 0;
- //zerowanie pamięci Player
- Player[playerid][pUID] = 0;
- Player[playerid][pKonto] = 0;
- Player[playerid][pOnline] = 0;
- Player[playerid][pSkin] = 0;
- Player[playerid][pLastSkin] = 0;
- Player[playerid][pGID] = 0;
- Player[playerid][pInGame] = 0;
- Player[playerid][pGodziny] = 0;
- Player[playerid][pLastLogin] = 0;
- Player[playerid][pHP] = 100.0;
- Player[playerid][pSex] = 0;
- Player[playerid][pWiek] = 0;
- Player[playerid][pSila] = 0;
- Player[playerid][pInvisible] = 0;
- Player[playerid][pDutyAll] = 0;
- Player[playerid][pJob] = 0;
- Player[playerid][pSpawnID] = 0;
- Player[playerid][pKasa] = 0;
- Player[playerid][pBank] = 0;
- Player[playerid][pControl] = 0;
- pGrupa[playerid][1] = 0;
- pGrupa[playerid][2] = 0;
- pGrupa[playerid][3] = 0;
- pGrupa[playerid][4] = 0;
- pGrupa[playerid][5] = 0;
- pGrupaPerm[playerid][1] = 0;
- pGrupaPerm[playerid][2] = 0;
- pGrupaPerm[playerid][3] = 0;
- pGrupaPerm[playerid][4] = 0;
- pGrupaPerm[playerid][5] = 0;
- pGrupaPayDay[playerid][1] = 0;
- pGrupaPayDay[playerid][2] = 0;
- pGrupaPayDay[playerid][3] = 0;
- pGrupaPayDay[playerid][4] = 0;
- pGrupaPayDay[playerid][5] = 0;
- Player[playerid][pBW] = 0;
- Player[playerid][pWyjezdzone] = 0;
- Player[playerid][pInt] = 0;
- Player[playerid][pVir] = 0;
- Player[playerid][pPosX] = 0;
- Player[playerid][pPosY] = 0;
- Player[playerid][pPosZ] = 0;
- Player[playerid][pQuit] = 0;
- Player[playerid][pQuitTime] = 0;
- Player[playerid][pAJ] = 0;
- Player[playerid][pJail] = 0;
- Player[playerid][pSpawn] = 0;
- Player[playerid][pSpawnTyp] = 0;
- Player[playerid][pPayDayGame] = 0;
- Player[playerid][pTelefon] = 0;
- //zerowanie pamięci Global
- IPB[playerid][ipb_Grupa] = 0;
- IPB[playerid][ipb_GameScore] = 0, SetPlayerScore(playerid, 0);
- IPB[playerid][ipb_Premium] = 0;
- IPB[playerid][ipb_NoRUN] = 0;
- IPB[playerid][ipb_NoVEH] = 0;
- IPB[playerid][ipb_NoOOC] = 0;
- IPB[playerid][ipb_NoGUN] = 0;
- IPB[playerid][ipb_Ban] = 0;
- IPB[playerid][ipb_PremiumScore] = 0;
- SetPVarInt(playerid, "Death", 0);
- for(new zero = 0; zero < 44; zero++)
- {
- Player[playerid][zPlayer:zero] = 0;
- }
- Statystyki[0]++;
- //offe
- SetPVarInt(playerid, "rpOffeClient", INVALID_PLAYER_ID);
- SetPVarInt(playerid, "rpOffePlayer", INVALID_PLAYER_ID);
- SetPVarInt(playerid, "rpOffeDoor", INVALID_PLAYER_ID);
- SetPVarInt(playerid, "rpOffeGroup", INVALID_PLAYER_ID);
- //
- DrzwiTimer[playerid] = SetTimerEx("GiftImage", 500, 0, "d", playerid);
- SetPVarInt(playerid, "GroupUID", INVALID_PLAYER_ID);
- SetPVarInt(playerid, "KomuOferuje", INVALID_PLAYER_ID);
- SetPVarInt(playerid, "KtoOferuje", INVALID_PLAYER_ID);
- //kasacja attachedobject
- for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
- }
- SetPVarInt(playerid, "ReplayPriv", -1);
- Serwer[0]++;
- new hour, minute, second;
- gettime(hour, minute, second);
- SetWorldTime(hour);
- TogglePlayerSpectating(playerid, true);
- for(new nr = 0; nr < 1024; nr++)
- {
- TextDrawHideForPlayer(playerid, Text:nr);
- }
- DeathInfo[playerid][time0] = 0;
- DeathInfo[playerid][killed] = 0;
- SetPlayerHealth(playerid, 100);
- new query[128];
- format(query, sizeof(query), "SELECT * FROM `1postacie` WHERE `nick` ='%s'", NickSAMP(playerid));
- mysql_query_ex(query);
- mysql_store_result();
- if(mysql_num_rows() == 0)
- {
- dShowPlayerDialog(playerid, 50, DIALOG_STYLE_MSGBOX, ""ServName"Logowanie", "Postać, na którą próbujesz się zalogować nie istnieje.\nCzy chcesz ją utworzyć oraz podpisać pod konto globalne?", "Tak", "Nie");
- }
- else
- {
- dShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_PASSWORD, ""ServName"Logowanie", "Witaj na serwerze RolePlay!\n\nPostać została odnaleziona w bazie danych,\ndokonaj autoryzacji wpisując hasło.", "Dalej", "Anuluj");
- SetPlayerColor(playerid, 0x000000FF);
- }
- return mysql_free_result();
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new veh;
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- veh = GetPlayerVehicleID(playerid);
- GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
- }
- if(newkeys == 1032 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(Player[playerid][pBW] != 0)
- return 1;
- for(new p = 0; p < MAX_DRZWI; p++)
- {
- if(Drzwi[p][dAktywne] == 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, Drzwi[p][dZewPosX], Drzwi[p][dZewPosY], Drzwi[p][dZewPosZ]) && Drzwi[p][dZewVir] == GetPlayerVirtualWorld(playerid))
- {
- if(Drzwi[p][dStatus] == 1)
- return InfoBoxShow(2, playerid, "Drzwi do ~y~budynku~w~ sa ~r~zamkniete~w~.", 3);
- SetPVarInt(playerid, "rpDoorEnterExit", gettime()+3);
- SetPVarInt(playerid, "Teleport", 1);
- TogglePlayerControllable(playerid, false);
- SetPlayerInterior(playerid, Drzwi[p][dIntWew]);
- SetPlayerVirtualWorld(playerid, Drzwi[p][dWewVir]);
- SetPlayerPos(playerid, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]);
- SetPlayerFacingAngle(playerid, Drzwi[p][dWewRot]);
- break;
- }
- if(IsPlayerInRangeOfPoint(playerid, 2.0, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]) && Drzwi[p][dWewVir] == GetPlayerVirtualWorld(playerid))
- {
- if(Drzwi[p][dStatus] == 1)
- return InfoBoxShow(2, playerid, "Drzwi do ~y~budynku~w~ sa ~r~zamkniete~w~.", 3);
- SetPVarInt(playerid, "rpDoorEnterExit", gettime()+3);
- SetPVarInt(playerid, "Teleport", 1);
- TogglePlayerControllable(playerid, false);
- SetPlayerInterior(playerid, Drzwi[p][dIntZew]);
- SetPlayerVirtualWorld(playerid, Drzwi[p][dZewVir]);
- SetPlayerPos(playerid, Drzwi[p][dZewPosX], Drzwi[p][dZewPosY], Drzwi[p][dZewPosZ]);
- SetPlayerFacingAngle(playerid, Drzwi[p][dZewRot]);
- break;
- }
- /* foreach(Player, player)
- {
- if(GetPVarInt(player, "rpSpec") == playerid)
- {
- PlayerSpectateVehicle(player, playerid, SPECTATE_MODE_SIDE);
- }
- }
- */
- }
- }
- }
- else if(newkeys == 5 || newkeys == 13)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetPVarInt(playerid, "Odpala") == 0 && pPojazd(playerid, veh) != 0)
- {
- if(Pojazd[CarUID(veh)][vHP] <= 350.0)
- return InfoBoxShow(2, playerid, "Silnik ~y~pojazdu~w~ jest doszczetnie ~r~zniszczony~w~.~n~Udaj sie do mechanika, aby go naprawic.", 3);
- if(Pojazd[CarUID(veh)][vPaliwo] <= 0.0)
- return InfoBoxShow(2, playerid, "W pojezdzie ~r~zabraklo~w~ paliwa.", 3);
- SetPVarInt(playerid, "Odpala", 1);
- if(engine == 1)
- SetEngine(veh, playerid, 0);
- else
- SetTimerEx("SetEngine", 3000, 0, "ddd", veh, playerid, 1), InfoBoxShow(2, playerid, "Odpalanie ~y~silnika~w~ moze potrwac kilka sekund...", 3);
- }
- }
- else if(newkeys == KEY_FIRE + 8 || newkeys == KEY_FIRE)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(lights == 1)
- SetVehicleParamsEx(veh, engine, 0, alarm, doors, bonnet, boot, objective);
- else
- SetVehicleParamsEx(veh, engine, 1, alarm, doors, bonnet, boot, objective);
- }
- }
- new Float:vPos[3];
- if(newkeys == 65536 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- for(new v = 0; v < MAX_VEHICLES; v++)
- {
- GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 4.0, vPos[0], vPos[1], vPos[2]) && GetVehicleVirtualWorld(v) == GetPlayerVirtualWorld(playerid))
- {
- SetVehicleParamsEx(v, engine, lights, alarm, 1, bonnet, boot, objective);
- break;
- }
- }
- }
- if(newkeys == 131072 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- new info[128];
- for(new v = 0; v < MAX_VEHICLES; v++)
- {
- GetVehiclePos(v, vPos[0], vPos[1], vPos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 4.0, vPos[0], vPos[1], vPos[2]) && GetVehicleVirtualWorld(v) == GetPlayerVirtualWorld(playerid) && pPojazd(playerid, v) != 0)
- {
- GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
- if(doors == 1)
- {
- format(info, sizeof(info), "~y~Drzwi~w~ pojazdu ~y~%s~w~ (UID: %d) sa ~r~zamkniete~w~.~n~Nie mozesz ~g~otworzyc~y~ bagaznika~w~.", GetVehicleName(CarUID(v)), CarUID(v));
- }
- if(GetPVarInt(playerid, "rpBoot") > gettime())
- return InfoBoxShow(2, playerid, "Zastosowano ~r~zabezpieczenie~w~, ktore nie pozwoli Ci naduzywac tej opcji.~n~Sprobuj ponownie za kilka sekund.", 3);
- if(boot == 1 && doors != 1)
- {
- SetPVarInt(playerid, "rpBoot", gettime()+3);
- format(info, sizeof(info), "~y~Bagaznik~w~ pojazdu ~y~%s~w~ (UID: %d) zostal ~r~zamkniety~w~.", GetVehicleName(CarUID(v)), CarUID(v));
- SetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, 0, objective);
- }
- else
- {
- if(doors != 1)
- {
- SetPVarInt(playerid, "rpBoot", gettime()+3);
- format(info, sizeof(info), "~y~Bagaznik~w~ pojazdu ~y~%s~w~ (UID: %d) zostal ~g~otwarty~w~.", GetVehicleName(CarUID(v)), CarUID(v));
- SetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, 1, objective);
- }
- }
- InfoBoxShow(2, playerid, info, 3);
- break;
- }
- }
- }
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(newkeys == 128 || newkeys == 136 || newkeys == 160)
- {
- TextDrawSetString(Licznik3[playerid], "~r~~h~!");
- }
- else
- {
- TextDrawSetString(Licznik3[playerid], "~w~!");
- }
- }
- if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER && newkeys == 2)
- {
- if(GetPlayerWeaponInData(playerid) != INVALID_WEAPON_DATA)
- {
- if(!(Grupa[Sluzba(playerid)][gFlagPerm] & G_FLAG_DRIVEBY))
- {
- Kara(0, playerid, -1, "Attempt Force DriveBy.", 0);
- return 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(GetPlayerSpeed(playerid) > 600 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new ACS[128], v = GetPlayerVehicleID(playerid);
- format(ACS, sizeof(ACS), "Warp: %dkm/h (%s).", GetPlayerSpeed(playerid), GetVehicleName(CarUID(GetPlayerVehicleID(playerid)))), Kara(2, playerid, -1, ACS, 7);
- SetVehicleVirtualWorld(v, v+2);
- SetVehicleToRespawn(v);
- }
- SetPVarInt(playerid, "AFK", 0);
- if(GetPVarInt(playerid, "rpBron") != 0)
- {
- new bron[13],ammo[13];
- for(new slot=0;slot<13;slot++)
- {
- GetPlayerWeaponData(playerid, slot, bron[slot], ammo[slot]);
- }
- new weapon=GetPlayerWeapon(playerid);
- if(bron[1]&&ammo[1]>0)
- {
- if(bron[1]==weapon){
- RemovePlayerAttachedObject(playerid, ATTACH_SLOT_1);
- }
- if(bron[1]!=weapon)
- {
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_1,GetWeaponModel(bron[1]),1, 0.199999, -0.139999, 0.030000, 0.500007, -115.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- }
- }
- if(bron[2]&&ammo[2]>0)
- {
- if(bron[2]==weapon){
- RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
- }
- if(bron[2]!=weapon)
- {
- SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[2]),8, -0.079999, -0.15, 0.009999, 180.100006, -10.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- }
- }
- if(bron[3]&&ammo[3]>0)
- {
- if(bron[3]==weapon){
- RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
- }
- if(bron[3]!=weapon)
- {
- SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[3]),1,-0.25, -0.19, -0.1, 0.399932, 13.000000, 10.000000, 1.099999, 1.000000, 1.000000);
- }
- }
- if(bron[4]&&ammo[4]>0)
- {
- if(bron[4]==weapon){
- RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
- }
- if(bron[4]!=weapon)
- {
- SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[4]),7, 0.000000, -0.100000, -0.080000, -95.000000, 90.000000, 6.000000, 1.000000, 1.000000, 1.00000);
- }
- }
- if(bron[5]&&ammo[5]>0)
- {
- if(bron[5]==weapon){
- RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
- }
- if(bron[5]!=weapon)
- {
- SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[5]),1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- }
- }
- if(bron[6]&&ammo[6]>0)
- {
- if(bron[6]==weapon){
- RemovePlayerAttachedObject(playerid,ATTACH_SLOT_1);
- }
- if(bron[6]!=weapon)
- {
- SetPlayerAttachedObject(playerid,ATTACH_SLOT_1,GetWeaponModel(bron[6]),1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- }
- }
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerTeam(playerid, NO_TEAM);
- SetPlayerHealth(playerid, 100);
- TextDrawHideForPlayer(playerid, ImagenGift);
- if(Login(playerid) == 1)
- {
- SetPVarInt(playerid, "Teleport", 1);
- GameTextForPlayer(playerid, "~g~Pomyslnie zespawnowano.", 1500, 5);
- for(new nr = 0; nr < 11; nr++)
- {
- SetPlayerSkillLevel(playerid, nr, 1);
- }
- SetPlayerSkillLevel(playerid, 3, 999);
- SetPlayerSkillLevel(playerid, 7, 999);
- SetPlayerSkillLevel(playerid, 8, 999);
- SetPlayerSkillLevel(playerid, 9, 999);
- setHP(playerid, Player[playerid][pHP]);
- if(GetPVarInt(playerid, "rpBronUID") == 0)
- {
- ResetPlayerWeapons(playerid);
- }
- SetPlayerSkin(playerid, Player[playerid][pSkin]);
- SetPlayerHealth(playerid, Player[playerid][pHP]);
- //Spawn AdminJail
- if(Player[playerid][pAJ] != 0)
- {
- SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+2222);
- return 1;
- }
- //Nadawanie BW
- if(GetPVarInt(playerid, "Death") == 1)
- {
- Player[playerid][pBW] = 10;
- SetPVarInt(playerid, "Death", 0);
- }
- //spawn BW
- if(Player[playerid][pBW] > 0)
- {
- SetPVarInt(playerid, "Teleport", 1);
- SetPVarInt(playerid, "SpawnBW", gettime()+5);
- format(String, sizeof(String), "Twoja postać została pobita do stanu BW.\nMusisz odczekać jeszcze %d minut, aby móc normalnie funkcjonować.", Player[playerid][pBW]), Info(playerid, String);
- SetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
- SetPlayerVirtualWorld(playerid, Player[playerid][pVir]);
- return SetPlayerInterior(playerid, Player[playerid][pInt]);
- }
- //wchodzenie po /qs, crash, timeout
- if(Player[playerid][pQuit] == 1)
- {
- if(gettime() < Player[playerid][pQuitTime]+600)
- {
- SetPVarInt(playerid, "Teleport", 1);
- InfoBoxShow(2, playerid, "W wyniku ~y~crashu~w~ lub ~y~wyjscia z gry~w~ za pomoca komendy ~y~/qs~w~ zostajesz przywrocony do poprzedniej pozycji.", 3);
- SetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
- SetPlayerVirtualWorld(playerid, Player[playerid][pVir]);
- SetPlayerInterior(playerid, Player[playerid][pInt]), Player[playerid][pQuit] = 0;
- }
- else
- {
- SetPVarInt(playerid, "Teleport", 1);
- Player[playerid][pQuit] = 0, InfoBoxShow(2, playerid, "Od poprzedniej wyjscia z gry w wyniku ~y~crashu~w~ lub uzycia ~y~/qs~w~ minelo wiecej niz ~r~10 minut~w~.~n~Zostajesz zespawnowany na spawnie Twojej postaci.", 3);
- }
- return 1;
- }
- //spawn normalny
- if(Player[playerid][pSpawn] == 0)
- {
- SetPVarInt(playerid, "Teleport", 1);
- SetPlayerPos(playerid, 444.6531,-1729.9272,9.9767);
- }
- else if(Player[playerid][pSpawn] == 1)
- {
- SetPVarInt(playerid, "Teleport", 1);
- if(Drzwi[Player[playerid][pSpawnID]][dAktywne] == OWNER_PLAYER && Drzwi[Player[playerid][pSpawnID]][dOwner] == 1)
- {
- new d = Player[playerid][pSpawnID];
- SetPlayerInterior(playerid, Drzwi[d][dIntWew]);
- SetPlayerVirtualWorld(playerid, Drzwi[d][dWewVir]);
- SetPlayerPos(playerid, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]);
- }
- else
- {
- Player[playerid][pSpawn] = 0;
- Player[playerid][pSpawnID] = 0;
- OnPlayerSpawn(playerid);
- }
- }
- else if(Player[playerid][pSpawn] == 2)
- {
- SetPVarInt(playerid, "Teleport", 1);
- if(Player[playerid][pSpawnTyp] == 1)
- {
- SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
- SetPlayerInterior(playerid, IntArray2[49][0]);
- SetPlayerPos(playerid, IntArray[49][0], IntArray[49][1], IntArray[49][2]);
- return SetPlayerFacingAngle(playerid, IntArray[49][3]);
- }
- else if(Player[playerid][pSpawnTyp] == 2)
- {
- SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
- SetPlayerInterior(playerid, IntArray2[58][0]);
- SetPlayerPos(playerid, IntArray[58][0], IntArray[58][1], IntArray[58][2]);
- return SetPlayerFacingAngle(playerid, IntArray[58][3]);
- }
- return 1;
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
- {
- if(fScaleX > 2 || fScaleX < 0 || fScaleY > 2 || fScaleY < 0 || fScaleZ > 2 || fScaleZ < 0)
- return InfoBoxShow(2, playerid, "Skalowanie ~y~obiektu~w~ przekroczylo ~r~dopuszczalne~w~ rozmiary.", 3), RemovePlayerAttachedObject(playerid, index);
- InfoBoxShow(2, playerid, "Skalowanie ~y~obiektu~w~ zostalo zakonczone ~g~sukcesem~w~.", 3);
- return SetPlayerAttachedObject(playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- //zerowanie ofert
- if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
- {
- if(Offer[playerid][oType] == 7)
- {
- UpdateDynamic3DTextLabelText(Text3D:Veh3DText[Offer[playerid][oItemUID]], KOL_NAME, " ");
- }
- foreach(Player, p)
- {
- if(p != playerid && Offer[p][oCustomerID] == Offer[playerid][oCustomerID])
- {
- Offer[playerid][oCustomerID] = INVALID_PLAYER_ID;
- Offer[p][oCustomerID] = INVALID_PLAYER_ID;
- }
- else
- {
- Offer[playerid][oCustomerID] = INVALID_PLAYER_ID;
- }
- }
- }
- //kasowanie dostarczania paczek
- if(GetPVarInt(playerid, "rpPaczka") != 0)
- {
- Paczka[GetPVarInt(playerid, "rpPaczka")][pDostarcza] = 0;
- }
- //koniec
- Player[playerid][pInGame] = 0;
- if(Login(playerid) == 1)
- {
- //dodawanie sesji
- new query[256];
- format(query, sizeof(query), "INSERT INTO `1sesje` (`data`,`char`,`online`,`global`) VALUES ('%d', %d, '%d', '%d')", gettime(), Player[playerid][pUID], gettime() - Player[playerid][pSesja], Player[playerid][pGID]);
- mysql_query_ex(query);
- //koniec zapisu sesji
- for(new nr = 0; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 1 && Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[nr][iTyp] != 2)
- {
- Przedmiot[nr][iUsed] = 0;
- }
- }
- }
- if(GetPVarInt(playerid, "rpBronUID") != 0)
- {
- new bron[13], amunicja[13];
- for (new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerid, i, bron[i], amunicja[i]);
- if(bron[i] == GetPVarInt(playerid, "rpBron"))
- {
- ResetPlayerWeapons(playerid);
- Przedmiot[GetPVarInt(playerid, "rpBronUID")][iUsed] = 0;
- Przedmiot[GetPVarInt(playerid, "rpBronUID")][iWartosc2] = amunicja[i];
- }
- }
- }
- Data();
- new h, m, s, Time[3];
- FullTime(gettime() - Player[playerid][pSesja], Time[0], Time[1], Time[2]);
- gettime(h, m, s);
- SavePlayerStats(playerid, SAVE_PLAYER_BASIC);
- SavePlayerStats(playerid, SAVE_PLAYER_POS);
- SavePlayerStats(playerid, SAVE_PLAYER_GROUP);
- }
- UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pNickName], KOL_NAME, " ");
- UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pOpis], COLOR_DESC, " ");
- return SetPVarInt(playerid, "Teleport", 1);
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new ACS[128];
- if(Login(playerid) == 1)
- {
- dHP[playerid] = 75;
- SetPVarInt(playerid, "Death", 1);
- if((gettime() - DeathInfo[playerid][time0]) < 1)
- {
- DeathInfo[playerid][killed]++;
- if(DeathInfo[playerid][killed] == KILL_LIMIT)
- {
- format(ACS, sizeof(ACS), "FakeKill na graczu %s.", CharName(killerid)), Kara(0, playerid, -1, ACS, 0);
- }
- }
- else DeathInfo[playerid][killed] = 0;
- DeathInfo[playerid][time0] = gettime();
- if(GetPVarInt(playerid, "rpBronUID") != 0)
- {
- new bron[13], amunicja[13];
- for (new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerid, i, bron[i], amunicja[i]);
- if(bron[i] == GetPVarInt(playerid, "rpBron"))
- {
- ResetPlayerWeapons(playerid);
- Przedmiot[GetPVarInt(playerid, "rpBronUID")][iUsed] = 0;
- Przedmiot[GetPVarInt(playerid, "rpBronUID")][iWartosc2] = amunicja[i];
- SetPVarInt(playerid, "rpBron", 0);
- SetPVarInt(playerid, "rpAmmo", 0);
- SetPVarInt(playerid, "rpBronAC", gettime()+8);
- SetPVarInt(playerid, "rpBronUID", 0);
- }
- }
- }
- GetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
- }
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- foreach(Player, p)
- {
- if(GetPVarInt(p, "OffeVeh") == vehicleid)
- {
- SetPVarInt(p, "OffeVeh", 0);
- SetPVarInt(p, "OffeVehTime", 0);
- Tip(p, "Naprawa pojazdu została anulowana, pojazd został zniszczony.");
- TextDrawHideForPlayer(p, TDOffe[p]);
- Offer[p][oBlock] = 0;
- }
- }
- UpdateDynamic3DTextLabelText(Text3D:Veh3DText[vehicleid], KOL_NAME, " ");
- new panels1, doors1, lights1, tires1;
- GetVehicleDamageStatus(vehicleid, panels1, doors1, lights1, tires1);
- new veh = CarUID(vehicleid);
- if(Pojazd[veh][vPanels] < panels1)
- {
- Pojazd[veh][vPanels] = panels1;
- }
- if(Pojazd[veh][vDoors] < doors1)
- {
- Pojazd[veh][vDoors] = doors1;
- }
- if(Pojazd[veh][vLights] < lights1)
- {
- Pojazd[veh][vLights] = lights1;
- }
- if(Pojazd[veh][vTires] < tires1)
- {
- Pojazd[veh][vTires] = tires1;
- }
- ZapiszPojazd(vehicleid);
- Pojazd[veh][vHP] = 300;
- SetVehicleHealth(vehicleid, 300);
- return ZapiszPojazd(vehicleid);
- }
- public OnVehicleSpawn(vehicleid)
- {
- return UstawParametryPojazdu(vehicleid);
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new succes = 0, Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- //Zabezpieczenie
- if(pPojazd(playerid, vehicleid) == 0 && Player[playerid][pOnline] <= 10800)
- {
- foreach(Player, p)
- {
- if(GetPlayerVehicleID(p) == vehicleid && GetPlayerState(p) == PLAYER_STATE_DRIVER)
- {
- succes = 1;
- }
- }
- if(succes == 0)
- {
- return SetPlayerPos(playerid, Pos[0]+0.05, Pos[1]+0.05, Pos[2]+0.01), Info(playerid, "Nie możesz wejść do pojazdu, gdy nie ma w nim kierowcy.\nTa informacja przestanie się pojawiać po przegraniu 3 godzin.");
- }
- }
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- if(doors == 1)
- return SetPlayerPos(playerid, Pos[0]+0.05, Pos[1]+0.05, Pos[2]+0.01);
- if(!ispassenger)
- {
- if(pPojazd(playerid, vehicleid) == 0)
- {
- return SetPlayerPos(playerid, Pos[0]+0.05, Pos[1]+0.05, Pos[2]+0.01);
- }
- SetPVarInt(playerid, "EnterVehicle", 1);
- return printf("[cars] %s wsiadł do pojazdu %s (UID: %d) jako kierowca.", cName(playerid), GetVehicleName(CarUID(vehicleid)), CarUID(vehicleid));
- }
- SetPVarInt(playerid, "EnterVehicle", 2);
- return printf("[cars] %s wsiadł do pojazdu %s (UID: %d) jako pasażer.", cName(playerid), GetVehicleName(CarUID(vehicleid)), CarUID(vehicleid));
- }
- public OnVehicleDamageStatusUpdate(vehicleid, playerid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new string[128];
- if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
- {
- if(GetPVarInt(playerid, "EnterVehicle") == 0)
- {
- format(string, sizeof(string), "Nieautoryzowane wejscie do pojazdu (%d:%s).", CarUID(GetPlayerVehicleID(playerid)), GetVehicleName(CarUID(GetPlayerVehicleID(playerid)))), Kara(0, playerid, -1, string, 0);
- }
- else
- {
- SetPVarInt(playerid, "EnterVehicle", 0);
- }
- }
- if(newstate == PLAYER_STATE_DRIVER)
- {
- TextDrawShowForPlayer(playerid, Licznik0[playerid]);
- TextDrawShowForPlayer(playerid, Licznik1[playerid]);
- TextDrawShowForPlayer(playerid, Licznik2[playerid]);
- TextDrawShowForPlayer(playerid, Licznik3[playerid]);
- if(pPojazd(playerid, GetPlayerVehicleID(playerid)) == 0)
- {
- format(string, sizeof(string), "Nieautoryzowane wejscie do pojazdu (%d:%s).", CarUID(GetPlayerVehicleID(playerid)), GetVehicleName(CarUID(GetPlayerVehicleID(playerid)))), Kara(0, playerid, -1, string, 0);
- }
- return 1;
- }
- if(oldstate == PLAYER_STATE_DRIVER)
- {
- SetPVarInt(playerid, "rpPasy", 0);
- TextDrawHideForPlayer(playerid, Licznik0[playerid]);
- TextDrawHideForPlayer(playerid, Licznik1[playerid]);
- TextDrawHideForPlayer(playerid, Licznik2[playerid]);
- TextDrawHideForPlayer(playerid, Licznik3[playerid]);
- if(GetPVarInt(playerid, "LastVehicleID") != 0)
- {
- if(pPojazd(playerid, GetPVarInt(playerid, "LastVehicleID")) != 0)
- {
- GetVehiclePos(GetPVarInt(playerid, "LastVehicleID"), VehicleLastPos[GetPVarInt(playerid, "LastVehicleID")][0], VehicleLastPos[GetPVarInt(playerid, "LastVehicleID")][1], VehicleLastPos[GetPVarInt(playerid, "LastVehicleID")][2]);
- GetVehicleZAngle(GetPVarInt(playerid, "LastVehicleID"), VehicleLastPos[GetPVarInt(playerid, "LastVehicleID")][3]);
- }
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(Login(playerid) == 1)
- {
- printf("[dial] %s: [%s] (%d, %d, %d)", cName(playerid), inputtext, dialogid, response, listitem);
- }
- if(dialogid == 0)
- return 1;
- else if(dialogid == DIALOG_ID)
- {
- if(!response) return Kick(playerid);
- new str[312];
- new hash[256];
- new salt[256];
- mysql_real_escape_string(inputtext, str);
- format(str, sizeof str, "SELECT 1postacie.owneruid, 1postacie.uid, members.members_pass_salt FROM 1postacie JOIN members ON members.member_id = 1postacie.owneruid WHERE 1postacie.nick = '%s' LIMIT 1", NickSAMP(playerid));
- mysql_query_ex(str);
- mysql_store_result();
- if(mysql_num_rows() != 0)
- {
- mysql_fetch_row_format(str);
- sscanf(str, "p<|>dds[256]", globaluid[playerid], playeruid[playerid], salt);
- Player[playerid][pUID] = playeruid[playerid];
- SetPVarInt(playerid, "pGID", globaluid[playerid]);
- }
- mysql_free_result();
- format(hash, sizeof(hash), "%s%s", MD5_Hash(salt), MD5_Hash(inputtext));
- mysql_real_escape_string(hash, hash);
- format(str, sizeof(str), "SELECT 1postacie.*, members.name FROM 1postacie JOIN members ON members.members_pass_hash = md5('%s') WHERE 1postacie.uid = %d LIMIT 1", hash, playeruid[playerid]);
- mysql_query_ex(str);
- mysql_store_result();
- if(mysql_num_rows())
- {
- mysql_free_result();
- format(String, sizeof(String), "[info] Pomyslnie zalogowano (%s).", inputtext), PlayerLog(playerid, String);
- setLogin(playerid, 1), OnPlayerLoginIC(playerid, NickSAMP(playerid));
- }
- else
- {
- mysql_free_result();
- SetPVarInt(playerid, "BledneLogowanie", GetPVarInt(playerid, "BledneLogowanie") +1);
- if(GetPVarInt(playerid, "BledneLogowanie") == 2)
- {
- Kick(playerid);
- }
- new query[200];
- GetPlayerIp(playerid, Player[playerid][pIP], 16);
- format(query, sizeof(query), "INSERT INTO `1sesje_log` (`data`,`char`,`global`,`status`,`IP`) VALUES (%d, %d, %d, %d, '%s')", gettime(), playeruid[playerid], globaluid[playerid], 0, Player[playerid][pIP]);
- mysql_query_ex(query);
- dShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_PASSWORD, ""ServName"Logowanie", "Witaj na serwerze RolePlay!\n\nPostać została odnaleziona w Naszej bazie danych,\ndokonaj autoryzacji wpisując hasło.", "Dalej", "Anuluj");
- InfoBoxShow(2, playerid, "Podane haslo jest ~r~nieprawidlowe~w~.", 3);
- }
- }
- else if(dialogid == 2)
- {
- new iteminfo[128];
- if(!response)
- {
- SetPVarInt(playerid, "ItemList", ListItem[playerid][listitem]);
- format(iteminfo, sizeof(iteminfo), "{AAC5E3}Zarządzanie {B3D341}»{AAC5E3} %s", Przedmiot[ListItem[playerid][listitem]][iNazwa]);
- return dShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, iteminfo, "1\tOdłóż przedmiot\n2\tOddaj za darmo osobie w pobliżu\n3\tSprzedaj osobie w pobliżu\n4\tWłóż do torby\n5\tWłóż do szafy\n6\tPokaż informacje", "Wybierz", "Anuluj");
- }
- return UseItem(playerid, ListItem[playerid][listitem]);
- }
- else if(dialogid == 3)
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- if(Przedmiot[GetPVarInt(playerid, "ItemList")][iAktywny] == 1 && Przedmiot[GetPVarInt(playerid, "ItemList")][iOwner] == 1 && Przedmiot[GetPVarInt(playerid, "ItemList")][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[GetPVarInt(playerid, "ItemList")][iUsed] == 1)
- return Info(playerid, "Przedmiot jest aktualnie używany przez Twoją postać.");
- if(!IsPlayerInAnyVehicle(playerid))
- {
- new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- Przedmiot[GetPVarInt(playerid, "ItemList")][iPosX] = Pos[0];
- Przedmiot[GetPVarInt(playerid, "ItemList")][iPosY] = Pos[1];
- Przedmiot[GetPVarInt(playerid, "ItemList")][iPosZ] = Pos[2]-0.95;
- ItemObiekt[GetPVarInt(playerid, "ItemList")] = CreateObject(GetItemModel(GetPVarInt(playerid, "ItemList")), Przedmiot[GetPVarInt(playerid, "ItemList")][iPosX], Przedmiot[GetPVarInt(playerid, "ItemList")][iPosY], Przedmiot[GetPVarInt(playerid, "ItemList")][iPosZ], ItemRotX(GetPVarInt(playerid, "ItemList")), 0, 0, GetPlayerVirtualWorld(playerid));
- Przedmiot[GetPVarInt(playerid, "ItemList")][iOwner] = 7;
- Przedmiot[GetPVarInt(playerid, "ItemList")][iOwnerUID] = 0;
- Przedmiot[GetPVarInt(playerid, "ItemList")][iVir] = GetPlayerVirtualWorld(playerid);
- format(String, sizeof(String), "* %s odkłada przedmiot na ziemię.", CharName(playerid));
- }
- else
- {
- Przedmiot[GetPVarInt(playerid, "ItemList")][iOwner] = 2;
- Przedmiot[GetPVarInt(playerid, "ItemList")][iOwnerUID] = CarUID(GetPlayerVehicleID(playerid));
- format(String, sizeof(String), "* %s odkłada przedmiot w pojeździe.", CharName(playerid));
- }
- ZapiszPrzedmiot(GetPVarInt(playerid, "ItemList"));
- return ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- return InfoBoxShow(2, playerid, "Ten ~y~przedmiot~w~ nie jest Twoja wlasnoscia.", 3);
- }
- case 5:
- {
- new id = GetPVarInt(playerid, "ItemList"), status[16], iteminfo[64], waga[64], flaga[32];
- if(Przedmiot[id][iAktywny] == 1)
- {
- format(iteminfo, sizeof(iteminfo), "{AAC5E3}Informacje {B3D341}»{AAC5E3} %s", Przedmiot[id][iNazwa]);
- if(Przedmiot[id][iUsed] == 1)
- status = "Aktywny";
- else
- status = "Nieaktywny";
- if(Przedmiot[id][iTyp] == 1)
- {
- format(waga, sizeof(waga), "(%dg)", Przedmiot[id][iWartosc2] * 3);
- }
- if(Przedmiot[id][iFlaga] == 0)
- flaga = "Brak oflagowania";
- else
- format(flaga, sizeof(flaga), "%d", Przedmiot[id][iFlaga]);
- format(String, sizeof(String), "Identyfikator:\t\t%d\nTyp:\t\t\t%s\n\nStatus:\t\t\t%s\nWaga:\t\t\t%dg %s\n\nWartość 1:\t\t%d\nWartość 2:\t\t%d\nFlaga dla grupy:\t%s", id, PrzedmiotTyp(id), status, Przedmiot[id][iWaga], waga, Przedmiot[id][iWartosc1], Przedmiot[id][iWartosc2], flaga);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, iteminfo, String, "Rozumiem", "");
- }
- return InfoBoxShow(2, playerid, "Ten ~y~przedmiot~w~ nie jest Twoja wlasnoscia.", 3);
- }
- }
- return 1;
- }
- else if(dialogid == 4)
- {
- if(!response) return 1;
- new uid;
- if(sscanf(inputtext, "d", uid))
- return dShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj UID przedmiotu, którym chcesz zarządzać.\nBłąd: Tylko liczby.", "Dalej", "Anuluj");
- SetPVarInt(playerid, "rpItemEdit", uid);
- if(Przedmiot[uid][iAktywny] == 0)
- return Info(playerid, "Taki przedmiot nie jest aktywny, nie możesz go w żaden sposób edytować.");
- return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- }
- else if(dialogid == DIALOG_ITEM_EDIT)
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+1, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Aby dodać nowy przedmiot, uzupełnij poniżesze pola.\n[typ] [wartość 1] [wartość 2] [owner] [owner UID] [waga] [nazwa]", "Dalej", "Anuluj");
- case 1: return dShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj UID przedmiotu, którym chcesz zarządzać.", "Dalej", "Anuluj");
- }
- }
- else if(dialogid == DIALOG_ITEM_EDIT+1)
- {
- if(!response) return 1;
- new Nazwa[256], Typ, Wartosc1, Wartosc2, Owner1, Owner2, Waga;
- if(sscanf(inputtext, "dddddds[256]", Typ, Wartosc1, Wartosc2, Owner1, Owner2, Waga, Nazwa))
- return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+1, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Aby dodać nowy przedmiot, uzupełnij poniżesze pola.\n[typ] [wartość 1] [wartość 2] [owner] [owner UID] [waga] [nazwa]", "Dalej", "Anuluj");
- Tip(playerid, "Przedmiot został stworzony pomyślnie.");
- return DodajPrzedmiot(playerid, Nazwa, Typ, Wartosc1, Wartosc2, Owner1, Owner2, Waga);
- }
- else if(dialogid == DIALOG_ITEM_EDIT+2)
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+3, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nową nazwę dla tego przedmiotu", "Dalej", "Anuluj");
- case 1: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+4, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości dla tego przedmiotu:\n[wartość 1] [wartość 2]", "Dalej", "Anuluj");
- case 2: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+5, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tBroń\n2\tUbranie\n3\tŻywność\n4\tBrak typu\n5\tKomponenty zewnętrzne\n6\tNarkotyki\n7\tRękawiczki\n8\tMaska\n9\tMedykamenty\n10\tMegafon\n11\tKajdanki\n12\tCzęści / Akcesoria dające pojazdom HP\n13\tKomponenty wewnętrzne", "Dalej", "Anuluj");
- case 3: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+6, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości właściciela dla tego przedmiotu:\n[wartość 1] [wartość 2]", "Dalej", "Anuluj");
- case 4:
- {
- new id = GetPVarInt(playerid, "rpItemEdit"), status[16], iteminfo[64], flaga[32];
- format(iteminfo, sizeof(iteminfo), "{AAC5E3}Informacje {B3D341}»{AAC5E3} %s", Przedmiot[id][iNazwa]);
- if(Przedmiot[id][iUsed] == 1)
- status = "Aktywny";
- else
- status = "Nieaktywny";
- if(Przedmiot[id][iFlaga] == 0)
- flaga = "Brak oflagowania";
- else
- format(flaga, sizeof(flaga), "%d", Przedmiot[id][iFlaga]);
- format(String, sizeof(String), "Identyfikator:\t\t%d\nTyp:\t\t\t%s\n\nStatus:\t\t\t%s\nWaga:\t\t\t%dg\n\nWartość 1:\t\t%d\nWartość 2:\t\t%d\nFlaga dla grupy:\t%s", id, PrzedmiotTyp(id), status, Przedmiot[id][iWaga], Przedmiot[id][iWartosc1], Przedmiot[id][iWartosc2], flaga);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, iteminfo, String, "Rozumiem", "");
- }
- case 5:
- {
- if(Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iAktywny] == 1)
- {
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iAktywny] = 0;
- ZapiszPrzedmiot(GetPVarInt(playerid, "rpItemEdit"));
- return Tip(playerid, "Przedmiot został usunięty.");
- }
- else
- {
- return Info(playerid, "Taki przedmiot nie istnieje.");
- }
- }
- case 6: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+7, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nową wagę przedmiotu:\n[waga]", "Dalej", "Anuluj");
- case 7: return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+8, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości oflagowania:\n[typ {1 - gracz} {2 - grupa}][identyfikator]", "Dalej", "Anuluj");
- }
- }
- else if(dialogid == DIALOG_ITEM_EDIT+3)
- {
- if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- new nazwa[256];
- if(sscanf(inputtext, "s[256]", nazwa))
- return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+3, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nową nazwę dla tego przedmiotu", "Dalej", "Anuluj");
- strmid(Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iNazwa], nazwa, 0, 32, 32);
- dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- return Tip(playerid, "Nazwa przedmiotu została zmieniona.");
- }
- else if(dialogid == DIALOG_ITEM_EDIT+4)
- {
- if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- new wartosc1, wartosc2;
- if(sscanf(inputtext, "dd", wartosc1, wartosc2))
- return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+4, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości dla tego przedmiotu:\n[wartość 1] [wartość 2]", "Dalej", "Anuluj");
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iWartosc1] = wartosc1;
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iWartosc2] = wartosc2;
- dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- return Tip(playerid, "Wartości przedmiotu zostały zmienione.");
- }
- else if(dialogid == DIALOG_ITEM_EDIT+5)
- {
- if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iTyp] = listitem+1;
- dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tEdytuj nazwę przedmiotu\n2\tEdytuj wartości przedmiotu\n3\tEdytuj typ przedmiotu wedle listy\n4\tEdytuj właściciela przedmiotu\n5\tPokaż informacje o przedmiocie", "Dalej", "Anuluj");
- return Tip(playerid, "Typ przedmiotu został zmieniony.");
- }
- else if(dialogid == DIALOG_ITEM_EDIT+6)
- {
- if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- new wartosc1, wartosc2;
- if(sscanf(inputtext, "dd", wartosc1, wartosc2))
- return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+6, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości właściciela dla tego przedmiotu:\n[wartość 1] [wartość 2]", "Dalej", "Anuluj");
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iOwner] = wartosc1;
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iOwnerUID] = wartosc2;
- dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tEdytuj nazwę przedmiotu\n2\tEdytuj wartości przedmiotu\n3\tEdytuj typ przedmiotu wedle listy\n4\tEdytuj właściciela przedmiotu\n5\tPokaż informacje o przedmiocie", "Dalej", "Anuluj");
- return Tip(playerid, "Właściciel przedmiotu został zmieniony.");
- }
- else if(dialogid == DIALOG_ITEM_EDIT+7)
- {
- if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- new wartosc1;
- if(sscanf(inputtext, "d", wartosc1))
- return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+7, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nową wagę przedmiotu:\n[waga]", "Dalej", "Anuluj");
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iWaga] = wartosc1;
- dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- return Tip(playerid, "Waga przedmiotu została zmieniona.");
- }
- else if(dialogid == DIALOG_ITEM_EDIT+8)
- {
- if(!response) return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", EDIT_ITEM, "Dalej", "Anuluj");
- new wartosc1, wartosc2;
- if(sscanf(inputtext, "dd", wartosc1, wartosc2))
- return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+8, DIALOG_STYLE_INPUT, ""ServName"Przedmioty", "Podaj nowe wartości oflagowania:\n[typ {1 - gracz} {2 - grupa}][identyfikator]", "Dalej", "Anuluj");
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iFlaga] = wartosc1;
- Przedmiot[GetPVarInt(playerid, "rpItemEdit")][iFlagaUID] = wartosc2;
- dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT+2, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tEdytuj nazwę przedmiotu\n2\tEdytuj wartości przedmiotu\n3\tEdytuj typ przedmiotu wedle listy\n4\tEdytuj właściciela przedmiotu\n5\tPokaż informacje o przedmiocie", "Dalej", "Anuluj");
- return Tip(playerid, "Flagi przedmiotu zostały zmienione.");
- }
- //tworzenie postaci
- else if(dialogid == 50)
- {
- if(response)
- {
- dShowPlayerDialog(playerid, 51, DIALOG_STYLE_INPUT, ""ServName"Tworzenie postaci", "Znajdujesz się w kreatorze tworzenia postaci oraz podpisywania jej pod konto globalne na forum.\nPodaj identyfikator (UID) konta globalnego, do którego chcesz przypisać tą postać.", "Dalej", "Anuluj");
- }
- else
- {
- Kick(playerid);
- }
- return 1;
- }
- else if(dialogid == 51)
- {
- new idenfytikator = 0;
- if(!response) return Kick(playerid);
- if(sscanf(inputtext, "d", idenfytikator))
- return dShowPlayerDialog(playerid, 51, DIALOG_STYLE_INPUT, ""ServName"Tworzenie postaci", "Podany przez Ciebie identyfikator postaci jest błędny.\nPodaj identyfikator (UID) konta globalnego, do którego chcesz przypisać tą postać.", "Dalej", "Anuluj");
- new query[128], query2[128];
- format(query, sizeof(query), "SELECT `member_id`,`members_display_name`,`members_pass_salt` FROM `members` WHERE `member_id` =%d", idenfytikator);
- mysql_query_ex(query);
- mysql_store_result();
- if(mysql_num_rows() == 0)
- {
- dShowPlayerDialog(playerid, 51, DIALOG_STYLE_INPUT, ""ServName"Tworzenie postaci", "Takie konto nie istnieje.\nPodaj identyfikator (UID) konta globalnego, do którego chcesz przypisać tą postać.", "Dalej", "Anuluj");
- }
- else
- {
- mysql_fetch_row_format(query2);
- sscanf(query2, "p<|>ds[64]s[64]", Player[playerid][pGID], Player[playerid][pName], Player[playerid][pSalt]);
- format(String, sizeof(String), "Aby podpisać tą postać pod konto globalne %s, podaj hasło.", Player[playerid][pName]), dShowPlayerDialog(playerid, 52, DIALOG_STYLE_PASSWORD, ""ServName"Tworzenie postaci", String, "Dalej", "Anuluj");
- }
- mysql_free_result();
- return 1;
- }
- else if(dialogid == 52)
- {
- if(response)
- {
- new password[64], data[128], hashex[100], query[512];
- format(password, sizeof(password), "%s", inputtext);
- format(hashex, sizeof(hashex), "%s%s", MD5_Hash(Player[playerid][pSalt]), MD5_Hash(password));
- format(query, sizeof(query), "SELECT `gamescore`,`premium`,`ban_uid`,`member_group_id`,`ban_time` FROM `members` WHERE members_pass_hash = md5('%s') AND member_id = '%d' LIMIT 1", hashex, Player[playerid][pGID]);
- mysql_query_ex(query);
- mysql_store_result();
- if(mysql_fetch_row_format(data, "|"))
- {
- sscanf(data, "p<|>ddddd", IPB[playerid][ipb_GameScore], IPB[playerid][ipb_Premium], IPB[playerid][ipb_Ban], IPB[playerid][ipb_Grupa], IPB[playerid][ipb_BanTime]);
- SetPlayerScore(playerid, IPB[playerid][ipb_GameScore]);
- printf("%d, %d", IPB[playerid][ipb_Ban], IPB[playerid][ipb_BanTime]);
- mysql_free_result();
- if(IPB[playerid][ipb_Grupa] == 5 || IPB[playerid][ipb_Ban] != 0 && gettime() < IPB[playerid][ipb_BanTime])
- {
- SendClientMessage(playerid, -1, "Konto globalne, na które właśnie się zalogowałeś posiada status osoby {BB0000}zbanowanej{FFFFFF}.");
- format(String, sizeof(String), "Z powyższego powodu proces tworzenia nowej postaci dla konta globalnego %s (UID: %d) zostaje przerwany.", Player[playerid][pName], Player[playerid][pGID]);
- SendClientMessage(playerid, -1, String);
- return KickWithMessage(playerid, -1, "Jeżeli nie zgadzasz się z nałożoną na Ciebie karą, napisz odwołanie na forum (page-rp.pl).");
- }
- dShowPlayerDialog(playerid, 53, DIALOG_STYLE_LIST, ""ServName"Tworzenie postaci (1/3)", "Mężczyzna\nKobieta", "Dalej", "Anuluj");
- }
- else
- {
- mysql_free_result();
- format(String, sizeof(String), "Aby podpisać tą postać pod konto globalne %s, podaj poprawne hasło.", Player[playerid][pName]), dShowPlayerDialog(playerid, 52, DIALOG_STYLE_PASSWORD, ""ServName"Tworzenie postaci", String, "Dalej", "Anuluj");
- }
- }
- return 1;
- }
- else if(dialogid == 53)
- {
- if(!response) return Kick(playerid);
- switch(listitem)
- {
- case 0:
- {
- SetPVarInt(playerid, "CharCreate1", CHAR_SEX_MALE);
- }
- case 1:
- {
- SetPVarInt(playerid, "CharCreate1", CHAR_SEX_FEMALE);
- }
- }
- return dShowPlayerDialog(playerid, 54, DIALOG_STYLE_LIST, ""ServName"Tworzenie postaci (2/3)", "{AAC5E3}Przedmioty startowe I{FFFFFF}\n\t$250\n\tTelefon komórkowy\n{AAC5E3}Przedmioty startowe II{FFFFFF}\n\t$100\n\tDokumenty postaci\n{AAC5E3}Przedmioty startowe III{FFFFFF}\n\t350$", "Dalej", "Anuluj");
- }
- else if(dialogid == 54)
- {
- new query[256];
- SetPVarInt(playerid, "CharCreate2", 0);
- if(!response) return Kick(playerid);
- if(listitem == 0)
- {
- SetPVarInt(playerid, "CharCreate2", 1);
- }
- else if(listitem == 3)
- {
- SetPVarInt(playerid, "CharCreate2", 2);
- }
- else if(listitem == 6)
- {
- SetPVarInt(playerid, "CharCreate2", 3);
- }
- else
- {
- dShowPlayerDialog(playerid, 54, DIALOG_STYLE_LIST, ""ServName"Tworzenie postaci (2/3)", "{F8E394}Przedmioty startowe I{FFFFFF}\n\t$250\n\tTelefon komórkowy\n{F8E394}Przedmioty startowe II{FFFFFF}\n\t$100\n\tDokumenty postaci\n{F8E394}Przedmioty startowe III{FFFFFF}\n\t350$", "Dalej", "Anuluj");
- }
- if(GetPVarInt(playerid, "CharCreate2") != 0)
- {
- if(GetPVarInt(playerid, "CharCreate1") == CHAR_SEX_MALE)
- {
- format(query, sizeof(query), "INSERT INTO `1postacie` (`nick`,`skin`,`owneruid`,`plec`) VALUES ('%s', '%d', '%d', '%d')", NickSAMP(playerid), Random_Skin_Male[random(sizeof(Random_Skin_Male))], Player[playerid][pGID], GetPVarInt(playerid, "CharCreate1"));
- }
- else
- {
- format(query, sizeof(query), "INSERT INTO `1postacie` (`nick`,`skin`,`owneruid`,`plec`) VALUES ('%s', '%d', '%d', '%d')", NickSAMP(playerid), Random_Skin_Female[random(sizeof(Random_Skin_Female))], Player[playerid][pGID], GetPVarInt(playerid, "CharCreate1"));
- }
- }
- mysql_query_ex(query);
- //ostatnia postać `members`
- format(query, sizeof(query), "UPDATE `members` SET `lastchar`=%d WHERE member_id = '%d'", mysql_insert_id(), Player[playerid][pGID]);
- mysql_query_ex(query);
- return OnPlayerConnect(playerid), Player[playerid][pPakiet] = GetPVarInt(playerid, "CharCreate2");
- }
- else if(dialogid == 55)
- {
- if(!response) return 1;
- new query[256];
- switch(listitem)
- {
- case 0://Konto premium 7 dni
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_1))
- return Info(playerid, "Na twoim koncie jest już aktywna usługa {B3D341}Konto premium (7 dni){AAC5E3}.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_1)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_1;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_1;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Konto premium (7 dni){AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 1, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 1://konto premium 14 dni
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_2))
- return Info(playerid, "Na twoim koncie jest już aktywna usługa {B3D341}Konto premium (14 dni){AAC5E3}.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_2)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_2;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_2;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Konto premium (14 dni){AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 2, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 2://Konto premium 31 dni
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_3))
- return Info(playerid, "Na twoim koncie jest już aktywna usługa {B3D341}Konto premium (31 dni){AAC5E3}.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_3)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_3;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_3;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Konto premium (31 dni){AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 3, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 3://Przedmiot
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_4))
- return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_4)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_4;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_4;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Stworzenie przedmiotu{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 4, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 4://Blokada postaci
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_5))
- return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_5)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_5;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_5;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Blokada postaci{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 5, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 5://Edycja profilu
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_6))
- return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_6)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_6;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_6;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Edycja profilu CSS i HTML{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 6, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 6://Nowa grupa
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_7))
- return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_7)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_7;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_7;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Stworzenie nowej grupy{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 7, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 7://Etykiety
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_8))
- return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_8)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_8;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_8;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}10 etykiet tekstowych{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 8, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 8://Zmiana tożsamości
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_9))
- return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_9)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_9;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_9;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Zmiana tożsamości{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 9, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 9://Kasacja postaci
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_10))
- return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_10)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_10;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_10;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Usunięcie postaci{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 10, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- case 10://Własny interior
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_11))
- return Info(playerid, "Na twoim koncie jest już aktywna ta usługa.\nAby zakupić nową, wykorzystaj najpierw poprzednią.");
- if(IPB[playerid][ipb_PremiumScore] < SERVICE_PREMIUM_11)
- {
- Info(playerid, "Na swoim koncie globalnym nie masz aktualnej ilości punktów premium, aby móc zakupić tę usługę.\nAby skorzystać z doładowania punktów użyj w tym celu komendy /premium zakup.");
- }
- else
- {
- IPB[playerid][ipb_PremiumScore] -= SERVICE_PREMIUM_11;
- IPB[playerid][ipb_PremiumService] += SERVICE_B_PREMIUM_11;
- Global_Data_Save(playerid);
- Info(playerid, "Zakup usługi {B3D341}Własny interior{AAC5E3} powiódł się.\nAby aktywować usługę użyj komendy /premium aktywuj.");
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], 11, Player[playerid][pIP]);
- mysql_query_ex(query);
- }
- return 1;
- }
- }
- return 1;
- }
- else if(dialogid == 56)
- {
- if(!response) return 1;
- new pakiet = 0, query[512];
- if(sscanf(inputtext, "d", pakiet))
- return Info(playerid, "Taki pakiet nie istnieje.\nTransakcja zostaje przerwana.");
- if(pakiet == 1)
- {
- if(IPB[playerid][ipb_GameScore] < 300)
- return Info(playerid, "Nie posiadasz wystarczającej ilości punktów GameScore.\nZakup wirtualnych € zostaje przerwany.");
- IPB[playerid][ipb_PremiumScore] += 10;
- IPB[playerid][ipb_GameScore] -= 300;
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], -1, Player[playerid][pIP]);
- mysql_query_ex(query);
- return Info(playerid, "Transakcja zakończona sukcesem.\nNa Twoje konto trafiło 10 wirtualnych €."), Global_Data_Save(playerid);
- }
- else if(pakiet == 2)
- {
- if(IPB[playerid][ipb_GameScore] < 600)
- return Info(playerid, "Nie posiadasz wystarczającej ilości punktów GameScore.\nZakup wirtualnych € zostaje przerwany.");
- IPB[playerid][ipb_PremiumScore] += 25;
- IPB[playerid][ipb_GameScore] -= 600;
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], -2, Player[playerid][pIP]);
- mysql_query_ex(query);
- return Info(playerid, "Transakcja zakończona sukcesem.\nNa Twoje konto trafiło 25 wirtualnych €."), Global_Data_Save(playerid);
- }
- else if(pakiet == 3)
- {
- if(IPB[playerid][ipb_GameScore] < 110)
- return Info(playerid, "Nie posiadasz wystarczającej ilości punktów GameScore.\nZakup wirtualnych € zostaje przerwany.");
- IPB[playerid][ipb_PremiumScore] += 50;
- IPB[playerid][ipb_GameScore] -= 1100;
- format(query, sizeof(query), "INSERT INTO `1premium` (`date`,`gid`,`typ`,`IP`) VALUES ('%d', %d, '%d', '%s')", gettime(), Player[playerid][pGID], -3, Player[playerid][pIP]);
- mysql_query_ex(query);
- return Info(playerid, "Transakcja zakończona sukcesem.\nNa Twoje konto trafiło 50 wirtualnych €."), Global_Data_Save(playerid);
- }
- return Info(playerid, "Taki pakiet nie istnieje.\nTransakcja zostaje przerwana.");
- }
- else if(dialogid == 57)
- {
- if(!response) return 1;
- if(!strcmp(inputtext, "» Konto premium (7 dni)", true))
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_1))
- {
- if(IPB[playerid][ipb_Premium] == 0 || IPB[playerid][ipb_Premium] < gettime())
- {
- IPB[playerid][ipb_Premium] = gettime() + (7 * DAY_SECOND);
- }
- else
- {
- IPB[playerid][ipb_Premium] += (7 * DAY_SECOND);
- }
- IPB[playerid][ipb_PremiumService] -= SERVICE_B_PREMIUM_1;
- Info(playerid, "Aktywacja usługi {B3D341}Konto premium (7 dni){AAC5E3} przebiegła pomyślnie."), Global_Data_Save(playerid);
- }
- else
- {
- Info(playerid, "Usługa {B3D341}Konto premium (7 dni){AAC5E3} nie została jeszcze zakupiona.");
- }
- return 1;
- }
- else if(!strcmp(inputtext, "» Konto premium (14 dni)", true))
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_2))
- {
- if(IPB[playerid][ipb_Premium] == 0 || IPB[playerid][ipb_Premium] < gettime())
- {
- IPB[playerid][ipb_Premium] = gettime() + (14 * DAY_SECOND);
- }
- else
- {
- IPB[playerid][ipb_Premium] += (14 * DAY_SECOND);
- }
- IPB[playerid][ipb_PremiumService] -= SERVICE_B_PREMIUM_2;
- Info(playerid, "Aktywacja usługi {B3D341}Konto premium (14 dni){AAC5E3} przebiegła pomyślnie."), Global_Data_Save(playerid);
- }
- else
- {
- Info(playerid, "Usługa {B3D341}Konto premium (14 dni){AAC5E3} nie została jeszcze zakupiona.");
- }
- return 1;
- }
- else if(!strcmp(inputtext, "» Konto premium (31 dni)", true))
- {
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_3))
- {
- if(IPB[playerid][ipb_Premium] == 0 || IPB[playerid][ipb_Premium] < gettime())
- {
- IPB[playerid][ipb_Premium] = gettime() + (31 * DAY_SECOND);
- }
- else
- {
- IPB[playerid][ipb_Premium] += (31 * DAY_SECOND);
- }
- IPB[playerid][ipb_PremiumService] -= SERVICE_B_PREMIUM_3;
- Info(playerid, "Aktywacja usługi {B3D341}Konto premium (31 dni){AAC5E3} przebiegła pomyślnie."), Global_Data_Save(playerid);
- }
- else
- {
- Info(playerid, "Usługa {B3D341}Konto premium (31 dni){AAC5E3} nie została jeszcze zakupiona.");
- }
- return 1;
- }
- return 1;
- }
- else if(dialogid == 100)
- {
- if(!response) return 1;
- if(Przedmiot[ListItem[playerid][listitem+1]][iAktywny] == 1 && Przedmiot[ListItem[playerid][listitem+1]][iOwner] == 7)
- {
- if(ItemWaga(playerid) + Przedmiot[ListItem[playerid][listitem+1]][iWaga] > ItemUdzwig(playerid))
- return Info(playerid, "Nie masz wystarczającej siły, aby podnieść ten przedmiot.");
- Przedmiot[ListItem[playerid][listitem+1]][iOwner] = 1;
- Przedmiot[ListItem[playerid][listitem+1]][iOwnerUID] = Player[playerid][pUID];
- ZapiszPrzedmiot(ListItem[playerid][listitem+1]);
- format(String, sizeof(String), "* %s podnosi przedmiot %s.", CharName(playerid), Przedmiot[ListItem[playerid][listitem+1]][iNazwa]);
- DestroyObject(ItemObiekt[ListItem[playerid][listitem+1]]);
- return ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- return 1;
- }
- else if(dialogid == 101)
- {
- if(!response) return 1;
- if(listitem == 0) return 1;
- if(Przedmiot[ListItem[playerid][listitem+1]][iAktywny] == 1 && Przedmiot[ListItem[playerid][listitem+1]][iOwner] == 1 && Przedmiot[ListItem[playerid][listitem+1]][iOwnerUID] == Player[playerid][pUID])
- {
- Przedmiot[ListItem[playerid][listitem+1]][iWartosc2] += Przedmiot[GetPVarInt(playerid, "AmunicjaUID")][iWartosc2];
- Przedmiot[GetPVarInt(playerid, "AmunicjaUID")][iAktywny] = 0;
- ZapiszPrzedmiot(GetPVarInt(playerid, "AmunicjaUID"));
- ZapiszPrzedmiot(ListItem[playerid][listitem+1]);
- format(String, sizeof(String), "* %s uzupełnia przedmiot %s.", CharName(playerid), Przedmiot[ListItem[playerid][listitem+1]][iNazwa]);
- return ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- return 1;
- }
- else if(dialogid == 110)
- {
- if(!response) return 1;
- if(pDrzwiOwner(playerid, GetPVarInt(playerid, "rpDrzwi")) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- Drzwi[GetPVarInt(playerid, "rpDrzwi")][dOwner] = OWNER_GROUP;
- Drzwi[GetPVarInt(playerid, "rpDrzwi")][dOwnerUID] = ListItem[playerid][listitem];
- return Info(playerid, "Drzwi zostały pomyślnie podpisane pod grupę."), ZapiszDrzwi(GetPVarInt(playerid, "rpDrzwi"));
- }
- else if(dialogid == 200)
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0: return dShowPlayerDialog(playerid, 201, DIALOG_STYLE_INPUT, ""ServName"Logi", "Podaj UID wpisu w celu jego dezaktywacji:", "Dalej", "Anuluj");
- }
- return 1;
- }
- else if(dialogid == 201)
- {
- new log, typ, char0, query[256], owner;
- if(!response) return 1;
- if(sscanf(inputtext, "d", log))
- {
- return 1;//błąd
- }
- format(query, sizeof(query), "SELECT `typ`,`char`,`owner` FROM `1logi` WHERE `uid`=%d", log);
- mysql_query_ex(query);
- mysql_store_result();
- if(mysql_num_rows() != 0)
- {
- mysql_fetch_row_format(query);
- sscanf(query, "p<|>ddd", typ, char0, owner);
- }
- mysql_free_result();
- if(typ == 2)
- {
- format(query, sizeof(query), "UPDATE `members` SET `ban_time`=0 WHERE `member_id`=%d", owner);
- mysql_query_ex(query);
- }
- else if(typ == 3 || typ == 7)
- {
- format(query, sizeof(query), "UPDATE `1postacie` SET `konto`=1 WHERE `uid`=%d", char0);
- mysql_query_ex(query);
- }
- format(query, sizeof(query), "UPDATE `1logi` SET `expires`=0, `dezprzez`=%d WHERE `uid`=%d", Player[playerid][pGID], log);
- mysql_query_ex(query);
- return 1;
- }
- else if(dialogid == 202)
- {
- if(!response) return 1;
- new nr = GetPVarInt(playerid, "rpDoorPickUp");
- switch(listitem)
- {
- case 0: Drzwi[nr][dPickup] = 1240;
- case 1: Drzwi[nr][dPickup] = 1242;
- case 2: Drzwi[nr][dPickup] = 1239;
- case 3: Drzwi[nr][dPickup] = 1272;
- case 4: Drzwi[nr][dPickup] = 1273;
- case 5: Drzwi[nr][dPickup] = 1212;
- case 6: Drzwi[nr][dPickup] = 1241;
- case 7: Drzwi[nr][dPickup] = 1247;
- case 8: Drzwi[nr][dPickup] = 1274;
- case 9: Drzwi[nr][dPickup] = 1275;
- case 10: Drzwi[nr][dPickup] = 1314;
- case 11: Drzwi[nr][dPickup] = 1318;
- }
- ZapiszDrzwi(nr);
- DestroyDynamicPickup(DrzwiPickup[nr]);
- return CreateDynamicPickup(Drzwi[nr][dPickup], 2, Drzwi[nr][dZewPosX], Drzwi[nr][dZewPosY], Drzwi[nr][dZewPosZ], Drzwi[nr][dZewVir]);
- }
- else if(dialogid == 250)
- {
- if(!response) return 1;
- new d = GetPVarInt(playerid, "rpDrzwi");
- if(!strcmp(inputtext, "1 Zmień nazwę drzwi", true))
- {
- if(pDrzwiOwner(playerid, d) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- return dShowPlayerDialog(playerid, 251, DIALOG_STYLE_INPUT, ""ServName"Drzwi", "W poniższym polu możesz zmienić nazwę wyświetlaną drzwi.\nPamiętaj jednak, że zmiana kosztować Cię będzie $50.", "Dalej", "Anuluj");
- }
- else if(!strcmp(inputtext, "2 Pokaż informacje o drzwiach", true))
- return DoorInfo(playerid, d);
- else if(!strcmp(inputtext, "3 Przekaż budynek dla gracza", true))
- {
- if(pDrzwiOwner(playerid, d) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- return Tip(playerid, "Aby zaoferować komuś kupno budynku użyj komendy /o drzwi.");
- }
- else if(!strcmp(inputtext, "4 Przypisz budynek pod grupę", true))
- {
- if(pDrzwiOwner(playerid, d) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- new grupai[64], grupy[256], grupyx;
- for(new slot = 1; slot < 6; slot++)
- {
- if(pGrupa[playerid][slot] != 0 && Grupa[pGrupa[playerid][slot]][gAktywna] == 1 && (pGrupaPerm[playerid][slot] & PERM_LEADER))
- {
- format(grupai, sizeof(grupai), "%d\t{FFFFFF}%s (%d){FFFFFF}", slot, Grupa[pGrupa[playerid][slot]][gNazwa], pGrupa[playerid][slot]);
- format(grupy, sizeof(grupy), "%s%s\n", grupy, grupai);
- ListItem[playerid][grupyx] = pGrupa[playerid][slot];
- grupyx ++;
- }
- }
- if(!grupyx) return InfoBoxShow(2, playerid, "Twoja postac nie jest liderem zadnej grupy.", 3);
- return dShowPlayerDialog(playerid, 110, DIALOG_STYLE_LIST, ""ServName"Grupy", grupy, "Wybierz", "Anuluj");
- }
- else if(!strcmp(inputtext, "5 Przypisz budynek pod postać", true))
- {
- if(pDrzwiOwner(playerid, d) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- return Tip(playerid, "Ta funkcja została tymczasowo wyłączona.");
- }
- else if(!strcmp(inputtext, "6 Zmień pozycję wewnętrzną", true))
- {
- if(pDrzwiOwner(playerid, d) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- if(InDoor(playerid) != d)
- return Info(playerid, "Musisz być we wnętrzu budynku, w którym chciałeś edytować pozycję.");
- GetPlayerPos(playerid, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]);
- GetPlayerFacingAngle(playerid, Drzwi[d][dWewRot]);
- return Info(playerid, "Pozycja wewnętrzna budynku została pomyślnie zmieniona.");
- }
- else if(!strcmp(inputtext, "7 Przypisz obiekty do drzwi", true))
- {
- if(pDrzwiOwner(playerid, d) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- return 1;
- }
- else if(!strcmp(inputtext, "8 Przypisz etykiety do drzwi", true))
- {
- if(pDrzwiOwner(playerid, d) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- return 1;
- }
- else if(!strcmp(inputtext, "9 Zmień interior (widoczność na świat)", true))
- {
- if(pDrzwiOwner(playerid, d) == 0)
- return Info(playerid, "Brak uprawnień do zarządzania tymi drzwiami.");
- return 1;
- }
- return 1;
- }
- else if(dialogid == 300)
- {
- if(!response) return 1;
- new zone = GetPVarInt(playerid, "rpAreaZone"), owner[128];
- if(!strcmp(inputtext, "1 Pokaż informacje o strefie", true))
- {
- if(GangZoneInfo[zone][gOwner] == OWNER_GROUP && Grupa[GangZoneInfo[zone][gOwnerUID]][gAktywna] == 1)
- {
- format(owner, 128, "%s (UID: %d)", Grupa[GangZoneInfo[zone][gOwnerUID]][gNazwa], GangZoneInfo[zone][gOwnerUID]);
- }
- else
- {
- format(owner, 128, "Brak właściciela, strefę można przejąć.");
- }
- format(String, sizeof(String), "Strefa:\t\t%s (UID: %d)\nWłaściciel:\t%s", GangZoneInfo[zone][gNazwa], zone, owner);
- return Info(playerid, String);
- }
- if(!strcmp(inputtext, "2 Przejmij strefę", true))
- {
- new grupai[64], grupy[256], grupyx;
- for(new slot = 1; slot < 6; slot++)
- {
- if(pGrupa[playerid][slot] != 0 && Grupa[pGrupa[playerid][slot]][gAktywna] == 1 && (pGrupaPerm[playerid][slot] & PERM_LEADER))
- {
- if(GroupDoorInArea(pGrupa[playerid][slot], zone) > 1)
- {
- format(grupai, sizeof(grupai), "%d\t{FFFFFF}%s (%d){FFFFFF}", slot, Grupa[pGrupa[playerid][slot]][gNazwa], pGrupa[playerid][slot]);
- format(grupy, sizeof(grupy), "%s%s\n", grupy, grupai);
- ListItem[playerid][grupyx] = pGrupa[playerid][slot];
- grupyx ++;
- }
- }
- }
- if(!grupyx) return InfoBoxShow(2, playerid, "Twoja postac nie jest liderem zadnej grupy lub ta nie posiada wymaganej ilosci budynkow.", 3);
- return dShowPlayerDialog(playerid, 301, DIALOG_STYLE_LIST, "{AAC5E3}Wybierz grupę, dla której chcesz przejąć strefę.", grupy, "Wybierz", "Anuluj");
- }
- if(GangZoneInfo[zone][gOwner] == 2 && Grupa[GangZoneInfo[zone][gOwnerUID]][gAktywna] == 1)
- {
- if((pGrupaPerm[playerid][GrupaSlot(playerid, GangZoneInfo[zone][gOwnerUID])] & PERM_LEADER))
- {
- if(!strcmp(inputtext, "3 Widoczność strefy", true))
- {
- //
- return 1;
- }
- }
- else
- {
- Info(playerid, "Brak uprawnień do podglądu strefy.");
- }
- }
- return 1;
- }
- else if(dialogid == 301)
- {
- if(!response) return 1;
- if(GroupDoorInArea(ListItem[playerid][listitem], GetPVarInt(playerid, "rpAreaZone")) > 1)
- {
- GangZoneInfo[GetPVarInt(playerid, "rpAreaZone")][gOwner] = OWNER_GROUP;
- GangZoneInfo[GetPVarInt(playerid, "rpAreaZone")][gOwnerUID] = ListItem[playerid][listitem];
- Info(playerid, "Stefa została pomyślnie przejęta."), Zapisz_Strefe(GetPVarInt(playerid, "rpAreaZone"));
- }
- else
- {
- Info(playerid, "Aby przejąć daną strefę, grupa musi posiadać minimum dwa budynki na jej terenie.");
- }
- return 1;
- }
- else if(dialogid == 500)
- {
- if(!response) return 1;
- new v = ListItem[playerid][listitem];
- if(Pojazd[v][vAktywny] == 1)
- {
- if(Pojazd[v][vSpawn] == 1)
- {
- foreach(Player, p)
- {
- if(GetPlayerVehicleID(p) == PojazdModel[v])
- {
- return InfoBoxShow(2, playerid, "Nie mozesz odspawnowac tego ~y~pojazdu~w~, poniewaz ktos znajduje sie w srodku.", 3);
- }
- if(GetPVarInt(p, "OffeVeh") == PojazdModel[v])
- {
- SetPVarInt(p, "OffeVeh", 0);
- SetPVarInt(p, "OffeVehTime", 0);
- Tip(playerid, "Naprawa pojazdu została anulowana, pojazd został odspawnowany.");
- TextDrawHideForPlayer(p, TDOffe[p]);
- Offer[p][oBlock] = 0;
- }
- }
- format(String, sizeof(String), "Odspawnowano pojazd ~y~%s~w~ (UID: %d).", GetVehicleName(v), v);
- InfoBoxShow(2, playerid, String, 3);
- UpdateDynamic3DTextLabelText(Text3D:Veh3DText[PojazdModel[v]], KOL_NAME, " ");
- ZapiszPojazd(PojazdModel[v]);
- DestroyVehicle(PojazdModel[v]);
- Pojazd[v][vSpawn] = 0;
- if(Pojazd[v][vOwner] == 1)
- {
- if(GetPVarInt(playerid, "VehicleSpawn") > 0)
- {
- SetPVarInt(playerid, "VehicleSpawn", GetPVarInt(playerid, "VehicleSpawn")-1);
- }
- }
- else if(Pojazd[v][vOwner] == 2)
- {
- if(Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn] > 0)
- {
- Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn] = Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn]-1;
- }
- }
- }
- else
- {
- if(Pojazd[v][vOwner] == 1)
- {
- if(GetPVarInt(playerid, "VehicleSpawn") == 4)
- return InfoBoxShow(2, playerid, "Posiadasz maksymalna ilosc jednoczesnie zespawnowanych ~y~pojazdow~w~.", 3);
- }
- else if(Pojazd[v][vOwner] == 2)
- {
- if(Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn] >= Grupa[Pojazd[v][vOwnerUID]][gVehLimit])
- return InfoBoxShow(2, playerid, "Grupa posiada maksymalna ilosc jednoczesnie zespawnowanych ~y~pojazdow~w~.", 3);
- }
- PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
- GetVehiclePos(PojazdModel[v], VehicleLastPos[PojazdModel[v]][0], VehicleLastPos[PojazdModel[v]][1], VehicleLastPos[PojazdModel[v]][2]);
- GetVehicleZAngle(PojazdModel[v], VehicleLastPos[PojazdModel[v]][3]);
- Pojazd[v][vSpawn] = 1;
- PojazdUID[PojazdModel[v]] = v;
- if(Pojazd[v][vReje] == 0)
- {
- SetVehicleNumberPlate(PojazdModel[v], " ");
- }
- else if(Pojazd[v][vReje] == 1)
- {
- format(String, sizeof(String), "SA %04d", v);
- SetVehicleNumberPlate(PojazdModel[v], String);
- }
- SetVehicleToRespawn(PojazdModel[v]);
- UstawParametryPojazdu(PojazdModel[v]);
- format(String, sizeof(String), "Zespawnowano pojazd ~y~%s~w~ (UID: %d).", GetVehicleName(v), v);
- InfoBoxShow(2, playerid, String, 3);
- SetPVarInt(playerid, "VehicleSpawn", GetPVarInt(playerid, "VehicleSpawn")+1);
- }
- }
- return 1;
- }
- else if(dialogid == 997)
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- if(Player[playerid][pJob] == 1)
- return Info(playerid, "Aktualnie jesteś zatrudniony jako mechanik, nie możesz ponownie wziąć tej pracy.");
- Player[playerid][pJob] = 1, InfoBoxShow(2, playerid, "Gratulacje!~n~Podjadles sie pracy ~y~Mechanika~w~.", 3);
- }
- case 1:
- {
- if(Player[playerid][pJob] == 2)
- return Info(playerid, "Aktualnie jesteś zatrudniony jako kurier, nie możesz ponownie wziąć tej pracy.");
- Player[playerid][pJob] = 2, InfoBoxShow(2, playerid, "Gratulacje!~n~Podjadles sie pracy ~y~Kuriera~w~.", 3);
- }
- case 2:
- {
- if(Player[playerid][pJob] == 3)
- return Info(playerid, "Aktualnie jesteś zatrudniony jako rybak, nie możesz ponownie wziąć tej pracy.");
- Player[playerid][pJob] = 3, InfoBoxShow(2, playerid, "Gratulacje!~n~Podjadles sie pracy ~y~Rybaka~w~.", 3);
- }
- }
- return 1;
- }
- else if(dialogid == 998)
- {
- if(!response) return 1;
- new interior = listitem + 1;
- SetPVarInt(playerid, "Teleport", 1);
- SetPlayerInterior(playerid, IntArray2[interior][0]);
- SetPlayerPos(playerid, IntArray[interior][0], IntArray[interior][1], IntArray[interior][2]);
- return SetPlayerFacingAngle(playerid, IntArray[interior][3]);
- }
- else if(dialogid == 999)
- {
- if(!response) return 1;
- format(String, sizeof(String), "Typ grupy ~y~%s~w~ (UID: %d) zostal zmieniony na ~y~%s~w~.", Grupa[GetPVarInt(playerid, "GroupType")][gNazwa], GetPVarInt(playerid, "GroupType"), TypGrupy[listitem+1]);
- InfoBoxShow(2, playerid, String, 3);
- if(Grupa[GetPVarInt(playerid, "GroupType")][gAktywna] == 0) return 1;
- Grupa[GetPVarInt(playerid, "GroupType")][gTyp] = listitem+1;
- return ZapiszGrupe(GetPVarInt(playerid, "GroupType"));
- }
- else if(dialogid == 1000)
- {
- if(!response) return 1;
- //opcje wyciągania produktu, zmiany cen i tak dalej
- return 1;
- }
- else if(dialogid == 1001)
- {
- new powtorzenia = 0, typ, w1, w2, w3, waga, cena, ilosc, nazwa[64];
- if(!response) return 1;
- if(sscanf(inputtext, "ddddddds[64]", typ, w1, w2, w3, waga, cena, ilosc, nazwa))
- return dShowPlayerDialog(playerid, 1001, DIALOG_STYLE_INPUT, ""ServName"Dodawanie produktów", "[typ] [w 1] [w 2] [w 3] [waga] [cena] [ilość] [nazwa]", "Dodaj", "Anuluj");
- if(ilosc < 1 || ilosc > 100)
- return Tip(playerid, "Błędna ilość dodawanych przedmiotów."), dShowPlayerDialog(playerid, 1001, DIALOG_STYLE_INPUT, ""ServName"Dodawanie produktów", "[typ] [w 1] [w 2] [w 3] [waga] [cena] [ilość] [nazwa]", "Dodaj", "Anuluj");
- for(new nr = 1; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 0)
- {
- Przedmiot[nr][iAktywny] = 1;
- Przedmiot[nr][iTyp] = typ;
- Przedmiot[nr][iWartosc1] = w1;
- Przedmiot[nr][iWartosc2] = w2;
- Przedmiot[nr][iWartosc3] = w3;
- Przedmiot[nr][iOwner] = 3;
- Przedmiot[nr][iOwnerUID] = GetPVarInt(playerid, "GrupaDodajProdukt");
- Przedmiot[nr][iWaga] = waga;
- Przedmiot[nr][iUsed] = 0;
- Przedmiot[nr][iVir] = 0;
- Przedmiot[nr][iPrice] = cena;
- strmid(Przedmiot[nr][iNazwa], nazwa, 0, 64, 64);
- ZapiszPrzedmiot(nr);
- powtorzenia++;
- if(powtorzenia == ilosc)
- {
- break;
- }
- }
- }
- return 1;
- }
- else if(dialogid == 1002)
- {
- //skladanie oferty
- return 1;
- }
- else if(dialogid == 1003)
- {
- new item = ListItem[playerid][listitem], infopay[128], info[1024];
- SetPVarInt(playerid, "rpListItemShop", item);
- strcat(infopay, "1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", sizeof(infopay));
- if(Przedmiot[item][iPremiumPrice] != 0)
- {
- strcat(infopay, "3\tZapłać za pomocą wirtualnych €\n", sizeof(infopay));
- }
- format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d)\nSkładający:\t\t%s (UID: %d)\nKoszt oferty:\t\t$%d (€%d)\n----\n%s", "Kupno przedmiotu", Przedmiot[item][iNazwa], item, Grupa[Przedmiot[item][iOwnerUID]][gNazwa], Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice], Przedmiot[item][iPremiumPrice], infopay);
- return dShowPlayerDialog(playerid, 1004, DIALOG_STYLE_LIST, ""ServName"Sklep", info, "Akceptuj", "Odrzuć");
- }
- else if(dialogid == 1004)//sklep 24/7
- {
- if(!response) return 1;
- new item = GetPVarInt(playerid, "rpListItemShop"), itemOwner = Przedmiot[item][iOwnerUID];
- if(Przedmiot[item][iOwner] == 3)
- {
- if(!strcmp(inputtext, "1 Zapłać za pomocą gotówki", true))
- {
- if(dKasa(playerid) < Przedmiot[item][iPrice])
- return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zakupic produkt.", 3);
- gKasa(Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice]);
- sKasa(playerid, -Przedmiot[item][iPrice]);
- format(String, sizeof(String), "Zakupiles przedmiot ~y~%s~w~ (UID: %d) za kwote ~g~$~y~%d~w~ w sklepie samoobslugowym ~y~%s~w~.", Przedmiot[item][iNazwa], item, Przedmiot[item][iPrice], Grupa[itemOwner][gNazwa]);
- InfoBoxShow(2, playerid, String, 3);
- }
- else if(!strcmp(inputtext, "3 Płacę w wirtualnych €", true) && Przedmiot[item][iPremiumPrice] != 0)
- {
- if(IPB[playerid][ipb_PremiumScore] < Przedmiot[item][iPremiumPrice])
- return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacej ilosci ~y~wirtualnych~w~ pieniedzy, aby moc zakupic produkt.", 3);
- Grupa[Przedmiot[item][iOwnerUID]][gWirCash] += Przedmiot[item][iPremiumPrice];
- format(String, sizeof(String), "Zakupiles przedmiot ~y~%s~w~ (UID: %d) za ~g~%d~w~ wirtualnych pieniedzy w sklepie samoobslugowym ~y~%s~w~.", Przedmiot[item][iNazwa], item, Przedmiot[item][iPremiumPrice], Grupa[itemOwner][gNazwa]);
- InfoBoxShow(2, playerid, String, 3);
- IPB[playerid][ipb_PremiumScore] -= Przedmiot[item][iPremiumPrice];
- Global_Data_Save(playerid);
- }
- else if(!strcmp(inputtext, "2 Zapłać za pomocą karty płatniczej", true))
- {
- if(Player[playerid][pBank] < Przedmiot[item][iPrice])
- return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zakupic produkt.", 3);
- gKasa(Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice]);
- Player[playerid][pBank] -= Przedmiot[item][iPrice];
- format(String, sizeof(String), "Zakupiles przedmiot ~y~%s~w~ (UID: %d) za kwote ~g~$~y~%d~w~ w sklepie samoobslugowym ~y~%s~w~.", Przedmiot[item][iNazwa], item, Przedmiot[item][iPrice], Grupa[itemOwner][gNazwa]);
- InfoBoxShow(2, playerid, String, 3);
- }
- else
- {
- if(dKasa(playerid) < Przedmiot[item][iPrice])
- return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zakupic produkt.", 3);
- gKasa(Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice]);
- sKasa(playerid, -Przedmiot[item][iPrice]);
- format(String, sizeof(String), "Zakupiles przedmiot ~y~%s~w~ (UID: %d) za kwote ~g~$~y~%d~w~ w sklepie samoobslugowym ~y~%s~w~.", Przedmiot[item][iNazwa], item, Przedmiot[item][iPrice], Grupa[itemOwner][gNazwa]);
- InfoBoxShow(2, playerid, String, 3);
- }
- AddPoints(Przedmiot[item][iOwnerUID], Przedmiot[item][iPrice]);
- Przedmiot[item][iOwner] = 1;
- Przedmiot[item][iOwnerUID] = Player[playerid][pUID];
- ZapiszPrzedmiot(item);
- if(Przedmiot[item][iTyp] == 18)
- {
- new numer = item+random(999999);
- Przedmiot[item][iWartosc1] = numer;
- }
- }
- else
- {
- InfoBoxShow(2, playerid, "Wystapil ~r~blad~w~. Sprobuj ponownie zakupic ~y~produkt~w~.", 3);
- }
- return 1;
- }
- else if(dialogid == 2000)
- {
- if(!response) return 1;
- new Items[2048], Item[128], Itemy = 0;
- if(Sluzba(playerid) == 0)
- return Info(playerid, "Wejdź na służbę grupy, dla której chcesz zamówić produkty.\nW przeciwnym razie nie możesz skorzytać opcji zamawiania.");
- for(new i = 0; i < sizeof(Zamowienia); i++)
- {
- if(Zamowienia[i][Produkt_Kategoria] == listitem+1)
- {
- if(Zamowienia[i][Produkt_Owner] == 1 && Zamowienia[i][Produkt_OwnerUID] == Grupa[Sluzba(playerid)][gTyp])//wczytywanie wedle typu
- {
- format(Item, sizeof(Item), "%d\t$%d\t%s", i, Zamowienia[i][Produkt_Price], Zamowienia[i][Produkt_Nazwa]);
- format(Items, sizeof(Items), "%s%s\n", Items, Item);
- ListItem[playerid][Itemy] = i;
- Itemy++;
- }
- if(Zamowienia[i][Produkt_Owner] == 2 && Zamowienia[i][Produkt_OwnerUID] == Sluzba(playerid))//wczytywanie wedle UniqueID grupy
- {
- format(Item, sizeof(Item), "%d\t$%d\t%s", i, Zamowienia[i][Produkt_Price], Zamowienia[i][Produkt_Nazwa]);
- format(Items, sizeof(Items), "%s%s\n", Items, Item);
- ListItem[playerid][Itemy] = i;
- Itemy++;
- }
- }
- }
- if(!Itemy)
- return Info(playerid, "Nie możesz zamówić żadnego przedmiotu z tej kategorii.");
- SendClientMessage(playerid, 0xFFF000, "Hurtownia (telefon): Witaj w Hurtowni. Wybierz produkt, który chciałbyś zamówić.");
- return dShowPlayerDialog(playerid, 2001, DIALOG_STYLE_LIST, ""ServName"Zamówienia", Items, "Wybierz", "Anuluj");
- }
- else if(dialogid == 2001)//rozpoczęcie zamówień
- {
- if(!response) return ShowOrderCat(playerid);
- if(Sluzba(playerid) == 0)
- return InfoBoxShow(2, playerid, "Wejdz na sluzbe ~y~grupy~w~, dla ktorej chcesz zamowic produkty.", 3);
- SetPVarInt(playerid, "rpZamowienie", ListItem[playerid][listitem]);
- format(String, sizeof(String),"%s (przez telefon): %s", CharName(playerid), Zamowienia[ListItem[playerid][listitem]][Produkt_Nazwa]);
- PokazTekst(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- format(String, sizeof(String), "Poniżej podaj ilość produktów, które mają zostać zamówione dla Twojej grupy.\nKoszt jednego produktu to $%d.", Zamowienia[ListItem[playerid][listitem]][Produkt_Price]);
- return dShowPlayerDialog(playerid, 2002, DIALOG_STYLE_INPUT, ""ServName"Zamówienia", String, "Zamów", "Anuluj");
- }
- else if(dialogid == 2002)
- {
- new ilosc = 0, item = GetPVarInt(playerid, "rpZamowienie");
- if(sscanf(inputtext, "d", ilosc))
- {
- format(String, sizeof(String), "Poniżej podaj ilość produktów, które mają zostać zamówione dla Twojej grupy.\nKoszt jednego produktu to $%d.", Zamowienia[GetPVarInt(playerid, "rpZamowienie")][Produkt_Price]);
- return dShowPlayerDialog(playerid, 2002, DIALOG_STYLE_INPUT, ""ServName"Zamówienia", String, "Zamów", "Anuluj");
- }
- if(ilosc > 10 || ilosc <= 0)
- return Tip(playerid, "Podana ilośc przedmiotów jest błędna.");
- if(Zamowienia[item][Produkt_Price] * ilosc > Grupa[Sluzba(playerid)][gBank])
- return Tip(playerid, "Grupa nie posiada wystarczających środków, aby zamówić taką ilość produktów.");
- for(new p = 1; p < MAX_ITEM; p++)
- {
- if(Paczka[p][pAktywna] == 0)
- {
- Paczka[p][pAktywna] = 1;
- strmid(Paczka[p][pNazwa], Zamowienia[item][Produkt_Nazwa], 0, 64, 64);
- Paczka[p][pTyp] = Zamowienia[item][Produkt_Typ];
- Paczka[p][pValue1] = Zamowienia[item][Produkt_Wartosc1];
- if(Zamowienia[item][Produkt_Typ] == 3)
- {
- Paczka[p][pValue2] = gettime();
- Paczka[p][pValue3] = gettime();
- }
- else
- {
- Paczka[p][pValue2] = Zamowienia[item][Produkt_Wartosc2];
- Paczka[p][pValue3] = Zamowienia[item][Produkt_Wartosc3];
- }
- Paczka[p][pPrice] = Zamowienia[item][Produkt_Price];
- Paczka[p][pWaga] = Zamowienia[item][Produkt_Waga];
- Paczka[p][pIlosc] = ilosc;
- Paczka[p][pOwner] = 3;
- if(Zamowienia[item][Produkt_Owner] == 2)
- {
- Paczka[p][pOwnerUID] = Zamowienia[item][Produkt_OwnerUID];
- }
- else
- {
- Paczka[p][pOwnerUID] = Sluzba(playerid);
- }
- Paczka[p][pDoor] = InDoor(playerid);
- Paczka[p][pFlaga] = Zamowienia[item][Produkt_Flaga];
- Paczka[p][pFlagaUID] = Zamowienia[item][Produkt_FlagaUID];
- Grupa[Paczka[p][pOwnerUID]][gBank] -= Paczka[p][pPrice]*ilosc;
- ZapiszGrupe(Paczka[p][pOwnerUID]);
- format(String, sizeof(String), "Hurtownia (telefon): Zamówiłeś x%d %s za kwotę $%d, pozostała kwota na koncie grupy to $%d.", ilosc, Paczka[p][pNazwa], Paczka[p][pPrice]*ilosc, Grupa[Paczka[p][pOwnerUID]][gBank]);
- SendClientMessage(playerid, 0xFFF000, String);
- break;
- }
- }
- return 1;
- }
- else if(dialogid == 2501)//odbiór paczki
- {
- if(!response) return 1;
- new p = ListItem[playerid][listitem];
- if(Paczka[p][pDostarcza] == 0)
- {
- new typ = Paczka[p][pTyp];
- if(typ == 1 || typ == 6 || typ == 9 || typ == 14 || typ == 15)
- {
- if(Grupa[Sluzba(playerid)][gTyp] != 7)
- return Info(playerid, "Paczki specjalne może przewozić tylko i wyłącznie firma kurierska.");
- SetPVarInt(playerid, "rpSpecialPack", Sluzba(playerid));
- }
- else
- {
- SetPVarInt(playerid, "rpSpecialPack", 0);
- }
- Paczka[p][pDostarcza] = Player[playerid][pUID];
- SetPVarInt(playerid, "rpPaczka", p);
- InfoBoxShow(2, playerid, "~y~Paczka~w~ zostala ~g~odebrana~w~. Dostarcz ja do ~y~budynku~w~, z ktorego ja zamowiono.", 3);
- SetPlayerMapIcon(playerid, 0, Drzwi[Paczka[p][pDoor]][dZewPosX], Drzwi[Paczka[p][pDoor]][dZewPosY], Drzwi[Paczka[p][pDoor]][dZewPosZ], 51, 0, MAPICON_GLOBAL_CHECKPOINT);
- }
- else
- {
- Info(playerid, "Ta paczka jest aktualnie dostarczana przez innego kuriera.");
- }
- return 1;
- }
- else if(dialogid == 8888)
- {
- new gracz = Offer[playerid][oCustomerID];
- if(Offer[playerid][oCustomerID] == INVALID_PLAYER_ID || Offer[gracz][oCustomerID] == INVALID_PLAYER_ID)
- return 1;
- if(response)
- {
- new paytype = 0;
- if(!strcmp(inputtext, "1 Zapłać za pomocą gotówki", true))
- {
- if(dKasa(playerid) < Offer[gracz][oPrice])
- {
- paytype = 1;
- Offer[playerid][oCustomerID] = INVALID_PLAYER_ID, Offer[gracz][oCustomerID] = INVALID_PLAYER_ID;
- format(String, sizeof(String), "Gracz ~y~%s~w~ ~r~odrzucil~w~ Twoja oferte.", CharName(playerid));
- InfoBoxShow(2, gracz, String, 3);
- return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zaakceptowac oferte.", 3);
- }
- }
- else if(!strcmp(inputtext, "2 Zapłać za pomocą karty płatniczej", true))
- {
- if(Player[playerid][pBank] < Offer[gracz][oPrice])
- {
- paytype = 2;
- Offer[playerid][oCustomerID] = INVALID_PLAYER_ID, Offer[gracz][oCustomerID] = INVALID_PLAYER_ID;
- format(String, sizeof(String), "Gracz ~y~%s~w~ ~r~odrzucil~w~ Twoja oferte.", CharName(playerid));
- InfoBoxShow(2, gracz, String, 3);
- return InfoBoxShow(2, playerid, "Nie posiadasz wystarczajacych ~y~funduszy~w~, aby moc zaakceptowac oferte.", 3);
- }
- }
- else
- {
- Tip(playerid, "Nie wybrałeś środka płatniczego, transakcja przerwana.");
- Offer[playerid][oCustomerID] = INVALID_PLAYER_ID, Offer[gracz][oCustomerID] = INVALID_PLAYER_ID;
- format(String, sizeof(String), "Gracz ~y~%s~w~ ~r~odrzucil~w~ Twoja oferte.", CharName(playerid));
- return InfoBoxShow(2, gracz, String, 3);
- }
- format(String, sizeof(String), "Gracz ~y~%s~w~ ~g~zaakceptowal~w~ Twoja oferte.", CharName(playerid));
- InfoBoxShow(2, gracz, String, 3);
- format(String, sizeof(String), "~g~Zaakceptowales ~w~oferte gracza ~y~%s~w~.", CharName(gracz));
- InfoBoxShow(2, playerid, String, 3);
- if(Offer[gracz][oType] == OFFER_VEHICLE)
- {
- if(paytype == 1)
- {
- sKasa(playerid, -Offer[gracz][oPrice]), sKasa(gracz, Offer[gracz][oPrice]);
- }
- else if(paytype == 2)
- {
- Player[playerid][pBank] -= Offer[gracz][oPrice], Player[gracz][pBank] += Offer[gracz][oPrice];
- format(String, sizeof(String), "[SMS] » Bank: Z Twojego konta pobrano $%d za usługę. Pozostały stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
- SendClientMessage(playerid, 0xFFF000FF, String);
- format(String, sizeof(String), "[SMS] » Bank: Na Twoje konto wpłynęło $%d za usługę. Nowy stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
- SendClientMessage(gracz, 0xFFF000FF, String);
- }
- Offer[gracz][oBlock] = 0;
- printf("[offe] %s zaakceptował ofertę gracza %s. Typ oferty: Kupno pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(Offer[gracz][oItemUID]), Offer[gracz][oItemUID], Offer[gracz][oPrice]);
- RemovePlayerFromVehicle(gracz);
- Pojazd[Offer[gracz][oItemUID]][vOwnerUID] = Player[playerid][pUID];
- Info(playerid, "Świetnie!\nZakupiłeś pojazd, od teraz możesz nim zarządzać poprzez komendę /v.");
- }
- else if(Offer[gracz][oType] == OFFER_DOORS)
- {
- if(paytype == 1)
- {
- sKasa(playerid, -Offer[gracz][oPrice]), sKasa(gracz, Offer[gracz][oPrice]);
- }
- else if(paytype == 2)
- {
- Player[playerid][pBank] -= Offer[gracz][oPrice], Player[gracz][pBank] += Offer[gracz][oPrice];
- format(String, sizeof(String), "[SMS] » Bank: Z Twojego konta pobrano $%d za usługę. Pozostały stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
- SendClientMessage(playerid, 0xFFF000FF, String);
- format(String, sizeof(String), "[SMS] » Bank: Na Twoje konto wpłynęło $%d za usługę. Nowy stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
- SendClientMessage(gracz, 0xFFF000FF, String);
- }
- Offer[gracz][oBlock] = 0;
- printf("[offe] %s zaakceptował ofertę gracza %s. Typ oferty: Kupno drzwi, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), Drzwi[Offer[gracz][oItemUID]][dNazwa], Offer[gracz][oItemUID], Offer[gracz][oPrice]);
- Drzwi[Offer[gracz][oItemUID]][dOwnerUID] = Player[playerid][pUID], ZapiszDrzwi(Offer[gracz][oItemUID]);
- Info(playerid, "Świetnie!\nZakupiłeś budynek, od teraz możesz nim zarządzać poprzez komendę /drzwi.");
- }
- else if(Offer[gracz][oType] == OFFER_WELCOME)
- {
- //witamy postacie
- }
- else if(Offer[gracz][oType] == OFFER_REPAIR)
- {
- if(paytype == 1)
- {
- sKasa(playerid, -Offer[gracz][oPrice]), Grupa[Offer[gracz][oGroupUID]][gBank] += (Offer[gracz][oPrice]/10), sKasa(gracz, (Offer[gracz][oPrice]/15));
- }
- else if(paytype == 2)
- {
- Player[playerid][pBank] -= Offer[gracz][oPrice], Grupa[Offer[gracz][oGroupUID]][gBank] += (Offer[gracz][oPrice]/10), Player[gracz][pBank] += (Offer[gracz][oPrice]/15);
- format(String, sizeof(String), "[SMS] » Bank: Z Twojego konta pobrano $%d za usługę. Pozostały stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
- SendClientMessage(playerid, 0xFFF000FF, String);
- format(String, sizeof(String), "[SMS] » Bank: Na Twoje konto wpłynęło $%d za usługę. Nowy stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
- SendClientMessage(gracz, 0xFFF000FF, String);
- }
- printf("[offe] %s zaakceptował ofertę gracza %s. Typ oferty: Naprawa pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(Offer[gracz][oItemUID]), Offer[gracz][oItemUID], Offer[gracz][oPrice]);
- SetPVarInt(gracz, "OffeVeh", GetPlayerVehicleID(playerid));
- SetPVarInt(gracz, "OffeVehTime", 120);
- SetPVarInt(gracz, "OffeVehType", OFFER_REPAIR);
- format(String, sizeof(String), "Proces naprawy pojazdu %s (UID: %d) rozpoczął się.\nPamiętaj, by silnik pojazdu był zgaszony.", GetVehicleName(Offer[gracz][oItemUID]), Offer[gracz][oItemUID]);
- Info(playerid, String);
- }
- else if(Offer[gracz][oType] == OFFER_REGISTER)
- {
- if(paytype == 1)
- {
- sKasa(playerid, -Offer[gracz][oPrice]), Grupa[Offer[gracz][oGroupUID]][gBank] += (Offer[gracz][oPrice]/10), sKasa(gracz, (Offer[gracz][oPrice]/15));
- }
- else if(paytype == 2)
- {
- Player[playerid][pBank] -= Offer[gracz][oPrice], Grupa[Offer[gracz][oGroupUID]][gBank] += (Offer[gracz][oPrice]/10), Player[gracz][pBank] += (Offer[gracz][oPrice]/15);
- format(String, sizeof(String), "[SMS] » Bank: Z Twojego konta pobrano $%d za usługę. Pozostały stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
- SendClientMessage(playerid, 0xFFF000FF, String);
- format(String, sizeof(String), "[SMS] » Bank: Na Twoje konto wpłynęło $%d za usługę. Nowy stan konta to $%d.", Offer[gracz][oPrice], Player[playerid][pBank]);
- SendClientMessage(gracz, 0xFFF000FF, String);
- }
- Pojazd[Offer[gracz][oItemUID]][vReje] = 1;
- Offer[gracz][oBlock] = 0;
- printf("[offe] %s zaakceptował ofertę gracza %s. Typ oferty: Rejestracja pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(Offer[gracz][oItemUID]), Offer[gracz][oItemUID], Offer[gracz][oPrice]);
- Info(playerid, "Świetnie!\nUdało Ci się zarejestrować swój pojazd, od teraz możesz bezpiecznie poruszać się po drogach.\nPamiętaj, aby pojazd zrespawnować.");
- }
- else if(Offer[gracz][oType] == OFFER_MONTAGE)
- {
- }
- else
- {
- //nieznana usługa
- }
- //koniec wykonywania oferty
- }
- else
- {
- Offer[gracz][oBlock] = 0;
- format(String, sizeof(String), "Gracz ~y~%s~w~ ~r~odrzucil~w~ Twoja oferte.", CharName(playerid));
- InfoBoxShow(2, gracz, String, 3);
- format(String, sizeof(String), "~r~Odrzuciles ~w~oferte gracza ~y~%s~w~.", CharName(gracz));
- InfoBoxShow(2, playerid, String, 3);
- }
- return Offer[playerid][oCustomerID] = INVALID_PLAYER_ID, Offer[gracz][oCustomerID] = INVALID_PLAYER_ID;
- }
- else if(dialogid == 9950)
- {
- new listid = ListItem[playerid][listitem], ItemA[128], ItemB[1024], grup = 0;
- if(!response) return 1;
- if(Grupa[listid][gAktywna] == 1)
- {
- format(ItemA, sizeof(ItemA), "{AAC5E3}UID\tNazwa{FFFFFF}");
- for(new nr = 1; nr < MAX_GRUPY; nr++)
- {
- if(Grupa[nr][gAktywna] == 1 && Grupa[nr][gOwner] == listid)
- {
- format(ItemA, sizeof(ItemA), "%d\t%s", nr, Grupa[nr][gNazwa]);
- format(ItemB, sizeof(ItemB), "%s%s\n", ItemB, ItemA);
- grup++;
- }
- }
- if(grup == 0) return format(String, sizeof(String), "Do grupy ~y~%s~w~ (UID: %d) nie sa przepisane zadne podgrupy.", Grupa[listid][gNazwa], listid), InfoBoxShow(2, playerid, String, 3);
- }
- return dShowPlayerDialog(playerid, 9950, DIALOG_STYLE_LIST, ""ServName"Podgrupy", ItemB, "Wybierz", "");
- }
- else if(dialogid == 9990)
- {
- if(!response) return 1;
- if(!strcmp(inputtext, "1 Ukrywanie postaci", true))
- {
- if(IPB[playerid][ipb_Premium] < gettime())
- return InfoBoxShow(2, playerid, "Nie posiadasz ~y~konta premium~w~, aby moc skorzystac z tej opcji.", 3);
- if(Player[playerid][pInvisible] == 0)
- {
- InfoBoxShow(2, playerid, "Postac zostala ~y~ukryta~w~ pomyslnie.", 3);
- Player[playerid][pInvisible] = 1;
- }
- else
- {
- InfoBoxShow(2, playerid, "Postac zostala ~y~odkryta~w~ pomyslnie.", 3);
- Player[playerid][pInvisible] = 0;
- }
- return 1;
- }
- else if(!strcmp(inputtext, "6 Stacja radiowa", true))
- {
- new rekord = 0, grupy[1024];
- for(new g = 1; g < MAX_GRUPY; g++)
- {
- if(Grupa[g][gAktywna] == 1 && Grupa[g][gTyp] == 16)
- {
- new players, grupa[75];
- ListItem[playerid][rekord] = g;
- rekord++;
- foreach(Player, p)
- {
- if(Sluzba(p) == g)
- {
- players++;
- }
- }
- format(grupa, sizeof(grupa), "%d\t%s\t(Służba: %d)", g, Grupa[g][gNazwa], players);
- format(grupy, sizeof(grupy), "%s%s\n", grupy, grupa);
- }
- }
- if(rekord == 0)
- Info(playerid, "Aktualnie nie istnieje żadna grupa o typie radio.");
- else
- dShowPlayerDialog(playerid, 9991, DIALOG_STYLE_LIST, ""ServName"Radio", grupy, "Wybierz", "Anuluj");
- return 1;
- }
- else if(!strcmp(inputtext, "7 Wyświetlanie stref", true))
- {
- if(IPB[playerid][ipb_ZoneShow] == 0)
- {
- IPB[playerid][ipb_ZoneShow] = 1;
- Info(playerid, "Strefy od tego momentu będą wyświetlane na mapie.\nPamiętaj, że to jest ustawienie globalne dla wszystkich Twoich postaci.");
- }
- else
- {
- IPB[playerid][ipb_ZoneShow] = 0;
- Info(playerid, "Strefy od tego momentu nie będą wyświetlane na mapie.\nPamiętaj, że to jest ustawienie globalne dla wszystkich Twoich postaci.");
- }
- return 1;
- }
- return 1;
- }
- else if(dialogid == 9991)
- {
- if(!response) return 1;
- if(Grupa[ListItem[playerid][listitem]][gAktywna] == 1 && Grupa[ListItem[playerid][listitem]][gTyp] == 16)
- {
- Player[playerid][pRadio] = ListItem[playerid][listitem];
- format(String, sizeof(String), "Pomyślnie zmieniłeś stację radiową, której będzie słuchać Twoja postać.\nNowa stacja to %s.", Grupa[ListItem[playerid][listitem]][gNazwa]), Info(playerid, String);
- }
- else
- {
- Info(playerid, "Grupa nie jest aktywna lub nie działa jako radio.");
- }
- return 1;
- }
- else if(dialogid == 9992)
- {
- switch(listitem)
- {
- case 0: return 1;
- case 1: return 1;
- case 2: return 1;
- case 3: return 1;
- case 4: return 1;
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerCommandReceived(playerid, cmdtext[])//zcmd
- {
- printf("[cmmd] %s: %s", cName(playerid), cmdtext);
- Statystyki[2]++;
- if(Login(playerid) == 0)
- {
- PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)//zcmd
- {
- if(!success)
- {
- PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(Login(playerid) != 1)
- return 0;
- if(Player[playerid][pBW] != 0)
- {
- Info(playerid, "Podczas stanu BW nie możesz używać czatu.");
- return 0;
- }
- if(GetPVarInt(playerid, "ItemTDPage") != 0 && text[0] == '>')
- {
- if(GetPVarInt(playerid, "ItemTDPage") >= 5)
- return 0;
- SetPVarInt(playerid, "ItemTDPage", GetPVarInt(playerid, "ItemTDPage")+1);
- if(GetPVarInt(playerid, "ItemTDPage") == 2)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (2) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 10; i < 20; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- else if(GetPVarInt(playerid, "ItemTDPage") == 3)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (3) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 20; i < 30; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- else if(GetPVarInt(playerid, "ItemTDPage") == 4)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (4) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 30; i < 40; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- else if(GetPVarInt(playerid, "ItemTDPage") == 5)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (5) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 40; i < 50; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- return 0;
- }
- if(GetPVarInt(playerid, "ItemTDPage") != 0 && text[0] == '<')
- {
- SetPVarInt(playerid, "ItemTDPage", GetPVarInt(playerid, "ItemTDPage")-1);
- if(GetPVarInt(playerid, "ItemTDPage") == 0)
- {
- TextDrawHideForPlayer(playerid, ItemTD0[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD1[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD2[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD3[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD4[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD5[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD6[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD7[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD8[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD9[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD10[playerid]);
- return 0;
- }
- if(GetPVarInt(playerid, "ItemTDPage") == 1)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (1) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 0; i < 10; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- else if(GetPVarInt(playerid, "ItemTDPage") == 2)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (2) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 10; i < 20; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- else if(GetPVarInt(playerid, "ItemTDPage") == 3)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (3) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 20; i < 30; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- else if(GetPVarInt(playerid, "ItemTDPage") == 4)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (4) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 30; i < 40; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- else if(GetPVarInt(playerid, "ItemTDPage") == 5)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (5) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 40; i < 50; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- return 0;
- }
- if(text[0] == '!')
- {
- new wiadomosc[256], slot;
- if(sscanf(text[1], "ds[256]", slot, wiadomosc))
- {
- Tip(playerid, "Czat IC: ![slot] [wiadomość]");
- return 0;
- }
- if(slot < 1 || slot > 5)
- {
- InfoBoxShow(2, playerid, "Podany przez Ciebie slot grupy jest nieprawidlowy.", 3);
- return 0;
- }
- if(pGrupa[playerid][slot] == 0 || Grupa[pGrupa[playerid][slot]][gAktywna] == 0)
- {
- InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
- return 0;
- }
- if(!(Grupa[pGrupa[playerid][slot]][gFlagPerm] & G_FLAG_IC))
- {
- InfoBoxShow(2, playerid, "~y~Grupa~w~ nie ma uprawnien do korzystania z czatu ~y~InCharacter~w~.", 3);
- return 0;
- }
- format(String, sizeof(String),"%s (słuchawka): %s", CharName(playerid), wiadomosc);
- PokazTekst(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- SendGroupMessage(1, playerid, pGrupa[playerid][slot], wiadomosc);
- return 0;
- }
- if(text[0] == '@')
- {
- new wiadomosc[256], slot;
- if(sscanf(text[1], "ds[256]", slot, wiadomosc))
- {
- Tip(playerid, "Czat OOC: @[slot] [wiadomość]");
- return 0;
- }
- if(slot < 1 || slot > 5)
- {
- InfoBoxShow(2, playerid, "Podany przez Ciebie slot grupy jest nieprawidlowy.", 3);
- return 0;
- }
- if(pGrupa[playerid][slot] == 0 || Grupa[pGrupa[playerid][slot]][gAktywna] == 0)
- {
- InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
- return 0;
- }
- if(!(Grupa[pGrupa[playerid][slot]][gFlagPerm] & G_FLAG_OOC))
- {
- InfoBoxShow(2, playerid, "Czat ~y~grupy~w~ zostal ~r~wylaczony~w~ przez lidera.", 3);
- return 0;
- }
- SendGroupMessage(0, playerid, pGrupa[playerid][slot], wiadomosc);
- return 0;
- }
- //
- else if(!strcmp(":/", text, true)){
- format(String, sizeof(String), "* %s krzywi się.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- return 0;
- }
- else if(!strcmp(":D", text, true)){
- format(String, sizeof(String), "* %s śmieje się.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- return 0;
- }
- else if(!strcmp(":P", text, true)){
- format(String, sizeof(String), "* %s wystawia język.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- return 0;
- }
- else if(!strcmp(":)", text, true)){
- format(String, sizeof(String), "* %s uśmiecha się.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- return 0;
- }
- else if(!strcmp(":(", text, true)){
- format(String, sizeof(String), "* %s smuci się.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- return 0;
- }
- if(text[0] == '?')
- {
- InfoBoxShow(2, playerid, "Taki znak nie istnieje w swiecie InCharacter, zastosuj w inny sposob.", 3);
- return 0;
- }
- else if(text[0] == '.')
- {
- if(strlen(text) == 1) return 0;
- strdel(text, 0, 1);
- format(String, sizeof(String),"[%d] %s (( %s ))",playerid, CharName(playerid), text);
- PokazTekst(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- return 0;
- }
- else if(text[strlen(text)-1] == '!' && text[strlen(text)-2] == '!')
- {
- if(strlen(text) < 78)
- {
- format(String, sizeof(String), "%s krzyczy: %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- else
- {
- new pos = strfind(text, " ", true, strlen(text) / 2);
- if(pos != -1)
- {
- new text2[64];
- strmid(text2, text, pos + 1, strlen(text));
- strdel(text, pos, strlen(text));
- format(String, sizeof(String), "%s krzyczy: %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- format(String, sizeof(String), " ...%s", text2);
- ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- }
- }
- else
- {
- if(strlen(text) < 78)
- {
- format(String, sizeof(String), "%s mówi: %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- else
- {
- new pos = strfind(text, " ", true, strlen(text) / 2);
- if(pos != -1)
- {
- new text2[64];
- strmid(text2, text, pos + 1, strlen(text));
- strdel(text, pos, strlen(text));
- format(String, sizeof(String), "%s mówi: %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- format(String, sizeof(String), " ...%s", text2);
- ProxDetector(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- }
- }
- }
- return 0;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- new ACS[200];
- SetPVarFloat(playerid, "rpHealthCheat", GetPVarFloat(playerid, "rpHealthCheat") + amount);
- if(dHP[playerid] > dHP[playerid] - amount)
- {
- dHP[playerid] -= amount;
- }
- //zabezpieczenie przed CleoGun & InfinityAmmo
- if(weaponid > 0 && weaponid < 46)
- {
- if(issuerid != playerid)
- {
- if(weaponid != GetPVarInt(issuerid, "rpBron"))
- return format(ACS, sizeof(ACS), "NoWeapon: %d (%s), Sys: %d (%s).", weaponid, WeapName(weaponid), GetPVarInt(issuerid, "rpBron"), WeapName(GetPVarInt(issuerid, "rpBron"))), Kara(0, issuerid, -1, ACS, 7);
- if(weaponid > 10 && weaponid < 46)
- {
- if(!(Grupa[Sluzba(issuerid)][gFlagPerm] & G_FLAG_DRIVEBY))
- {
- if(GetPlayerState(issuerid) == PLAYER_STATE_PASSENGER || GetPlayerState(issuerid) == PLAYER_STATE_DRIVER)
- return format(ACS, sizeof(ACS), "DriveBy: %s (weapID: %d, weapName: %s).", Nick(playerid), weaponid, WeapName(weaponid)), Kara(0, issuerid, -1, ACS, 7);
- }
- }
- new weapons[13][2];
- for (new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(issuerid, i, weapons[i][0], weapons[i][1]);
- if(weapons[i][0] == GetPVarInt(issuerid, "rpBron"))
- {
- if(amount <= 5)
- {
- //
- }
- else
- {
- new w = weaponid;
- if(w == 42 || w == 41 || w == 38 || w == 37 || w == 36 || w == 35 || w == 34 || w == 33 || w == 32 || w == 31 || w == 30 || w == 29 || w == 28 || w == 27 || w == 26 || w == 25 || w == 24 || w == 23 || w == 22 || w == 18 || w == 16)
- {
- SetPVarInt(issuerid, "rpAmmo", GetPVarInt(issuerid, "rpAmmo")-1);
- SetPVarInt(issuerid, "rpAmmoCheat", GetPVarInt(issuerid, "rpAmmoCheat")+1);
- }
- }
- }
- }
- }
- }
- if(amount < 10)
- {
- SetPVarInt(playerid, "rpDamage", 2);
- }
- if(amount > 10)
- {
- SetPVarInt(playerid, "rpDamage", 4);
- }
- UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pNickName], KOL_DAMAGE, CharName3DText(playerid));
- if(weaponid != 0 && issuerid != playerid && amount > 5.0)
- {
- ApplyAnimation(playerid, "CRACK", "crckidle1", 1.5, 1, 0, 0, 0, 0);
- SetPVarInt(playerid, "rpAnimacja", 15);
- }
- return 1;
- }
- Data()
- {
- return getdate(Rok,Miesiac,Dzien);
- }
- Tip(playerid, tekst[])
- {
- format(String, sizeof(String), "Tip:{FFFFFF} %s", tekst);
- return SendClientMessage(playerid, 0xB3D341FF, String);
- }
- KaraBox(text[])
- {
- if(NapisUzywany)
- {
- TextDrawHideForAll(TDKara);
- KillTimer(NapisTimer);
- }
- NapisUzywany = true;
- TextDrawSetString(TDKara,text);
- TextDrawShowForAll(TDKara);
- NapisTimer=SetTimer("KaraBoxOFF", 15000, false);
- return 1;
- }
- Funkcja::KaraBoxOFF()
- {
- NapisUzywany = false;
- TextDrawHideForAll(TDKara);
- KillTimer(NapisTimer);
- return 1;
- }
- Funkcja::UpdateGlobal(playerid, global)
- {
- if(Login(playerid) == 1)
- {
- new query[256];
- mysql_reconnect();
- format(query, sizeof(query), "UPDATE `members` SET `gamescore`=%d, `NoRUN`=%d, `NoVEH`=%d, `NoOOC`=%d, `NoGUN`=%d, `premiumscore`=%d, `premium`=%d WHERE `member_id`=%d", IPB[playerid][ipb_GameScore], IPB[playerid][ipb_NoRUN], IPB[playerid][ipb_NoVEH], IPB[playerid][ipb_NoOOC], IPB[playerid][ipb_NoGUN], IPB[playerid][ipb_PremiumScore], IPB[playerid][ipb_Premium], global);
- mysql_query_ex(query);
- }
- return 1;
- }
- Funkcja::Powitanie(playerid)
- {
- Player[playerid][pGID] = GetPVarInt(playerid, "pGID");
- new query[512];
- format(query, sizeof(query), "SELECT `gameperm`,`premium`,`ban_uid`,`member_group_id`,`ban_time`,`members_display_name` FROM `members` WHERE `member_id`=%d LIMIT 1", GetPVarInt(playerid, "pGID"));
- mysql_query_ex(query);
- mysql_store_result();
- if(mysql_num_rows() != 0)
- {
- mysql_fetch_row_format(query);
- sscanf(query, "p<|>ddddds[256]", Player[playerid][pAdmin], IPB[playerid][ipb_Premium], IPB[playerid][ipb_Ban], IPB[playerid][ipb_Grupa], IPB[playerid][ipb_BanTime], Player[playerid][pName]);
- }
- mysql_free_result();
- if(IPB[playerid][ipb_Grupa] == 5 || IPB[playerid][ipb_Ban] != 0 && gettime() < IPB[playerid][ipb_BanTime])
- {
- SetPVarInt(playerid, "TimeBanned", 1);
- SendClientMessage(playerid, -1, "Konto globalne, na które właśnie się zalogowałeś posiada status osoby {BB0000}zbanowanej{FFFFFF}.");
- format(String, sizeof(String), "Z powyższego powodu proces tworzenia logowania dla konta globalnego %s (UID: %d) zostaje przerwany.", Player[playerid][pName], Player[playerid][pGID]);
- SendClientMessage(playerid, -1, String);
- return KickWithMessage(playerid, -1, "Jeżeli nie zgadzasz się z nałożoną na Ciebie karą, napisz odwołanie na forum (page-rp.pl).");
- }
- //Sesja
- format(query, sizeof(query), "INSERT INTO `1sesje_log` (`data`,`char`,`global`,`status`,`IP`) VALUES ('%d', %d, '%d', '%d', '%s')", gettime(), Player[playerid][pUID], Player[playerid][pGID], 1, Player[playerid][pIP]);
- mysql_query_ex(query);
- Player[playerid][pLastLogin] = gettime();
- Player[playerid][pInGame] = 1;
- SavePlayerStats(playerid, SAVE_PLAYER_BASIC);
- if(IPB[playerid][ipb_Premium] > gettime())
- SetPlayerColor(playerid, 0xFFFFFFFF);
- else
- SetPlayerColor(playerid, 0xD6D6D6FF);
- format(String, sizeof(String), "Witaj {AAC5E3}%s{FFFFFF}, zalogowałeś się na postać {AAC5E3}%s (UID: %d, GID: %d){FFFFFF}. Miłej gry!", Player[playerid][pName], Nick(playerid), Player[playerid][pUID], Player[playerid][pGID], playerid);
- SendClientMessage(playerid, -1, String);
- SetPlayerScore(playerid, IPB[playerid][ipb_GameScore]);
- if(Player[playerid][pAdmin] > 0)
- {
- SendClientMessage(playerid, -1, "Konto globalne, na które właśnie się zalogowałeś posiada status {BB0000}Administratora{FFFFFF}. Pamiętaj, by nie nadużywać uprawnień.");
- }
- HidePlayerZone(playerid);
- ShowPlayerZone(playerid);
- Player[playerid][pGID] = GetPVarInt(playerid, "pGID");
- Global_Data_Load(playerid);
- //Pierwsze logowanie w danym dniu
- new day, month, year;
- getdate(day, month, year);
- if(Player[playerid][pLastDay] != day)
- {
- Player[playerid][pLastDay] = day;
- IPB[playerid][ipb_GameScore] += 15;
- Tip(playerid, "Otrzymujesz 15 punktów GameScore za pierwsze logowanie się w tym dniu.");
- Global_Data_Save(playerid);
- }
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1)
- {
- if(Przedmiot[p][iTyp] == 18 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[p][iWartosc1] == Player[playerid][pTelefon])
- {
- return Przedmiot[p][iUsed] = 1;
- }
- }
- }
- }
- SetPVarInt(playerid, "Teleport", 1);
- return Player[playerid][pTelefon] = 0;
- }
- Funkcja::Achivement(playerid, achiv)
- {
- new query[256], achiv0 = 0;
- if(achiv == 1 && Player[playerid][pAchiv1] == 0)
- {
- achiv0++;
- Player[playerid][pAchiv1] = gettime();
- format(query, sizeof(query), "UPDATE `1postacie` SET `achiv1`=%d", Player[playerid][pAchiv1]);
- }
- else if(achiv == 2 && Player[playerid][pAchiv2] == 0)
- {
- achiv0++;
- Player[playerid][pAchiv2] = gettime();
- format(query, sizeof(query), "UPDATE `1postacie` SET `achiv2`=%d", Player[playerid][pAchiv2]);
- }
- else if(achiv == 3 && Player[playerid][pAchiv3] == 0)
- {
- achiv0++;
- Player[playerid][pAchiv3] = gettime();
- format(query, sizeof(query), "UPDATE `1postacie` SET `achiv3`=%d", Player[playerid][pAchiv3]);
- }
- if(achiv0 > 0) return mysql_query_ex(query);
- return 1;
- }
- Funkcja::Sekundnik()
- {
- new player = 0;
- foreach(Player, p)
- {
- player++;
- }
- if(player > Statystyki[1])
- {
- Statystyki[1] = player;
- }
- new hour, minute, second, Time[3], players;
- gettime(hour, minute, second);
- if(minute == 01 && second < 3)
- {
- SetWorldTime(hour);
- }
- //system pojazdów
- for(new v = 0; v < MAX_VEHICLES; v++)
- {
- GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
- if(engine == 1)
- {
- foreach(Player, p)
- {
- if(GetPlayerVehicleID(p) == v)
- {
- if(GetPlayerState(p) == PLAYER_STATE_DRIVER)
- {
- if(GetPlayerSpeed(p) >= 100)
- Pojazd[CarUID(v)][vPaliwo] -= 0.007;
- else if(GetPlayerSpeed(p) < 100 && GetPlayerSpeed(p) > 10)
- Pojazd[CarUID(v)][vPaliwo] -= 0.005;
- else if(GetPlayerSpeed(p) <= 10)
- Pojazd[CarUID(v)][vPaliwo] -= 0.003;
- new Float:speed, Float:timex;
- speed = GetPlayerSpeed(p);
- timex = 3600;
- Pojazd[CarUID(v)][vPrzebieg] += speed/timex*3;
- Player[p][pWyjezdzone] += speed/timex*3;
- }
- }
- else
- {
- Pojazd[CarUID(v)][vPaliwo] -= 0.001;
- }
- }
- if(Pojazd[CarUID(v)][vPaliwo] <= 0.0)
- {
- SetVehicleParamsEx(v, 0, lights, alarm, doors, bonnet, boot, objective);
- }
- }
- }
- //koniec
- foreach(Player, p)
- {
- // format(String, sizeof(String), "FPS: %d", GetPlayerFPS(p)), Tip(p, String);
- if(Login(p) == 1)
- {
- //strefy
- if(GetPVarInt(p, "LastZone") != PlayerInZone(p))
- {
- if(!AreaToArea(150.0, GetPVarInt(p, "LastZone"), PlayerInZone(p)))
- {
- if(GetPVarInt(p, "Teleport") == 0 && GetPVarInt(p, "LastZone") > 0)
- {
- if(GetPlayerVirtualWorld(p) == 0 && PlayerInZone(p) != 0)
- {
- format(String, sizeof(String), "Prawdopodobny AirBreak: %d, %d.", GetPVarInt(p, "LastZone"), PlayerInZone(p));
- Kara(0, p, -1, String, 0);
- }
- }
- }
- SetPVarInt(p, "Teleport", 0);
- SetPVarInt(p, "LastZone", PlayerInZone(p));
- if(GetPlayerState(p) == PLAYER_STATE_DRIVER)
- {
- if(GetPVarInt(p, "LastSpeed") != GangZoneInfo[PlayerInZone(p)][gSpeed])
- {
- SetPVarInt(p, "LastSpeed", GangZoneInfo[PlayerInZone(p)][gSpeed]);
- if(GangZoneInfo[PlayerInZone(p)][gSpeed] != 0)
- format(String, sizeof(String), "~g~Limit:~w~ %dkmh.", GangZoneInfo[PlayerInZone(p)][gSpeed]);
- else
- format(String, sizeof(String), "~g~Limit:~w~ brak.");
- GameTextForPlayer(p, String, 1250, 6);
- }
- }
- }
- //
- if(GetPlayerSpeed(p) > 0)
- {
- if(gettime() > GetPVarInt(p, "Spawned"))
- {
- new Float:PosX, Float:PosY, Float:PosZ,
- VirtualWorld, InteriorID;
- GetPlayerPos(p, PosX, PosY, PosZ);
- VirtualWorld = GetPlayerVirtualWorld(p);
- InteriorID = GetPlayerInterior(p);
- Player[p][pPosX] = PosX;
- Player[p][pPosY] = PosY;
- Player[p][pPosZ] = PosZ;
- Player[p][pVir] = VirtualWorld;
- Player[p][pInt] = InteriorID;
- }
- }
- if(GetPVarInt(p, "rpWedka2") < gettime())
- {
- if(GetPVarInt(p, "rpWedka1") != 0)
- {
- SetPVarInt(p, "rpWedka1", 0);
- SetPVarInt(p, "rpWedka2", 0);
- SetPVarInt(p, "rpWedka3", 0);
- /* new ryba = random(20);
- switch(ryba)
- {
- case 0:
- {
- return 1;
- }
- case 1..3:
- {
- return 1;
- }
- case 4:
- case 5:
- case 6..7:
- {
- return 1;
- }
- case 8:
- case 9:
- case 10:
- case 11..14:
- {
- return 1;
- }
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21..23:
- {
- return 1;
- }
- case 24:
- case 25:
- }
- */
- }
- }
- else
- {
- if(GetPVarInt(p, "rpWedka1") != 0)
- {
- if(GetPVarInt(p, "rpWedka3") == 4)
- {
- SetPVarInt(p, "rpWedka3", 0);
- ApplyAnimation(p, "SWORD", "sword_block", 50.0, 0, 1, 0, 1, 1);
- }
- else
- {
- SetPVarInt(p, "rpWedka3", GetPVarInt(p, "rpWedka3")+1);
- }
- //random itemów
- }
- }
- SetPVarInt(p, "AFK", GetPVarInt(p, "AFK") + 1);
- players++;
- FullTime(Player[p][pOnline], Time[0], Time[1], Time[2]);
- if(Time[1] == 0 && Time[2] == 0)
- {
- if(Time[0] == 30 && Time[1] == 0 && Time[2] < 1 && Player[p][pAchiv1] <= 0)
- {
- IPB[p][ipb_GameScore] += 250;
- Achivement(p, 1);
- InfoBoxShow(0, p, "Gratulacje!~n~Odblokowales osiagniecie ~y~30 godzin online~w~!~n~Otrzymujesz w nagrode ~b~~h~250~w~ punktow ~b~~h~GameScore~w~!", 6);
- }
- if(IPB[p][ipb_Premium] > gettime())
- IPB[p][ipb_GameScore] += 15;
- else
- IPB[p][ipb_GameScore] += 10;
- UpdateGlobal(p, Player[p][pGID]);
- Global_Data_Save(p);
- }
- SetPlayerScore(p, IPB[p][ipb_GameScore]);
- if(Player[p][pBW] != 0)
- {
- new animlib[32], animname[32];
- GetAnimationName(GetPlayerAnimationIndex(p),animlib,32,animname,32);
- format(String, sizeof(String), "~r~BW~w~: %d min.", Player[p][pBW]);
- GameTextForPlayer(p, String, 1500, 1);
- TogglePlayerControllable(p, false);
- new Float:Pos[3];
- GetPlayerPos(p, Pos[0], Pos[1], Pos[2]);
- SetPlayerCameraPos(p, Pos[0], Pos[1]+2, Pos[2]+12);
- SetPlayerCameraLookAt(p, Pos[0], Pos[1], Pos[2]);
- if(!strcmp(animname, "crckdeth1"))
- animlib = " ";
- else
- ApplyAnimation(p,"CRACK","crckdeth1",4.1,0,0,0,1,0);
- }
- if(GetPVarInt(p, "rpAnimacja") != 0)
- {
- SetPVarInt(p, "rpAnimacja", GetPVarInt(p, "rpAnimacja")-1);
- if(GetPVarInt(p, "rpAnimacja") <= 0)
- {
- ClearAnimations(p);
- }
- }
- if(Sluzba(p) != 0 && Grupa[Sluzba(p)][gAktywna] == 1)
- {
- Player[p][pDutyAll]++;
- }
- if(GetPVarInt(p, "AFK") < 5)
- {
- Player[p][pPayDayGame]++;
- }
- Player[p][pOnline]++;
- Statystyki[4]++;
- if(GetPVarInt(p, "rpDamage") > 0)
- {
- SetPVarInt(p, "rpDamage", GetPVarInt(p, "rpDamage")-1);
- }
- if(GetPVarInt(p, "rpDamage") == 0)
- {
- if((Grupa[Sluzba(p)][gFlagPerm] & G_FLAG_COLOR))
- UpdateDynamic3DTextLabelText(Text3D:Player[p][pNickName], Grupa[Sluzba(p)][gKolor], CharName3DText(p));
- else
- UpdateDynamic3DTextLabelText(Text3D:Player[p][pNickName], KOL_NAME, CharName3DText(p));
- }
- //Resetowanie /ame
- if(gettime() > GetPVarInt(p, "rpAme"))
- {
- UpdateDynamic3DTextLabelText(Text3D:Player[p][pAme], COLOR_PURPLE, " ");
- }
- //oferta naprawy
- if(GetPVarInt(p, "OffeVehTime") != 0 && GetPVarInt(p, "OffeVehType") == OFFER_REPAIR)
- {
- new Float:vehPos[3];
- GetVehiclePos(GetPVarInt(p, "OffeVeh"), vehPos[0], vehPos[1], vehPos[2]);
- GetVehicleParamsEx(GetPVarInt(p, "OffeVeh"), engine, lights, alarm, doors, bonnet, boot, objective);
- if(engine <= 0)
- {
- if(IsPlayerInRangeOfPoint(p, 6.0, vehPos[0], vehPos[1], vehPos[2]))
- {
- SetPVarInt(p, "OffeVehTime", GetPVarInt(p, "OffeVehTime")-1);
- TextDrawShowForPlayer(p, TDOffe[p]);
- format(String, sizeof(String), "~w~Naprawa:~b~~h~~h~ %d ~w~sekund.", GetPVarInt(p, "OffeVehTime"));
- TextDrawSetString(TDOffe[p], String);
- format(String, sizeof(String), "Pojazd jest w trakcie naprawy\nDo końca: %d sekund.", GetPVarInt(p, "OffeVehTime"));
- UpdateDynamic3DTextLabelText(Text3D:Veh3DText[GetPVarInt(p, "OffeVeh")], KOL_NAME, String);
- if(GetPVarInt(p, "OffeVehTime") <= 0)
- {
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vHP] = 1000.0;
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vPanels] = 0;
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vDoors] = 0;
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vLights] = 0;
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vTires] = 0;
- SetVehicleHealth(GetPVarInt(p, "OffeVeh"), Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vHP]);
- UpdateVehicleDamageStatus(GetPVarInt(p, "OffeVeh"), Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vPanels], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vDoors], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vLights], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vTires]);
- ZapiszPojazd(CarUID(GetPVarInt(p, "OffeVeh")));
- format(String, sizeof(String), "Naprawa pojazdu %s (UID: %d) została zakończona.", GetVehicleName(CarUID(GetPVarInt(p, "OffeVeh"))), CarUID(GetPVarInt(p, "OffeVeh"))), Info(p, String);
- TextDrawHideForPlayer(p, TDOffe[p]);
- Offer[p][oBlock] = 0;
- UpdateDynamic3DTextLabelText(Text3D:Veh3DText[GetPVarInt(p, "OffeVeh")], KOL_NAME, " ");
- }
- }
- else
- {
- GameTextForPlayer(p, "~r~Naprawa przerwana.~n~Oddaliles sie od pojazdu.", 2000, 5);
- }
- }
- else
- {
- GameTextForPlayer(p, "~r~Naprawa przerwana.~n~Silnik pojazdu musi byc zgaszony.", 2000, 5);
- }
- }
- //oferta lakierowania
- if(GetPVarInt(p, "OffeVehTime") != 0 && GetPVarInt(p, "OffeVehType") == OFFER_RESPRAY)
- {
- }
- //oferta montażu
- if(GetPVarInt(p, "OffeVehTime") != 0 && GetPVarInt(p, "OffeVehType") == OFFER_MONTAGE)
- {
- new Float:vehPos[3];
- GetVehiclePos(GetPVarInt(p, "OffeVeh"), vehPos[0], vehPos[1], vehPos[2]);
- GetVehicleParamsEx(GetPVarInt(p, "OffeVeh"), engine, lights, alarm, doors, bonnet, boot, objective);
- if(engine <= 0)
- {
- if(IsPlayerInRangeOfPoint(p, 6.0, vehPos[0], vehPos[1], vehPos[2]))
- {
- SetPVarInt(p, "OffeVehTime", GetPVarInt(p, "OffeVehTime")-1);
- TextDrawShowForPlayer(p, TDOffe[p]);
- format(String, sizeof(String), "~w~Montaz komponentu:~b~~h~~h~ %d ~w~sekund.", GetPVarInt(p, "OffeVehTime"));
- TextDrawSetString(TDOffe[p], String);
- format(String, sizeof(String), "Pojazd jest w trakcie montażu\nDo końca: %d sekund.", GetPVarInt(p, "OffeVehTime"));
- UpdateDynamic3DTextLabelText(Text3D:Veh3DText[GetPVarInt(p, "OffeVeh")], KOL_NAME, String);
- if(GetPVarInt(p, "OffeVehTime") <= 0)
- {
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vHP] = 1000.0;
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vPanels] = 0;
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vDoors] = 0;
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vLights] = 0;
- Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vTires] = 0;
- SetVehicleHealth(GetPVarInt(p, "OffeVeh"), Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vHP]);
- UpdateVehicleDamageStatus(GetPVarInt(p, "OffeVeh"), Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vPanels], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vDoors], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vLights], Pojazd[CarUID(GetPVarInt(p, "OffeVeh"))][vTires]);
- ZapiszPojazd(CarUID(GetPVarInt(p, "OffeVeh")));
- format(String, sizeof(String), "Montaż komponentu w pojeździe %s (UID: %d) został zakończony.", GetVehicleName(CarUID(GetPVarInt(p, "OffeVeh"))), CarUID(GetPVarInt(p, "OffeVeh"))), Info(p, String);
- TextDrawHideForPlayer(p, TDOffe[p]);
- Offer[p][oBlock] = 0;
- UpdateDynamic3DTextLabelText(Text3D:Veh3DText[GetPVarInt(p, "OffeVeh")], KOL_NAME, " ");
- }
- }
- else
- {
- GameTextForPlayer(p, "~r~Naprawa przerwana.~n~Oddaliles sie od pojazdu.", 2000, 5);
- }
- }
- else
- {
- GameTextForPlayer(p, "~r~Naprawa przerwana.~n~Silnik pojazdu musi byc zgaszony.", 2000, 5);
- }
- }
- }
- }
- if(players > Serwer[1])
- {
- Serwer[1] = players;
- }
- if(hour == 10 && minute == 35 && second < 3 && restart == 0)
- {
- new query[256];
- format(query, sizeof(query), "INSERT INTO `1stats` (`data`,`logowania`,`gracze`,`komendy`,`kary`,`online`) VALUES ('%d', %d, '%d', %d, '%d', %d)", gettime(), Statystyki[0], Statystyki[1], Statystyki[2], Statystyki[3], Statystyki[4]);
- mysql_query_ex(query);
- restart = 1;
- print("Wykonal sie automatyczny restart serwera.");
- for(new nr = 0; nr < MAX_OBIEKT; nr++){
- if(Obiekt[nr][oAktywny] == 1){
- ZapiszObiekt(nr);
- }
- }
- for(new nr = 0; nr < MAX_ITEM; nr++){
- if(Przedmiot[nr][iAktywny] == 1){
- ZapiszPrzedmiot(nr);
- if(Przedmiot[nr][iTyp] == 1 && Przedmiot[nr][iUsed] == 1)
- {
- Przedmiot[nr][iUsed] = 0;
- }
- }
- }
- foreach(Player, p)
- {
- if(Login(p) == 1)
- {
- InfoBoxShow(2, p, "Wlasnie nastapil automatyczny restart serwera.", 3);
- SavePlayerStats(p, SAVE_PLAYER_BASIC);
- SavePlayerStats(p, SAVE_PLAYER_POS);
- SavePlayerStats(p, SAVE_PLAYER_GROUP);
- OnPlayerDisconnect(p, 0);
- Kick(p);
- }
- }
- for(new uid = 0; uid < 5000; uid++)
- {
- PayDay(uid);
- }
- mysql_free_result();
- SetTimerEx("Restart", 5000, 0, "");
- }
- return 1;
- }
- Funkcja::Minutnik()
- {
- mysql_check();
- foreach(Player, p)
- {
- if(Login(p) == 1)
- {
- //Strefy
- HidePlayerZone(p);
- ShowPlayerZone(p);
- // AdminJail
- if(Player[p][pAJ] > 0)
- {
- Player[p][pAJ]--;
- if(Player[p][pAJ] == 0)
- {
- Tip(p, "Czas Twojego AJ dobiegł końca, graj zgodnie z zasadami RolePlay.");
- OnPlayerSpawn(p);
- }
- }
- // Brutally Wounded (bw)
- if(Player[p][pBW] > 0)
- {
- ApplyAnimation(p,"CRACK","crckdeth1",4.1,0,0,0,1,0);
- Player[p][pBW]--;
- if(Player[p][pBW] == 0)
- {
- setHP(p, 9.0);
- TogglePlayerControllable(p, true);
- SetCameraBehindPlayer(p);
- ClearAnimations(p);
- Info(p, "Twoja postać ocknęła się po stanie nieprzytomności (BW).\nPamiętaj, że taki stan trzeba należycie odegrać.");
- }
- }
- // Areszt
- if(Player[p][pJail] < gettime() && Player[p][pJail] != 0)
- {
- new info[128];
- Player[p][pJail] = 0;
- SetPlayerPos(p, Drzwi[InDoor(p)][dWewPosX], Drzwi[InDoor(p)][dWewPosY], Drzwi[InDoor(p)][dWewPosZ]);
- format(info, sizeof(info), "Czas aresztu gracza %s dobiegł końca. Zostaje on wypuszczony na wolność.", CharName(p));
- SendGroupMessage(0, p, Drzwi[InDoor(p)][dOwnerUID], info);
- }
- // Zerowanie permów
- if(pGrupa[p][1] == 0 || Grupa[pGrupa[p][1]][gAktywna] == 0)
- {
- pGrupaPerm[p][1] = 0;
- }
- if(pGrupa[p][2] == 0 || Grupa[pGrupa[p][2]][gAktywna] == 0)
- {
- pGrupaPerm[p][2] = 0;
- }
- if(pGrupa[p][3] == 0 || Grupa[pGrupa[p][3]][gAktywna] == 0)
- {
- pGrupaPerm[p][3] = 0;
- }
- if(pGrupa[p][4] == 0 || Grupa[pGrupa[p][4]][gAktywna] == 0)
- {
- pGrupaPerm[p][4] = 0;
- }
- if(pGrupa[p][5] == 0 || Grupa[pGrupa[p][5]][gAktywna] == 0)
- {
- pGrupaPerm[p][5] = 0;
- }
- }
- }
- return 1;
- }
- Funkcja::DziesiecioMinutnik()
- {
- foreach(Player, p)
- {
- if(Login(p) == 1)
- {
- SavePlayerStats(p, SAVE_PLAYER_BASIC);
- }
- }
- for(new nr = 0; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 1)
- {
- if(Przedmiot[nr][iTyp] == 17)
- {
- if(Przedmiot[nr][iWartosc2] < gettime())
- {
- Przedmiot[nr][iAktywny] = 0;
- DestroyDynamicObject(ItemObiekt[nr]);
- }
- }
- ZapiszPrzedmiot(nr);
- }
- }
- for(new v = 0; v < MAX_VEHICLES; v++)
- {
- if(Pojazd[v][vSpawn] == 1)
- {
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- ZapiszPojazd(veh);
- }
- }
- }
- }
- return 1;
- }
- Funkcja::AntyCheat()
- {
- new bron[13], amunicja[13], ACS[512];
- foreach(Player, p)
- {
- new ban = 0;
- if(Login(p) == 1)
- {
- //kasa
- if(GetPlayerMoney(p) != dKasa(p))
- {
- ResetPlayerMoney(p);
- GivePlayerMoney(p, dKasa(p));
- }
- if(GetPVarInt(p, "rpDoorEnterExit") != 0)
- {
- if(gettime() > GetPVarInt(p, "rpDoorEnterExit"))
- {
- TogglePlayerControllable(p, true);
- SetPVarInt(p, "rpDoorEnterExit", 0);
- }
- }
- //na pojazdy / w pojazdach
- if(GetPlayerState(p) == PLAYER_STATE_DRIVER)
- {
- new v = GetPlayerVehicleID(p), veh = CarUID(v), Float:vehHP, panels1, doors1, lights1, tires1;
- //komponenty pojazdu
- for(new component = 0; component < 14; component++)
- {
- new comp = GetVehicleComponentInSlot(v, component), bool:compreturn;
- if(comp > 0)
- {
- if(VehTune[v][0] == comp)
- { compreturn = true; }
- if(VehTune[v][1] == comp)
- { compreturn = true; }
- if(VehTune[v][2] == comp)
- { compreturn = true; }
- if(VehTune[v][3] == comp)
- { compreturn = true; }
- if(VehTune[v][4] == comp)
- { compreturn = true; }
- if(VehTune[v][5] == comp)
- { compreturn = true; }
- if(VehTune[v][6] == comp)
- { compreturn = true; }
- if(VehTune[v][7] == comp)
- { compreturn = true; }
- if(VehTune[v][8] == comp)
- { compreturn = true; }
- if(VehTune[v][9] == comp)
- { compreturn = true; }
- if(VehTune[v][10] == comp)
- { compreturn = true; }
- if(VehTune[v][11] == comp)
- { compreturn = true; }
- if(VehTune[v][12] == comp)
- { compreturn = true; }
- if(VehTune[v][13] == comp)
- { compreturn = true; }
- if(compreturn == false)
- {
- new string[128];
- format(string, sizeof(string), "Tuning pojazdu: %d (%s) (Komponent: %d).", v, GetVehicleName(CarUID(v)), comp), Kara(0, p, -1, string, 0);
- SetVehicleToRespawn(v);
- }
- }
- }
- //uszkodzenia wizualne
- GetVehicleHealth(v, vehHP);
- GetVehicleDamageStatus(v, panels1, doors1, lights1, tires1);
- if(GetPVarInt(p, "Fix") < gettime())
- {
- if(panels1 == 0 && Pojazd[veh][vPanels] != 0 || doors1 == 0 && Pojazd[veh][vDoors] != 0 || lights1 == 0 && Pojazd[veh][vLights] != 0 || tires1 == 0 && Pojazd[veh][vTires] != 0 )
- {
- new string[128];
- format(string, sizeof(string), "Wymuszona naprawa: %d (%s), Visual.", veh, GetVehicleName(veh)), Kara(0, p, -1, string, 0);
- SetVehicleHealth(v, Pojazd[veh][vHP]);
- UpdateVehicleDamageStatus(v, Pojazd[veh][vPanels], Pojazd[veh][vDoors], Pojazd[veh][vLights], Pojazd[veh][vTires]);
- }
- //uszkodzenia wewnętrzne
- if(vehHP > Pojazd[veh][vHP])
- {
- new string[128];
- format(string, sizeof(string), "Wymuszona naprawa: %d (%s), HP (+%.1f).", veh, GetVehicleName(veh), vehHP-Pojazd[veh][vHP]), Kara(0, p, -1, string, 0);
- SetVehicleHealth(v, Pojazd[veh][vHP]);
- }
- }
- if(Pojazd[veh][vHP] > vehHP)
- {
- new Float:Difference = Pojazd[veh][vHP] - vehHP;
- //zapis do logów w tym miejscu
- //koniec zapisu do logów -> początek zabierania HP wedle obrażeń pojazdu
- Pojazd[veh][vHP] = vehHP;
- foreach(Player, player)
- {
- if(GetPlayerVehicleID(p) == v && Player[p][pBW] == 0)
- {
- new Float:Damage = 0.0;
- if(GetPVarInt(player, "rpPasy") == 1)
- Damage = Difference * 0.05;
- else
- Damage = Difference * 0.1;
- if(dHP[player] < Damage)
- {
- new string[128];
- format(string, sizeof(string), "** %s w skutek wypadku stracił przytomność. **", CharName(player));
- ProxDetector(10.0, player, string, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO);
- SetPVarInt(player, "SpawnBW", gettime()+5);
- ApplyAnimation(player, "CRACK", "crckdeth1", 4.1, 0, 0, 0, 1, 0);
- TogglePlayerControllable(player, false);
- Player[player][pBW] = 10;
- }
- else
- {
- giveHP(player, -Damage);
- }
- SetPVarInt(player, "rpDamage", 2);
- UpdateDynamic3DTextLabelText(Text3D:Player[player][pNickName], KOL_DAMAGE, CharName3DText(player));
- }
- }
- }
- if(GetPlayerSpeed(p) > 275)
- {
- format(ACS, sizeof(ACS), "SpeedHack: %dkm/h (%s).", GetPlayerSpeed(p), GetVehicleName(CarUID(v))), Kara(0, p, -1, ACS, 7);
- }
- }
- if(GetPVarInt(p, "Banned") < gettime())
- {
- if(GetPVarInt(p, "Banned") != 0)
- {
- Kick(p);
- }
- }
- for(new player = 0; player < MAX_PLAYERS; player++)
- {
- if(player != p && Login(player) == 1)
- {
- if(Player[p][pUID] == Player[player][pUID])
- {
- Kara(0, player, -1, "Double InGame Char.", 0);
- }
- }
- }
- new Float:armour, Float:ACHP;
- GetPlayerHealth(p, ACHP);
- if(ACHP != dHP[p])
- {
- if(ACHP > dHP[p])
- {
- if(GetPVarInt(p, "ACT") < gettime() - 30)
- {
- SetPVarInt(p, "ACT", gettime());
- SetPVarInt(p, "ACR", 0);
- }
- else
- {
- if(Player[p][pBW] != 0)
- {
- SetPVarInt(p, "ACR", 0);
- }
- SetPVarInt(p, "ACR", GetPVarInt(p, "ACR")+1);
- /*if(GetPVarInt(p, "ACR") > 10)
- {
- Kara(0, p, -1, "Prawdopodobny GodMode.", 0);
- }*/
- }
- SetPlayerHealth(p, dHP[p]);
- }
- else
- {
- dHP[p] = ACHP;
- }
- }
- GetPlayerArmour(p, armour);
- if(armour >= 1)
- {
- format(ACS, sizeof(ACS), "Armour: %.1f%.", armour), Kara(0, p, -1, ACS, 0);
- }
- if(GetPlayerSpeed(p) > 3)
- {
- if(gettime() > GetPVarInt(p, "SpawnBW"))
- {
- if(Player[p][pBW] != 0)
- {
- format(ACS, sizeof(ACS), "UnFreeze: %dj.", GetPlayerSpeed(p));
- Kara(0, p, -1, ACS, 7);
- }
- }
- }
- //Broń
- for (new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(p, i, bron[i], amunicja[i]);
- if(bron[i] != GetPVarInt(p, "rpBron"))
- {
- if(bron[i] != 0)
- {
- if(GetPVarInt(p, "rpBronAC") < gettime())
- {
- if(bron[i] != 0)
- {
- ban = 1;
- format(ACS, sizeof(ACS), "Bron: %d/%d (%s), System: %d/%d (%s).", bron[i], amunicja[i], WeapName(bron[i]), GetPVarInt(p, "rpBron"), GetPVarInt(p, "rpAmmo"), WeapName(GetPVarInt(p, "rpBron"))), Kara(0, p, -1, ACS, 7);
- break;
- }
- }
- }
- }
- if(amunicja[i] > GetPVarInt(p, "rpAmmo") && ban == 0)
- {
- if(GetPVarInt(p, "rpBronAC") < gettime())
- {
- if(GetPVarInt(p, "rpAmmoCheat") == 0)
- format(ACS, sizeof(ACS), "Ammo: %d/%d (%s), System: %d/%d (%s).", bron[i], amunicja[i], WeapName(bron[i]), GetPVarInt(p, "rpBron"), GetPVarInt(p, "rpAmmo"), WeapName(GetPVarInt(p, "rpBron"))), Kara(0, p, -1, ACS, 21);
- else
- {
- printf("[inf] %s - %d (Sys: %d/%d, Shot: %d)", NickShow(p), GetPVarInt(p, "rpBron"), GetPVarInt(p, "rpBron"), GetPVarInt(p, "rpAmmo"), GetPVarInt(p, "rpAmmoCheat"));
- format(ACS, sizeof(ACS), "Inf: %d/%d (%s), System: %d (%s), Shot: %d.", bron[i], amunicja[i], WeapName(GetPVarInt(p, "rpBron")), GetPVarInt(p, "rpBron"), WeapName(GetPVarInt(p, "rpBron")), GetPVarInt(p, "rpAmmoCheat")), Kara(0, p, -1, ACS, 21);
- }
- break;
- }
- }
- }
- // Anty FlyHack
- new anim_id = GetPlayerAnimationIndex(p), Float:PosX, Float:PosY, Float:PosZ;
- GetPlayerPos(p, PosX, PosY, PosZ);
- if(PosZ > 75.0 && (anim_id == 1543 || anim_id == 1538 || anim_id == 1539))
- {
- format(ACS, sizeof(ACS), "FlyHack: %.1fh.", PosZ);
- Kara(0, p, -1, ACS, 0);
- }
- //
- if(GetPlayerState(p) == PLAYER_STATE_DRIVER)
- {
- GetVehicleParamsEx(GetPlayerVehicleID(p), engine, lights, alarm, doors, bonnet, boot, objective);
- if(lights == 1)
- TextDrawSetString(Licznik1[p], "~g~~h~L");
- else
- TextDrawSetString(Licznik1[p], "~w~L");
- if(engine == 1)
- {
- format(String, sizeof(String), "%03d km/h", GetPlayerSpeed(p));
- TextDrawSetString(Licznik0[p], String);
- format(String, sizeof(String), "%.2fL", Pojazd[CarUID(GetPlayerVehicleID(p))][vPaliwo]);
- TextDrawSetString(Licznik2[p], String);
- }
- else
- {
- TextDrawSetString(Licznik0[p], "000 km/h");
- TextDrawSetString(Licznik2[p], "0.00L");
- }
- }
- //LastVehicle
- if(GetPlayerState(p) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(p) > 0 && GetPlayerVehicleID(p) != GetPVarInt(p, "LastVehicleID"))
- {
- SetPVarInt(p, "LastVehicleID", GetPlayerVehicleID(p));
- }
- //Odspawnowywanie pojazdów
- for(new V = 0; V < MAX_VEHICLES; V++)
- {
- new Float:vPos[4];
- GetVehiclePos(V, vPos[0], vPos[1], vPos[2]);
- GetVehicleZAngle(V, vPos[3]);
- if(VehicleLastPos[V][0] > 0 || VehicleLastPos[V][1] > 0 || VehicleLastPos[V][2] > 0)
- {
- if(vPos[0] != VehicleLastPos[V][0] || vPos[1] != VehicleLastPos[V][1] || vPos[3] != VehicleLastPos[V][3])
- {
- new Occupied = 0;
- foreach(Player, gracz)
- {
- if(GetPlayerVehicleID(gracz) == V)
- {
- Occupied = 1;
- }
- }
- if(Occupied == 0)
- {
- if(IsBoat(V) == 0)
- {
- SetVehiclePos(V, VehicleLastPos[V][0], VehicleLastPos[V][1], VehicleLastPos[V][2]);
- SetVehicleZAngle(V, VehicleLastPos[V][3]);
- }
- }
- }
- }
- }
- }
- }
- return 1;
- }
- Funkcja::Kara(rodzaj, gracz, admin, powod[], czas)
- {
- Statystyki[3]++;
- if(Login(gracz) == 0)
- return InfoBoxShow(2, admin, "~w~Nieznaleziono gracza po podanym ~y~ID~w~.~n~Prawdopodobnie nie jest zalogowany na serwer.", 3);
- new query[256], kara[128], text[64];
- if(czas == 1)
- text = "(1 dzien)";
- else
- format(text, sizeof(text), "(%d dni)", czas);
- if(czas == 0)
- {
- text = " ";
- }
- if(rodzaj == 0)
- {
- if(admin == -1)
- {
- format(kara, sizeof(kara), "Kick~n~~w~Gracz: %s~n~Nadal: System~n~%s", CharName(gracz), powod);
- KaraBox(kara), Kick(gracz);
- }
- else
- {
- format(kara, sizeof(kara), "Kick~n~~w~Gracz: %s~n~Nadal: %s~n~%s", CharName(gracz), CharName(admin), powod);
- KaraBox(kara), Kick(gracz);
- admin = Player[admin][pGID];
- }
- format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin, gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
- }
- else if(rodzaj == 1)
- {
- if(admin == -1)
- {
- format(kara, sizeof(kara), "Warn~n~~w~Gracz: %s~n~Nadal: System~n~%s", CharName(gracz), powod);
- KaraBox(kara);
- }
- else
- {
- format(kara, sizeof(kara), "Warn~n~~w~Gracz: %s~n~Nadal: %s~n~%s", CharName(gracz), CharName(admin), powod);
- KaraBox(kara);
- admin = Player[admin][pGID];
- }
- format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin, gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
- }
- else if(rodzaj == 2)
- {
- if(admin == -1)
- {
- format(kara, sizeof(kara), "Ban ~w~%s~n~Gracz: %s~n~Nadal: System~n~%s", text, CharName(gracz), powod);
- KaraBox(kara);
- }
- else
- {
- format(kara, sizeof(kara), "Ban ~w~%s~n~Gracz: %s~n~Nadal: %s~n~%s", text, CharName(gracz), CharName(admin), powod);
- KaraBox(kara);
- admin = Player[admin][pGID];
- }
- format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin, gettime(), rodzaj, powod, gettime()+czas*86400, Player[gracz][pUID]);
- mysql_query_ex(query);
- return Banned(gracz, gettime()+czas*86400, mysql_insert_id());
- }
- else if(rodzaj == 3)
- {
- new czas1;
- if(czas == 0)
- czas1 = 999;
- else
- czas1 = gettime()+czas*86400;
- format(kara, sizeof(kara), "Blokada postaci ~w~%s~n~Gracz: %s~n~Nadal: %s~n~%s", text, CharName(gracz), CharName(admin), powod);
- KaraBox(kara), Player[gracz][pKonto] = czas1, Kick(gracz);
- admin = Player[admin][pGID];
- format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin, gettime(), rodzaj, powod, czas1, Player[gracz][pUID]);
- }
- else if(rodzaj == 4)
- {
- Player[gracz][pAJ] = czas;
- if(admin == -1)
- {
- format(kara, sizeof(kara), "AdminJail~n~~w~Gracz: %s~n~Nadal: System~n~%s", CharName(gracz), powod);
- KaraBox(kara), Kick(gracz);
- }
- else
- {
- format(kara, sizeof(kara), "AdminJail~n~~w~Gracz: %s~n~Nadal: %s~n~%s", CharName(gracz), CharName(admin), powod);
- KaraBox(kara), Kick(gracz);
- admin = Player[admin][pGID];
- }
- format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin, gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
- }
- else if(rodzaj == 7)
- {
- Player[gracz][pKonto] = 999, Kick(gracz);
- format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin, gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
- }
- else if(rodzaj == 8)
- {
- Global_Data_Save(gracz);
- format(kara, sizeof(kara), "GameScore ~w~%s~n~Gracz: %s~n~Nadal: %s~n~%s", text, CharName(gracz), CharName(admin), powod);
- KaraBox(kara);
- admin = Player[admin][pGID];
- format(query, sizeof(query), "INSERT INTO `1logi` (`owner`,`admin`,`addtime`,`typ`,`text`,`expires`,`char`) VALUES (%d, %d, %d, %d, '%s', %d, %d)", Player[gracz][pGID], admin, gettime(), rodzaj, powod, 999, Player[gracz][pUID]);
- }
- return mysql_query_ex(query);
- }
- Funkcja::Spawnuj(playerid)
- {
- ResetPlayerWeapons(playerid);
- return SpawnPlayer(playerid);
- }
- Funkcja::dShowPlayerDialog(playerid,id,styl,napis[],text[],res[],res2[])
- {
- setDialog(playerid,id);
- return ShowPlayerDialog(playerid,id,styl,napis,text,res,res2);
- }
- Funkcja::OnPlayerLoginIC(playerid, name[])
- {
- if(Login(playerid) == 1)
- {
- SetPVarInt(playerid, "LastZone", 0);
- SetPVarInt(playerid, "Spawned", gettime()+5);
- TogglePlayerSpectating(playerid, false);
- for(new Globalne:i; i < Globalne; i++)
- IPB[playerid][i] = 0;
- Player[playerid][pSesja] = gettime();
- Data();
- new h, m, s, data[512];
- gettime(h, m, s);
- format(String, sizeof(String), "[info] Sesja rozpoczeta %02d/%02d/%d, Godzina %02d:%02d:%02d.", Dzien, Miesiac, Rok, h, m, s);
- PlayerLog(playerid, String);
- new query[512];
- format(query, sizeof(query), "SELECT `konto`,`online`,`skin`,`invisible`,`nick` FROM `1postacie` WHERE `uid`=%d LIMIT 1", Player[playerid][pUID]);
- mysql_query_ex(query);
- mysql_store_result();
- if(mysql_num_rows() != 0)
- {
- mysql_fetch_row_format(query);
- sscanf(query, "p<|>dddds[32]", Player[playerid][pKonto], Player[playerid][pOnline], Player[playerid][pSkin], Player[playerid][pInvisible], Player[playerid][pNick]);
- }
- mysql_free_result();
- //
- if(Player[playerid][pKonto] == 999)
- return Info(playerid, "Postać została uśmiercona w sposób InCharacter, nie możesz na niej grać."), Kick(playerid);
- if(Player[playerid][pKonto] != 1 && Player[playerid][pKonto] > gettime())
- return Info(playerid, "Konto zostało zablokowane przez Administrację.\nOdwiedź kartę gracza, by dowiedzieć się więcej."), Kick(playerid);
- Player[playerid][pKonto] = 1;
- GetPlayerIp(playerid, Player[playerid][pIP], 16);
- //wczytujemy wszystko
- format(query, sizeof(query), "SELECT `konto`,`online`,`skin`,`lastskin`,`owneruid`,`ingame`,`godziny`,`HP`,`plec`,`wiek`,`sila`,`invisible`,`allduty`,`job`,`spawnid`,`kasa`,`bank`,`BW`,`dystans`,`interior`,`vw`,`posx`,`posy`,`posz`,`quit`,`quittime`,`AJ`,`JAIL`,`Spawn`,`SpawnTyp`,`paydaygame`,`telefon` FROM `1postacie` WHERE uid = '%d' LIMIT 1", Player[playerid][pUID]);
- mysql_query_ex(query);
- mysql_store_result();
- if(mysql_fetch_row_format(data, "|"))
- {
- sscanf(data, "p<|>dddddddfddddddddddfddfffdddddddd",
- Player[playerid][pKonto],
- Player[playerid][pOnline],
- Player[playerid][pSkin],
- Player[playerid][pLastSkin],
- Player[playerid][pGID],
- Player[playerid][pInGame],
- Player[playerid][pGodziny],
- Player[playerid][pHP],
- Player[playerid][pSex],
- Player[playerid][pWiek],
- Player[playerid][pSila],
- Player[playerid][pInvisible],
- Player[playerid][pDutyAll],
- Player[playerid][pJob],
- Player[playerid][pSpawnID],
- Player[playerid][pKasa],
- Player[playerid][pBank],
- Player[playerid][pBW],
- Player[playerid][pWyjezdzone],
- Player[playerid][pInt],
- Player[playerid][pVir],
- Player[playerid][pPosX],
- Player[playerid][pPosY],
- Player[playerid][pPosZ],
- Player[playerid][pQuit],
- Player[playerid][pQuitTime],
- Player[playerid][pAJ],
- Player[playerid][pJail],
- Player[playerid][pSpawn],
- Player[playerid][pSpawnTyp],
- Player[playerid][pPayDayGame],
- Player[playerid][pTelefon]);
- SetPlayerHealth(playerid, Player[playerid][pHP]);
- setHP(playerid, Player[playerid][pHP]);
- }
- mysql_free_result();
- //Wczytyjemy grupy gracza
- format(query, sizeof(query), "SELECT `group_1`,`group_2`,`group_3`,`group_4`,`group_5`,`g_perm_1`,`g_perm_2`,`g_perm_3`,`g_perm_4`,`g_perm_5`,`g_payday_1`,`g_payday_2`,`g_payday_3`,`g_payday_4`,`g_payday_5` FROM `1postacie` WHERE uid = '%d' LIMIT 1", Player[playerid][pUID]);
- mysql_query_ex(query);
- mysql_store_result();
- if(mysql_fetch_row_format(data, "|"))
- {
- sscanf(data, "p<|>ddddddddddddddd", pGrupa[playerid][1], pGrupa[playerid][2], pGrupa[playerid][3], pGrupa[playerid][4], pGrupa[playerid][5],
- pGrupaPerm[playerid][1], pGrupaPerm[playerid][2], pGrupaPerm[playerid][3], pGrupaPerm[playerid][4], pGrupaPerm[playerid][5],
- pGrupaPayDay[playerid][1], pGrupaPayDay[playerid][2], pGrupaPayDay[playerid][3], pGrupaPayDay[playerid][4], pGrupaPayDay[playerid][5]);
- }
- mysql_free_result();
- //koniec
- Powitanie(playerid);
- Player[playerid][pGID] = GetPVarInt(playerid, "pGID");
- return 1;
- }
- return Info(playerid, "Logowanie nieautoryzowane."), Kick(playerid);
- }
- Funkcja::SavePlayerStats(playerid, what)
- {
- if(!Login(playerid) || GetPVarInt(playerid, "TimeBanned") == 1)
- {
- return 1;
- }
- Player[playerid][pLastLogin] = gettime();
- new timex[3];
- FullTime(Player[playerid][pOnline], timex[0], timex[1], timex[2]);
- Player[playerid][pGodziny] = timex[0];
- new query[512], main_query[1024];
- format(main_query, sizeof(main_query), "UPDATE `1postacie` SET");
- if(what & SAVE_PLAYER_CASH)
- {
- format(query, sizeof(query), " kasa = '%d', bank = '%d'", dKasa(playerid), Player[playerid][pBank]);
- if(strlen(main_query) > 32)
- {
- strcat(main_query, ",", sizeof(main_query));
- }
- strcat(main_query, query, sizeof(main_query));
- }
- if(what & SAVE_PLAYER_BASIC)
- {
- format(query, sizeof(query), " kasa = '%d', bank = '%d', skin = '%d', lastskin = '%d', dystans = '%f', BW = '%d', HP = '%f', Spawn = '%d', SpawnTyp = '%d', SpawnID = '%d', sila = '%d', job = '%d', paydaygame = '%d', AJ = '%d', JAIL = '%d', telefon = '%d', ingame = '%d', online = '%d', lastlogin = '%d', godziny = '%d', `konto` = '%d'",
- dKasa(playerid),
- Player[playerid][pBank], Player[playerid][pSkin], GetPlayerSkin(playerid), Player[playerid][pWyjezdzone], Player[playerid][pBW], dHP[playerid],
- Player[playerid][pSpawn], Player[playerid][pSpawnTyp], Player[playerid][pSpawnID], Player[playerid][pSila], Player[playerid][pJob], Player[playerid][pPayDayGame], Player[playerid][pAJ], Player[playerid][pJail], Player[playerid][pTelefon], Player[playerid][pInGame], Player[playerid][pOnline],
- Player[playerid][pLastLogin], Player[playerid][pGodziny], Player[playerid][pKonto]);
- if(strlen(main_query) > 32)
- {
- strcat(main_query, ",", sizeof(main_query));
- }
- strcat(main_query, query, sizeof(main_query));
- }
- if(what & SAVE_PLAYER_POS)
- {
- GetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
- Player[playerid][pInt] = GetPlayerInterior(playerid);
- Player[playerid][pVir] = GetPlayerVirtualWorld(playerid);
- // Pozycja (interior, virtual world, posx, posy, posz)
- format(query, sizeof(query), " quit = '%d', quittime = '%d', interior = '%d', vw = '%d', posx = '%f', posy = '%f', posz = '%f'",
- Player[playerid][pQuit], Player[playerid][pQuitTime], Player[playerid][pInt],
- Player[playerid][pVir],
- Player[playerid][pPosX],
- Player[playerid][pPosY],
- Player[playerid][pPosZ]);
- if(strlen(main_query) > 32)
- {
- strcat(main_query, ",", sizeof(main_query));
- }
- strcat(main_query, query, sizeof(main_query));
- }
- if(what & SAVE_PLAYER_GROUP)
- {
- // Pozycja (interior, virtual world, posx, posy, posz)
- format(query, sizeof(query), " group_1 = '%d', group_2 = '%d', group_3 = '%d', group_4 = '%d', group_5 = '%d', g_perm_1 = '%d', g_perm_2 = '%d', g_perm_3 = '%d', g_perm_4 = '%d', g_perm_5 = '%d', g_payday_1 = '%d', g_payday_2 = '%d', g_payday_3 = '%d', g_payday_4 = '%d', g_payday_5 = '%d'",
- pGrupa[playerid][1],
- pGrupa[playerid][2],
- pGrupa[playerid][3],
- pGrupa[playerid][4],
- pGrupa[playerid][5],
- pGrupaPerm[playerid][1],
- pGrupaPerm[playerid][2],
- pGrupaPerm[playerid][3],
- pGrupaPerm[playerid][4],
- pGrupaPerm[playerid][5],
- pGrupaPayDay[playerid][1],
- pGrupaPayDay[playerid][2],
- pGrupaPayDay[playerid][3],
- pGrupaPayDay[playerid][4],
- pGrupaPayDay[playerid][5]);
- if(strlen(main_query) > 32)
- {
- strcat(main_query, ",", sizeof(main_query));
- }
- strcat(main_query, query, sizeof(main_query));
- }
- format(query, sizeof(query), " WHERE uid = '%d' LIMIT 1", Player[playerid][pUID]);
- strcat(main_query, query, sizeof(main_query));
- return mysql_query_ex(main_query);
- }
- /*
- for(new s = 1; s < 6; s++)
- {
- if(GrupaGraczSlot(playerid, s, pGrupa[playerid][s]) != 0)
- {
- if(pGrupa[playerid][s] != 0)
- {
- pGrupa[playerid][s] = 0;
- }
- }
- }
- */
- //Update mysql
- Funkcja::Door_Update(doorID)
- {
- new query[512], main_query[1024];
- format(main_query, sizeof(main_query), "UPDATE `1drzwi` SET");
- if(Drzwi[doorID][dAktywne] == 1)
- {
- mysql_real_escape_string(Drzwi[doorID][dNazwa], Drzwi[doorID][dNazwa]);
- format(query, sizeof(query), " owner = '%d', owner_uid = '%d', name = '%s'", Drzwi[doorID][dOwner], Drzwi[doorID][dOwnerUID], Drzwi[doorID][dNazwa]);
- if(strlen(main_query) > 32)
- {
- strcat(main_query, ",", sizeof(main_query));
- }
- strcat(main_query, query, sizeof(main_query));
- }
- format(query, sizeof(query), " WHERE uid = '%d' LIMIT 1", doorID);
- strcat(main_query, query, sizeof(main_query));
- return mysql_query_ex(main_query);
- }
- //
- Funkcja::Global_Data_Load(playerid)
- {
- if(Player[playerid][pGID] == 0)
- return 1;
- new file[40];
- if(Login(playerid) != 1) return 1;
- format(file,sizeof(file), "Gracze/gData/%d.ini", Player[playerid][pGID]);
- if(DOF2_FileExists(file))
- {
- IPB[playerid][ipb_GameScore] = DOF2_GetInt(file, "GameScore");
- IPB[playerid][ipb_Premium] = DOF2_GetInt(file, "Premium");
- IPB[playerid][ipb_PremiumScore] = DOF2_GetInt(file, "PremiumScore");
- IPB[playerid][ipb_PremiumService] = DOF2_GetInt(file, "PremiumService");
- IPB[playerid][ipb_ZoneShow] = DOF2_GetInt(file, "ZoneShow");
- }
- else
- {
- DOF2_CreateFile(file);
- IPB[playerid][ipb_GameScore] = DOF2_GetInt(file, "GameScore");
- IPB[playerid][ipb_Premium] = DOF2_GetInt(file, "Premium");
- IPB[playerid][ipb_PremiumScore] = DOF2_GetInt(file, "PremiumScore");
- IPB[playerid][ipb_PremiumService] = DOF2_GetInt(file, "PremiumService");
- IPB[playerid][ipb_ZoneShow] = DOF2_GetInt(file, "ZoneShow");
- }
- UpdateGlobal(playerid, Player[playerid][pGID]);
- return DOF2_SaveFile();
- }
- Funkcja::Global_Data_Save(playerid)
- {
- if(Player[playerid][pGID] == 0)
- return 1;
- UpdateGlobal(playerid, Player[playerid][pGID]);
- new file[40];
- if(Login(playerid) != 1) return 1;
- format(file,sizeof(file), "Gracze/gData/%d.ini", Player[playerid][pGID]);
- if(DOF2_FileExists(file))
- {
- DOF2_SetInt(file, "GameScore", IPB[playerid][ipb_GameScore]);
- DOF2_SetInt(file, "Premium", IPB[playerid][ipb_Premium]);
- DOF2_SetInt(file, "PremiumScore", IPB[playerid][ipb_PremiumScore]);
- DOF2_SetInt(file, "PremiumService", IPB[playerid][ipb_PremiumService]);
- DOF2_SetInt(file, "ZoneShow", IPB[playerid][ipb_ZoneShow]);
- }
- else
- {
- DOF2_CreateFile(file);
- DOF2_SetInt(file, "GameScore", IPB[playerid][ipb_GameScore]);
- DOF2_SetInt(file, "Premium", IPB[playerid][ipb_Premium]);
- DOF2_SetInt(file, "PremiumScore", IPB[playerid][ipb_PremiumScore]);
- DOF2_SetInt(file, "PremiumService", IPB[playerid][ipb_PremiumService]);
- DOF2_SetInt(file, "ZoneShow", 1);
- }
- return DOF2_SaveFile();
- }
- ShowOrderCat(playerid)
- {
- new kat[64], list[1024];
- for(new i = 1; i < sizeof(KategorieZamowien); i++)
- {
- format(kat, sizeof(kat), "%d\t%s", i, KategorieZamowien[i]);
- format(list, sizeof(list), "%s%s\n", list, kat);
- }
- return dShowPlayerDialog(playerid, 2000, DIALOG_STYLE_LIST, ""ServName"Zamówienia", list, "Wybierz", "Anuluj");
- }
- NickShow(playerid)
- {
- new text[64];
- format(text, sizeof(text), "%s (UID: %d, GID: %d)", Nick(playerid), Player[playerid][pUID], Player[playerid][pGID]);
- return text;
- }
- Funkcja::PlayerToPlayer(Float:radi, playerid, targetid)
- {
- if(IsPlayerConnected(playerid) && IsPlayerConnected(targetid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- //radi = 2.0; //Trigger Radius
- GetPlayerPos(targetid, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- IsBoat(vehicleid)
- {
- new boat = 0, model = GetVehicleModel(vehicleid);
- switch(model)
- {
- case 472: boat = 1;
- case 473: boat = 1;
- case 493: boat = 1;
- case 595: boat = 1;
- case 484: boat = 1;
- case 430: boat = 1;
- case 453: boat = 1;
- case 452: boat = 1;
- case 446: boat = 1;
- case 454: boat = 1;
- }
- return boat;
- }
- stock AreaToArea(Float:radi, area_one, area_two)
- {
- new Float:tempposx, Float:tempposy, Float:tempposz;
- tempposx = (GangZoneInfo[area_one][gMinX] -GangZoneInfo[area_two][gMinX]);
- tempposy = (GangZoneInfo[area_one][gMinY] -GangZoneInfo[area_two][gMinY]);
- tempposz = (0 -0);
- if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 0;
- }
- stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
- return 0;
- }
- stock GroupDoorInArea(group, area)
- {
- new door = 0;
- for(new d = 1; d < MAX_DRZWI; d++)
- {
- if(Drzwi[d][dAktywne] == 1 && Drzwi[d][dOwner] == OWNER_GROUP && Drzwi[d][dOwnerUID] == group)
- {
- if(Drzwi[d][dZewPosX] <= GangZoneInfo[area][gMaxX] && Drzwi[d][dZewPosX] >= GangZoneInfo[area][gMinX] && Drzwi[d][dZewPosY] <= GangZoneInfo[area][gMaxY] && Drzwi[d][dZewPosY] >= GangZoneInfo[area][gMinY])
- {
- door++;
- }
- }
- }
- return door;
- }
- stock PlayerInZone(playerid)
- {
- new zone = 0;
- for(new g = 1; g < MAX_GANG_ZONES; g++)
- {
- if(IsPlayerInArea(playerid, GangZoneInfo[g][gMaxX], GangZoneInfo[g][gMinX], GangZoneInfo[g][gMaxY], GangZoneInfo[g][gMinY]))
- {
- if(GangZoneInfo[g][gAktywna] == 1)
- {
- zone = g;
- break;
- }
- }
- }
- return zone;
- }
- stock HidePlayerZone(playerid)
- {
- for(new g = 1; g < MAX_GANG_ZONES; g++)
- {
- if(GangZoneInfo[g][gAktywna] == 1)
- {
- GangZoneHideForPlayer(playerid, GangZone[g]);
- }
- }
- return 1;
- }
- stock ShowPlayerZone(playerid)
- {
- for(new g = 1; g < MAX_GANG_ZONES; g++)
- {
- if(GangZoneInfo[g][gAktywna] == 1)
- {
- if(GangZoneInfo[g][gOwner] == OWNER_GROUP && IPB[playerid][ipb_ZoneShow] == 1)
- {
- GangZoneShowForPlayer(playerid, GangZone[g], Grupa[GangZoneInfo[g][gOwnerUID]][gKolorZone]);
- }
- }
- }
- return 1;
- }
- stock GetPlayerWeaponInData(playerID)
- {
- new weapID = INVALID_WEAPON_DATA, weapons[13], ammo;
- for(new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerID, i, weapons[i], ammo);
- if(weapons[i] != 0)
- {
- weapID = weapons[i];
- continue;
- }
- }
- return weapID;
- }
- stock DoorObject(doorID)
- {
- new object = 0;
- for(new o = 1; o < MAX_OBIEKT; o++)
- {
- if(Obiekt[o][oVir] == Drzwi[doorID][dWewVir])
- {
- object++;
- }
- }
- return object;
- }
- stock DoorInfo(playerid, doorID)
- {
- new owner[16], ownerType[64], info[2048], vw[64];
- //Informacje o właścicielu
- if(Drzwi[doorID][dOwner] == OWNER_PLAYER)
- {
- owner = "Gracz";
- format(ownerType, 64, "Gracz (%d)", Drzwi[doorID][dOwnerUID]);
- }
- else if(Drzwi[doorID][dOwner] == OWNER_GROUP)
- {
- owner = "Grupa";
- format(ownerType, 64, "%s (%d)", Grupa[Drzwi[doorID][dOwnerUID]][gNazwa], Drzwi[doorID][dOwnerUID]);
- }
- else
- {
- ownerType = "Brak";
- owner = "Brak";
- }
- //Virtual World, Interior
- format(vw, 64, "VirtualWorld:\t\t%d\nInterior:\t\t%d", Drzwi[doorID][dWewVir], Drzwi[doorID][dIntWew]);
- //Formatowanie ogólne
- format(info, 2048, "Identyfikator:\t\t%d\nNazwa drzwi:\t\t%s\nTyp ownera:\t\t%s\nOwner:\t\t\t%s\n%s\nObiekty:\t\t%d (%d)", doorID, Drzwi[doorID][dNazwa], owner, ownerType, vw, DoorObject(doorID), Drzwi[doorID][dObiekty]);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, ""ServName"Drzwi", info, "Rozumiem", "");
- }
- stock KickWithMessage(playerid, color, message[])
- {
- SendClientMessage(playerid, color, message);
- SetTimerEx("KickPublic", 1000, 0, "d", playerid);
- return 1;
- }
- forward KickPublic(playerid);
- public KickPublic(playerid) return Kick(playerid);
- stock WordWrap(givenString[128], spaces) // By Mario
- {
- new editingString[128], spaceCounter = 0;
- memcpy(editingString, givenString, 0, 128 * 4);
- // Zrób pętlę na każdy bit
- for (new i = 0; editingString[i] != 0; i++)
- {
- // Sprawdź czy po przecinku lub kropce jest spacja - jeśli nie, dodaj ją
- if(editingString[i] == ',' || editingString[i] == '.')
- {
- if(editingString[i+1] != ' ') strins(editingString, " ", i + 1);
- }
- // Nalicz spacje
- if(editingString[i] == ' ' && editingString[i+1] != ' ') spaceCounter++;
- // Jeśli naliczył wskazaną ilość spacji, przenieś do następnej linijki
- if(spaceCounter >= spaces)
- {
- editingString[i] = '\n';
- spaceCounter = 0;
- }
- }
- return editingString;
- }
- stock floatval(Float:f)
- {
- new str[20], str2[10];
- floatround(f);
- format(str, sizeof str, "%f", f);
- if(f >= 0 && f < 10) strmid(str2, str, 0, 1);
- else if(f >= 10 && f < 100) strmid(str2, str, 0, 2);
- else if(f >= 100 && f < 1000) strmid(str2, str, 0, 3);
- else if(f >= 1000 && f < 10000) strmid(str2, str, 0, 4);
- return strval(str2);
- }
- stock SetVehicleSpeed(vehicleid, Float:speed)
- {
- new Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, Float:a;
- GetVehicleVelocity(vehicleid, x1, y1, z1);
- GetVehiclePos(vehicleid, x2, y2, z2);
- GetVehicleZAngle(vehicleid, a); a = 360 - a;
- x1 = (floatsin(a, degrees) * (speed/100) + floatcos(a, degrees) * 0 + x2) - x2;
- y1 = (floatcos(a, degrees) * (speed/100) + floatsin(a, degrees) * 0 + y2) - y2;
- SetVehicleVelocity(vehicleid, x1, y1, z1);
- }
- stock GetVehicleSpeed(vehicleid)
- {
- new Float:vSpeed[3];
- GetVehicleVelocity( vehicleid, vSpeed[0], vSpeed[1], vSpeed[2] );
- new Float:vSpeed_Float;
- vSpeed_Float = floatsqroot( ((vSpeed[0] * vSpeed[0]) + (vSpeed[1] * vSpeed[1])) + (vSpeed[2] * vSpeed[2])) * 161;
- new vSpeed_Int;
- vSpeed_Int = floatround( vSpeed_Float, floatround_round);
- return vSpeed_Int;
- }
- stock hexstring(string[])
- {
- new ret, val, i;
- if (string[0] == '0' && string[1] | 0x20 == 'x') i = 2;
- while (string[i])
- {
- ret <<= 4;
- val = string[i++] - '0';
- if (val > 0x09) val -= 0x07;
- if (val > 0x0F) val -= 0x20;
- if (val < 0x01) continue;
- if (val < 0x10) ret += val;
- }
- return ret;
- }
- stock GetPlayerFPS(playerid)
- {
- SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
- if(GetPVarInt(playerid, "DrunkL") < 100) SetPlayerDrunkLevel(playerid, 2000);
- else{
- if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
- {
- SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
- SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
- if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256))
- {
- return GetPVarInt(playerid, "FPS") - 1;
- }
- }
- }
- return 0;
- }
- stock GetCharName(uid)
- {
- new name[MAX_PLAYER_NAME+1], file[40];
- format(file, sizeof(file), "Gracze/%d.ini", uid);
- if(DOF2_FileExists(file))
- {
- name = DOF2_GetString(file, "Nick");
- }
- else
- {
- name = "---";
- }
- return name;
- }
- stock GetVehicleName(uid)
- {
- new tmp = Pojazd[uid][vModel] - 400;
- return nazwypojazdow[tmp];
- }
- stock pDrzwi(playerid, drzwi)
- {
- new typ = 0;
- if(Drzwi[drzwi][dOwner] == OWNER_PLAYER && Drzwi[drzwi][dOwnerUID] == Player[playerid][pUID])
- {
- typ = OWNER_PLAYER;
- }
- for(new g = 1; g < 6; g++)
- {
- if(Drzwi[drzwi][dOwner] == OWNER_GROUP && Drzwi[drzwi][dOwnerUID] == GroupSlot(playerid, pGrupa[playerid][g]))
- {
- typ = OWNER_GROUP;
- }
- printf("Drzwi: %d, Uprawnienia z grupy o UID %d (Slot: %d)", drzwi, pGrupa[playerid][g], g);
- }
- return typ;
- }
- stock pDrzwiOwner(playerid, drzwi)
- {
- new typ = 0;
- if(Drzwi[drzwi][dOwner] == OWNER_PLAYER && Drzwi[drzwi][dOwnerUID] == Player[playerid][pUID])
- {
- return typ = OWNER_PLAYER;
- }
- for(new g = 1; g < 6; g++)
- {
- if(Drzwi[drzwi][dOwner] == OWNER_GROUP && Drzwi[drzwi][dOwnerUID] == GroupSlot(playerid, pGrupa[playerid][g]))
- {
- if((pGrupaPerm[playerid][g] & PERM_LEADER))
- {
- printf("Drzwi: %d, Uprawnienia z grupy o UID %d (Slot: %d)", drzwi, pGrupa[playerid][g], g);
- return typ = OWNER_GROUP;
- }
- }
- }
- return typ;
- }
- stock InDoor(playerid)
- {
- new door = 0;
- for(new d = 0; d < MAX_DRZWI; d++)
- {
- if(Drzwi[d][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]) && Drzwi[d][dWewVir] == GetPlayerVirtualWorld(playerid))
- {
- door = d;
- }
- }
- return door;
- }
- stock pPojazd(playerid, vehicleid)
- {
- new drive = 0;
- if(Pojazd[CarUID(vehicleid)][vOwner] == 1 && Pojazd[CarUID(vehicleid)][vOwnerUID] == Player[playerid][pUID])
- {
- drive = 1;
- }
- if(Pojazd[CarUID(vehicleid)][vOwner] == 2 && ((pGrupaPerm[playerid][GroupSlot(playerid, Pojazd[CarUID(vehicleid)][vOwnerUID])] & PERM_OFFER)))
- {
- drive = 2;
- }
- if(pItem(playerid, 20, CarUID(vehicleid), 0) != 0)
- {
- drive = 3;
- }
- return drive;
- }
- stock pAdminPerm(playerid)
- {
- new permision = 0;
- if(GetPVarInt(playerid, "Grupa") == 4)
- {
- permision = 4;
- }
- else if(GetPVarInt(playerid, "Grupa") == 7)
- {
- permision = 7;
- }
- return permision;
- }
- stock pItem(playerid, typ, wartosc1, wartosc2)
- {
- new item = 0;
- for(new p = 1; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[p][iTyp] == typ)
- {
- if(Przedmiot[p][iWartosc1] == wartosc1 && Przedmiot[p][iWartosc2] == wartosc2)
- {
- item = p;
- }
- }
- }
- }
- return item;
- }
- stock GrupaInfo(playerid, grupa)
- {
- new info[128], big_str[1024], aktywnosc[64], podgrupa[128];
- if(Grupa[grupa][gPunkty] >= 1000)
- format(aktywnosc, sizeof(aktywnosc), "{00B000}%d{FFFFFF} pkt.", Grupa[grupa][gPunkty]);
- else
- format(aktywnosc, sizeof(aktywnosc), "{FF8000}%d{FFFFFF} pkt.", Grupa[grupa][gPunkty]);
- if(Grupa[grupa][gOwner] != 0)
- {
- format(podgrupa, sizeof(podgrupa), "Grupa nadrzędna:\t%s (%d)", Grupa[Grupa[grupa][gOwner]][gNazwa], Grupa[grupa][gOwner]);
- }
- format(info, sizeof(info), ""ServName"%s (UID: %d)", Grupa[grupa][gNazwa], grupa);
- format(big_str, sizeof(big_str), "Typ grupy:\t\t%s\nNazwa grupy:\t\t%s\nTag:\t\t\t%s\nBudżet:\t\t\t$%d\nEuro:\t\t\t€%d\nAktwyność:\t\t%s\nDotacja rządowa:\t$%d\nLimit pojazdów:\t\t%d\n%s", GrupaTyp(grupa), Grupa[grupa][gNazwa], Grupa[grupa][gTag], Grupa[grupa][gBank], Grupa[grupa][gWirCash], aktywnosc, Grupa[grupa][gPayDay], Grupa[grupa][gVehLimit], podgrupa);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, info, big_str, "Wybierz", "");
- }
- stock PaliwoMax(model)
- {
- new paliwo = 0;
- switch(model)
- {
- case 400: paliwo = 60;
- case 401: paliwo = 40;
- case 402: paliwo = 55;
- case 403: paliwo = 200;
- case 404: paliwo = 30;
- case 405: paliwo = 50;
- case 406: paliwo = 95;
- case 407: paliwo = 120;
- case 408: paliwo = 95;
- case 409: paliwo = 75;
- case 410: paliwo = 30;
- case 411: paliwo = 55;
- case 412: paliwo = 40;
- case 413: paliwo = 45;
- case 414: paliwo = 45;
- case 415: paliwo = 65;
- case 416: paliwo = 95;
- case 417: paliwo = 150;
- case 418: paliwo = 45;
- case 419: paliwo = 45;
- case 420: paliwo = 55;
- case 421: paliwo = 55;
- case 422: paliwo = 35;
- case 423: paliwo = 40;
- case 424: paliwo = 30;
- case 425: paliwo = 150;
- case 426: paliwo = 60;
- case 427: paliwo = 90;
- case 428: paliwo = 90;
- case 429: paliwo = 55;
- case 430: paliwo = 100;
- case 431: paliwo = 200;
- case 432: paliwo = 200;
- case 433: paliwo = 100;
- case 434: paliwo = 55;
- case 435: paliwo = -1;
- case 436: paliwo = 30;
- case 437: paliwo = 140;
- case 438: paliwo = 60;
- case 439: paliwo = 50;
- case 440: paliwo = 75;
- case 441: paliwo = -1;
- case 442: paliwo = 35;
- case 443: paliwo = 75;
- case 444: paliwo = 25;
- case 445: paliwo = 35;
- case 446: paliwo = 45;
- case 447: paliwo = 95;
- case 448: paliwo = 10;
- case 449: paliwo = -1;
- case 450: paliwo = -1;
- case 451: paliwo = 50;
- case 452: paliwo = 65;
- case 453: paliwo = 45;
- case 454: paliwo = 45;
- case 455: paliwo = 75;
- case 456: paliwo = 80;
- case 457: paliwo = 15;
- case 458: paliwo = 50;
- case 459: paliwo = 50;
- case 460: paliwo = 65;
- case 461: paliwo = 30;
- case 462: paliwo = 10;
- case 463: paliwo = 30;
- case 464: paliwo = -1;
- case 465: paliwo = -1;
- case 466: paliwo = 40;
- case 467: paliwo = 40;
- case 468: paliwo = 30;
- case 469: paliwo = 100;
- case 470: paliwo = 110;
- case 471: paliwo = 35;
- case 472: paliwo = 50;
- case 473: paliwo = 25;
- case 474: paliwo = 35;
- case 475: paliwo = 54;
- case 476: paliwo = 110;
- case 477: paliwo = 50;
- case 478: paliwo = 30;
- case 479: paliwo = 35;
- case 480: paliwo = 55;
- case 481: paliwo = -1;
- case 482: paliwo = 75;
- case 483: paliwo = 60;
- case 484: paliwo = 95;
- case 485: paliwo = 15;
- case 486: paliwo = 65;
- case 487: paliwo = 120;
- case 488: paliwo = 100;
- case 489: paliwo = 65;
- case 490: paliwo = 65;
- case 491: paliwo = 55;
- case 492: paliwo = 60;
- case 493: paliwo = 70;
- case 494: paliwo = 50;
- case 495: paliwo = 65;
- case 496: paliwo = 50;
- case 497: paliwo = 125;
- case 498: paliwo = 25;
- case 499: paliwo = 55;
- case 500: paliwo = 45;
- case 501: paliwo = -1;
- case 502: paliwo = 55;
- case 503: paliwo = 55;
- case 504: paliwo = 55;
- case 505: paliwo = 65;
- case 506: paliwo = 50;
- case 507: paliwo = 65;
- case 508: paliwo = 65;
- case 509: paliwo = -1;
- case 510: paliwo = -1;
- case 511: paliwo = 100;
- case 512: paliwo = 100;
- case 513: paliwo = 100;
- case 514: paliwo = 125;
- case 515: paliwo = 135;
- case 516: paliwo = 35;
- case 517: paliwo = 45;
- case 518: paliwo = 50;
- case 519: paliwo = 250;
- case 520: paliwo = 200;
- case 521: paliwo = 35;
- case 522: paliwo = 35;
- case 523: paliwo = 35;
- case 524: paliwo = 65;
- case 525: paliwo = 60;
- case 526: paliwo = 45;
- case 527: paliwo = 45;
- case 528: paliwo = 55;
- case 529: paliwo = 40;
- case 530: paliwo = 15;
- case 531: paliwo = 30;
- case 532: paliwo = 75;
- case 533: paliwo = 60;
- case 534: paliwo = 55;
- case 535: paliwo = 50;
- case 536: paliwo = 45;
- case 537: paliwo = -1;
- case 538: paliwo = -1;
- case 539: paliwo = 25;
- case 540: paliwo = 45;
- case 541: paliwo = 65;
- case 542: paliwo = 35;
- case 543: paliwo = 30;
- case 544: paliwo = 95;
- case 545: paliwo = 40;
- case 546: paliwo = 45;
- case 547: paliwo = 55;
- case 548: paliwo = 200;
- case 549: paliwo = 35;
- case 550: paliwo = 48;
- case 551: paliwo = 60;
- case 552: paliwo = 55;
- case 553: paliwo = 120;
- case 554: paliwo = 45;
- case 555: paliwo = 45;
- case 556: paliwo = 25;
- case 557: paliwo = 25;
- case 558: paliwo = 60;
- case 559: paliwo = 55;
- case 560: paliwo = 75;
- case 561: paliwo = 55;
- case 562: paliwo = 55;
- case 563: paliwo = 125;
- case 564: paliwo = -1;
- case 565: paliwo = 45;
- case 566: paliwo = 55;
- case 567: paliwo = 55;
- case 568: paliwo = 30;
- case 569: paliwo = -1;
- case 570: paliwo = -1;
- case 571: paliwo = 15;
- case 572: paliwo = 15;
- case 573: paliwo = 65;
- case 574: paliwo = 25;
- case 575: paliwo = 55;
- case 576: paliwo = 50;
- case 577: paliwo = 250;
- case 578: paliwo = 80;
- case 579: paliwo = 80;
- case 580: paliwo = 65;
- case 581: paliwo = 35;
- case 582: paliwo = 45;
- case 583: paliwo = 15;
- case 584: paliwo = -1;
- case 585: paliwo = 45;
- case 586: paliwo = 35;
- case 587: paliwo = 50;
- case 588: paliwo = 45;
- case 589: paliwo = 50;
- case 590: paliwo = -1;
- case 591: paliwo = -1;
- case 592: paliwo = 250;
- case 593: paliwo = 75;
- case 594: paliwo = -1;
- case 595: paliwo = 55;
- case 596: paliwo = 60;
- case 597: paliwo = 60;
- case 598: paliwo = 50;
- case 599: paliwo = 55;
- case 600: paliwo = 35;
- case 601: paliwo = 75;
- case 602: paliwo = 55;
- case 603: paliwo = 50;
- case 604: paliwo = 25;
- case 605: paliwo = 20;
- case 606: paliwo = -1;
- case 607: paliwo = -1;
- case 608: paliwo = -1;
- case 609: paliwo = 35;
- case 610: paliwo = -1;
- case 611: paliwo = -1;
- }
- return paliwo;
- }
- stock VehInfo(playerid, vehicleid)
- {
- new veh = CarUID(vehicleid), paliwo[32], info[128], big_str[1024], owner[16];
- if(Pojazd[veh][vPaliwoTyp] == 1)
- {
- paliwo = "Benzyna";
- }
- else if(Pojazd[veh][vPaliwoTyp] == 2)
- {
- paliwo = "Diesel";
- }
- else if(Pojazd[veh][vPaliwoTyp] == 3)
- {
- paliwo = "Gas";
- }
- else
- {
- paliwo = "-";
- }
- if(Pojazd[veh][vOwner] == 1)
- owner = "Gracz";
- else
- owner = "Grupa";
- format(big_str, sizeof(big_str), "Model:\t\t\t%d\nKolory:\t\t\t%d:%d\nRodzaj paliwa:\t\t%s\nPaliwo:\t\t\t%.1fl\nStan techniczny:\t%.2f HP\nPrzebieg:\t\t%.2f km\nTyp ownera:\t\t%s\nUID ownera:\t\t%d\n\nParking:\n\t\tX: %.04f\tY: %.04f\tZ: %.04f", Pojazd[veh][vModel], Pojazd[veh][vKolor1], Pojazd[veh][vKolor2], paliwo, Pojazd[veh][vPaliwo], Pojazd[veh][vHP], Pojazd[veh][vPrzebieg], owner, Pojazd[veh][vOwnerUID], Pojazd[veh][vPosX], Pojazd[veh][vPosY], Pojazd[veh][vPosZ]);
- format(info, sizeof(info), ""ServName"%s (UID: %d, sampID: %d)", GetVehicleName(veh), veh, vehicleid);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, info, big_str, "Wybierz", "");
- }
- stock GrupaTyp(grupa)
- {
- new tmp = Grupa[grupa][gTyp];
- return TypGrupy[tmp];
- }
- stock GrupaGracz(playerid, grupa)
- {
- new grupainvite = 0;
- if(pGrupa[playerid][1] == grupa)
- {
- grupainvite = 1;
- }
- if(pGrupa[playerid][2] == grupa)
- {
- grupainvite = 2;
- }
- if(pGrupa[playerid][3] == grupa)
- {
- grupainvite = 3;
- }
- if(pGrupa[playerid][4] == grupa)
- {
- grupainvite = 4;
- }
- if(pGrupa[playerid][5] == grupa)
- {
- grupainvite = 5;
- }
- return grupainvite;
- }
- stock GrupaGraczSlot(playerid, slot, grupa)
- {
- new grupainvite = 0;
- if(pGrupa[playerid][1] == grupa && slot != 1)
- {
- grupainvite = 1;
- }
- if(pGrupa[playerid][2] == grupa && slot != 2)
- {
- grupainvite = 2;
- }
- if(pGrupa[playerid][3] == grupa && slot != 3)
- {
- grupainvite = 3;
- }
- if(pGrupa[playerid][4] == grupa && slot != 4)
- {
- grupainvite = 4;
- }
- if(pGrupa[playerid][5] == grupa && slot != 5)
- {
- grupainvite = 5;
- }
- return grupainvite;
- }
- stock GrupaSlot(playerid, grupa)
- {
- new Slot = 0;
- if(pGrupa[playerid][1] == grupa)
- {
- Slot = 1;
- }
- if(pGrupa[playerid][2] == grupa)
- {
- Slot = 2;
- }
- if(pGrupa[playerid][3] == grupa)
- {
- Slot = 3;
- }
- if(pGrupa[playerid][4] == grupa)
- {
- Slot = 4;
- }
- if(pGrupa[playerid][5] == grupa)
- {
- Slot = 5;
- }
- return Slot;
- }
- stock SendGroupMessage(typ, playerid, group, text[])
- {
- foreach(Player, i)
- {
- if(pGrupa[i][1] == group || pGrupa[i][2] == group || pGrupa[i][3] == group || pGrupa[i][4] == group || pGrupa[i][5] == group)
- {
- if(typ == 0)
- {
- format(String, sizeof(String), "@%d %s (( [%d] %s: %s ))", GrupaSlot(playerid, group), Grupa[group][gTag], playerid, CharName(playerid), text);
- SendClientMessage(i, Grupa[group][gKolor], String);
- }
- else if(typ == 1)
- {
- format(String, sizeof(String), "!%d ** %s: %s **", GrupaSlot(playerid, group), CharName(playerid), text);
- SendClientMessage(i, Grupa[group][gKolor], String);
- }
- else
- {
- SendClientMessage(i, Grupa[group][gKolor], String);
- }
- }
- }
- return 1;
- }
- stock giveHP(playerid, Float:HP)
- {
- dHP[playerid]+=HP;
- if(dHP[playerid]>100) dHP[playerid]=100;
- SetPlayerHealth(playerid,dHP[playerid]);
- return 1;
- }
- stock setHP(playerid, Float:HP)
- {
- dHP[playerid]=HP;
- if(dHP[playerid]>100) dHP[playerid]=100;
- SetPlayerHealth(playerid,HP);
- return 1;
- }
- stock Float:getHP(playerid)
- {
- return dHP[playerid];
- }
- stock dKasa(playerid)
- return Player[playerid][pKasa];
- stock sKasa(playerid, kasa)
- return Player[playerid][pKasa] += kasa;
- stock gKasa(grupa, kasa)
- {
- //tulog
- return Grupa[grupa][gBank] += kasa, ZapiszGrupe(grupa);
- }
- stock AddPoints(grupa, kwota)
- {
- Grupa[grupa][gPunkty] += kwota/10;
- return ZapiszGrupe(grupa);
- }
- stock cName(playerid)
- {
- new nick[64];
- format(nick, sizeof(nick), "%s (UID: %d, GID: %d)", Nick(playerid), Player[playerid][pUID], Player[playerid][pGID]);
- return nick;
- }
- stock CharName3DText(playerid)
- {
- new zwrot[256], statusy[128], bw[16], rekawiczki[16], afk[64], afk0[32], afk1[3], org[16], discman[16], sila[16], pasy[8];
- if(Player[playerid][pBW] != 0)
- {
- if(Player[playerid][pSex] == CHAR_SEX_MALE)
- bw = ", nieprzytomny";
- else
- bw = ", nieprzytomna";
- }
- if(GetPVarInt(playerid, "rpPasy") == 1)
- {
- pasy = ", pasy";
- }
- if(ItemUsed(playerid, 7) != 0)
- rekawiczki = ", rękawice";
- if(ItemUsed(playerid, 23) != 0)
- discman = ", słucha muzyki";
- if(Sluzba(playerid) != 0 && (Grupa[Sluzba(playerid)][gFlagPerm] & G_FLAG_DEPARTMENT))
- format(org, sizeof(org), ", %s", Grupa[Sluzba(playerid)][gTag]);
- if(Player[playerid][pSila] > 5000)
- {
- if(Player[playerid][pSex] == CHAR_SEX_MALE)
- format(sila, sizeof(sila), "wysportowany");
- else
- format(sila, sizeof(sila), "wysportowana");
- }
- else
- {
- format(sila, sizeof(sila), "%dj", Player[playerid][pSila]);
- }
- if(GetPVarInt(playerid, "AFK") > 5)
- {
- format(afk0, sizeof(afk0), ", AFK od ");
- format(afk, sizeof(afk), "%s%s", afk, afk0);
- FullTime(GetPVarInt(playerid, "AFK"), afk1[0], afk1[1], afk1[2]);
- if(afk1[0] != 0){
- format(afk0, sizeof(afk0), "%02dh. ", afk1[0]);
- format(afk, sizeof(afk), "%s%s", afk, afk0);
- }
- if(afk1[1] != 0){
- format(afk0, sizeof(afk0), "%02dm. ", afk1[1]);
- format(afk, sizeof(afk), "%s%s", afk, afk0);
- }
- if(afk1[2] != 0){
- format(afk0, sizeof(afk0), "%02ds.", afk1[2]);
- format(afk, sizeof(afk), "%s%s", afk, afk0);
- }
- }
- else
- {
- afk = "";
- }
- if(Status(playerid) == 0)
- {
- format(statusy, sizeof(statusy), "%s%s%s%s%s%s%s%s", sila, org, bw, rekawiczki, discman, pasy, afk);
- format(zwrot, sizeof(zwrot), "%s (%d)\n(%s%s%s)", CharName(playerid), playerid, statusy);
- }
- else if(Status(playerid) == 1)
- {
- format(statusy, sizeof(statusy), "%s%s%s%s%s", bw, rekawiczki, discman, pasy, afk);
- format(zwrot, sizeof(zwrot), "%s (%d)\n(ukryta twarz%s)", CharName(playerid), playerid, statusy);
- }
- else if(Status(playerid) == 2)
- {
- format(zwrot, sizeof(zwrot), "%s (%d)", CharName(playerid), playerid);
- }
- return zwrot;
- }
- stock NickSAMP(playerid)
- {
- new nick[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nick, sizeof(nick));
- return nick;
- }
- stock FullTime(sekundy,&godziny,&minuty,&sek)
- {
- if(sekundy<60)
- {
- sek = sekundy;
- return 1;
- }
- if(!sekundy) return 1;
- while(sekundy>=3600)
- {
- godziny += 1;
- sekundy -= 3600;
- }
- if(!sekundy) return 1;
- while(sekundy >= 60)
- {
- minuty += 1;
- sekundy -= 60;
- }
- sek = sekundy;
- return 1;
- }
- stock TimeFormat(sekundy, &dni = 0, &godziny = 0, &minuty = 0, &sek = 0)
- {
- godziny = sekundy / 3600;
- sekundy -= godziny * 3600;
- minuty = sekundy / 60;
- sekundy -= minuty * 60;
- sek = sekundy;
- return 1;
- }
- stock Nick(playerid)
- {
- new nick[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nick, sizeof(nick));
- UnderscoreToSpace(nick);
- return nick;
- }
- stock WeapName(weapID)
- {
- new weapName[64];
- GetWeaponName(weapID, weapName, sizeof(weapName));
- if(IsNull(weapName))
- weapName = "-";
- return weapName;
- }
- stock UnderscoreToSpace(name[])
- {
- new pos = strfind(name,"_", true);
- if( pos != -1 )
- name[pos] = ' ';
- }
- Banned(playerid, time, uid)
- {
- new query[256];
- format(query, sizeof(query), "UPDATE `members` SET `ban_time`=%d, `ban_uid`=%d WHERE `member_id`=%d", time, uid, Player[playerid][pGID]);
- mysql_query_ex(query);
- return Ban(playerid);
- }
- stock GetWeaponModel(weaponid)
- {
- switch(weaponid)
- {
- case 1:
- return 331;
- case 2..8:
- return weaponid+331;
- case 9:
- return 341;
- case 10..15:
- return weaponid+311;
- case 16..18:
- return weaponid+326;
- case 22..29:
- return weaponid+324;
- case 30,31:
- return weaponid+325;
- case 32:
- return 372;
- case 33..45:
- return weaponid+324;
- case 46:
- return 371;
- }
- return 0;
- }
- stock ItemRotX(item)
- {
- switch(Przedmiot[item][iTyp])
- {
- case 1: return 90;
- case 2: return 0;
- case 5: return 90;
- case 17: return 0;
- }
- return 0;
- }
- stock GetItemModel(item)
- {
- if(Przedmiot[item][iTyp] == 1)
- {
- switch(Przedmiot[item][iWartosc1])
- {
- case 1:
- return 331;
- case 2..8:
- return Przedmiot[item][iWartosc1]+331;
- case 9:
- return 341;
- case 10..15:
- return Przedmiot[item][iWartosc1]+311;
- case 16..18:
- return Przedmiot[item][iWartosc1]+326;
- case 22..29:
- return Przedmiot[item][iWartosc1]+324;
- case 30,31:
- return Przedmiot[item][iWartosc1]+325;
- case 32:
- return 372;
- case 33..45:
- return Przedmiot[item][iWartosc1]+324;
- case 46:
- return 371;
- }
- }
- else if(Przedmiot[item][iTyp] == 2)
- return 2843;
- else if(Przedmiot[item][iTyp] == 5)
- return Przedmiot[item][iWartosc1];
- else if(Przedmiot[item][iTyp] == 15)
- return 2358;
- else if(Przedmiot[item][iTyp] == 17)
- return 2060;
- return 0;
- }
- stock ItemWaga(playerid)
- {
- new waga;
- for(new nr = 0; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID] && Przedmiot[nr][iAktywny] == 1)
- {
- waga += Przedmiot[nr][iWaga];
- if(Przedmiot[nr][iTyp] == 1)
- {
- if(Przedmiot[nr][iWartosc2] != 0)
- {
- waga += Przedmiot[nr][iWartosc2]*8;
- }
- }
- }
- }
- return waga;
- }
- stock ItemUdzwig(playerid)
- {
- new udzwig = 0;
- udzwig = Player[playerid][pSila]*3;
- if(ItemList(playerid, 16) != 0)
- {
- udzwig += Przedmiot[ItemList(playerid, 16)][iWartosc1];
- }
- return udzwig;
- }
- stock ItemUsed(playerid, typ)
- {
- new used = 0;
- for(new nr = 0; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 1 && Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[nr][iTyp] == typ && Przedmiot[nr][iUsed] == 1)
- {
- used = nr;
- break;
- }
- }
- }
- return used;
- }
- stock ItemList(playerid, typ)
- {
- new used = 0;
- for(new nr = 0; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 1 && Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[nr][iTyp] == typ)
- {
- used = nr;
- break;
- }
- }
- }
- return used;
- }
- stock PokazTekst(Float:radi, playerid, string[], col1, col2, col3, col4, col5)
- {
- #define MAX_LINE 128
- new len = strlen(string), tmp[ MAX_LINE + 5 ];
- if(len >= MAX_LINE)
- {
- new text1[ MAX_LINE + 1 ], text2[ MAX_LINE + 1 ], space = strfind(string, " ", .pos = MAX_LINE-10);
- if(space == -1) space = MAX_LINE;
- strmid(text1, string, 0, space); strmid(text2, string, space, len);
- if(space != -1) strdel(text2, 0, 1);
- format(tmp, sizeof tmp, "%s...", text1); ProxDetector(radi, playerid, tmp, col1, col2, col3, col4, col5);
- format(tmp, sizeof tmp, "...%s", text2); ProxDetector(radi, playerid, tmp, col1, col2, col3, col4, col5);
- }
- else ProxDetector(radi, playerid, string, col1, col2, col3, col4, col5);
- return 1;
- }
- ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid)){
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- new vir=GetPlayerVirtualWorld(playerid);
- foreach(Player, i){
- if(IsPlayerConnected(i)&&GetPlayerVirtualWorld(i)==vir){
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))){
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))){
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))){
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))){
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))){
- SendClientMessage(i, col5, string);
- }
- }
- }
- }
- return 1;
- }
- PrzedmiotTyp(item)
- {
- new i = Przedmiot[item][iTyp];
- new tmp = i;
- return ItemTyp[tmp-1];
- }
- CharName(playerid)
- {
- new zwrot[32];
- if(Status(playerid) == 0)
- {
- format(zwrot, sizeof(zwrot), "%s", Nick(playerid));
- }
- else if(Status(playerid) == 1)
- {
- format(zwrot, sizeof(zwrot), "Nieznajomy %x", Player[playerid][pUID]+979797);
- }
- else if(Status(playerid) == 2)
- {
- format(zwrot, sizeof(zwrot), "%s", Player[playerid][pName]);
- }
- return zwrot;
- }
- PlayerLog(playerid,log[])
- {
- new File:plik,h,m,s;
- gettime(h,m,s);
- format(LogData, sizeof(LogData), "Logi/Gracze/%s.log", NickSAMP(playerid));
- if(DOF2_FileExists(LogData))
- {
- plik = fopen(LogData, io_append);
- if (plik)
- {
- format(LogStr, sizeof(LogStr), "\n[%02d:%02d:%02d] %s",h,m,s,log);
- fwrite(plik, LogStr);
- fclose(plik);
- }
- }
- else
- {
- DOF2_CreateFile(LogData);
- plik = fopen(LogData, io_append);
- if (plik)
- {
- format(LogStr, sizeof(LogStr), "[%02d:%02d:%02d] %s",h,m,s,log);
- fwrite(plik, LogStr);
- fclose(plik);
- }
- }
- return 1;
- }
- Funkcja::InfoBoxShow(typ,playerid,string[],sek)
- {
- new czas = sek*1000;
- TextDrawHideForPlayer(playerid, Doors[playerid]);
- TextDrawHideForPlayer(playerid, Informacja[playerid]);
- TextDrawHideForPlayer(playerid, Tiper[playerid]);
- KillTimer(DrzwiTimer[playerid]);
- InfoWyswietla[playerid]=1;
- if(typ == 0)
- {
- TextDrawSetString(Doors[playerid], string);
- TextDrawShowForPlayer(playerid, Doors[playerid]);
- }
- if(typ == 1)
- {
- TextDrawSetString(Informacja[playerid], string);
- TextDrawShowForPlayer(playerid, Informacja[playerid]);
- }
- if(typ == 2)
- {
- TextDrawSetString(Tiper[playerid], string);
- TextDrawShowForPlayer(playerid, Tiper[playerid]);
- PlayerPlaySound(playerid, 1149, 0, 0, 0);
- }
- DrzwiTimer[playerid] = SetTimerEx("InfoBoxHide", czas, 0, "d", playerid);
- return 1;
- }
- Funkcja::ShowPlayerItem(playerid)
- {
- new przedmioty = 0, type[128], Items[1024], info[128];
- for(new nr = 0; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID] && Przedmiot[nr][iAktywny] == 1)
- {
- ListItem[playerid][przedmioty] = nr;
- if(Przedmiot[nr][iUsed] == 1)
- format(type, sizeof(type), "{FFFFFF}%d{FFFFFF}\t%s\t\t{000000}(%d, %d, %dg)",nr, Przedmiot[nr][iNazwa], Przedmiot[nr][iWartosc1], Przedmiot[nr][iWartosc2], Przedmiot[nr][iWaga]);
- else
- format(type, sizeof(type), "{FFFFFF}%d{AAC5E3}\t%s\t\t{000000}(%d, %d, %dg)",nr, Przedmiot[nr][iNazwa], Przedmiot[nr][iWartosc1], Przedmiot[nr][iWartosc2], Przedmiot[nr][iWaga]);
- format(Items, sizeof(Items), "%s%s\n", Items, type);
- przedmioty++;
- }
- }
- if(przedmioty == 0) return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
- format(info, sizeof(info), ""ServName"Przedmioty (%d, %dg/%dg )", przedmioty, ItemWaga(playerid), ItemUdzwig(playerid));
- return dShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, info, Items, "Wybierz", "Opcje");
- }
- Funkcja::Oferta(odkogo, dlakogo, typ, value1, value2, value3)
- {
- return 1;
- }
- Funkcja::InfoBoxHide(playerid)
- {
- if(InfoWyswietla[playerid] == 1)
- {
- TextDrawHideForPlayer(playerid, Doors[playerid]);
- TextDrawHideForPlayer(playerid, Informacja[playerid]);
- TextDrawHideForPlayer(playerid, Tiper[playerid]);
- InfoWyswietla[playerid]=0;
- KillTimer(DrzwiTimer[playerid]);
- }
- return 1;
- }
- Funkcja::UseItem(playerid, uid)
- {
- new typ = Przedmiot[uid][iTyp], used = Przedmiot[uid][iUsed];
- if(Przedmiot[uid][iOwner] != 1 || Przedmiot[uid][iOwnerUID] != Player[playerid][pUID] || Przedmiot[uid][iAktywny] == 0)
- return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
- if(Przedmiot[uid][iFlaga] != 0)
- {
- if(Przedmiot[uid][iFlaga] == 1)
- {
- if(Przedmiot[uid][iFlagaUID] != Player[playerid][pUID])
- return format(String, sizeof(String), "Ten przedmiot jest oflagowany dla gracza o identyfikatorze ~y~%d~w~. Nie mozesz go uzyc.", Przedmiot[uid][iFlagaUID]), InfoBoxShow(2, playerid, String, 3);
- }
- else if(Przedmiot[uid][iFlaga] == 2)
- {
- if(Przedmiot[uid][iFlagaUID] != Sluzba(playerid))
- return format(String, sizeof(String), "Ten przedmiot jest oflagowany dla grupy o identyfikatorze ~y~%d~w~. Nie mozesz go uzyc.", Przedmiot[uid][iFlagaUID]), InfoBoxShow(2, playerid, String, 3);
- }
- }
- if(typ == 1)
- {
- if(used == 0)
- {
- if(GetPVarInt(playerid, "rpBron") != 0)
- return Tip(playerid, "Aktualnie używasz już jakiejś broni.");
- if(Przedmiot[uid][iWartosc2] == 0)
- return Tip(playerid, "Ten przedmiot nie posiada amunicji, zdobądź ją aby go użyć.");
- Przedmiot[uid][iUsed] = 1;
- GivePlayerWeapon(playerid, Przedmiot[uid][iWartosc1], Przedmiot[uid][iWartosc2]);
- format(String, sizeof(String), "* %s wyciąga przedmiot %s.", CharName(playerid), Przedmiot[uid][iNazwa]);
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- SetPVarInt(playerid, "rpBron", Przedmiot[uid][iWartosc1]);
- SetPVarInt(playerid, "rpAmmo", Przedmiot[uid][iWartosc2]);
- SetPVarInt(playerid, "rpBronAC", gettime());
- SetPVarInt(playerid, "rpBronUID", uid);
- }
- else
- {
- new bron[13], amunicja[13];
- for (new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerid, i, bron[i], amunicja[i]);
- if(bron[i] == GetPVarInt(playerid, "rpBron"))
- {
- ResetPlayerWeapons(playerid);
- Przedmiot[uid][iWartosc2] = amunicja[i];
- }
- }
- Przedmiot[uid][iUsed] = 0;
- format(String, sizeof(String), "* %s chowa przedmiot %s.", CharName(playerid), Przedmiot[uid][iNazwa]);
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- ResetPlayerWeapons(playerid);
- SetPVarInt(playerid, "rpBron", 0);
- SetPVarInt(playerid, "rpAmmo", 0);
- SetPVarInt(playerid, "rpBronAC", gettime()+5);
- SetPVarInt(playerid, "rpBronUID", 0);
- RemovePlayerAttachedObject(playerid, ATTACH_SLOT_1);
- }
- }
- else if(typ == 2)
- {
- SetPlayerSkin(playerid, Przedmiot[uid][iWartosc2]);
- Player[playerid][pSkin] = Przedmiot[uid][iWartosc2];
- for (new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID] && Przedmiot[p][iTyp] == 2)
- {
- Przedmiot[p][iUsed] = 0;
- }
- }
- Przedmiot[uid][iUsed] = 1;
- return 1;
- }
- else if(typ == 3)
- {
- if(getHP(playerid) < 10)
- return Info(playerid, "Nie możesz spożyć tego przedmiotu.\nAby dodać HP w tym stanie postaci musisz udać się do szpitala w celu aplikowania medykamentu.");
- }
- else if(typ == 7)
- {
- if(Przedmiot[uid][iUsed] == 0)
- {
- format(String, sizeof(String), "* %s zakłada rękawiczki.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- return Przedmiot[uid][iUsed] = 1;
- }
- else
- {
- format(String, sizeof(String), "* %s ściąga rękawiczki.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- return Przedmiot[uid][iUsed] = 0;
- }
- }
- else if(typ == 8)
- {
- if(Przedmiot[uid][iUsed] == 0)
- {
- format(String, sizeof(String), "* %s zakłada na twarz przedmiot %s.", CharName(playerid), Przedmiot[uid][iNazwa]);
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- Przedmiot[uid][iUsed] = 1;
- return setStatus(playerid, 1);
- }
- else
- {
- format(String, sizeof(String), "* %s ściąga z twarzy przedmiot %s.", CharName(playerid), Przedmiot[uid][iNazwa]);
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- Przedmiot[uid][iUsed] = 0;
- return setStatus(playerid, 0);
- }
- }
- else if(typ == 9)
- {
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- foreach(Player, p)
- {
- if(p != playerid && IsPlayerInRangeOfPoint(p, 5.0, Pos[0], Pos[1], Pos[2]) && Player[p][pBW] >= 1)
- {
- Przedmiot[uid][iAktywny] = 0, ZapiszPrzedmiot(uid);
- format(String, sizeof(String), "* %s aplikuje lek %s.", CharName(playerid), CharName(p));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- Player[p][pBW] = 0;
- return setHP(p, Przedmiot[uid][iWartosc1]);
- }
- }
- return Info(playerid, "W pobliżu nie ma żadnego gracza w stanie BW.");
- }
- else if(typ == 13)
- {
- new Itemy[1024], Item[128], list = 1;
- for(new p = 0; p < MAX_ITEM; p++)
- {
- SetPVarInt(playerid, "AmunicjaUID", uid);
- if(uid != p && Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[p][iWartosc1] == Przedmiot[uid][iWartosc1])
- {
- format(Item, sizeof(Item), "%d\t\t%dg\t\t%s", p, Przedmiot[p][iWaga], Przedmiot[p][iNazwa]);
- format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
- ListItem[playerid][list] = p;
- list++;
- }
- }
- }
- if(list == 1) return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
- format(Itemy, sizeof(Itemy), "%s", Itemy);
- return dShowPlayerDialog(playerid, 101, DIALOG_STYLE_LIST, ""ServName"Przedmioty", Itemy, "Podnies", "Anuluj");
- }
- else if(typ == 16)
- {
- if(Przedmiot[uid][iUsed] == 0)
- {
- InfoBoxShow(2, playerid, "Telefon zostal ~g~uruchomiony~w~.", 3);
- for(new p = 0; p < MAX_ITEM; p++)
- {
- //resetowanie innych urządzeń
- if(uid != p && Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[p][iTyp] == 18 && Przedmiot[p][iUsed] == 1)
- {
- Przedmiot[p][iUsed] = 0;
- InfoBoxShow(2, playerid, "Uruchamiajac ten telefon wylaczyles pozostale ~y~urzadzenia~w~.", 3);
- }
- }
- }
- Player[playerid][pTelefon] = Przedmiot[uid][iWartosc1];
- Przedmiot[uid][iUsed] = 1;
- return ZapiszPrzedmiot(uid);
- }
- InfoBoxShow(2, playerid, "Telefon zostal ~r~wylaczony~w~.", 3);
- Player[playerid][pTelefon] = 0;
- Przedmiot[uid][iUsed] = 0;
- return ZapiszPrzedmiot(uid);
- }
- /* else if(typ == 19)
- {
- new Itemy[1024], Item[128], list = 1;
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(uid != p && Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 5 && Przedmiot[p][iOwnerUID] == uid)
- {
- format(Item, sizeof(Item), "%d\t\t%dg\t\t%s", p, Przedmiot[p][iWaga], Przedmiot[p][iNazwa]);
- format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
- ListItem[playerid][list] = p;
- list++;
- }
- }
- if(list == 1) return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
- format(Itemy, sizeof(Itemy), "%s", Itemy);
- return dShowPlayerDialog(playerid, 101, DIALOG_STYLE_LIST, ""ServName"Przedmioty", Itemy, "Wyjmij", "Anuluj");
- } // torba
- */
- else if(typ == 19)
- {
- if(Przedmiot[uid][iUsed] == 0)
- {
- new Attach = 0;
- if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_2) && Attach == 0)
- {
- SetPVarInt(playerid, "rpFishSlot", 2);
- Attach = 2;
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_2, 18632, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- EditAttachedObject(playerid, ATTACH_SLOT_2);
- }
- if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_3) && Attach == 0)
- {
- SetPVarInt(playerid, "rpFishSlot", 3);
- Attach = 3;
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_3, 18632, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- EditAttachedObject(playerid, ATTACH_SLOT_3);
- }
- if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_4) && Attach == 0)
- {
- SetPVarInt(playerid, "rpFishSlot", 4);
- Attach = 4;
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_4, 18632, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- EditAttachedObject(playerid, ATTACH_SLOT_4);
- }
- if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_5) && Attach == 0)
- {
- SetPVarInt(playerid, "rpFishSlot", 5);
- Attach = 5;
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_5, 18632, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- EditAttachedObject(playerid, ATTACH_SLOT_5);
- }
- if(Attach == 0)
- return Info(playerid, "Wykorzystałeś limit doczepionych do ciała obiektów.");
- Przedmiot[uid][iUsed] = 1;
- InfoBoxShow(2, playerid, "Uzyj ~y~edytora~w~ pozycji obiektu doczepianego w celu idealnego przypasowania do swojej postaci.", 5);
- return ZapiszPrzedmiot(uid);
- }
- RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "rpFishSlot"));
- Przedmiot[uid][iUsed] = 0;
- return ZapiszPrzedmiot(uid);
- }
- else if(typ == 20)
- {
- new veh = Przedmiot[uid][iWartosc1];
- for(new v = 1; v < MAX_POJAZDY; v++)
- {
- new file[40];
- format(file, sizeof(file), "Pojazdy/%d.ini", v);
- if(Pojazd[v][vAktywny] == 0 && !DOF2_FileExists(file))
- {
- Pojazd[v][vAktywny] = 1;
- Pojazd[v][vModel] = veh;
- if(Przedmiot[uid][iFlaga] == 1)
- {
- Pojazd[v][vOwner] = 1;
- Pojazd[v][vOwnerUID] = Przedmiot[uid][iFlagaUID];
- }
- if(Przedmiot[uid][iFlaga] == 2)
- {
- Pojazd[v][vOwner] = 2;
- Pojazd[v][vOwnerUID] = Przedmiot[uid][iFlagaUID];
- }
- Pojazd[v][vKolor1] = random(252);
- Pojazd[v][vKolor2] = random(252);
- Pojazd[v][vPrzebieg] = 0.0;
- Pojazd[v][vHP] = 1000.0;
- GetPlayerPos(playerid, Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ]);
- GetPlayerFacingAngle(playerid, Pojazd[v][vRot]);
- Pojazd[v][vVir] = GetPlayerVirtualWorld(playerid);
- Pojazd[v][vReje] = 0;
- Pojazd[v][vPanels] = 0;
- Pojazd[v][vDoors] = 0;
- Pojazd[v][vLights] = 0;
- Pojazd[v][vTires] = 0;
- Pojazd[v][vPaliwoTyp] = 1;
- Pojazd[v][vPaliwo] = PaliwoMax(veh);
- Pojazd[v][vPaliwoMax] = PaliwoMax(veh);
- //tworzenie
- PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
- Pojazd[v][vSpawn] = 1;
- PojazdUID[PojazdModel[v]] = v;
- if(Pojazd[v][vReje] == 0)
- {
- SetVehicleNumberPlate(PojazdModel[v], " ");
- }
- else if(Pojazd[v][vReje] == 1)
- {
- format(String, sizeof(String), "SA %04d", v);
- SetVehicleNumberPlate(PojazdModel[v], String);
- }
- SetVehicleToRespawn(PojazdModel[v]);
- UstawParametryPojazdu(PojazdModel[v]);
- format(String, sizeof(String), "Utworzono pojazd ~y~%s~w~ (UID: %d) jako ~r~Gracz~w~. Powinien sie on zespawnowac w okolicy Magazynu Pojazdow, wskazowka dojazdu jest marker.", GetVehicleName(v), v);
- InfoBoxShow(2, playerid, String, 3);
- Przedmiot[uid][iAktywny] = 0, ZapiszPrzedmiot(uid);
- ZapiszPojazd(PojazdModel[v]);
- break;
- }
- }
- return 1;
- }
- else if(typ == 23)
- {
- if(Przedmiot[uid][iUsed] == 0)
- {
- new Attach = 0;
- if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_2) && Attach == 0)
- {
- SetPVarInt(playerid, "rpBagSlot", 2);
- Attach = 2;
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_2, 1210, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- EditAttachedObject(playerid, ATTACH_SLOT_2);
- }
- if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_3) && Attach == 0)
- {
- SetPVarInt(playerid, "rpBagSlot", 3);
- Attach = 3;
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_3, 1210, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- EditAttachedObject(playerid, ATTACH_SLOT_3);
- }
- if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_4) && Attach == 0)
- {
- SetPVarInt(playerid, "rpBagSlot", 4);
- Attach = 4;
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_4, 1210, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- EditAttachedObject(playerid, ATTACH_SLOT_4);
- }
- if(!IsPlayerAttachedObjectSlotUsed(playerid, ATTACH_SLOT_5) && Attach == 0)
- {
- SetPVarInt(playerid, "rpBagSlot", 5);
- Attach = 5;
- SetPlayerAttachedObject(playerid, ATTACH_SLOT_5, 1210, 6, 0.079376, 0.037070, 0.007706, 181.482910, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- EditAttachedObject(playerid, ATTACH_SLOT_5);
- }
- if(Attach == 0)
- return Info(playerid, "Wykorzystałeś limit doczepionych do ciała obiektów.");
- Przedmiot[uid][iUsed] = 1;
- InfoBoxShow(2, playerid, "Uzyj ~y~edytora~w~ pozycji obiektu doczepianego w celu idealnego przypasowania do swojej postaci.", 5);
- return ZapiszPrzedmiot(uid);
- }
- RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "rpBagSlot"));
- Przedmiot[uid][iUsed] = 0;
- return ZapiszPrzedmiot(uid);
- }
- return 1;
- }
- public OnPlayerPickUpDynamicPickup(playerid, pickupid)
- {
- new info[128];
- for(new i = 0; i <= MAX_DRZWI; i++)
- {
- if(pickupid == DrzwiPickup[i])
- {
- if(Drzwi[i][dAktywne] == 1)
- {
- new adm[16], enter_pay[32];
- if(Drzwi[i][dStatus] == 0){ info= "~y~Aby wejsc, wcisnij jednoczesnie~n~~w~[~b~~h~~h~~k~~SNEAK_ABOUT~ + ~k~~PED_SPRINT~~w~]"; }
- else if(Drzwi[i][dStatus] == 1){ info= "~r~Drzwi sa zamkniete"; }
- if(IPB[playerid][ipb_Grupa] == 4)
- format(adm, sizeof(adm), " ~w~(UID: %d)", i);
- format(enter_pay, sizeof(enter_pay), "_");
- if(Drzwi[i][dCreatePrice] != 0)
- {
- format(String, sizeof(String), "Te drzwi nie zostały jeszcze kupione.\nUżyj komendy /drzwi w celu dokonania zakupu.\nCena drzwi:\t\t$%d", Drzwi[i][dCreatePrice]);
- Info(playerid, String);
- format(enter_pay, sizeof(enter_pay), "~w~~n~Koszt drzwi: ~g~$%d~n~", Drzwi[i][dCreatePrice]);
- }
- format(String, sizeof(String), "%s%s~n~%s~n~%s", Drzwi[i][dNazwa], adm, enter_pay, info);
- return InfoBoxShow(0,playerid,String,6);
- }
- }
- }
- return 1;
- }
- public OnDynamicObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
- {
- new rotacja[200], obiekty[500];
- format(rotacja, sizeof(rotacja), "~n~~b~~h~~h~Rotacja X: ~w~%.2f ~b~~h~~h~Rotacja Y: ~w~%.2f ~b~~h~~h~Rotacja Z: ~w~%.2f", rx, ry, rz);
- format(obiekty, sizeof(obiekty), "~y~Edytor obiektow.~n~~b~~h~~h~Edytowany obiekt: ~w~%d ~b~~h~~h~VirtualWorld: ~w~%d~n~~b~~h~~h~Pozycja X: ~w~%.2f ~b~~h~~h~Pozycja Y: ~w~%.2f ~b~~h~~h~Pozycja Z: ~w~%.2f%s", Obiekt(playerid), Obiekt[Obiekt(playerid)][oVir], x, y, z, rotacja);
- InfoBoxShow(1, playerid, obiekty, 60);
- if(response == 0)
- {
- InfoBoxShow(1, playerid, " ", 1);
- CancelEdit(playerid), SetPVarInt(playerid, "objectedit", 0);
- SetDynamicObjectPos(MapObiekt[objectid], Obiekt[MapObiekt[objectid]][oPosX], Obiekt[MapObiekt[objectid]][oPosY], Obiekt[MapObiekt[objectid]][oPosZ]);
- SetDynamicObjectRot(MapObiekt[objectid], Obiekt[MapObiekt[objectid]][oRotX], Obiekt[MapObiekt[objectid]][oRotY], Obiekt[MapObiekt[objectid]][oRotZ]);
- setObiekt(playerid, 0);
- }
- else if(response == 1)
- {
- InfoBoxShow(1, playerid, " ", 1);
- CancelEdit(playerid), SetPVarInt(playerid, "objectedit", 0);
- Obiekt[MapObiekt[objectid]][oPosX] = x, Obiekt[MapObiekt[objectid]][oPosY] = y, Obiekt[MapObiekt[objectid]][oPosZ] = z;
- Obiekt[MapObiekt[objectid]][oRotX] = rx, Obiekt[MapObiekt[objectid]][oRotY] = ry, Obiekt[MapObiekt[objectid]][oRotZ] = rz;
- SetDynamicObjectPos(MapObiekt[objectid], x, y, z);
- SetDynamicObjectRot(MapObiekt[objectid], rx, ry, rz);
- ZapiszObiekt(MapObiekt[objectid]);
- setObiekt(playerid, 0);
- }
- else if(response == 3)
- {
- Tip(playerid, "response 3");
- Obiekt[MapObiekt[objectid]][oPosX] = x, Obiekt[MapObiekt[objectid]][oPosY] = y, Obiekt[MapObiekt[objectid]][oPosZ] = z;
- Obiekt[MapObiekt[objectid]][oRotX] = rx, Obiekt[MapObiekt[objectid]][oRotY] = ry, Obiekt[MapObiekt[objectid]][oRotZ] = rz;
- Obiekt[MapObiekt[objectid]][oGateX] = x, Obiekt[MapObiekt[objectid]][oGateY] = y, Obiekt[MapObiekt[objectid]][oGateZ] = z;
- Obiekt[MapObiekt[objectid]][oGateRotX] = rx, Obiekt[MapObiekt[objectid]][oGateRotY] = ry, Obiekt[MapObiekt[objectid]][oGateRotZ] = rz;
- SetDynamicObjectPos(MapObiekt[objectid], x, y, z);
- SetDynamicObjectRot(MapObiekt[objectid], rx, ry, rz);
- ZapiszObiekt(MapObiekt[objectid]);
- }
- return 1;
- }
- public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
- {
- setObiekt(playerid, MapObiekt[objectid]);
- return EditDynamicObject(playerid, MapObiekt[objectid]);
- }
- Funkcja::DodajPrzedmiot(playerid, Nazwa[], Typ, Wartosc1, Wartosc2, Owner1, Owner2, Waga)
- {
- new nr;
- for(nr = 1; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 0)
- {
- Przedmiot[nr][iAktywny] = 1;
- Przedmiot[nr][iTyp] = Typ;
- Przedmiot[nr][iWartosc1] = Wartosc1;
- Przedmiot[nr][iWartosc2] = Wartosc2;
- Przedmiot[nr][iOwner] = Owner1;
- Przedmiot[nr][iOwnerUID] = Owner2;
- Przedmiot[nr][iWaga] = Waga;
- Przedmiot[nr][iUsed] = 0;
- Przedmiot[nr][iVir] = GetPlayerVirtualWorld(playerid);
- strmid(Przedmiot[nr][iNazwa], Nazwa, 0, 64, 64);
- if(Owner1 == 7)
- {
- new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- Przedmiot[nr][iPosX] = Pos[0];
- Przedmiot[nr][iPosY] = Pos[1];
- Przedmiot[nr][iPosZ] = Pos[2]-0.95;
- ItemObiekt[nr] = CreateDynamicObject(GetItemModel(nr), Przedmiot[nr][iPosX], Przedmiot[nr][iPosY], Przedmiot[nr][iPosZ], ItemRotX(nr), 0, 0, GetPlayerVirtualWorld(playerid));
- }
- ZapiszPrzedmiot(nr);
- break;
- }
- }
- return 1;
- }
- CarUID(vehicle)
- {
- new vuid = PojazdUID[vehicle];
- return vuid;
- }
- stock GetPlayerSpeed(playerid)
- {
- new Float:vx,Float:vy,Float:vz,Float:vpredkosc;
- if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz); else GetPlayerVelocity(playerid,vx,vy,vz);
- vpredkosc=floatsqroot((vx*vx)+(vy*vy)+(vz*vz))*198;
- return floatround(vpredkosc);
- }
- stock mysql_check()
- {
- if(mysql_ping() == (-1))
- {
- print("[MySQL] Utracono połączenie. Ponawiam... [Próba: 1/3]");
- mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
- if(!mysql_reload())
- {
- print("[MySQL] Próba nie powiodła się, ponawiam... [Próba: 2/3]");
- if(!mysql_reload())
- {
- print("[MySQL] Próba nie powiodła się, ponawiam... [Próba: 3/3]");
- if(!mysql_reload())
- {
- print("[MySQL] Próba nie powiodła się. [Zakończono]");
- SendRconCommand("hostname [RolePlay] Błąd bazy danych, zaczekaj...");
- SendRconCommand("password pass000");
- SetGameModeText("[MySQL] Failed Connect");
- }
- else print("[MySQL] Połączenie powiodło się.");
- }
- else print("[MySQL] Połączenie powiodło się.");
- }
- else print("[MySQL] Połączenie powiodło się.");
- }
- return 1;
- }
- //Moduły RolePlay
- Funkcja::PayDay(uid)
- {
- new file[64], PlayerData[13] = 0, PD = 0;
- format(file, sizeof(file), "Gracze/%d.ini", uid);
- if(DOF2_FileExists(file))
- {
- //pobieranie gotówki
- PlayerData[0] = DOF2_GetInt(file, "Bank");
- //pobieranie przynależności
- PlayerData[1] = DOF2_GetInt(file, "Grupa1");
- PlayerData[2] = DOF2_GetInt(file, "Grupa2");
- PlayerData[3] = DOF2_GetInt(file, "Grupa3");
- PlayerData[4] = DOF2_GetInt(file, "Grupa4");
- PlayerData[5] = DOF2_GetInt(file, "Grupa5");
- //pobieranie kwoty wypłaty
- PlayerData[6] = DOF2_GetInt(file, "GrupaPayDay1");
- PlayerData[7] = DOF2_GetInt(file, "GrupaPayDay2");
- PlayerData[8] = DOF2_GetInt(file, "GrupaPayDay3");
- PlayerData[9] = DOF2_GetInt(file, "GrupaPayDay4");
- PlayerData[10] = DOF2_GetInt(file, "GrupaPayDay5");
- //inne
- PlayerData[11] = DOF2_GetInt(file, "OwnerUID");
- PlayerData[12] = DOF2_GetInt(file, "PayDayGame");
- }
- else
- {
- return 1;
- }
- DOF2_SetInt(file, "PayDayGame", 0), DOF2_SaveFile();
- if(PlayerData[12] >= 1800)// Blokujemy nadanie wypłaty dla osoby, która w danym dniu nie przegrała 30 minut.
- {
- if(PlayerData[1] != 0 && Grupa[PlayerData[1]][gAktywna] == 1)
- {
- if(PlayerData[6] <= Grupa[PlayerData[1]][gPayDay])
- {
- PD += PlayerData[6];
- }
- }
- if(PlayerData[2] != 0 && Grupa[PlayerData[2]][gAktywna] == 1)
- {
- if(PlayerData[7] <= Grupa[PlayerData[2]][gPayDay])
- {
- PD += PlayerData[7];
- }
- }
- if(PlayerData[3] != 0 && Grupa[PlayerData[3]][gAktywna] == 1)
- {
- if(PlayerData[8] <= Grupa[PlayerData[3]][gPayDay])
- {
- PD += PlayerData[8];
- }
- }
- if(PlayerData[4] != 0 && Grupa[PlayerData[4]][gAktywna] == 1)
- {
- if(PlayerData[9] <= Grupa[PlayerData[4]][gPayDay])
- {
- PD += PlayerData[9];
- }
- }
- if(PlayerData[5] != 0 && Grupa[PlayerData[5]][gAktywna] == 1)
- {
- if(PlayerData[10] <= Grupa[PlayerData[5]][gPayDay])
- {
- PD += PlayerData[10];
- }
- }
- if(PD == 0)
- return DOF2_SetInt(file, "Bank", PlayerData[0]+200), DOF2_SaveFile();
- if(PD < 1500)
- PlayerData[0] += PD;
- else
- PlayerData[0] += 1500, PD = 1500;
- //wysyłamy rekord do MySQL
- new query[256];
- format(query, sizeof(query), "INSERT INTO `1payday` (`global`,`char`,`paydayplus`,`paydayminus`,`data`) VALUES ('%d', %d, '%d', '%d', '%d')", PlayerData[11], uid, PD, 0, gettime());
- mysql_query_ex(query);
- //kończymy wysyłanie insertu do MySQL
- printf("System przydzielil graczu %d $%d wyplaty, nowy stan konta to $%d.", uid, PD, PlayerData[0]);
- return DOF2_SetInt(file, "Bank", PlayerData[0]), DOF2_SaveFile();
- }
- return 1;
- }
- Funkcja::Wczytaj_Pojazdy()
- {
- new file[40];
- for(new v = 1; v < MAX_POJAZDY; v++)
- {
- format(file,sizeof(file), "Pojazdy/%d.ini", v);
- if(DOF2_FileExists(file))
- {
- Pojazd[v][vAktywny] = DOF2_GetInt(file, "Aktywny");
- Pojazd[v][vModel] = DOF2_GetInt(file, "Model");
- Pojazd[v][vOwner] = DOF2_GetInt(file, "Owner");
- Pojazd[v][vOwnerUID] = DOF2_GetInt(file, "OwnerUID");
- Pojazd[v][vKolor1] = DOF2_GetInt(file, "Kolor1");
- Pojazd[v][vKolor2] = DOF2_GetInt(file, "Kolor2");
- Pojazd[v][vPrzebieg] = DOF2_GetFloat(file, "Przebieg");
- Pojazd[v][vHP] = DOF2_GetFloat(file, "HP");
- Pojazd[v][vPosX] = DOF2_GetFloat(file, "PosX");
- Pojazd[v][vPosY] = DOF2_GetFloat(file, "PosY");
- Pojazd[v][vPosZ] = DOF2_GetFloat(file, "PosZ");
- Pojazd[v][vRot] = DOF2_GetFloat(file, "Rot");
- Pojazd[v][vVir] = DOF2_GetInt(file, "Vir");
- Pojazd[v][vReje] = DOF2_GetInt(file, "Reje");
- Pojazd[v][vPanels] = DOF2_GetInt(file, "Panels");
- Pojazd[v][vDoors] = DOF2_GetInt(file, "Doors");
- Pojazd[v][vLights] = DOF2_GetInt(file, "Lights");
- Pojazd[v][vTires] = DOF2_GetInt(file, "Tires");
- Pojazd[v][vPaliwoTyp] = DOF2_GetInt(file, "PaliwoTyp");
- Pojazd[v][vPaliwo] = DOF2_GetFloat(file, "Paliwo");
- Pojazd[v][vPaliwoMax] = DOF2_GetFloat(file, "PaliwoMax");
- if(Pojazd[v][vAktywny] == 1)
- {
- new query[256];
- format(query, sizeof(query), "INSERT INTO `1veh` (`uid`,`model`,`marka`,`owner`,`owner_uid`,`HP`,`przebieg`) VALUES ('%d', '%d', '%s', '%d', '%d', %f, %f)", v, Pojazd[v][vModel], GetVehicleName(v), Pojazd[v][vOwner], Pojazd[v][vOwnerUID], Pojazd[v][vHP], Pojazd[v][vPrzebieg]);
- mysql_query_ex(query);
- }
- if(Pojazd[v][vAktywny] == 1 && Pojazd[v][vOwner] == 2)
- {
- StatsVeh++;
- if(Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn] < Grupa[Pojazd[v][vOwnerUID]][gVehLimit])
- {
- Pojazd[v][vSpawn] = 1;
- PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
- GetVehiclePos(PojazdModel[v], VehicleLastPos[PojazdModel[v]][0], VehicleLastPos[PojazdModel[v]][1], VehicleLastPos[PojazdModel[v]][2]);
- GetVehicleZAngle(PojazdModel[v], VehicleLastPos[PojazdModel[v]][3]);
- PojazdUID[PojazdModel[v]] = v;
- /* if(Pojazd[v][vOwner] == 2 && Grupa[Pojazd[v][vOwnerUID]][gAktywna] == 0)
- {
- Pojazd[v][vAktywny] = 0;
- ZapiszPojazd(PojazdModel[v]);
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 8 && Przedmiot[p][iOwnerUID] == v && Przedmiot[p][iTyp] == 5)
- {
- ZapiszPrzedmiot(p);
- }
- }
- DestroyVehicle(PojazdModel[v]);
- printf("[veh][deleted] %s (UID: %d, sampID: %d) zostal skasowany, poniewaz grupa (UID: %d) zostala usunieta.", GetVehicleName(v), v, PojazdModel[v], Pojazd[v][vOwnerUID]);
- }
- */
- if(Pojazd[v][vReje] == 0)
- {
- SetVehicleNumberPlate(PojazdModel[v], " ");
- }
- else if(Pojazd[v][vReje] == 1)
- {
- format(String, sizeof(String), "SA %04d", v);
- SetVehicleNumberPlate(PojazdModel[v], String);
- }
- SetVehicleToRespawn(PojazdModel[v]);
- UstawParametryPojazdu(PojazdModel[v]);
- UpdateVehicleDamageStatus(PojazdModel[v], Pojazd[v][vPanels], Pojazd[v][vDoors], Pojazd[v][vLights], Pojazd[v][vTires]);
- Grupa[Pojazd[v][vOwnerUID]][gVehLimitSpawn]++;
- }
- }
- else
- {
- Pojazd[v][vSpawn] = 0;
- }
- }
- }
- return 1;
- }
- Funkcja::ZapiszPojazd(vehicleid)
- {
- if(vehicleid < 1 || vehicleid > MAX_VEHICLES) return 1;
- new file[40], veh = CarUID(vehicleid);
- format(file, sizeof(file), "Pojazdy/%d.ini", veh);
- //nadpisywanie
- GetVehicleHealth(vehicleid, Pojazd[veh][vHP]);
- Pojazd[veh][vVir] = GetVehicleVirtualWorld(vehicleid);
- Pojazd[veh][vModel] = GetVehicleModel(vehicleid);
- new panels1, doors1, lights1, tires1;
- GetVehicleDamageStatus(vehicleid, panels1, doors1, lights1, tires1);
- if(Pojazd[veh][vPanels] < panels1)
- {
- Pojazd[veh][vPanels] = panels1;
- }
- if(Pojazd[veh][vDoors] < doors1)
- {
- Pojazd[veh][vDoors] = doors1;
- }
- if(Pojazd[veh][vLights] < lights1)
- {
- Pojazd[veh][vLights] = lights1;
- }
- if(Pojazd[veh][vTires] < tires1)
- {
- Pojazd[veh][vTires] = tires1;
- }
- //
- if(DOF2_FileExists(file))
- {
- DOF2_SetInt(file, "Aktywny", Pojazd[veh][vAktywny]);
- DOF2_SetInt(file, "Model", Pojazd[veh][vModel]);
- DOF2_SetInt(file, "Owner", Pojazd[veh][vOwner]);
- DOF2_SetInt(file, "OwnerUID", Pojazd[veh][vOwnerUID]);
- DOF2_SetInt(file, "Kolor1", Pojazd[veh][vKolor1]);
- DOF2_SetInt(file, "Kolor2", Pojazd[veh][vKolor2]);
- DOF2_SetFloat(file, "Przebieg", Pojazd[veh][vPrzebieg]);
- DOF2_SetFloat(file, "HP", Pojazd[veh][vHP]);
- DOF2_SetFloat(file, "PosX", Pojazd[veh][vPosX]);
- DOF2_SetFloat(file, "PosY", Pojazd[veh][vPosY]);
- DOF2_SetFloat(file, "PosZ", Pojazd[veh][vPosZ]);
- DOF2_SetFloat(file, "Rot", Pojazd[veh][vRot] );
- DOF2_SetInt(file, "Vir", Pojazd[veh][vVir]);
- DOF2_SetInt(file, "Reje", Pojazd[veh][vReje]);
- DOF2_SetInt(file, "Panels", Pojazd[veh][vPanels]);
- DOF2_SetInt(file, "Doors", Pojazd[veh][vDoors]);
- DOF2_SetInt(file, "Lights", Pojazd[veh][vLights]);
- DOF2_SetInt(file, "Tires", Pojazd[veh][vTires]);
- DOF2_SetInt(file, "PaliwoTyp",Pojazd[veh][vPaliwoTyp]);
- DOF2_SetFloat(file, "Paliwo", Pojazd[veh][vPaliwo]);
- DOF2_SetFloat(file, "PaliwoMax",Pojazd[veh][vPaliwoMax]);
- DOF2_SetInt(file, "Blokada" ,Pojazd[veh][vBlokada]);
- DOF2_SetString(file,"BlokadaText",Pojazd[veh][vBlokadaText]);
- DOF2_SaveFile();
- }
- else
- {
- DOF2_CreateFile(file);
- DOF2_SetInt(file, "Aktywny", Pojazd[veh][vAktywny]);
- DOF2_SetInt(file, "Model", Pojazd[veh][vModel]);
- DOF2_SetInt(file, "Owner", Pojazd[veh][vOwner]);
- DOF2_SetInt(file, "OwnerUID", Pojazd[veh][vOwnerUID]);
- DOF2_SetInt(file, "Kolor1", Pojazd[veh][vKolor1]);
- DOF2_SetInt(file, "Kolor2", Pojazd[veh][vKolor2]);
- DOF2_SetFloat(file, "Przebieg", Pojazd[veh][vPrzebieg]);
- DOF2_SetFloat(file, "HP", Pojazd[veh][vHP]);
- DOF2_SetFloat(file, "PosX", Pojazd[veh][vPosX]);
- DOF2_SetFloat(file, "PosY", Pojazd[veh][vPosY]);
- DOF2_SetFloat(file, "PosZ", Pojazd[veh][vPosZ]);
- DOF2_SetFloat(file, "Rot", Pojazd[veh][vRot] );
- DOF2_SetInt(file, "Vir", Pojazd[veh][vVir]);
- DOF2_SetInt(file, "Reje", Pojazd[veh][vReje]);
- DOF2_SetInt(file, "Panels", Pojazd[veh][vPanels]);
- DOF2_SetInt(file, "Doors", Pojazd[veh][vDoors]);
- DOF2_SetInt(file, "Lights", Pojazd[veh][vLights]);
- DOF2_SetInt(file, "Tires", Pojazd[veh][vTires]);
- DOF2_SetInt(file, "PaliwoTyp",Pojazd[veh][vPaliwoTyp]);
- DOF2_SetFloat(file, "Paliwo", Pojazd[veh][vPaliwo]);
- DOF2_SetFloat(file, "PaliwoMax",Pojazd[veh][vPaliwoMax]);
- DOF2_SetInt(file, "Blokada" ,Pojazd[veh][vBlokada]);
- DOF2_SetString(file,"BlokadaText",Pojazd[veh][vBlokadaText]);
- DOF2_SaveFile();
- }
- return 1;//printf("Zapisano: %s (UID: %d, sampID: %d)", GetVehicleName(veh), veh, vehicleid);
- }
- Funkcja::UstawParametryPojazdu(vehicleid)
- {
- SetVehicleHealth(vehicleid, Pojazd[CarUID(vehicleid)][vHP]);
- SetVehicleVirtualWorld(vehicleid, Pojazd[CarUID(vehicleid)][vVir]);
- //Dodawanie tuningu
- new tune = 0;
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 8 && Przedmiot[p][iOwnerUID] == CarUID(vehicleid) && Przedmiot[p][iTyp] == 5)
- {
- if(tune < 14)
- {
- tune++;
- VehTune[vehicleid][tune] = Przedmiot[p][iWartosc2], AddVehicleComponent(vehicleid, Przedmiot[p][iWartosc2]);
- }
- }
- }
- return UpdateVehicleDamageStatus(vehicleid, Pojazd[CarUID(vehicleid)][vPanels], Pojazd[CarUID(vehicleid)][vDoors], Pojazd[CarUID(vehicleid)][vLights], Pojazd[CarUID(vehicleid)][vTires]);
- }
- Funkcja::NadpiszParametryPojazdu(vehicleid)
- {
- new v = CarUID(vehicleid);
- GetVehicleHealth(vehicleid, Pojazd[v][vHP]);
- Pojazd[v][vVir] = GetVehicleVirtualWorld(vehicleid);
- return 1;//ZapiszPojazd(v);
- }
- Funkcja::Wczytaj_Obiekty()
- {
- new file[40];
- for(new nr = 0; nr < MAX_OBIEKT; nr++)
- {
- format(file,sizeof(file),"Obiekty/%d.ini",nr);
- if(DOF2_FileExists(file))
- {
- Obiekt[nr][oAktywny] = DOF2_GetInt(file, "Aktywny");
- Obiekt[nr][oModel] = DOF2_GetInt(file, "Model");
- Obiekt[nr][oVir] = DOF2_GetInt(file, "Vir");
- Obiekt[nr][oTyp] = DOF2_GetInt(file, "Typ");
- Obiekt[nr][oPosX] = DOF2_GetFloat(file, "PosX");
- Obiekt[nr][oPosY] = DOF2_GetFloat(file, "PosY");
- Obiekt[nr][oPosZ] = DOF2_GetFloat(file, "PosZ");
- Obiekt[nr][oRotX] = DOF2_GetFloat(file, "RotX");
- Obiekt[nr][oRotY] = DOF2_GetFloat(file, "RotY");
- Obiekt[nr][oRotZ] = DOF2_GetFloat(file, "RotZ");
- //tekstury
- Obiekt[nr][oMatIndex] = DOF2_GetInt(file, "MatIndex");
- Obiekt[nr][oMatModel] = DOF2_GetInt(file, "MatModel");
- Obiekt[nr][oMatTxdname] = DOF2_GetString(file, "MatTxdname");
- Obiekt[nr][oMatTexture] = DOF2_GetString(file, "MatTexture");
- if(Obiekt[nr][oAktywny] == 1)
- {
- StatsObj++;
- MapObiekt[nr] = CreateDynamicObject(Obiekt[nr][oModel], Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ], Obiekt[nr][oRotX], Obiekt[nr][oRotY], Obiekt[nr][oRotZ], Obiekt[nr][oVir]);
- SetDynamicObjectMaterial(nr, Obiekt[nr][oMatIndex], Obiekt[nr][oMatModel], Obiekt[nr][oMatTxdname], Obiekt[nr][oMatTexture], 0xFFFFFFFF);
- }
- }
- else
- {
- Obiekt[nr][oAktywny] = 0;
- }
- }
- return 1;
- }
- Funkcja::ZapiszObiekt(nr)
- {
- if(nr < 1 || nr > MAX_OBIEKT) return 1;
- new file[40];
- format(file,sizeof(file),"Obiekty/%d.ini",nr);
- if(DOF2_FileExists(file))
- {
- DOF2_SetInt(file, "Aktywny", Obiekt[nr][oAktywny]);
- DOF2_SetInt(file, "Model", Obiekt[nr][oModel]);
- DOF2_SetInt(file, "Vir", Obiekt[nr][oVir]);
- DOF2_SetInt(file, "Typ", Obiekt[nr][oTyp]);
- DOF2_SetFloat(file, "PosX", Obiekt[nr][oPosX]);
- DOF2_SetFloat(file, "PosY", Obiekt[nr][oPosY]);
- DOF2_SetFloat(file, "PosZ", Obiekt[nr][oPosZ]);
- DOF2_SetFloat(file, "RotX", Obiekt[nr][oRotX]);
- DOF2_SetFloat(file, "RotY", Obiekt[nr][oRotY]);
- DOF2_SetFloat(file, "RotZ", Obiekt[nr][oRotZ]);
- //tekstury
- DOF2_SetInt(file, "MatIndex", Obiekt[nr][oMatIndex]);
- DOF2_SetInt(file, "MatModel", Obiekt[nr][oMatModel]);
- DOF2_SetString(file, "MatTxdname", Obiekt[nr][oMatTxdname]);
- DOF2_SetString(file, "MatTexture", Obiekt[nr][oMatTexture]);
- DOF2_SaveFile();
- }
- else
- {
- DOF2_CreateFile(file);
- DOF2_SetInt(file, "Aktywny", Obiekt[nr][oAktywny]);
- DOF2_SetInt(file, "Model", Obiekt[nr][oModel]);
- DOF2_SetInt(file, "Vir", Obiekt[nr][oVir]);
- DOF2_SetInt(file, "Typ", Obiekt[nr][oTyp]);
- DOF2_SetFloat(file, "PosX", Obiekt[nr][oPosX]);
- DOF2_SetFloat(file, "PosY", Obiekt[nr][oPosY]);
- DOF2_SetFloat(file, "PosZ", Obiekt[nr][oPosZ]);
- DOF2_SetFloat(file, "RotX", Obiekt[nr][oRotX]);
- DOF2_SetFloat(file, "RotY", Obiekt[nr][oRotY]);
- DOF2_SetFloat(file, "RotZ", Obiekt[nr][oRotZ]);
- //tekstury
- DOF2_SetInt(file, "MatIndex", Obiekt[nr][oMatIndex]);
- DOF2_SetInt(file, "MatModel", Obiekt[nr][oMatModel]);
- DOF2_SetString(file, "MatTxdname", Obiekt[nr][oMatTxdname]);
- DOF2_SetString(file, "MatTexture", Obiekt[nr][oMatTexture]);
- DOF2_SaveFile();
- }
- return 1;
- }
- Funkcja::Restart()
- {
- return SendRconCommand("gmx");
- }
- Funkcja::Wczytaj_Drzwi()
- {
- new file[40], query[512];
- for(new nr = 0; nr < MAX_DRZWI; nr++)
- {
- format(file,sizeof(file),"Drzwi/%d.ini",nr);
- if(DOF2_FileExists(file))
- {
- Drzwi[nr][dAktywne] = DOF2_GetInt(file, "Aktywne");
- Drzwi[nr][dOwner] = DOF2_GetInt(file, "Owner");
- Drzwi[nr][dOwnerUID] = DOF2_GetInt(file, "OwnerUID");
- Drzwi[nr][dWewVir] = DOF2_GetInt(file, "WewVir");
- Drzwi[nr][dZewVir] = DOF2_GetInt(file, "ZewVir");
- Drzwi[nr][dPickup] = DOF2_GetInt(file, "Pickup");
- Drzwi[nr][dObiekty] = DOF2_GetInt(file, "Obiekty");
- Drzwi[nr][dNazwa] = DOF2_GetString(file, "Nazwa");
- Drzwi[nr][dWewPosX] = DOF2_GetFloat(file, "WewPosX");
- Drzwi[nr][dWewPosY] = DOF2_GetFloat(file, "WewPosY");
- Drzwi[nr][dWewPosZ] = DOF2_GetFloat(file, "WewPosZ");
- Drzwi[nr][dZewPosX] = DOF2_GetFloat(file, "ZewPosX");
- Drzwi[nr][dZewPosY] = DOF2_GetFloat(file, "ZewPosY");
- Drzwi[nr][dZewPosZ] = DOF2_GetFloat(file, "ZewPosZ");
- //Rot
- Drzwi[nr][dZewRot] = DOF2_GetFloat(file, "ZewRot");
- Drzwi[nr][dWewRot] = DOF2_GetFloat(file, "WewRot");
- Drzwi[nr][dStatus] = DOF2_GetInt(file, "Status");
- Drzwi[nr][dIntZew] = DOF2_GetInt(file, "IntZew");
- Drzwi[nr][dIntWew] = DOF2_GetInt(file, "IntWew");
- Drzwi[nr][dCreatePrice] = DOF2_GetInt(file, "Price");
- Drzwi[nr][dCreateTime] = DOF2_GetInt(file, "Create");
- if(Drzwi[nr][dAktywne] == 1)
- {
- Door_Update(nr);
- StatsDoor++;
- DrzwiPickup[nr] = CreateDynamicPickup(Drzwi[nr][dPickup], 2, Drzwi[nr][dZewPosX], Drzwi[nr][dZewPosY], Drzwi[nr][dZewPosZ], Drzwi[nr][dZewVir]);
- }
- else
- {
- format(query, 128, "DELETE FROM `1drzwi` WHERE uid = '%d'", nr), mysql_query_ex(query);
- }
- }
- else
- {
- Drzwi[nr][dAktywne] = 0;
- }
- }
- return 1;
- }
- Funkcja::ZapiszDrzwi(nr)
- {
- if(nr < 0 || nr > MAX_DRZWI) return 1;
- new file[40];
- format(file,sizeof(file),"DRZWI/%d.ini",nr);
- if(DOF2_FileExists(file))
- {
- DOF2_SetInt(file, "Aktywne", Drzwi[nr][dAktywne]);
- DOF2_SetInt(file, "Owner", Drzwi[nr][dOwner]);
- DOF2_SetInt(file, "OwnerUID", Drzwi[nr][dOwnerUID]);
- DOF2_SetInt(file, "WewVir", Drzwi[nr][dWewVir]);
- DOF2_SetInt(file, "ZewVir", Drzwi[nr][dZewVir]);
- DOF2_SetInt(file, "Pickup", Drzwi[nr][dPickup]);
- DOF2_SetInt(file, "Obiekty", Drzwi[nr][dObiekty]);
- DOF2_SetString(file, "Nazwa", Drzwi[nr][dNazwa]);
- DOF2_SetFloat(file, "WewPosX", Drzwi[nr][dWewPosX]);
- DOF2_SetFloat(file, "WewPosY", Drzwi[nr][dWewPosY]);
- DOF2_SetFloat(file, "WewPosZ", Drzwi[nr][dWewPosZ]);
- DOF2_SetFloat(file, "ZewPosX", Drzwi[nr][dZewPosX]);
- DOF2_SetFloat(file, "ZewPosY", Drzwi[nr][dZewPosY]);
- DOF2_SetFloat(file, "ZewPosZ", Drzwi[nr][dZewPosZ]);
- //Rot
- DOF2_SetFloat(file, "ZewRot", Drzwi[nr][dZewRot]);
- DOF2_SetFloat(file, "WewRot", Drzwi[nr][dWewRot]);
- DOF2_SetInt(file, "Status", Drzwi[nr][dStatus]);
- DOF2_SetInt(file, "IntZew", Drzwi[nr][dIntZew]);
- DOF2_SetInt(file, "IntWew", Drzwi[nr][dIntWew]);
- DOF2_SetInt(file, "Price", Drzwi[nr][dCreatePrice]);
- DOF2_SetInt(file, "Create", Drzwi[nr][dCreateTime]);
- DOF2_SaveFile();
- }
- else
- {
- DOF2_CreateFile(file);
- DOF2_SetInt(file, "Aktywne", Drzwi[nr][dAktywne]);
- DOF2_SetInt(file, "Owner", Drzwi[nr][dOwner]);
- DOF2_SetInt(file, "OwnerUID", Drzwi[nr][dOwnerUID]);
- DOF2_SetInt(file, "WewVir", Drzwi[nr][dWewVir]);
- DOF2_SetInt(file, "ZewVir", Drzwi[nr][dZewVir]);
- DOF2_SetInt(file, "Pickup", Drzwi[nr][dPickup]);
- DOF2_SetInt(file, "Obiekty", Drzwi[nr][dObiekty]);
- DOF2_SetString(file, "Nazwa", Drzwi[nr][dNazwa]);
- DOF2_SetFloat(file, "WewPosX", Drzwi[nr][dWewPosX]);
- DOF2_SetFloat(file, "WewPosY", Drzwi[nr][dWewPosY]);
- DOF2_SetFloat(file, "WewPosZ", Drzwi[nr][dWewPosZ]);
- DOF2_SetFloat(file, "ZewPosX", Drzwi[nr][dZewPosX]);
- DOF2_SetFloat(file, "ZewPosY", Drzwi[nr][dZewPosY]);
- DOF2_SetFloat(file, "ZewPosZ", Drzwi[nr][dZewPosZ]);
- //Rot
- DOF2_SetFloat(file, "ZewRot", Drzwi[nr][dZewRot]);
- DOF2_SetFloat(file, "WewRot", Drzwi[nr][dWewRot]);
- DOF2_SetInt(file, "Status", Drzwi[nr][dStatus]);
- DOF2_SetInt(file, "IntZew", Drzwi[nr][dIntZew]);
- DOF2_SetInt(file, "IntWew", Drzwi[nr][dIntWew]);
- DOF2_SetInt(file, "Price", Drzwi[nr][dCreatePrice]);
- DOF2_SetInt(file, "Create", Drzwi[nr][dCreateTime]);
- DOF2_SaveFile();
- }
- return 1;
- }
- Funkcja::Wczytaj_Przedmioty()
- {
- new file[40], wczytane;
- for(new nr = 1; nr < MAX_ITEM; nr++)
- {
- format(file,sizeof(file),"Przedmioty/%d.ini",nr);
- if(DOF2_FileExists(file))
- {
- Przedmiot[nr][iAktywny] = DOF2_GetInt(file, "Aktywny");
- Przedmiot[nr][iNazwa] = DOF2_GetString(file, "Nazwa");
- Przedmiot[nr][iWartosc1] = DOF2_GetInt(file, "Wartosc1");
- Przedmiot[nr][iWartosc2] = DOF2_GetInt(file, "Wartosc2");
- Przedmiot[nr][iWartosc3] = DOF2_GetInt(file, "Wartosc3");
- Przedmiot[nr][iTyp] = DOF2_GetInt(file, "Typ");
- Przedmiot[nr][iOwner] = DOF2_GetInt(file, "Owner");
- Przedmiot[nr][iOwnerUID] = DOF2_GetInt(file, "OwnerUID");
- Przedmiot[nr][iUsed] = DOF2_GetInt(file, "Used");
- Przedmiot[nr][iWaga] = DOF2_GetInt(file, "Waga");
- Przedmiot[nr][iVir] = DOF2_GetInt(file, "Vir");
- Przedmiot[nr][iPosX] = DOF2_GetFloat(file, "PosX");
- Przedmiot[nr][iPosY] = DOF2_GetFloat(file, "PosY");
- Przedmiot[nr][iPosZ] = DOF2_GetFloat(file, "PosZ");
- Przedmiot[nr][iRotX] = DOF2_GetFloat(file, "RotX");
- Przedmiot[nr][iFlaga] = DOF2_GetInt(file, "Flaga");
- Przedmiot[nr][iFlagaUID] = DOF2_GetInt(file, "FlagaUID");
- Przedmiot[nr][iPrice] = DOF2_GetInt(file, "Cena");
- Przedmiot[nr][iPremiumPrice]= DOF2_GetInt(file, "Premium");
- if(Przedmiot[nr][iAktywny] == 1)
- {
- StatsItem++;
- if(Przedmiot[nr][iOwner] == 7)
- {
- ItemObiekt[nr] = CreateObject(GetItemModel(nr), Przedmiot[nr][iPosX], Przedmiot[nr][iPosY], Przedmiot[nr][iPosZ], ItemRotX(nr), 0, 0, Przedmiot[nr][iVir]);
- }
- }
- wczytane ++;
- }
- else
- {
- Przedmiot[nr][iAktywny] = 0;
- }
- }
- return 1;
- }
- Funkcja::ZapiszPrzedmiot(nr)
- {
- if(nr < 1 || nr > MAX_ITEM) return 1;
- new file[40];
- format(file,sizeof(file),"Przedmioty/%d.ini",nr);
- if(DOF2_FileExists(file))
- {
- DOF2_SetInt(file, "Aktywny", Przedmiot[nr][iAktywny]);
- DOF2_SetString(file, "Nazwa", Przedmiot[nr][iNazwa]);
- DOF2_SetInt(file, "Wartosc1", Przedmiot[nr][iWartosc1]);
- DOF2_SetInt(file, "Wartosc2", Przedmiot[nr][iWartosc2]);
- DOF2_SetInt(file, "Wartosc3", Przedmiot[nr][iWartosc3]);
- DOF2_SetInt(file, "Typ", Przedmiot[nr][iTyp]);
- DOF2_SetInt(file, "Owner", Przedmiot[nr][iOwner]);
- DOF2_SetInt(file, "OwnerUID", Przedmiot[nr][iOwnerUID]);
- DOF2_SetInt(file, "Used", Przedmiot[nr][iUsed]);
- DOF2_SetInt(file, "Waga", Przedmiot[nr][iWaga]);
- DOF2_SetInt(file, "Vir", Przedmiot[nr][iVir]);
- DOF2_SetFloat(file, "PosX", Przedmiot[nr][iPosX]);
- DOF2_SetFloat(file, "PosY", Przedmiot[nr][iPosY]);
- DOF2_SetFloat(file, "PosZ", Przedmiot[nr][iPosZ]);
- DOF2_SetFloat(file, "RotX", Przedmiot[nr][iRotX]);
- DOF2_SetInt(file, "Flaga", Przedmiot[nr][iFlaga]);
- DOF2_SetInt(file, "FlagaUID", Przedmiot[nr][iFlagaUID]);
- DOF2_SetInt(file, "Cena", Przedmiot[nr][iPrice]);
- DOF2_SetInt(file, "Premium", Przedmiot[nr][iPremiumPrice]);
- DOF2_SaveFile();
- }
- else
- {
- DOF2_CreateFile(file);
- DOF2_SetInt(file, "Aktywny", Przedmiot[nr][iAktywny]);
- DOF2_SetString(file, "Nazwa", Przedmiot[nr][iNazwa]);
- DOF2_SetInt(file, "Wartosc1", Przedmiot[nr][iWartosc1]);
- DOF2_SetInt(file, "Wartosc2", Przedmiot[nr][iWartosc2]);
- DOF2_SetInt(file, "Wartosc3", Przedmiot[nr][iWartosc3]);
- DOF2_SetInt(file, "Typ", Przedmiot[nr][iTyp]);
- DOF2_SetInt(file, "Owner", Przedmiot[nr][iOwner]);
- DOF2_SetInt(file, "OwnerUID", Przedmiot[nr][iOwnerUID]);
- DOF2_SetInt(file, "Used", Przedmiot[nr][iUsed]);
- DOF2_SetInt(file, "Waga", Przedmiot[nr][iWaga]);
- DOF2_SetInt(file, "Vir", Przedmiot[nr][iVir]);
- DOF2_SetFloat(file, "PosX", Przedmiot[nr][iPosX]);
- DOF2_SetFloat(file, "PosY", Przedmiot[nr][iPosY]);
- DOF2_SetFloat(file, "PosZ", Przedmiot[nr][iPosZ]);
- DOF2_SetFloat(file, "RotX", Przedmiot[nr][iRotX]);
- DOF2_SetInt(file, "Flaga", Przedmiot[nr][iFlaga]);
- DOF2_SetInt(file, "FlagaUID", Przedmiot[nr][iFlagaUID]);
- DOF2_SetInt(file, "Cena", Przedmiot[nr][iPrice]);
- DOF2_SetInt(file, "Premium", Przedmiot[nr][iPremiumPrice]);
- DOF2_SaveFile();
- }
- return 1;
- }
- Funkcja::Wczytaj_Grupy()
- {
- new file[40];
- for(new nr = 0; nr < MAX_GRUPY; nr++)
- {
- format(file,sizeof(file),"Grupy/%d.ini",nr);
- if(DOF2_FileExists(file))
- {
- Grupa[nr][gAktywna] = DOF2_GetInt(file, "Aktywna");
- Grupa[nr][gOwner] = DOF2_GetInt(file, "Owner");
- Grupa[nr][gPunkty] = DOF2_GetInt(file, "Punkty");
- Grupa[nr][gPayDay] = DOF2_GetInt(file, "PayDay");
- Grupa[nr][gTyp] = DOF2_GetInt(file, "Typ");
- Grupa[nr][gNazwa] = DOF2_GetString(file, "Nazwa");
- Grupa[nr][gTag] = DOF2_GetString(file, "Tag");
- Grupa[nr][gBank] = DOF2_GetInt(file, "Bank");
- Grupa[nr][gWirCash] = DOF2_GetInt(file, "Premium");
- Grupa[nr][gKolor] = DOF2_GetInt(file, "Kolor");
- Grupa[nr][gKolorZone] = DOF2_GetInt(file, "KolorZone");
- //flagi
- Grupa[nr][gFlagPerm] = DOF2_GetInt(file, "FlagPerm");
- //limit pojazdów zespawnowanych
- Grupa[nr][gVehLimit] = DOF2_GetInt(file, "VehLimit");
- /* new query[128];
- format(query, sizeof(query), "INSERT INTO `1grupy` (`aktywna`,`owner`,`saldo`,`dotacja`,`czlonkowie`,`tag`,`nazwa`) VALUES (%d, %d, %d, %d, %d, '%s', '%s')"\
- , Grupa[nr][gAktywna], Grupa[nr][gOwner], Grupa[nr][gBank], Grupa[nr][gPayDay], 0, Grupa[nr][gTag], Grupa[nr][gNazwa]);
- mysql_query_ex(query); */
- Grupa[nr][gVehLimitSpawn] = 0;
- if(Grupa[nr][gAktywna] == 1)
- {
- StatsGroup++;
- ZapiszGrupe(nr);
- }
- }
- else
- {
- Grupa[nr][gAktywna] = 0;
- }
- }
- return 1;
- }
- Funkcja::ZapiszGrupe(nr)
- {
- if(nr < 0 || nr > MAX_GRUPY) return 1;
- new file[40];
- format(file,sizeof(file),"Grupy/%d.ini",nr);
- if(DOF2_FileExists(file))
- {
- DOF2_SetInt(file, "Aktywna", Grupa[nr][gAktywna]);
- DOF2_SetInt(file, "Owner", Grupa[nr][gOwner]);
- DOF2_SetInt(file, "Punkty", Grupa[nr][gPunkty]);
- DOF2_SetInt(file, "PayDay", Grupa[nr][gPayDay]);
- DOF2_SetInt(file, "Typ", Grupa[nr][gTyp]);
- DOF2_SetString(file, "Nazwa", Grupa[nr][gNazwa]);
- DOF2_SetString(file, "Tag", Grupa[nr][gTag]);
- DOF2_SetInt(file, "Bank", Grupa[nr][gBank]);
- DOF2_SetInt(file, "Premium", Grupa[nr][gWirCash]);
- DOF2_SetInt(file, "Kolor", Grupa[nr][gKolor]);
- DOF2_SetInt(file, "KolorZone", Grupa[nr][gKolorZone]);
- //flagi
- DOF2_SetInt(file, "FlagPerm", Grupa[nr][gFlagPerm]);
- //limit pojazdów zespawnowanych
- DOF2_SetInt(file, "VehLimit", Grupa[nr][gVehLimit]);
- DOF2_SaveFile();
- }
- else
- {
- DOF2_CreateFile(file);
- DOF2_SetInt(file, "Aktywna", Grupa[nr][gAktywna]);
- DOF2_SetInt(file, "Owner", Grupa[nr][gOwner]);
- DOF2_SetInt(file, "Punkty", Grupa[nr][gPunkty]);
- DOF2_SetInt(file, "PayDay", Grupa[nr][gPayDay]);
- DOF2_SetInt(file, "Typ", Grupa[nr][gTyp]);
- DOF2_SetString(file, "Nazwa", Grupa[nr][gNazwa]);
- DOF2_SetString(file, "Tag", Grupa[nr][gTag]);
- DOF2_SetInt(file, "Bank", Grupa[nr][gBank]);
- DOF2_SetInt(file, "Premium", Grupa[nr][gWirCash]);
- DOF2_SetInt(file, "Kolor", Grupa[nr][gKolor]);
- DOF2_SetInt(file, "KolorZone", Grupa[nr][gKolorZone]);
- //flagi
- DOF2_SetInt(file, "FlagPerm", Grupa[nr][gFlagPerm]);
- //limit pojazdów zespawnowanych
- DOF2_SetInt(file, "VehLimit", Grupa[nr][gVehLimit]);
- DOF2_SaveFile();
- }
- return 1;
- }
- Funkcja::Wczytaj_Strefy()
- {
- new file[40];
- for(new g = 1; g < MAX_GANG_ZONES; g++)
- {
- format(file, sizeof(file),"Strefy/%d.ini", g);
- if(DOF2_FileExists(file))
- {
- GangZoneInfo[g][gAktywna] = DOF2_GetInt(file, "Aktywna");
- GangZoneInfo[g][gMinX] = DOF2_GetFloat(file, "MinX");
- GangZoneInfo[g][gMinY] = DOF2_GetFloat(file, "MinY");
- GangZoneInfo[g][gMaxX] = DOF2_GetFloat(file, "MaxX");
- GangZoneInfo[g][gMaxY] = DOF2_GetFloat(file, "MaxY");
- GangZoneInfo[g][gColor] = DOF2_GetInt(file, "Color");
- GangZoneInfo[g][gOwner] = DOF2_GetInt(file, "Owner");
- GangZoneInfo[g][gOwnerUID] = DOF2_GetInt(file, "OwnerUID");
- GangZoneInfo[g][gNazwa] = DOF2_GetString(file, "Nazwa");
- GangZoneInfo[g][gSpeed] = DOF2_GetInt(file, "Speed");
- if(GangZoneInfo[g][gAktywna] == 1)
- {
- StatsZone++;
- GangZone[g] = GangZoneCreate(GangZoneInfo[g][gMinX], GangZoneInfo[g][gMinY], GangZoneInfo[g][gMaxX], GangZoneInfo[g][gMaxY]);
- }
- if(GroupDoorInArea(GangZoneInfo[g][gOwnerUID], g) < 2)
- {
- GangZoneInfo[g][gOwner] = 0;
- GangZoneInfo[g][gOwnerUID] = 0;
- //printf("[zone] Strefa %d została zwolniona.", g), Zapisz_Strefe(g);
- }
- }
- }
- return 1;
- }
- Funkcja::Zapisz_Strefe(id)
- {
- if(id < 0 || id > MAX_GANG_ZONES) return 1;
- new file[40];
- format(file, sizeof(file), "Strefy/%d.ini", id);
- if(DOF2_FileExists(file))
- {
- DOF2_SetInt(file, "Aktywna", GangZoneInfo[id][gAktywna]);
- DOF2_SetFloat(file, "MinX", GangZoneInfo[id][gMinX]);
- DOF2_SetFloat(file, "MinY", GangZoneInfo[id][gMinY]);
- DOF2_SetFloat(file, "MaxX", GangZoneInfo[id][gMaxX]);
- DOF2_SetFloat(file, "MaxY", GangZoneInfo[id][gMaxY]);
- DOF2_SetInt(file, "Color", GangZoneInfo[id][gColor]);
- DOF2_SetInt(file, "Owner", GangZoneInfo[id][gOwner]);
- DOF2_SetInt(file, "OwnerUID", GangZoneInfo[id][gOwnerUID]);
- DOF2_SetString(file, "Nazwa", GangZoneInfo[id][gNazwa]);
- DOF2_SetInt(file, "Speed", GangZoneInfo[id][gSpeed]);
- DOF2_SaveFile();
- }
- else
- {
- DOF2_CreateFile(file);
- DOF2_SetInt(file, "Aktywna", GangZoneInfo[id][gAktywna]);
- DOF2_SetFloat(file, "MinX", GangZoneInfo[id][gMinX]);
- DOF2_SetFloat(file, "MinY", GangZoneInfo[id][gMinY]);
- DOF2_SetFloat(file, "MaxX", GangZoneInfo[id][gMaxX]);
- DOF2_SetFloat(file, "MaxY", GangZoneInfo[id][gMaxY]);
- DOF2_SetInt(file, "Color", GangZoneInfo[id][gColor]);
- DOF2_SetInt(file, "Owner", GangZoneInfo[id][gOwner]);
- DOF2_SetInt(file, "OwnerUID", GangZoneInfo[id][gOwnerUID]);
- DOF2_SetString(file, "Nazwa", GangZoneInfo[id][gNazwa]);
- DOF2_SetInt(file, "Speed", GangZoneInfo[id][gSpeed]);
- DOF2_SaveFile();
- }
- return 1;
- }
- //other
- Funkcja::IsPlayerLogged(playerid)
- {
- new login = 0;
- if(Login(playerid) == 1)
- {
- login = 1;
- }
- return login;
- }
- Funkcja::NoLogin(playerid)
- return InfoBoxShow(2, playerid, "~w~Nieznaleziono gracza po podanym ~y~ID~w~.~n~Prawdopodobnie nie jest zalogowany na serwer.", 3);
- Funkcja::GiftImage(playerid)
- {
- Data();
- format(String, sizeof(String), "SA:MP ~w~RolePlay, %02d.%02d", Dzien, Miesiac);
- TextDrawSetString(TDData, String);
- TextDrawShowForPlayer(playerid, TDData);
- TextDrawShowForPlayer(playerid, PasekSanNews[playerid]);
- TextDrawHideForPlayer(playerid, ImagenGift);
- TextDrawSetString(ImagenGift, ImagesGift[random(sizeof(ImagesGift))]);
- TextDrawShowForPlayer(playerid, ImagenGift);
- return 1;
- }
- Funkcja::SetEngine(vehicleid, playerid, silnik)
- {
- if(GetPVarInt(playerid, "Odpala") == 1)
- {
- SetPVarInt(playerid, "Odpala", 0);
- GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- if(silnik == 1)
- {
- SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
- InfoBoxShow(2, playerid, "Silnik ~y~pojazdu~w~ zostal ~g~uruchomiony~w~.", 3);
- }
- else
- {
- SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
- InfoBoxShow(2, playerid, "Silnik ~y~pojazdu~w~ zostal ~r~wylaczony~w~.", 3);
- }
- }
- return 1;
- }
- Funkcja::mysql_query_ex(query[])
- {
- return mysql_query(query);
- }
- Funkcja::AntyCheatLog(dir[], string[])
- {
- new File:plik, h, m, s, day, month, year, date[64];
- gettime(h, m, s);
- getdate(day, month, year);
- format(date, sizeof(date), "%d-%d-%d", day, month, year);
- format(LogData, sizeof(LogData), "Logi/%s/%s.log", dir, date);
- if(DOF2_FileExists(LogData))
- {
- plik = fopen(LogData, io_append);
- if (plik)
- {
- format(LogStr, sizeof(LogStr), "\n[%02d:%02d:%02d] %s", h+1, m, s, string);
- fwrite(plik, LogStr);
- fclose(plik);
- }
- }
- else
- {
- DOF2_CreateFile(LogData);
- plik = fopen(LogData, io_append);
- if (plik)
- {
- format(LogStr, sizeof(LogStr), "\n[%02d:%02d:%02d] %s", h+1, m, s, string);
- fwrite(plik, LogStr);
- fclose(plik);
- }
- }
- return 1;
- }
- LoadNPC(name[], file[])
- {
- ConnectNPC(name, file);
- return printf("Wczytano postać NPC %s z pliku %s.", name, file);
- }
- GroupSlot(playerid, groupUID)
- {
- new slot = 0;
- if(pGrupa[playerid][1] == groupUID)
- slot = 1;
- if(pGrupa[playerid][2] == groupUID)
- slot = 2;
- if(pGrupa[playerid][3] == groupUID)
- slot = 3;
- if(pGrupa[playerid][4] == groupUID)
- slot = 4;
- if(pGrupa[playerid][5] == groupUID)
- slot = 5;
- return slot;
- }
- //Komendy administratora
- CMD:brama(playerid, params[])
- {
- new range = 0;
- if(IsPlayerInAnyVehicle(playerid)) range = 10;
- else range = 5;
- for(new o = 0; o < MAX_OBIEKT; o++)
- {
- if(Obiekt[o][oGate] == 1)
- {
- if(GetPlayerVirtualWorld(playerid) == 0)
- {
- if(GangZoneInfo[PlayerInZone(playerid)][gOwner] == 0 || GangZoneInfo[PlayerInZone(playerid)][gOwner] == OWNER_GROUP && GrupaSlot(playerid, GangZoneInfo[PlayerInZone(playerid)][gOwnerUID]) == 0)
- {
- return Info(playerid, "Nie posiadasz uprawnień do zarządzania tą bramą.");
- }
- }
- else
- {
- if(pDrzwi(playerid, InDoor(playerid)) == 0)
- return Info(playerid, "Nie posiadasz uprawnień do zarządzania tą bramą.");
- }
- if(IsPlayerInRangeOfPoint(playerid, range, Obiekt[o][oPosX], Obiekt[o][oPosY], Obiekt[o][oPosZ]) || IsPlayerInRangeOfPoint(playerid, range, Obiekt[o][oGateX], Obiekt[o][oGateY], Obiekt[o][oGateZ]))
- {
- if(Obiekt[o][oGateStatus] == 0)
- {
- Obiekt[o][oGateStatus] = 1;
- MoveDynamicObject(MapObiekt[o], Obiekt[o][oGateX], Obiekt[o][oGateY], Obiekt[o][oGateZ], 1, Obiekt[o][oGateRotX], Obiekt[o][oGateRotY], Obiekt[o][oGateRotZ]);
- }
- else
- {
- Obiekt[o][oGateStatus] = 0;
- MoveDynamicObject(MapObiekt[o], Obiekt[o][oPosX], Obiekt[o][oPosY], Obiekt[o][oPosZ], 1, Obiekt[o][oRotX], Obiekt[o][oRotY], Obiekt[o][oRotZ]);
- }
- break;
- }
- }
- if(o == MAX_OBIEKT - 1)
- return Info(playerid, "W pobliżu nie ma żadnej bramy.");
- }
- return 1;
- }
- CMD:area(playerid, params[])
- {
- if(PlayerInZone(playerid) == 0)
- return Info(playerid, "Aktualnie nie znajdujesz się w żadnej ze stref.");
- new title[64], zone = PlayerInZone(playerid), info[1024];
- SetPVarInt(playerid, "rpAreaZone", PlayerInZone(playerid));
- format(title, 64, "{AAC5E3}Area: %d (%s, %dkm/h)", zone, GangZoneInfo[zone][gNazwa], GangZoneInfo[zone][gSpeed]);
- if(GangZoneInfo[zone][gOwner] == 2 && Grupa[GangZoneInfo[zone][gOwnerUID]][gAktywna] == 1)
- {
- strcat(info, "1\tPokaż informacje o strefie\n", sizeof(info));
- if((pGrupaPerm[playerid][GrupaSlot(playerid, GangZoneInfo[zone][gOwnerUID])] & PERM_LEADER))
- {
- strcat(info, "3\tWidoczność strefy\n", sizeof(info));
- }
- }
- else
- {
- strcat(info, "1\tPokaż informacje o strefie\n", sizeof(info));
- strcat(info, "2\tPrzejmij strefę\n", sizeof(info));
- }
- if((Player[playerid][pAdmin] & ADMIN_PERM_ZONE))
- {
- strcat(info, "----\n", sizeof(info));
- strcat(info, "4\tUstaw limit prędkości dla pojazdów\n", sizeof(info));
- strcat(info, "5\tSkasuj obiekty znajdujące się na strefie\n", sizeof(info));
- strcat(info, "6\tWyświetl budynki, które zostały utworzone na terenie strefy\n", sizeof(info));
- strcat(info, "7\tUstal koszt utworzenia nowego budynku\n", sizeof(info));
- strcat(info, "8\tMożliwość parkowania pojazdów\n", sizeof(info));
- if(GangZoneInfo[zone][gOwner] == OWNER_GROUP)
- {
- strcat(info, "9\tUsuń dotychczasowego ownera\n", sizeof(info));
- }
- else
- {
- strcat(info, "10\tUstal nową grupę jako ownera\n", sizeof(info));
- }
- }
- return dShowPlayerDialog(playerid, 300, DIALOG_STYLE_LIST, title, info, "Wybierz", "Anuluj");
- }
- CMD:area2(playerid, params[])
- {
- GangZoneInfo[PlayerInZone(playerid)][gSpeed] = 75;
- return 1;
- }
- CMD:strefa(playerid, params[])
- {
- if((Player[playerid][pAdmin] & ADMIN_PERM_ZONE))
- {
- new sub[80],rest[80], zone_id;
- if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/strefa [stworz, edytuj, kolor, usun]");
- if(!strcmp(sub, "stworz", true))
- {
- new Float:zone_x, Float:zone_y, Float:Pos[3], name[32];
- if(sscanf(rest, "ff", zone_x, zone_y))
- return Tip(playerid, "/strefa stworz [MaxX] [MaxY]");
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- for(new g = 1; g < MAX_GANG_ZONES; g++)
- {
- new file[40];
- format(file, sizeof(file), "Strefy/%d.ini", g);
- if(GangZoneInfo[g][gAktywna] == 0 && !DOF2_FileExists(file))
- {
- TogglePlayerControllable(playerid, false);
- GangZoneInfo[g][gAktywna] = 1;
- GangZoneInfo[g][gMinX] = Pos[0];
- GangZoneInfo[g][gMinY] = Pos[1];
- GangZoneInfo[g][gMaxX] = Pos[0] + zone_x;
- GangZoneInfo[g][gMaxY] = Pos[1] + zone_y;
- GangZoneInfo[g][gColor] = -1;
- GangZoneInfo[g][gOwner] = OWNER_GROUP;
- GangZoneInfo[g][gOwnerUID] = 1;
- SetPlayerPos(playerid, GangZoneInfo[g][gMinX], GangZoneInfo[g][gMaxY], 50.0);
- GangZone[g] = GangZoneCreate(GangZoneInfo[g][gMinX], GangZoneInfo[g][gMinY], GangZoneInfo[g][gMaxX], GangZoneInfo[g][gMaxY]);
- GangZoneShowForPlayer(playerid, GangZone[g], 0xC7EAF8BB);
- format(String, sizeof(String), "X: %.0f, Y: %.0f", GangZoneInfo[g][gMinX], GangZoneInfo[g][gMinY]);
- format(name, sizeof(name), "%.0fx%.0f", zone_x, zone_y), Tip(playerid, String);
- strmid(GangZoneInfo[g][gNazwa], name, 0, 64, 64);
- format(String, sizeof(String), "Utworzona została nowa strefa (UID: %d) o wymiarach %.0fx%.0f", g, zone_x, zone_y), Info(playerid, String);
- Zapisz_Strefe(g);
- break;
- }
- }
- return 1;
- }
- else if(!strcmp(sub, "usun", true))
- {
- if(sscanf(rest, "d", zone_id))
- return Tip(playerid, "/strefa usun [ID]");
- if(GangZoneInfo[zone_id][gAktywna] == 0)
- return Tip(playerid, "Strefa nie jest aktywna.");
- GangZoneInfo[zone_id][gAktywna] = 0;
- return Zapisz_Strefe(zone_id), format(String, sizeof(String), "Strefa (UID: %d) została pomyślnie usunięta.", zone_id), Info(playerid, String);
- }
- else if(!strcmp(sub, "kolor", true))
- {
- new zone_color[6], text[10];
- if(sscanf(rest, "ds[6]", zone_id, zone_color))
- return Tip(playerid, "/strefa kolor [ID] [RRGGBB]");
- format(text, sizeof(text), "0x%sBB", zone_color);
- GangZoneInfo[zone_id][gColor] = hexstring(text);
- GangZoneHideForAll(zone_id);
- GangZoneShowForPlayer(playerid, zone_id, GangZoneInfo[zone_id][gColor]);
- return Zapisz_Strefe(zone_id), format(String, sizeof(String), "Strefa (UID: %d) została pomyślnie zmodyfikowana.", zone_id), Info(playerid, String);
- }
- return 1;
- }
- return 1;
- }
- CMD:opis(playerid, params[])
- {
- new desc[128];
- if(sscanf(params, "s[128]", desc))
- return Tip(playerid, "/opis [usun, treść opisu]");
- if(!strcmp(params, "usun"))
- {
- if(GetPVarInt(playerid, "rpOpis") == 0)
- return Tip(playerid, "Nie utworzyłeś jeszcze żadnego opisu.");
- return UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pOpis], COLOR_DESC, " "), SetPVarInt(playerid, "rpOpis", 0), Tip(playerid, "Opis został usunięty.");
- }
- if(strlen(desc) > 120 || strlen(desc) < 30)
- return Info(playerid, "Opis powinien mieć od 30 do 120 znaków.");
- UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pOpis], COLOR_DESC, WordWrap(desc, 5)), SetPVarInt(playerid, "rpOpis", 1), Info(playerid, WordWrap(desc, 5));
- return 1;
- }
- CMD:zamow(playerid, params[])
- {
- if(Sluzba(playerid) == 0)
- return Info(playerid, "Wejdź na służbę grupy, dla której chcesz zamówić produkty.\nW przeciwnym razie nie możesz skorzytać opcji zamawiania.");
- if(Drzwi[InDoor(playerid)][dOwner] == 2)
- {
- if(Drzwi[InDoor(playerid)][dOwnerUID] != Sluzba(playerid))
- return Info(playerid, "Musisz znajdować się w budynku, który należy do grupy, dla której chcesz zamówić produkty.");
- }
- else
- {
- return Info(playerid, "Musisz znajdować się w budynku, który należy do grupy, dla której chcesz zamówić produkty.");
- }
- return ShowOrderCat(playerid);
- }
- CMD:pogoda(playerid, params[])
- {
- new pogoda = 0;
- if(sscanf(params, "d", pogoda))
- return Tip(playerid, "/pogoda [identyfiaktor]");
- return SetWeather(pogoda);
- }
- CMD:ac(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_CHAT))
- return Info(playerid, "Brak uprawnień do korzystania z tej komendy.");
- new text[128], wiadomosc[128];
- if(sscanf(params, "s[100]", text))
- return Tip(playerid, "/ac [wiadomość]");
- foreach(Player, p)
- {
- if((Player[p][pAdmin] & ADMIN_PERM_CHAT))
- {
- format(wiadomosc, sizeof(wiadomosc), "{BB0000}%s [%d]{EEE8AA}", CharName(playerid), playerid);
- format(String, sizeof(String), "(( %s: %s ))", wiadomosc, text);
- SendClientMessage(p, 0xEEE8AAFF, String);
- }
- }
- return 1;//
- }
- CMD:aduty(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- if(Status(playerid) == 2)//Zejście ze służby
- {
- Info(playerid, "Kończysz służbę Administratora / GameMastera.");
- return setStatus(playerid, 0);
- }
- Info(playerid, "Rozpoczynasz służbę Administratora / GameMastera.");
- return setStatus(playerid, 2);
- }
- CMD:spec(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz;
- if(sscanf(params, "u", gracz))
- {
- if(GetPVarInt(playerid, "rpSpec") != INVALID_PLAYER_ID)
- {
- SetPVarInt(playerid, "rpSpec", INVALID_PLAYER_ID);
- InfoBoxShow(2, playerid, "Podglad ~y~gracza~r~ anulowany~w~.", 3);
- TogglePlayerSpectating(playerid, false);
- return SpawnPlayer(playerid);
- }
- return Tip(playerid, "/spec [gracz]");
- }
- if(IsPlayerLogged(gracz) == 0 || gracz == playerid) return NoLogin(playerid);
- TogglePlayerSpectating(playerid, true);
- SetPVarInt(playerid, "rpSpec", gracz);
- InfoBoxShow(2, playerid, "Podglad gracza jest teraz ~y~aktywny~w~.~n~~n~Uzywaj klawiszy ~r~LALT~w~ oraz ~r~LSHIFT~w~, aby swobodne ~g~przeskakiwac~w~ miedzy graczami.", 180);
- if(IsPlayerInAnyVehicle(gracz))
- {
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(gracz));
- }
- else
- {
- PlayerSpectatePlayer(playerid, gracz);
- }
- return 1;
- }
- CMD:bw(playerid, params[])
- {
- new gracz;
- if(sscanf(params, "u", gracz))
- return Tip(playerid, "/bw [gracz]");
- if(Player[gracz][pBW] == 0)
- {
- Player[gracz][pBW] = TIME_BW;
- }
- else
- {
- Player[gracz][pBW] = 0;
- TogglePlayerControllable(gracz, true);
- setHP(gracz, 100);
- SetCameraBehindPlayer(gracz);
- }
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz, powod[64];
- if(sscanf(params, "us[64]", gracz, powod))
- return Tip(playerid, "/kick [gracz] [powód]");
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- return Kara(0, gracz, playerid, powod, 0);
- }
- CMD:warn(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz, powod[64];
- if(sscanf(params, "us[64]", gracz, powod))
- return Tip(playerid, "/warn [gracz] [powód]");
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- return Kara(1, gracz, playerid, powod, 0);
- }
- CMD:gs(playerid, params[])
- return cmd_gamescore(playerid, params);
- CMD:gamescore(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz, powod[64], gs;
- if(sscanf(params, "uds[64]", gracz, gs, powod))
- return Tip(playerid, "/gamescore [gracz] [ilosc] [powód]");
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- IPB[gracz][ipb_GameScore] += gs;
- return Kara(8, gracz, playerid, powod, 0);
- }
- CMD:gmx(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_MAX))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- for(new nr = 0; nr < MAX_OBIEKT; nr++){
- if(Obiekt[nr][oAktywny] == 1){
- ZapiszObiekt(nr);
- }
- }
- for(new nr = 0; nr < MAX_ITEM; nr++){
- if(Przedmiot[nr][iAktywny] == 1){
- ZapiszPrzedmiot(nr);
- if(Przedmiot[nr][iTyp] == 1 && Przedmiot[nr][iUsed] == 1)
- {
- Przedmiot[nr][iUsed] = 0;
- }
- }
- }
- for(new nr = 0; nr < MAX_GRUPY; nr++){
- if(Grupa[nr][gAktywna] == 1){
- ZapiszGrupe(nr);
- }
- }
- foreach(Player, p)
- {
- if(Login(p) == 1)
- {
- Global_Data_Save(p);
- SavePlayerStats(p, SAVE_PLAYER_BASIC);
- SavePlayerStats(p, SAVE_PLAYER_POS);
- SavePlayerStats(p, SAVE_PLAYER_GROUP);
- OnPlayerDisconnect(p, 0);
- }
- }
- //dostarczanie produktów
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Paczka[p][pAktywna] == 1)
- {
- new powtorzenia = 0;
- for(new nr = 1; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 0)
- {
- Przedmiot[nr][iAktywny] = 1;
- Przedmiot[nr][iTyp] = Paczka[p][pTyp];
- Przedmiot[nr][iWartosc1] = Paczka[p][pValue1];
- Przedmiot[nr][iWartosc2] = Paczka[p][pValue2];
- Przedmiot[nr][iWartosc3] = Paczka[p][pValue3];
- Przedmiot[nr][iOwner] = Paczka[p][pOwner];
- Przedmiot[nr][iOwnerUID] = Paczka[p][pOwnerUID];
- Przedmiot[nr][iWaga] = Paczka[p][pWaga];
- Przedmiot[nr][iUsed] = 0;
- Przedmiot[nr][iVir] = 0;
- Przedmiot[nr][iPrice] = Paczka[p][pPrice];
- Przedmiot[nr][iFlaga] = Paczka[p][pFlaga];
- Przedmiot[nr][iFlagaUID] = Paczka[p][pFlagaUID];
- strmid(Przedmiot[nr][iNazwa], Paczka[p][pNazwa], 0, 64, 64);
- ZapiszPrzedmiot(nr);
- powtorzenia++;
- if(powtorzenia == Paczka[p][pIlosc])
- {
- break;
- }
- Paczka[p][pAktywna] = 0;
- }
- }
- }
- }
- //koniec
- for(new v = 0; v < MAX_VEHICLES; v++)
- {
- if(Pojazd[v][vSpawn] == 1)
- {
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- ZapiszPojazd(veh);
- }
- }
- }
- }
- for(new d = 0; d < MAX_DRZWI; d++)
- {
- if(Drzwi[d][dAktywne] == 1)
- {
- ZapiszDrzwi(d);
- }
- }
- return SetTimerEx("Restart", 3000, 0, "");
- }
- CMD:blok(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz, powod[64], czas;
- if(sscanf(params, "dds[64]", gracz, czas, powod))
- return Tip(playerid, "/blok [gracz] [czas - 0 dla kary wiecznej] [powód]");
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- return Kara(3, gracz, playerid, powod, czas);
- }
- CMD:logi(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_MAX))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- return dShowPlayerDialog(playerid, 200, DIALOG_STYLE_LIST, ""ServName"Logi", "1\tDezaktywacja kar\n2\tNadawanie kar", "Wybierz", "Anuluj");
- }
- //teleportacje
- CMD:tm(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz, Float:Pos[3];
- if(sscanf(params, "u", gracz))
- return Tip(playerid, "/tm [gracz]");
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(gracz, Pos[0], Pos[1]+2, Pos[2]);
- SetPVarInt(gracz, "Teleport", 1);
- SetPVarInt(playerid, "Teleport", 1);
- return SetPlayerVirtualWorld(gracz, GetPlayerVirtualWorld(playerid));
- }
- CMD:to(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz, Float:Pos[3];
- if(sscanf(params, "u", gracz))
- return Tip(playerid, "/to [gracz]");
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- GetPlayerPos(gracz, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0], Pos[1]+2, Pos[2]);
- SetPVarInt(gracz, "Teleport", 1);
- SetPVarInt(playerid, "Teleport", 1);
- return SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(gracz));
- }
- CMD:ptp(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz1, gracz2, Float:Pos[3];
- if(sscanf(params, "uu", gracz1, gracz2))
- return Tip(playerid, "/ptp [gracz 1] [gracz 2]");
- if(IsPlayerLogged(gracz1) == 0 || IsPlayerLogged(gracz2) == 0) return NoLogin(playerid);
- SetPVarInt(gracz1, "Teleport", 1);
- SetPVarInt(gracz2, "Teleport", 1);
- GetPlayerPos(gracz2, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(gracz1, Pos[0], Pos[1]+2, Pos[2]);
- return SetPlayerVirtualWorld(gracz1, GetPlayerVirtualWorld(gracz2));
- }
- CMD:tp(playerid, params[])
- {
- if(!(Player[playerid][pAdmin] & ADMIN_PERM_GM))
- return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new vir, int, Float:Pos[3];
- if(sscanf(params, "fffdd", Pos[0], Pos[1], Pos[2], int, vir))
- return Tip(playerid, "/tp [pos X] [pos Y] [pos Z] [int] [vir]");
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerInterior(playerid, int);
- SetPVarInt(playerid, "Teleport", 1);
- return SetPlayerVirtualWorld(playerid, vir);
- }
- CMD:set(playerid, params[])
- {
- if((Player[playerid][pAdmin] & ADMIN_PERM_GM))
- {
- new sub[80],rest[80], gracz, value;
- if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/set [skin, hp]");
- if(!strcmp(sub, "skin", true))
- {
- if(sscanf(rest, "ud", gracz, value))
- return Tip(playerid, "/set skin [gracz] [skin (0 - 299)]");
- if(value < 0 || value > 299)
- return Tip(playerid, "Podano błędne ID skina");
- Player[gracz][pSkin] = value;
- SetPlayerSkin(gracz, value);
- }
- return 1;
- }
- return 1;
- }
- CMD:ap(playerid, params[])
- {
- if((Player[playerid][pAdmin] & ADMIN_PERM_ITEM))
- return dShowPlayerDialog(playerid, DIALOG_ITEM_EDIT, DIALOG_STYLE_LIST, ""ServName"Przedmioty", "1\tStworz przedmiot\n2\tEdytuj przedmiot", "Wybierz", "Anuluj");
- return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania ~y~przedmiotami~w~ na serwerze.", 3);
- }
- CMD:av(playerid, params[])
- {
- if((Player[playerid][pAdmin] & ADMIN_PERM_VEHICLE))
- {
- new sub[80],rest[80], v, value2, val[32];
- if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/av [stworz | spawn | fix | hp | respawn | przypisz | tankuj | rejestruj]");
- if(!strcmp(sub, "stworz", true))
- {
- new veh;
- if(sscanf(rest, "d", veh))
- return Tip(playerid, "/av stworz [model]");
- for(v = 1; v < MAX_VEHICLES; v++)
- {
- new file[40];
- format(file, sizeof(file), "Pojazdy/%d.ini", v);
- if(Pojazd[v][vAktywny] == 0 && !DOF2_FileExists(file))
- {
- Pojazd[v][vAktywny] = 1;
- Pojazd[v][vModel] = veh;
- Pojazd[v][vOwner] = 1;
- Pojazd[v][vOwnerUID] = Player[playerid][pUID];
- Pojazd[v][vKolor1] = 1;
- Pojazd[v][vKolor2] = 1;
- Pojazd[v][vPrzebieg] = 0.0;
- Pojazd[v][vHP] = 1000.0;
- GetPlayerPos(playerid, Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ]);
- GetPlayerFacingAngle(playerid, Pojazd[v][vRot]);
- Pojazd[v][vVir] = GetPlayerVirtualWorld(playerid);
- Pojazd[v][vReje] = 0;
- Pojazd[v][vPanels] = 0;
- Pojazd[v][vDoors] = 0;
- Pojazd[v][vLights] = 0;
- Pojazd[v][vTires] = 0;
- Pojazd[v][vPaliwoTyp] = 1;
- Pojazd[v][vPaliwo] = PaliwoMax(veh);
- Pojazd[v][vPaliwoMax] = PaliwoMax(veh);
- //MySQL
- new query[256];
- format(query, sizeof(query), "INSERT INTO `1veh` (`uid`,`model`,`marka`,`owner`,`owner_uid`,`HP`,`przebieg`) VALUES ('%d', '%d', '%s', '%d', '%d', %f, %f)", v, Pojazd[v][vModel], GetVehicleName(v), Pojazd[v][vOwner], Pojazd[v][vOwnerUID], Pojazd[v][vHP], Pojazd[v][vPrzebieg]);
- mysql_query_ex(query);
- //tworzenie
- PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
- Pojazd[v][vSpawn] = 1;
- PojazdUID[PojazdModel[v]] = v;
- if(Pojazd[v][vReje] == 0)
- {
- SetVehicleNumberPlate(PojazdModel[v], " ");
- }
- else if(Pojazd[v][vReje] == 1)
- {
- format(String, sizeof(String), "SA %04d", v);
- SetVehicleNumberPlate(PojazdModel[v], String);
- }
- SetVehicleToRespawn(PojazdModel[v]);
- UstawParametryPojazdu(PojazdModel[v]);
- format(String, sizeof(String), "Utworzono pojazd ~y~%s~w~ (UID: %d) jako ~r~Administrator~w~.", GetVehicleName(v), v);
- InfoBoxShow(2, playerid, String, 3);
- ZapiszPojazd(PojazdModel[v]);
- break;
- }
- }
- return 1;
- }
- else if(!strcmp(sub, "usun", true))
- {
- if(sscanf(rest, "d", v))
- return Tip(playerid, "/av usun [identyfikator]");
- if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
- Pojazd[v][vAktywny] = 0;
- //Kasowanie z MySQL
- new query[128];
- format(query, 128, "DELETE FROM `1veh` WHERE uid = '%d'", v), mysql_query_ex(query);
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 8 && Przedmiot[p][iOwnerUID] == v && Przedmiot[p][iTyp] == 5)
- {
- Przedmiot[p][iAktywny] = 0;
- ZapiszPrzedmiot(p);
- }
- }
- ZapiszPojazd(veh);
- DestroyVehicle(PojazdModel[v]);
- }
- }
- return 1;
- }
- else if(!strcmp(sub, "spawn", true))
- {
- if(sscanf(rest, "d", v))
- return Tip(playerid, "/av spawn [identyfikator]");
- if(Pojazd[v][vAktywny] == 1)
- {
- if(Pojazd[v][vSpawn] == 1)
- {
- foreach(Player, p)
- {
- if(GetPlayerVehicleID(p) == PojazdModel[v])
- {
- return InfoBoxShow(2, playerid, "Nie mozesz odspawnowac tego ~y~pojazdu~w~, poniewaz ktos znajduje sie w srodku.", 3);
- }
- if(GetPVarInt(p, "OffeVeh") == PojazdModel[v])
- {
- SetPVarInt(p, "OffeVeh", 0);
- SetPVarInt(p, "OffeVehTime", 0);
- Tip(p, "Naprawa pojazdu została anulowana, pojazd został odspawnowany.");
- TextDrawHideForPlayer(p, TDOffe[p]);
- Offer[p][oBlock] = 0;
- }
- }
- UpdateDynamic3DTextLabelText(Text3D:Veh3DText[PojazdModel[v]], KOL_NAME, " ");
- format(String, sizeof(String), "Odspawnowano pojazd ~y~%s~w~ (UID: %d) jako ~r~Administrator~w~.", GetVehicleName(v), v);
- InfoBoxShow(2, playerid, String, 3);
- ZapiszPojazd(PojazdModel[v]);
- DestroyVehicle(PojazdModel[v]);
- Pojazd[v][vSpawn] = 0;
- }
- else
- {
- PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
- Pojazd[v][vSpawn] = 1;
- PojazdUID[PojazdModel[v]] = v;
- if(Pojazd[v][vReje] == 0)
- {
- SetVehicleNumberPlate(PojazdModel[v], " ");
- }
- else if(Pojazd[v][vReje] == 1)
- {
- format(String, sizeof(String), "SA %04d", v);
- SetVehicleNumberPlate(PojazdModel[v], String);
- }
- SetVehicleToRespawn(PojazdModel[v]);
- UstawParametryPojazdu(PojazdModel[v]);
- format(String, sizeof(String), "Zespawnowano pojazd ~y~%s~w~ (UID: %d) jako ~r~Administrator~w~.", GetVehicleName(v), v);
- InfoBoxShow(2, playerid, String, 3);
- }
- }
- else
- {
- InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- }
- return 1;
- }
- else if(!strcmp(sub, "fix", true))
- {
- new Float:valueHP;
- if(sscanf(rest, "df", v, valueHP))
- return Tip(playerid, "/av fix [identyfikator] [poziom HP]");
- if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
- Pojazd[v][vHP] = valueHP;
- Pojazd[v][vPanels] = 0;
- Pojazd[v][vDoors] = 0;
- Pojazd[v][vLights] = 0;
- Pojazd[v][vTires] = 0;
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- foreach(Player, p)
- {
- if(GetPlayerState(p) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == veh)
- {
- SetPVarInt(p, "Fix", gettime()+3);
- }
- }
- SetVehicleHealth(veh, Pojazd[v][vHP]);
- UpdateVehicleDamageStatus(veh, Pojazd[v][vPanels], Pojazd[v][vDoors], Pojazd[v][vLights], Pojazd[v][vTires]);
- ZapiszPojazd(veh);
- }
- }
- format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal naprawiony ~g~pomyslnie~w~.", GetVehicleName(v), v);
- return InfoBoxShow(2, playerid, String, 5);
- }
- else if(!strcmp(sub, "hp", true))
- {
- new Float:valueHP;
- if(sscanf(rest, "df", v, valueHP))
- return Tip(playerid, "/av hp [identyfikator] [poziom HP]");
- if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
- Pojazd[v][vHP] = valueHP;
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- foreach(Player, p)
- {
- if(GetPlayerState(p) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == veh)
- {
- SetPVarInt(p, "Fix", gettime()+3);
- }
- }
- SetVehicleHealth(veh, Pojazd[v][vHP]);
- ZapiszPojazd(veh);
- }
- }
- format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal naprawiony ~g~pomyslnie~w~.", GetVehicleName(v), v);
- return InfoBoxShow(2, playerid, String, 5);
- }
- else if(!strcmp(sub, "respawn", true))
- {
- if(sscanf(rest, "d", v))
- return Tip(playerid, "/av respawn [identyfikator]");
- if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- ZapiszPojazd(veh);
- SetVehicleToRespawn(veh);
- }
- }
- format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal zrespawnowany ~g~pomyslnie~w~.", GetVehicleName(v), v);
- return InfoBoxShow(2, playerid, String, 5);
- }
- else if(!strcmp(sub, "rejestruj", true))
- {
- if(sscanf(rest, "d", v))
- return Tip(playerid, "/av rejestruj [identyfikator]");
- if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
- if(Pojazd[v][vReje] == 1) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ jest zarejestrowany.", 3);
- Pojazd[v][vReje] = 1;
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- ZapiszPojazd(veh);
- SetVehicleToRespawn(veh);
- }
- }
- format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal zarejestrowany ~g~pomyslnie~w~.", GetVehicleName(v), v);
- return InfoBoxShow(2, playerid, String, 5);
- }
- else if(!strcmp(sub, "przypisz", true))
- {
- if(sscanf(rest, "ds[32]d", v, val, value2)) return Tip(playerid, "/av przypisz [identyfikator] [gracz / grupa] [oid]");
- if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
- if(!strcmp(val, "gracz"))
- {
- if(IsPlayerLogged(value2) == 0) return NoLogin(playerid);
- Pojazd[v][vOwner] = 1;
- Pojazd[v][vOwnerUID] = Player[value2][pUID];
- format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal przepisany ~g~pomyslnie~w~ na gracza ~y~%s~w~.", GetVehicleName(v), v, CharName(value2));
- InfoBoxShow(2, playerid, String, 5);
- }
- if(!strcmp(val, "grupa"))
- {
- if(Grupa[value2][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- Pojazd[v][vOwner] = 2;
- Pojazd[v][vOwnerUID] = value2;
- format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal przepisany ~g~pomyslnie~w~ na grupe ~y~%s~w~ (UID: %d).", GetVehicleName(v), v, Grupa[value2][gNazwa], value2);
- InfoBoxShow(2, playerid, String, 5);
- }
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- ZapiszPojazd(veh);
- }
- }
- return 1;
- }
- else if(!strcmp(sub, "tankuj", true))
- {
- if(sscanf(rest, "d", v))
- return Tip(playerid, "/av respawn [identyfikator]");
- if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
- Pojazd[v][vPaliwo] = Pojazd[v][vPaliwoMax];
- format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal zatankowany ~g~pomyslnie~w~.", GetVehicleName(v), v);
- return InfoBoxShow(2, playerid, String, 5);
- }
- else if(!strcmp(sub, "kolor", true))
- {
- new k1, k2;
- if(sscanf(rest, "ddd", v, k1, k2))
- return Tip(playerid, "/av kolor [identyfikator] [kolor 1] [kolor 2]");
- if(Pojazd[v][vAktywny] == 0) return InfoBoxShow(2, playerid, "Taki ~y~pojazd~w~ nie istnieje.", 3);
- if(Pojazd[v][vSpawn] == 0) return InfoBoxShow(2, playerid, "Ten ~y~pojazd~w~ nie jest zespawnowany.", 3);
- Pojazd[v][vKolor1] = k1;
- Pojazd[v][vKolor2] = k2;
- for(new veh = 0; veh < MAX_VEHICLES; veh++)
- {
- if(PojazdUID[veh] == v)
- {
- ChangeVehicleColor(veh, Pojazd[v][vKolor1], Pojazd[v][vKolor2]);
- ZapiszPojazd(veh);
- }
- }
- format(String, sizeof(String), "Pojazd ~y~%s~w~ (UID: %d) zostal przemalowany ~g~pomyslnie~w~.", GetVehicleName(v), v);
- return InfoBoxShow(2, playerid, String, 5);
- }
- return 1;
- }
- return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania ~y~pojazdami~w~ na serwerze.", 3);
- }
- CMD:mdoor(playerid, params[])
- {
- new cena = 0, nazwa[64];
- if(Sluzba(playerid) == 0)
- return Info(playerid, "Wejdź na służbę grupy, która posiada uprawnienia do tworzenia budynków.");
- if(!(pGrupaPerm[playerid][GroupSlot(playerid, Sluzba(playerid))] & PERM_MAYOR))
- return Info(playerid, "Nie posiadasz uprawnień do tworzenia budynków.");
- if(sscanf(params, "ds[64]", cena, nazwa))
- return Tip(playerid, "/mdoor [cena] [nazwa]");
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- for(new nr = 1; nr < MAX_DRZWI; nr++)
- {
- new file[40];
- format(file, sizeof(file), "Drzwi/%d.ini", nr);
- if(Drzwi[nr][dAktywne] == 0 && !DOF2_FileExists(file))
- {
- format(String, sizeof(String), "Utworzone zostały drzwi %s (UID: %d).\nPo 24 godzinach każdy gracz będzie mógł je kupić za kwotę $%d.\nPieniądze ze sprzedaży trafią na konto rządu.", nazwa, nr, cena), Info(playerid, String);
- Drzwi[nr][dAktywne] = 1;
- Drzwi[nr][dCreateTime] = gettime();
- Drzwi[nr][dCreatePrice] = cena;
- Drzwi[nr][dOwner] = 0;
- Drzwi[nr][dOwnerUID] = Player[playerid][pUID];
- Drzwi[nr][dZewVir] = GetPlayerVirtualWorld(playerid);
- Drzwi[nr][dIntZew] = GetPlayerInterior(playerid);
- Drzwi[nr][dWewVir] = nr;
- Drzwi[nr][dPickup] = 1239;
- Drzwi[nr][dObiekty] = 25;
- strmid(Drzwi[nr][dNazwa], nazwa, 0, 64, 64);
- Drzwi[nr][dWewPosX] = Pos[0];
- Drzwi[nr][dWewPosY] = Pos[1];
- Drzwi[nr][dWewPosZ] = Pos[2];
- Drzwi[nr][dZewPosX] = Pos[0];
- Drzwi[nr][dZewPosY] = Pos[1];
- Drzwi[nr][dZewPosZ] = Pos[2];
- Drzwi[nr][dStatus] = 1;
- ZapiszDrzwi(nr);
- DrzwiPickup[nr] = CreateDynamicPickup(Drzwi[nr][dPickup], 2, Drzwi[nr][dZewPosX], Drzwi[nr][dZewPosY], Drzwi[nr][dZewPosZ], Drzwi[nr][dZewVir]);
- break;
- }
- }
- return 1;
- }
- CMD:mgroup(playerid, params[])
- {
- if(Player[playerid][pMayor] == 1)
- {
- return 1;
- }
- return Info(playerid, "Nie posiadasz wystarczających uprawnień do użycia tej komendy.");
- }
- CMD:ad(playerid, params[])
- {
- if((Player[playerid][pAdmin] & ADMIN_PERM_DOOR))
- {
- new sub[80],rest[80], value1, value2, val[32], nazwa[32], query[512];
- if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/ad [stworz | usun | goto | wejscie (pickup) | wyjscie | interior | exitvw | entervw | typ | przypisz | pickup]");
- if(!strcmp(sub, "stworz", true))
- {
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- if(sscanf(rest, "s[32]", nazwa)) return Tip(playerid, "/ad stworz [nazwa]");
- for(new nr = 1; nr < MAX_DRZWI; nr++)
- {
- new file[40];
- format(file, sizeof(file), "Drzwi/%d.ini", nr);
- if(Drzwi[nr][dAktywne] == 0 && !DOF2_FileExists(file))
- {
- format(String, sizeof(String), "Utworzone zostały drzwi %s (UID: %d).", nazwa, nr), Info(playerid, String);
- Drzwi[nr][dAktywne] = 1;
- Drzwi[nr][dOwner] = 1;
- Drzwi[nr][dOwnerUID] = Player[playerid][pUID];
- Drzwi[nr][dZewVir] = GetPlayerVirtualWorld(playerid);
- Drzwi[nr][dIntZew] = GetPlayerInterior(playerid);
- Drzwi[nr][dWewVir] = nr;
- Drzwi[nr][dPickup] = 1239;
- Drzwi[nr][dObiekty] = 25;
- strmid(Drzwi[nr][dNazwa], nazwa, 0, 64, 64);
- Drzwi[nr][dWewPosX] = Pos[0];
- Drzwi[nr][dWewPosY] = Pos[1];
- Drzwi[nr][dWewPosZ] = Pos[2];
- Drzwi[nr][dZewPosX] = Pos[0];
- Drzwi[nr][dZewPosY] = Pos[1];
- Drzwi[nr][dZewPosZ] = Pos[2];
- Drzwi[nr][dStatus] = 1;
- ZapiszDrzwi(nr);
- DrzwiPickup[nr] = CreateDynamicPickup(Drzwi[nr][dPickup], 2, Drzwi[nr][dZewPosX], Drzwi[nr][dZewPosY], Drzwi[nr][dZewPosZ], Drzwi[nr][dZewVir]);
- format(query, sizeof(query), "INSERT INTO `1drzwi` (`uid`,`owner`,`owner_uid`,`name`) VALUES ('%d', '%d', '%d', '%s')", nr, Drzwi[nr][dOwner], Drzwi[nr][dOwnerUID], Drzwi[nr][dNazwa]);
- mysql_query_ex(query);
- GetPlayerFacingAngle(playerid, Drzwi[nr][dZewRot]);
- break;
- }
- }
- return 1;
- }
- else if(!strcmp(sub, "wejscie", true))
- {
- if(sscanf(rest, "d", value1)) return Tip(playerid, "/ad wejscie [identyfikator]");
- DestroyDynamicPickup(DrzwiPickup[value1]);
- GetPlayerPos(playerid, Drzwi[value1][dZewPosX], Drzwi[value1][dZewPosY], Drzwi[value1][dZewPosZ]);
- GetPlayerFacingAngle(playerid, Drzwi[value1][dZewRot]);
- return CreateDynamicPickup(Drzwi[value1][dPickup], 2, Drzwi[value1][dZewPosX], Drzwi[value1][dZewPosY], Drzwi[value1][dZewPosZ], Drzwi[value1][dZewVir]), ZapiszDrzwi(value1);
- }
- else if(!strcmp(sub, "usun", true))
- {
- if(sscanf(rest, "d", value1)) return Tip(playerid, "/ad usun [identyfikator]");
- if(Drzwi[value1][dAktywne] == 0)
- return InfoBoxShow(2, playerid, "Drzwi sa ~r~nieaktywne~w~.", 3);
- Drzwi[value1][dAktywne] = 0;
- DestroyDynamicPickup(DrzwiPickup[value1]);
- ZapiszDrzwi(value1);
- format(query, 128, "DELETE FROM `1drzwi` WHERE uid = '%d'", value1), mysql_query_ex(query);
- return InfoBoxShow(2, playerid, "Drzwi zostaly pomyslnie ~r~usuniete~w~.", 3);
- }
- else if(!strcmp(sub, "przypisz", true))
- {
- if(sscanf(rest, "ds[32]d", value1, val, value2)) return Tip(playerid, "/ad przypisz [identyfikator] [gracz / grupa] [oid]");
- if(Drzwi[value1][dAktywne] == 0)
- return InfoBoxShow(2, playerid, "Drzwi sa ~r~nieaktywne~w~.", 3);
- if(!strcmp(val, "gracz"))
- {
- if(IsPlayerLogged(value2) == 0) return NoLogin(playerid);
- Drzwi[value1][dOwner] = 1;
- Drzwi[value1][dOwnerUID] = Player[value2][pUID];
- format(String, sizeof(String), "Drzwi %s (UID: %d) zostały przypisane pomyślnie.\nTyp właściciela:\t\t%s\nWłaściciel:\t\t\t%s", Drzwi[value1][dNazwa], value1, "Gracz", CharName(value2)), Info(playerid, String);
- return ZapiszDrzwi(value1);
- }
- if(!strcmp(val, "grupa"))
- {
- if(Grupa[value2][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- Drzwi[value1][dOwner] = 2;
- Drzwi[value1][dOwnerUID] = value2;
- format(String, sizeof(String), "Drzwi %s (UID: %d) zostały przypisane pomyślnie.\nTyp właściciela:\t\t%s\nNazwa grupy:\t\t\t%s (UID: %d)", Drzwi[value1][dNazwa], value1, "Grupa", Grupa[value2][gNazwa], value2), Info(playerid, String);
- return ZapiszDrzwi(value1);
- }
- return 1;
- }
- else if(!strcmp(sub, "goto", true))
- {
- if(sscanf(rest, "d", value1))
- return Tip(playerid, "/ad goto [identyfikator]");
- if(Drzwi[value1][dAktywne] == 0)
- return InfoBoxShow(2, playerid, "Drzwi sa ~r~nieaktywne~w~.", 3);
- SetPlayerInterior(playerid, 0);
- SetPVarInt(playerid, "Teleport", 1);
- SetPlayerPos(playerid, Drzwi[value1][dZewPosX], Drzwi[value1][dZewPosY], Drzwi[value1][dZewPosZ]);
- return SetPlayerVirtualWorld(playerid, Drzwi[value1][dZewVir]);
- }
- else if(!strcmp(sub, "pickup", true))
- {
- if(sscanf(rest, "d", value1))
- return Tip(playerid, "/ad pickup [identyfikator]");
- if(Drzwi[value1][dAktywne] == 0)
- return InfoBoxShow(2, playerid, "Drzwi sa ~r~nieaktywne~w~.", 3);
- SetPVarInt(playerid, "rpDoorPickUp", value1);
- return dShowPlayerDialog(playerid, 202, DIALOG_STYLE_LIST, ""ServName"Drzwi", "1\t1240\tCzerwone serce\n2\t1242\tArmour\n3\t1239\tInfo pickup\n4\t1272\tNiebieski dom\n5\t1273\tZielony dom\n6\t1212\tBanknoty\n7\t1241\tPiguła\n8\t1247\tGwiazda LSPD\n9\t1274\tDolar\n10\t1275\tKoszulka\n11\t1314\tDwoje ludzi\n12\t1318\tBiała strzałka", "Wybierz", "Anuluj");
- }
- else if(!strcmp(sub, "wyjscie", true))
- {
- if(sscanf(rest, "d", value1))
- return Tip(playerid, "/ad wyjscie [identyfikator]");
- GetPlayerPos(playerid, Drzwi[value1][dWewPosX], Drzwi[value1][dWewPosY], Drzwi[value1][dWewPosZ]);
- Drzwi[value1][dIntWew] = GetPlayerInterior(playerid);
- InfoBoxShow(2, playerid, "Edycja drzwi zakonczona ~g~sukcesem~w~.", 3);
- GetPlayerFacingAngle(playerid, Drzwi[value1][dWewRot]);
- return ZapiszDrzwi(value1);
- }
- else if(!strcmp(sub, "wejscie", true))
- {
- if(sscanf(rest, "d", value1))
- return Tip(playerid, "/ad wejscie [identyfikator]");
- return ZapiszDrzwi(value1);
- }
- else if(!strcmp(sub, "interior", true))
- {
- new int[32], ints[3076];
- for(new nr = 1; nr < sizeof(IntArray2); nr++)
- {
- format(int, sizeof(int), "%d\t%s", nr, IntName[nr]);
- format(ints, sizeof(ints), "%s%s\n", ints, int);
- }
- return dShowPlayerDialog(playerid, 998, DIALOG_STYLE_LIST, ""ServName"Drzwi", ints, "Wybierz", "Anuluj");
- }
- else if(!strcmp(sub, "zamknij", true))
- {
- if(sscanf(rest, "d", value1))
- return Tip(playerid, "/ad zamknij [identyfikator]");
- if(Drzwi[value1][dStatus] == 1)
- {
- Drzwi[value1][dStatus] = 0;
- format(String, sizeof(String), "Drzwi %s (UID: %d) zostały otwarte.", Drzwi[value1][dNazwa], value1), Info(playerid, String);
- }
- else
- {
- Drzwi[value1][dStatus] = 1;
- format(String, sizeof(String), "Drzwi %s (UID: %d) zostały zamknięte.", Drzwi[value1][dNazwa], value1), Info(playerid, String);
- }
- return ZapiszDrzwi(value1);
- }
- else if(!strcmp(sub, "entervw", true))
- {
- if(sscanf(rest, "dd", value1, value2))
- return Tip(playerid, "/ad entervw [identyfikator] [virtual]");
- Drzwi[value1][dZewVir] = value2;
- return format(String, sizeof(String), "Virtual World wejściowy drzwi %s (UID: %d) został zmieniony na %d.", Drzwi[value1][dNazwa], value1, value2), Info(playerid, String), ZapiszDrzwi(value1);
- }
- else if(!strcmp(sub, "exitvw", true))
- {
- if(sscanf(rest, "dd", value1, value2))
- return Tip(playerid, "/ad exitvw [identyfikator] [virtual]");
- Drzwi[value1][dWewVir] = value2;
- return format(String, sizeof(String), "Virtual World wyjściowy drzwi %s (UID: %d) został zmieniony na %d.", Drzwi[value1][dNazwa], value1, value2), Info(playerid, String), ZapiszDrzwi(value1);
- }
- return 1;
- }
- return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania ~y~drzwiami~w~ na serwerze.", 3);
- }
- CMD:ag(playerid, params[])
- {
- if((Player[playerid][pAdmin] & ADMIN_PERM_GROUP))
- {
- new sub[80],rest[80], gracz, id, value[256], text[256], valueINT;
- if(sscanf(params, "s[80]S()[80]", sub, rest)) return Tip(playerid, "/ag [stworz | lider | zapros | wypros | panel | kolor | payday]"), Tip(playerid, "/ag [nazwa | pub | tag | lista | usun | flagi | typ | produkt]");
- if(!strcmp(sub, "stworz", true))
- {
- new nazwa[64];
- if(sscanf(rest, "s[64]", nazwa)) return Tip(playerid, "/ag stworz [nazwa]");
- for(new nr = 1; nr < MAX_GRUPY; nr++)
- {
- new file[40];
- format(file, sizeof(file), "Grupy/%d.ini", nr);
- if(Grupa[nr][gAktywna] == 0 && !DOF2_FileExists(file))
- {
- Grupa[nr][gAktywna] = 1;
- Grupa[nr][gOwner] = 0;
- Grupa[nr][gPunkty] = 0;
- Grupa[nr][gPayDay] = 100;
- Grupa[nr][gTyp] = 1;
- strmid(Grupa[nr][gNazwa], nazwa, 0, 64, 64);
- strmid(Grupa[nr][gTag], "NONE", 0, 64, 64);
- Grupa[nr][gBank] = 0;
- Grupa[nr][gKolor] = -1;
- Grupa[nr][gKolorZone] = -1;
- //flagi
- Grupa[nr][gFlagPerm] = 3;
- Grupa[nr][gVehLimit] = 5;
- ZapiszGrupe(nr);
- GrupaInfo(playerid, nr);
- break;
- }
- }
- return 1;
- }
- else if(!strcmp(sub, "lider", true))
- {
- if(sscanf(rest, "ud", gracz, id)) return Tip(playerid, "/ag lider [gracz] [grupa]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- if(GrupaSlot(gracz, id) != 0) return format(String, sizeof(String), "~w~Gracz juz jest czlonkiem ~y~grupy~w~ o ~y~UID~w~ %d.", id), InfoBoxShow(2, playerid, String, 3);
- if(pGrupa[gracz][1] == 0 || Grupa[pGrupa[gracz][1]][gAktywna] == 0)
- {
- pGrupa[gracz][1] = id, pGrupaPerm[gracz][1] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][2] == 0 || Grupa[pGrupa[gracz][2]][gAktywna] == 0)
- {
- pGrupa[gracz][2] = id, pGrupaPerm[gracz][2] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][3] == 0 || Grupa[pGrupa[gracz][3]][gAktywna] == 0)
- {
- pGrupa[gracz][3] = id, pGrupaPerm[gracz][3] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][4] == 0 || Grupa[pGrupa[gracz][4]][gAktywna] == 0)
- {
- pGrupa[gracz][4] = id, pGrupaPerm[gracz][4] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][5] == 0 || Grupa[pGrupa[gracz][5]][gAktywna] == 0)
- {
- pGrupa[gracz][5] = id, pGrupaPerm[gracz][5] = MAX_LEADER_PERM - 64, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d) na stanowisko lidera.", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- return InfoBoxShow(2, playerid, "Gracz posiada zajete wszystkie sloty grupowe, nie mozesz go zaprosic.", 3);
- }
- else if(!strcmp(sub, "zapros", true))
- {
- if(sscanf(rest, "ud", gracz, id)) return Tip(playerid, "/ag zapros [gracz] [grupa]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- if(GrupaSlot(gracz, id) != 0) return format(String, sizeof(String), "~w~Gracz juz jest czlonkiem ~y~grupy~w~ o ~y~UID~w~ %d.", id), InfoBoxShow(2, playerid, String, 3);
- if(pGrupa[gracz][1] == 0)
- {
- pGrupa[gracz][1] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][2] == 0)
- {
- pGrupa[gracz][2] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][3] == 0)
- {
- pGrupa[gracz][3] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][4] == 0)
- {
- pGrupa[gracz][4] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][5] == 0)
- {
- pGrupa[gracz][5] = id, format(String, sizeof(String), "Administrator %s zaprosił Cię do grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Zaprosiłeś jako Administrator gracza %s do grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- return InfoBoxShow(2, playerid, "Gracz posiada zajete wszystkie sloty grupowe, nie mozesz go zaprosic.", 3);
- }
- else if(!strcmp(sub, "wypros", true))
- {
- if(sscanf(rest, "ud", gracz, id)) return Tip(playerid, "/ag wypros [gracz] [grupa]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- if(pGrupa[gracz][1] == id)
- {
- pGrupa[gracz][1] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][2] == id)
- {
- pGrupa[gracz][2] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][3] == id)
- {
- pGrupa[gracz][3] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][4] == id)
- {
- pGrupa[gracz][4] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- if(pGrupa[gracz][5] == id)
- {
- pGrupa[gracz][5] = 0, format(String, sizeof(String), "Administrator %s wyprosił Cię z grupy %s (UID: %d).", CharName(playerid), Grupa[id][gNazwa], id), Info(gracz, String);
- return format(String, sizeof(String), "Wyprosiłeś jako Administrator gracza %s z grupy %s (UID: %d).", CharName(gracz), Grupa[id][gNazwa], id), Info(playerid, String);
- }
- format(String, sizeof(String), "~w~Gracz nie jest czlonkiem ~y~grupy~w~ o ~y~UID~w~ %d.", id);
- return InfoBoxShow(2, playerid, String, 3);
- }
- else if(!strcmp(sub, "panel", true))
- {
- if(sscanf(rest, "ud", gracz, id)) return Tip(playerid, "/ag panel [gracz] [grupa]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- return ZapiszGrupe(id);
- }
- else if(!strcmp(sub, "kolor", true))
- {
- if(sscanf(rest, "ds[256]", id, value)) return Tip(playerid, "/ag kolor [identyfikator] [kolor]");
- if(strlen(value)!=6) return InfoBoxShow(2, playerid, "Kolor ~b~~h~RGB~w~ nie moze miec wiecej niz 6 znakow.", 3);
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- format(text, sizeof(text), "0x%sBB", value);
- Grupa[id][gKolor] = hexstring(text);
- format(text, sizeof(text), "0x%sAA", value);
- Grupa[id][gKolorZone] = hexstring(text);
- InfoBoxShow(2, playerid, "Kolor rozpoznawczy grupy zostal zmieniony.", 3);
- return ZapiszGrupe(id);
- }
- else if(!strcmp(sub, "payday", true))
- {
- if(sscanf(rest, "dd", id, valueINT)) return Tip(playerid, "/ag payday [identyfikator] [dotacja]");
- if(valueINT > 1000) return InfoBoxShow(2, playerid, "Kwota wyplaty nie moze przekraczac ~g~$1000~w~.", 3);
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- Grupa[id][gPayDay] = valueINT;
- GrupaInfo(playerid, id);
- return ZapiszGrupe(id);
- }
- else if(!strcmp(sub, "nazwa", true))
- {
- if(sscanf(rest, "ds[64]", id, value)) return Tip(playerid, "/ag nazwa [identyfikator] [nazwa]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- strmid(Grupa[id][gNazwa], value, 0, 64, 64);
- return GrupaInfo(playerid, id), ZapiszGrupe(id);
- }
- else if(!strcmp(sub, "tag", true))
- {
- if(sscanf(rest, "ds[8]", id, value)) return Tip(playerid, "/ag tag [identyfikator] [tag]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- if(strlen(value) >= 5)
- return Info(playerid, "Wpisany przez Ciebie tag jest zbyt długi.");
- strmid(Grupa[id][gTag], value, 0, 64, 64);
- return GrupaInfo(playerid, id), ZapiszGrupe(id);
- }
- else if(!strcmp(sub, "usun", true))
- {
- if(sscanf(rest, "d", id)) return Tip(playerid, "/ag usun [idenfytikator]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- for(new nr = 1; nr < MAX_GRUPY; nr++)
- {
- new file[40];
- format(file, sizeof(file), "Grupy/%d.ini", nr);
- if(Grupa[nr][gAktywna] == 1 && Grupa[nr][gOwner] == id && id != nr)
- {
- Grupa[nr][gAktywna] = 0;
- ZapiszGrupe(nr);
- }
- }
- /* for(new d = 1; d < MAX_DRZWI; d++)
- {
- if(Drzwi[d][dOwner] == 2 && Drzwi[d][dOwnerUID] == id)
- {
- Drzwi[d][dAktywne] = 0;
- DestroyDynamicPickup(DrzwiPickup[d]);
- ZapiszDrzwi(d);
- }
- }
- for(new v = 1; v < MAX_POJAZDY; v++)
- {
- if(Pojazd[v][vOwner] == 2 && Pojazd[v][vOwnerUID] == id)
- {
- Pojazd[v][vAktywny] = 0, ZapiszPojazd(v);
- }
- }
- */
- Grupa[id][gAktywna] = 0;
- ZapiszGrupe(id);
- return Info(playerid, "Grupa została pomyślnie usunięta.");
- }
- else if(!strcmp(sub, "lista", true))
- {
- new grupa[128], grupy[1024], grup = 0;
- format(grupa, sizeof(grupa), "{AAC5E3}UID\tNazwa{FFFFFF}");
- for(new nr = 1; nr < MAX_GRUPY; nr++)
- {
- if(Grupa[nr][gAktywna] == 1 && Grupa[nr][gOwner] == 0)
- {
- new grupe = 0;
- for(new nrg = 1; nrg < MAX_GRUPY; nrg++)
- {
- if(Grupa[nrg][gAktywna] == 1 && Grupa[nrg][gOwner] == nr)
- {
- grupe++;
- }
- }
- ListItem[playerid][grup] = nr;
- if(grupe == 0)
- format(grupa, sizeof(grupa), "%d\t%s", nr, Grupa[nr][gNazwa]);
- else
- format(grupa, sizeof(grupa), "%d\t%s (%d)", nr, Grupa[nr][gNazwa], grupe);
- format(grupy, sizeof(grupy), "%s%s\n", grupy, grupa);
- grup++;
- }
- }
- if(grup == 0) return Info(playerid, "Nie istnieją żadne grupy.");
- dShowPlayerDialog(playerid, 9950, DIALOG_STYLE_LIST, ""ServName"Grupy", grupy, "Wybierz", "");
- }
- else if(!strcmp(sub, "typ", true))
- {
- new typ[32], typy[512];
- if(sscanf(rest, "d", id)) return Tip(playerid, "/ag typ [grupa]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- SetPVarInt(playerid, "GroupType", id);
- for(new t = 1; t < sizeof(TypGrupy); t++)
- {
- new tmp = t;
- format(typ, sizeof(typ), "%d\t%s", t, TypGrupy[tmp]);
- format(typy, sizeof(typy), "%s%s\n", typy, typ);
- }
- return dShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, ""ServName"Typ grupy", typy, "Wybierz", "Anuluj");
- }
- else if(!strcmp(sub, "produkt", true))
- {
- if(sscanf(rest, "d", id)) return Tip(playerid, "/ag produkt [grupa]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- SetPVarInt(playerid, "GrupaDodajProdukt", id);
- return dShowPlayerDialog(playerid, 1001, DIALOG_STYLE_INPUT, ""ServName"Dodawanie produktów", "[typ] [w 1] [w 2] [w 3] [waga] [cena] [ilość] [nazwa]", "Dodaj", "Anuluj");
- }
- else if(!strcmp(sub, "perm", true))
- {
- new perm;
- if(sscanf(rest, "dd", id, perm)) return Tip(playerid, "/ag produkt [grupa] [perm]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- Grupa[id][gFlagPerm] = perm, ZapiszGrupe(id);
- }
- else if(!strcmp(sub, "bank", true))
- {
- new perm;
- if(sscanf(rest, "dd", id, perm)) return Tip(playerid, "/ag bank [grupa] [kwota]");
- if(Grupa[id][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa ~r~nie jest aktywna~w~.", 3);
- Grupa[id][gBank] = perm, ZapiszGrupe(id);
- }
- return 1;
- }
- return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania ~y~grupami~w~ na serwerze.", 3);
- }
- // System obiektów
- CMD:mgate(playerid, params[])
- {
- if(Obiekt(playerid) == 0)
- return Tip(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- if(Obiekt[Obiekt(playerid)][oGate] == 0)
- {
- Tip(playerid, "Funkcja bramy dla tego obiektu została włączona.");
- Obiekt[Obiekt(playerid)][oGate] = 1;
- }
- else
- {
- Tip(playerid, "Funkcja bramy dla tego obiektu została wyłączona.");
- Obiekt[Obiekt(playerid)][oGate] = 0;
- }
- return 1;
- }
- CMD:mc(playerid, params[])
- {
- new model;
- if(sscanf(params, "d", model))
- return Tip(playerid, "/mc [model obiektu]");
- if((Player[playerid][pAdmin] & ADMIN_PERM_GROUP))
- {
- for(new nr = 1; nr < MAX_OBIEKT; nr++)
- {
- if(Obiekt[nr][oAktywny] == 0)
- {
- Obiekt[nr][oAktywny] = 1;
- Obiekt[nr][oModel] = model;
- Obiekt[nr][oVir] = GetPlayerVirtualWorld(playerid);
- Obiekt[nr][oTyp] = 0; // obiekt nie jest bramą
- //edycja tekstury
- strmid(Obiekt[Obiekt(playerid)][oMatTxdname], " ", 0, 32, 32);
- strmid(Obiekt[Obiekt(playerid)][oMatTexture], " ", 0, 32, 32);
- Obiekt[Obiekt(playerid)][oMatModel] = 0;
- Obiekt[Obiekt(playerid)][oMatIndex] = 0;
- GetPlayerPos(playerid, Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ]);
- MapObiekt[nr] = CreateDynamicObject(Obiekt[nr][oModel], Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ], Obiekt[nr][oRotX], Obiekt[nr][oRotY], Obiekt[nr][oRotZ], Obiekt[nr][oVir]);
- ZapiszObiekt(nr);
- setObiekt(playerid, nr);
- EditDynamicObject(playerid, MapObiekt[nr]);
- break;
- }
- }
- return 1;
- }
- for(new p = 0; p < MAX_DRZWI; p++)
- {
- if(Drzwi[p][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]) && Drzwi[p][dWewVir] == GetPlayerVirtualWorld(playerid))
- {
- if(pDrzwi(playerid, p) != 0)
- {
- if(DoorObject(p) >= Drzwi[p][dObiekty])
- return Info(playerid, "Przekroczyłeś dopuszczalną ilość stworzonych obiektów w tych drzwiach.");
- for(new nr = 1; nr < MAX_OBIEKT; nr++)
- {
- if(Obiekt[nr][oAktywny] == 0)
- {
- Obiekt[nr][oAktywny] = 1;
- Obiekt[nr][oModel] = model;
- Obiekt[nr][oVir] = GetPlayerVirtualWorld(playerid);
- Obiekt[nr][oTyp] = 0; // obiekt nie jest bramą
- GetPlayerPos(playerid, Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ]);
- MapObiekt[nr] = CreateDynamicObject(Obiekt[nr][oModel], Obiekt[nr][oPosX], Obiekt[nr][oPosY], Obiekt[nr][oPosZ], Obiekt[nr][oRotX], Obiekt[nr][oRotY], Obiekt[nr][oRotZ], Obiekt[nr][oVir]);
- ZapiszObiekt(nr);
- EditDynamicObject(playerid, MapObiekt[nr]);
- break;
- }
- }
- }
- else
- {
- Info(playerid, "Nie jesteś właścicielem tych drzwi.");
- }
- break;
- }
- if(p >= MAX_DRZWI - 1)
- return InfoBoxShow(2, playerid, "Nie znajdujesz sie w zadnym z ~y~budynkow~w~.", 3);
- }
- return 1;
- }
- CMD:md(playerid, params[])
- {
- if(Obiekt(playerid) == 0)
- return Tip(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- CancelEdit(playerid), SetPVarInt(playerid, "objectedit", 0);
- DestroyDynamicObject(MapObiekt[Obiekt(playerid)]);
- Obiekt[Obiekt(playerid)][oAktywny] = 0;
- format(String, sizeof(String), "Obiekty/%d.ini", Obiekt(playerid));
- setObiekt(playerid, 0);
- InfoBoxShow(2, playerid, "Edycja obiektow zostala ~r~zakonczona~w~.", 3);
- ClearAnimations(playerid);
- return DOF2_RemoveFile(String);
- }
- CMD:msel(playerid, params[])
- {
- if((Player[playerid][pAdmin] & ADMIN_PERM_GROUP))
- {
- if(GetPVarInt(playerid, "objectedit") == 0)
- return SelectObject(playerid), SetPVarInt(playerid, "objectedit", 1);
- return CancelEdit(playerid), Tip(playerid, "Edycja obiektów zakończona."), SetPVarInt(playerid, "objectedit", 0);
- }
- for(new p = 0; p < MAX_DRZWI; p++)
- {
- if(Drzwi[p][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]) && Drzwi[p][dWewVir] == GetPlayerVirtualWorld(playerid))
- {
- if(pDrzwi(playerid, p) != 0)
- {
- if(GetPVarInt(playerid, "objectedit") == 0)
- return SelectObject(playerid), SetPVarInt(playerid, "objectedit", 1);
- return CancelEdit(playerid), Tip(playerid, "Edycja obiektów zakończona."), SetPVarInt(playerid, "objectedit", 0);
- }
- else
- {
- Info(playerid, "Nie jesteś właścicielem tych drzwi.");
- }
- break;
- }
- if(p >= MAX_DRZWI - 1)
- return InfoBoxShow(2, playerid, "Nie znajdujesz sie w zadnym z ~y~budynkow~w~.", 3);
- }
- return 1;
- }
- CMD:mmat(playerid, params[])
- {
- if(Obiekt(playerid) == 0)
- return Tip(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- new materialindex, modelid, txdname[128], texturename[128];
- if(sscanf(params, "dds[128]s[128]", materialindex, modelid, txdname, texturename))
- return Tip(playerid, "/mmat [index] [model] [txdname] [texturename]");
- InfoBoxShow(2, playerid, "Tekstura zostala nalozona na ~y~obiekt~w~.", 3);
- strmid(Obiekt[Obiekt(playerid)][oMatTxdname], txdname, 0, 32, 32);
- strmid(Obiekt[Obiekt(playerid)][oMatTexture], texturename, 0, 32, 32);
- Obiekt[Obiekt(playerid)][oMatModel] = modelid;
- Obiekt[Obiekt(playerid)][oMatIndex] = materialindex;
- ZapiszObiekt(Obiekt(playerid));
- return SetDynamicObjectMaterial(Obiekt(playerid), materialindex, modelid, txdname, texturename, 0xFFFFFFFF);
- }
- //
- CMD:d(playerid, params[])
- {
- new wiadomosc[200];
- if(Sluzba(playerid) == 0 || !(Grupa[Sluzba(playerid)][gFlagPerm] & G_FLAG_DEPARTMENT)) return InfoBoxShow(2, playerid, "Musisz byc na sluzbie ~y~grupy~w~, ktora ma uprawnienia do korzystania z czatu departamentowego.", 3);
- if(sscanf(params, "s[200]", wiadomosc))
- return Tip(playerid, "/d [wiadomość]");
- format(String, sizeof(String),"%s (słuchawka): %s", CharName(playerid), wiadomosc);
- PokazTekst(10.0, playerid, String, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
- foreach(Player, p)
- {
- if((Grupa[Sluzba(p)][gFlagPerm] & G_FLAG_DEPARTMENT))
- {
- format(String, sizeof(String), "** (%s) %s: %s **", Grupa[Sluzba(playerid)][gTag], CharName(playerid), wiadomosc);
- SendClientMessage(p, 0x41B51AFF, String);
- }
- }
- return 1;
- }
- CMD:ame(playerid, params[])
- {
- new desc[128];
- if(sscanf(params, "s[128]", desc))
- return Tip(playerid, "/ame [Akcja]");
- if(strlen(desc) > 120 || strlen(desc) < 30)
- return Info(playerid, "Opis powinien mieć od 30 do 120 znaków.");
- desc[0] = chrtolower(desc[0]);
- format(String, sizeof(String), "** %s **", WordWrap(desc, 7));
- return UpdateDynamic3DTextLabelText(Text3D:Player[playerid][pAme], COLOR_PURPLE, String), SetPVarInt(playerid, "rpAme", gettime()+5);
- }
- CMD:me(playerid, params[])
- {
- new text[128], string[256];
- if(sscanf(params, "s[128]", text))
- {
- Tip(playerid, "/me [Akcja]");
- return 1;
- }
- text[0] = chrtolower(text[0]);
- if(strlen(text) < 78)
- {
- format(string, sizeof(string), "** %s %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- else
- {
- new pos = strfind(text, " ", true, strlen(text) / 2);
- if(pos != -1)
- {
- new text2[64];
- strmid(text2, text, pos + 1, strlen(text));
- strdel(text, pos, strlen(text));
- format(string, sizeof(string), "** %s %s ...", CharName(playerid), text);
- ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- format(string, sizeof(string), " ...%s", text2);
- ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- }
- return 1;
- }
- CMD:ja(playerid, params[]) return cmd_me(playerid, params);
- CMD:do(playerid, params[])
- {
- new text[128], string[256];
- if(sscanf(params, "s[128]", text))
- {
- Tip(playerid, "/do [Sytuacja]");
- return 1;
- }
- text[0] = chrtoupper(text[0]);
- if(strlen(text) < 78)
- {
- format(string, sizeof(string), "** %s (( %s ))", text, CharName(playerid));
- ProxDetector(10.0, playerid, string, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO);
- }
- else
- {
- new pos = strfind(text, " ", true, strlen(text) / 2);
- if(pos != -1)
- {
- new text2[64];
- strmid(text2, text, pos + 1, strlen(text));
- strdel(text, pos, strlen(text));
- format(string, sizeof(string), "** %s...", text);
- ProxDetector(10.0, playerid, string, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO);
- format(string, sizeof(string), " ...%s (( %s ))", text2, CharName(playerid));
- ProxDetector(10.0, playerid, string, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO, COLOR_DO);
- }
- }
- return 1;
- }
- CMD:sprobuj(playerid, params[])
- {
- new text[128], string[256];
- if(sscanf(params, "s[128]", text))
- {
- Tip(playerid, "/sprobuj [Akcja np. podnieść teczkę]");
- return 1;
- }
- new loss = random(2);
- switch(loss)
- {
- case 0:
- {
- if(Player[playerid][pSex] == CHAR_SEX_MALE)
- {
- format(string, sizeof(string), "*** %s zawiódł próbując %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- else
- {
- format(string, sizeof(string), "*** %s zawiodła próbując %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- }
- case 1:
- {
- if(Player[playerid][pSex] == CHAR_SEX_MALE)
- {
- format(string, sizeof(string), "*** %s odniósł sukces próbując %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- else
- {
- format(string, sizeof(string), "*** %s odniosła sukces próbując %s", CharName(playerid), text);
- ProxDetector(10.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- }
- }
- return 1;
- }
- CMD:a(playerid, params[])
- {
- new adm[64], list[512], admin = 0;
- foreach(Player, p)
- {
- if(Status(p) == 2)
- {
- if(GetPVarInt(p, "Grupa") == 4)
- format(adm, sizeof(adm), "%d\t{BB0000}Administrator\t{FFFFFF}%d\t%s", p, 0, CharName(p));
- else
- format(adm, sizeof(adm), "%d\t{0D7715}GameMaster\t{FFFFFF}%d\t%s", p, 0, CharName(p));
- format(list, sizeof(list), "%s%s\n", list, adm);
- admin++;
- }
- }
- if(admin == 0) return InfoBoxShow(2, playerid, "Brak ~r~administratorow~w~ na sluzbie.", 3);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, ""ServName"Administracja", list, "Wybierz", "Anuluj");
- }
- CMD:paczka(playerid, params[])
- {
- if(Player[playerid][pJob] != 2)
- return InfoBoxShow(2, playerid, "Ta komenda przeznaczona jest dla ~y~kurierow~w~, Twoja ~y~postac~w~ nie moze pobierac ~y~paczek~w~.", 3);
- if(GetPVarInt(playerid, "rpPaczka") == 0)
- {
- if(InDoor(playerid) != 5)
- {
- InfoBoxShow(2, playerid, "Nie znajdujesz sie w ~y~magazynie~w~. System zaznaczyl Ci ~y~budynek~w~, do ktorego masz sie udac na mapie.", 3);
- return SetPlayerMapIcon(playerid, 0, Drzwi[5][dZewPosX], Drzwi[5][dZewPosY], Drzwi[5][dZewPosZ], 51, 0, MAPICON_GLOBAL_CHECKPOINT);
- }
- new paczki = 0, pack[64], list[1024];
- for(new i = 0; i < MAX_ITEM; i++)
- {
- if(Paczka[i][pAktywna] == 1 && Paczka[i][pDostarcza] == 0)
- {
- ListItem[playerid][paczki] = i;
- new typ = Paczka[i][pTyp];
- if(typ == 1 || typ == 6 || typ == 9 || typ == 14 || typ == 15)
- format(pack, sizeof(pack), "%d\t{F0F2C8}%s{FFFFFF}", i, Drzwi[Paczka[i][pDoor]][dNazwa]);
- else
- format(pack, sizeof(pack), "{FFFFFF}%d\t%s{FFFFFF}", i, Drzwi[Paczka[i][pDoor]][dNazwa]);
- format(list, sizeof(list), "%s%s\n", list, pack);
- paczki++;
- }
- }
- if(paczki == 0)
- return InfoBoxShow(2, playerid, "W ~y~magazynie~w~ nie odnaleziono zadnych paczek, ktore oczekuja na dostarczenie.", 3);
- return dShowPlayerDialog(playerid, 2501, DIALOG_STYLE_LIST, ""ServName"Paczki", list, "Wybierz", "Anuluj");
- }
- if(InDoor(playerid) == Paczka[GetPVarInt(playerid, "rpPaczka")][pDoor])
- {
- new p = GetPVarInt(playerid, "rpPaczka");
- if(Paczka[p][pAktywna] == 1)
- {
- new powtorzenia = 0, ilosc, cena, cash;
- for(new nr = 1; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iAktywny] == 0)
- {
- ilosc = Paczka[p][pIlosc], cena = Paczka[p][pPrice];
- cash = ilosc*cena;
- Przedmiot[nr][iAktywny] = 1;
- Przedmiot[nr][iTyp] = Paczka[p][pTyp];
- Przedmiot[nr][iWartosc1] = Paczka[p][pValue1];
- Przedmiot[nr][iWartosc2] = Paczka[p][pValue2];
- Przedmiot[nr][iWartosc3] = Paczka[p][pValue3];
- Przedmiot[nr][iOwner] = Paczka[p][pOwner];
- Przedmiot[nr][iOwnerUID] = Paczka[p][pOwnerUID];
- Przedmiot[nr][iWaga] = Paczka[p][pWaga];
- Przedmiot[nr][iUsed] = 0;
- Przedmiot[nr][iVir] = 0;
- Przedmiot[nr][iPrice] = Paczka[p][pPrice];
- Przedmiot[nr][iFlaga] = Paczka[p][pFlaga];
- Przedmiot[nr][iFlagaUID] = Paczka[p][pFlagaUID];
- strmid(Przedmiot[nr][iNazwa], Paczka[p][pNazwa], 0, 64, 64);
- ZapiszPrzedmiot(nr);
- powtorzenia++;
- if(powtorzenia == Paczka[p][pIlosc])
- {
- Paczka[p][pAktywna] = 0;
- Paczka[p][pDostarcza] = 0;
- break;
- }
- }
- }
- RemovePlayerMapIcon(playerid, 0);
- SetPVarInt(playerid, "rpPaczka", 0);
- if(GetPVarInt(playerid, "rpSpecialPack") == 0)
- {
- if(cash > 0 && cash <= 100)
- return sKasa(playerid, 10), InfoBoxShow(2, playerid, "Otrzymujesz ~g~$~y~10~w~ za dostarczenie paczki.", 3);
- else if(cash > 100 && cash <= 200)
- return sKasa(playerid, 20), InfoBoxShow(2, playerid, "Otrzymujesz ~g~$~y~20~w~ za dostarczenie paczki.", 3);
- else if(cash > 200 && cash <= 500)
- return sKasa(playerid, 30), InfoBoxShow(2, playerid, "Otrzymujesz ~g~$~y~30~w~ za dostarczenie paczki.", 3);
- else if(cash > 500)
- return sKasa(playerid, 40), InfoBoxShow(2, playerid, "Otrzymujesz ~g~$~y~40~w~ za dostarczenie paczki.", 3);
- }
- else
- {
- if(cash > 0 && cash <= 100)
- return Grupa[GetPVarInt(playerid, "rpSpecialPack")][gPunkty] += 15/10, Grupa[GetPVarInt(playerid, "rpSpecialPack")][gBank] += 15, InfoBoxShow(2, playerid, "Firma kurierska otrzymuje ~g~$~y~15~w~ za dostarczenie paczki.", 3);
- else if(cash > 100 && cash <= 200)
- return Grupa[GetPVarInt(playerid, "rpSpecialPack")][gPunkty] += 25/10, Grupa[GetPVarInt(playerid, "rpSpecialPack")][gBank] += 25, InfoBoxShow(2, playerid, "Firma kurierska otrzymuje ~g~$~y~25~w~ za dostarczenie paczki.", 3);
- else if(cash > 200 && cash <= 500)
- return Grupa[GetPVarInt(playerid, "rpSpecialPack")][gPunkty] += 35/10, Grupa[GetPVarInt(playerid, "rpSpecialPack")][gBank] += 35, InfoBoxShow(2, playerid, "Firma kurierska otrzymuje ~g~$~y~35~w~ za dostarczenie paczki.", 3);
- else if(cash > 500)
- return Grupa[GetPVarInt(playerid, "rpSpecialPack")][gPunkty] += 45/10, Grupa[GetPVarInt(playerid, "rpSpecialPack")][gBank] += 45, InfoBoxShow(2, playerid, "Firma kurierska otrzymuje ~g~$~y~45~w~ za dostarczenie paczki.", 3);
- }
- }
- }
- else
- {
- InfoBoxShow(2, playerid, "Aby dostarczyc ~y~paczke~w~ musisz znajdowac sie we wnetrzu budynku, do ktorego jest ona zaadresowana.", 6);
- }
- return 1;
- }
- CMD:wedkuj(playerid, params[])
- {
- if(GetPVarInt(playerid, "rpWedka1") != 0)
- return Tip(playerid, "Łowisz już ryby");
- for(new nr = 1; nr < MAX_ITEM; nr++)
- {
- if(Przedmiot[nr][iTyp] == 21 && Przedmiot[nr][iAktywny] == 1)
- {
- if(Przedmiot[nr][iOwner] == 1 && Przedmiot[nr][iOwnerUID] == Player[playerid][pUID])
- {
- if(Przedmiot[nr][iWartosc2] == 3 && Przedmiot[nr][iUsed] == 1)
- {
- SetPVarInt(playerid, "rpWedka1", nr);
- SetPVarInt(playerid, "rpWedka2", gettime()+60);
- SetPVarInt(playerid, "rpWedka3", 0);
- break;
- }
- }
- }
- if(nr == MAX_ITEM -1)
- return InfoBoxShow(2, playerid, "Aby moc ~y~lowic~w~ ryby, musisz miec w uzyciu wedke.", 6);
- }
- return ApplyAnimation(playerid, "SWORD", "sword_block", 50.0, 0, 1, 0, 1, 1);
- }
- CMD:id(playerid, params[])
- {
- if(isnull(params)) return Tip(playerid, "/id [część nicku]");
- new player[64], list[1024];
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(Login(i))
- {
- if(strfind(NickSAMP(i), params, false, 0) != -1)
- {
- format(player, sizeof(player), "%d\t%s", i, CharName(i));
- format(list, sizeof(list), "%s%s\n", list, player);
- }
- if(i == MAX_PLAYERS - 1)
- return InfoBoxShow(2, playerid, "~r~Nie odnaleziono~w~ zadnego ~y~gracza~w~.", 6);
- }
- }
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, ""ServName"Gracze", list, "Wybierz", "Anuluj");
- }
- CMD:pokoj(playerid, params[])
- {
- return cmd_hotel(playerid, params);
- }
- CMD:praca(playerid, params[])
- {
- if(InDoor(playerid) == 18)
- {
- dShowPlayerDialog(playerid, 997, DIALOG_STYLE_LIST, ""ServName"Praca dorywcza", "1\tMechanik\n2\tKurier\n3\tRybak", "Wybierz", "Anuluj");
- }
- else
- {
- Info(playerid, "Aby podjąć pracę, musisz znajdować się w budynku urzędu miasta.");
- }
- return 1;
- }
- CMD:hotel(playerid, params[])
- {
- new sub[80],rest[80];
- if(sscanf(params, "s[80]S()[80]", sub, rest))
- return Tip(playerid, "/hotel [zamelduj, wymelduj, wejdz, wyjdz, info]");
- if(InDoor(playerid) == 0)
- return InfoBoxShow(2, playerid, "Aby wynajac pokoj, musisz znajdowac sie w ~y~budynku~w~.", 3);
- if(Drzwi[InDoor(playerid)][dOwner] == 2)
- {
- if(Grupa[Drzwi[InDoor(playerid)][dOwnerUID]][gTyp] != 10)
- return InfoBoxShow(2, playerid, "~y~Budynek~w~, w ktorym sie znajdujesz ~r~nie jest podpisany~w~ pod skrypt hotelu.", 3);
- }
- else
- {
- return InfoBoxShow(2, playerid, "~y~Budynek~w~, w ktorym sie znajdujesz ~r~nie jest podpisany~w~ pod skrypt hotelu.", 3);
- }
- if(!strcmp(sub, "zamelduj"))
- {
- new nazwa[16];
- if(sscanf(rest, "s[16]", nazwa))
- return Tip(playerid, "/hotel zamelduj [maly, sredni, duzy]");
- if(Player[playerid][pSpawn] == 2 && Player[playerid][pSpawnID] == InDoor(playerid))
- return Info(playerid, "Jesteś już zameldowany w tym hotelu.");
- Player[playerid][pSpawn] = 2;
- Player[playerid][pSpawnID] = InDoor(playerid);
- if(!strcmp(rest, "maly"))
- {
- SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
- SetPlayerInterior(playerid, IntArray2[49][0]);
- SetPlayerPos(playerid, IntArray[49][0], IntArray[49][1], IntArray[49][2]);
- SetPlayerFacingAngle(playerid, IntArray[49][3]);
- Player[playerid][pSpawnTyp] = 1;
- InfoBoxShow(2, playerid, "Swietnie! ~y~Zameldowales~w~ sie w hotelu, od teraz co noc z Twojego konta bedzie pobierana oplata w kwocie ~g~$~y~10~w~ za wynajecie pokoju.", 5);
- }
- else if(!strcmp(rest, "sredni"))
- {
- SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
- SetPlayerInterior(playerid, IntArray2[58][0]);
- SetPlayerPos(playerid, IntArray[58][0], IntArray[58][1], IntArray[58][2]);
- SetPlayerFacingAngle(playerid, IntArray[58][3]);
- Player[playerid][pSpawnTyp] = 2;
- InfoBoxShow(2, playerid, "Swietnie! ~y~Zameldowales~w~ sie w hotelu, od teraz co noc z Twojego konta bedzie pobierana oplata w kwocie ~g~$~y~20~w~ za wynajecie pokoju.", 5);
- }
- else if(!strcmp(rest, "duzy"))
- {
- Player[playerid][pSpawnTyp] = 3;
- InfoBoxShow(2, playerid, "Swietnie! ~y~Zameldowales~w~ sie w hotelu, od teraz co noc z Twojego konta bedzie pobierana oplata w kwocie ~g~$~y~30~w~ za wynajecie pokoju.", 5);
- }
- format(String, sizeof(String), "* %s odebrał klucz do pokoju od recepcjonisty.", CharName(playerid));
- return ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- }
- else if(!strcmp(sub, "wymelduj"))
- {
- if(Player[playerid][pSpawn] == 2)
- {
- if(Player[playerid][pSpawnID] != InDoor(playerid))
- return Info(playerid, "Nie jesteś zameldowany w tym hotelu.");
- Player[playerid][pSpawn] = 0;
- Player[playerid][pSpawnID] = 0;
- }
- else
- {
- Info(playerid, "Nie jesteś zameldowany w hotelu.");
- }
- return 1;
- }
- else if(!strcmp(sub, "info"))
- {
- //informacje
- return 1;
- }
- else if(!strcmp(sub, "wejdz"))
- {
- if(Player[playerid][pSpawn] == 2)
- {
- if(Player[playerid][pSpawnID] == InDoor(playerid))
- {
- format(String, sizeof(String), "* %s wszedł do pokoju hotelowego.", CharName(playerid)), ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- if(Player[playerid][pSpawnTyp] == 1)
- {
- SetPlayerVirtualWorld(playerid, Player[playerid][pUID]+1000);
- SetPlayerInterior(playerid, IntArray2[49][0]);
- SetPlayerPos(playerid, IntArray[49][0], IntArray[49][1], IntArray[49][2]);
- return SetPlayerFacingAngle(playerid, IntArray[49][3]);
- }
- else if(Player[playerid][pSpawnTyp] == 2)
- {
- }
- else if(Player[playerid][pSpawnTyp] == 3)
- {
- }
- }
- else
- {
- Info(playerid, "Nie wynajmujesz pokoju w tym hotelu.");
- }
- }
- else
- {
- Info(playerid, "Budynek, w którym się znajdujesz nie jest własnością grupy.");
- }
- return 1;
- }
- else if(!strcmp(sub, "wyjdz"))
- {
- if(Player[playerid][pSpawn] == 2)
- {
- if(Player[playerid][pSpawnTyp] == 1)
- {
- if(GetPlayerInterior(playerid) == IntArray2[49][0] && GetPlayerVirtualWorld(playerid) == Player[playerid][pUID]+1000)
- {
- //wychodzenie
- }
- else
- {
- Info(playerid, "Nie znajdujesz się w pokoju hotelowym.");
- }
- }
- if(Player[playerid][pSpawnTyp] == 2)
- {
- if(GetPlayerInterior(playerid) == IntArray2[58][0] && GetPlayerVirtualWorld(playerid) == Player[playerid][pUID]+1000)
- {
- //wychodzenie
- }
- else
- {
- Info(playerid, "Nie znajdujesz się w pokoju hotelowym.");
- }
- }
- else if(Player[playerid][pSpawnTyp] == 3)
- {
- if(GetPlayerInterior(playerid) == IntArray2[49][0] && GetPlayerVirtualWorld(playerid) == Player[playerid][pUID]+1000)
- {
- //wychodzenie
- }
- else
- {
- Info(playerid, "Nie znajdujesz się w pokoju hotelowym.");
- }
- }
- return 1;
- }
- else
- {
- Info(playerid, "Nie jesteś zameldowany w hotelu.");
- }
- return 1;
- }
- return 1;
- }
- CMD:premium(playerid, params[])
- {
- new premiumInfo[2048], info[1024];
- if(!strcmp(params, "zakup"))
- {
- strcat(info, "Witaj w panelu usług premium.\nMożesz tutaj zamienić swoje GameScore na wirtualne €.\nDzięki nim będziesz mógł skorzystać z całej gamy usług, które Ci oferujemy!\n\n", sizeof(info));
- strcat(info, "{B3D341}Pakiet 1:{AAC5E3} 10 wirtualnych € za 300 punktów GameScore.\n", sizeof(info));
- strcat(info, "{B3D341}Pakiet 2:{AAC5E3} 25 wirtualnych € za 600 punktów GameScore.\n", sizeof(info));
- strcat(info, "{B3D341}Pakiet 3:{AAC5E3} 50 wirtualnych € za 1100 punktów GameScore.\n", sizeof(info));
- strcat(info, "\nW poniższym okienku wpisz idetyfikator pakietu, który chcesz zakupić.\nPamiętaj, że decyzja jest nieodwołalna.\n", sizeof(info));
- return dShowPlayerDialog(playerid, 56, DIALOG_STYLE_INPUT, ""ServName"Usługi premium", info, "Wybierz", "Anuluj");
- }
- else if(!strcmp(params, "przekaz"))
- {
- return 1;
- }
- else if(!strcmp(params, "info"))
- {
- strcat(info, "\t{B3D341}»{AAC5E3} Konto premium (7 dni).\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Konto premium (14 dni).\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Konto premium (31 dni).\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Stworzenie przedmiotu.\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Blokada postaci.\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Edycja profilu CSS i HTML.\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Stworzenie nowej grupy.\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} 10 etykiet tekstowych.\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Zmiana tożsamości.\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Usunięcie postaci.\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Własny interior.\n", sizeof(info));
- strcat(info, "\t{B3D341}»{AAC5E3} Pakiet obiektów #25.\n", sizeof(info));
- format(premiumInfo, 1024, "Za pomocą opcji komendy /premium możesz zakupić wirtualne € za GameScore.\nPosiadanie wirtualnych € pozwala Ci na szereg opcji Premium.\nLista dostępnych usług:\n\n%s", info);
- return Info(playerid, premiumInfo);
- }
- else if(!strcmp(params, "aktywuj"))
- {
- new uslugi = 0;
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_1))
- uslugi ++, format(info, sizeof(info), "%s»\tKonto premium (7 dni)\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_2))
- uslugi ++, format(info, sizeof(info), "%s»\tKonto premium (14 dni)\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_3))
- uslugi ++, format(info, sizeof(info), "%s»\tKonto premium (31 dni)\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_4))
- uslugi ++, format(info, sizeof(info), "%s»\tStworzenie przedmiotu\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_5))
- uslugi ++, format(info, sizeof(info), "%s»\tBlokada postaci\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_6))
- uslugi ++, format(info, sizeof(info), "%s»\tEdycja profilu CSS i HTML\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_7))
- uslugi ++, format(info, sizeof(info), "%s»\tStworzenie nowej grupy\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_8))
- uslugi ++, format(info, sizeof(info), "%s»\t10 etykiet tekstowych\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_9))
- uslugi ++, format(info, sizeof(info), "%s»\tZmiana tożsamości\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_10))
- uslugi ++, format(info, sizeof(info), "%s»\tUsunięcie postaci\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_11))
- uslugi ++, format(info, sizeof(info), "%s»\tWłasny interior\n", info);
- if((IPB[playerid][ipb_PremiumService] & SERVICE_B_PREMIUM_12))
- uslugi ++, format(info, sizeof(info), "%s»\tPakiet obiektów #25\n", info);
- return dShowPlayerDialog(playerid, 57, DIALOG_STYLE_LIST, ""ServName"Usługi premium", info, "Aktywuj", "Anuluj");
- //usługa wybierana za pomocą zmiennej ListItem
- }
- Tip(playerid, "/premium [zakup, przekaz, aktywuj, info]");
- return dShowPlayerDialog(playerid, 55, DIALOG_STYLE_LIST, ""ServName"Usługi premium", "1\t€10\tKonto premium (7 dni)\n2\t€19\tKonto premium (14 dni)\n3\t€27\tKonto premium (31 dni)\n4\t€4\tStworzenie przedmiotu\n5\t€7\tBlokada postaci\n6\t€5\tEdycja profilu CSS i HTML\n7\t€10\tStworzenie nowej grupy\n8\t€8\t10 etykiet tekstowych\n9\t€10\tZmiana tożsamości\n10\t€8\tUsunięcie postaci\n11\t€4\tWłasny interior\n12\t€0\tPakiet obiektów #25", "Wybierz", "Anuluj");
- }
- CMD:stats(playerid, params[])
- {
- new gracz = playerid;
- if(GetPVarInt(playerid, "Grupa") == 4)
- {
- if(!sscanf(params, "u", gracz))
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- }
- new timexo[3], stats[3000], postac[128], timex[3], grupy[256], grupa[64], other[256], jobs[16], zone = PlayerInZone(gracz), strefa[32], drzwi[16];
- if(Player[gracz][pJob] == 1)
- {
- format(jobs, sizeof(jobs), "Mechanik");
- }
- else if(Player[gracz][pJob] == 2)
- {
- format(jobs, sizeof(jobs), "Kurier");
- }
- else if(Player[gracz][pJob] == 3)
- {
- format(jobs, sizeof(jobs), "Rybak");
- }
- else
- {
- format(jobs, sizeof(jobs), "Brak");
- }
- format(postac, sizeof(postac), "{FFFFFF}%s (%s, %d, %d) [%s]", CharName(gracz), Player[gracz][pName], Player[gracz][pUID], Player[gracz][pGID], Player[gracz][pIP]);
- FullTime(Player[gracz][pOnline], timexo[0], timexo[1], timexo[2]);
- FullTime(Player[gracz][pDutyAll], timex[0], timex[1], timex[2]);
- new grups = 0;
- for(new slot = 1; slot < 6; slot++)
- {
- if(pGrupa[gracz][slot] != 0 && Grupa[pGrupa[gracz][slot]][gAktywna] == 1)
- {
- grups ++;
- if((pGrupaPerm[playerid][slot] & PERM_LEADER))
- format(grupa, sizeof(grupa), "\tSlot %d\t\t{AAC5E3}%s (%d){FFFFFF}", slot, Grupa[pGrupa[gracz][slot]][gNazwa], pGrupa[gracz][slot]);
- else
- format(grupa, sizeof(grupa), "\tSlot %d\t\t%s (%d)", slot, Grupa[pGrupa[gracz][slot]][gNazwa], pGrupa[gracz][slot]);
- format(grupy, sizeof(grupy), "%s%s\n", grupy, grupa);
- }
- }
- if(grups != 0)
- {
- SetPVarInt(playerid, "GrupyGracza", grups);
- }
- format(other, sizeof(other), "\n1\tUkrywanie postaci\n2\tAnimacja chodzenia\n3\tStyl rozmowy\n4\tSzybki komputer\n5\tLicznik prędkości\n6\tStacja radiowa\n7\tWyświetlanie stref");
- if(!grups)
- {
- format(grupy, sizeof(grupy), "\tBrak przynależności"), SetPVarInt(playerid, "GrupyGracza", 1);
- }
- new useattachslot = 0;
- if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_1))
- useattachslot++;
- if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_2))
- useattachslot++;
- if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_3))
- useattachslot++;
- if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_4))
- useattachslot++;
- if(IsPlayerAttachedObjectSlotUsed(gracz, ATTACH_SLOT_5))
- useattachslot++;
- if(zone == 0)
- format(strefa, 32, "Strefa neutralna");
- else
- format(strefa, 32, "%d (%s, %dkm/h)", zone, GangZoneInfo[zone][gNazwa], GangZoneInfo[zone][gSpeed]);
- if(InDoor(gracz) == 0)
- format(drzwi, 16, "Poza budynkiem");
- else
- format(drzwi, 16, "%d", InDoor(gracz));
- format(stats, sizeof(stats), "Czas gry:\t\t%dh. i %dm.\nSiła:\t\t\t%dj\nHP:\t\t\t%.0f\nSłużba:\t\t\t%dh. i %dm.\nPieniądze:\t\t$%d\nBank:\t\t\t$%d\nEuro:\t\t\t€%d\nDług:\t\t\t$%d\nStrefa:\t\t\t%s\nDrzwi:\t\t\t%s\nWyjeżdżone:\t\t%.0fkm\nSkin:\t\t\t%d", timexo[0], timexo[1], Player[gracz][pSila], getHP(gracz), timex[0], timex[1], dKasa(gracz), Player[gracz][pBank], IPB[playerid][ipb_PremiumScore], Player[playerid][pDlug], strefa, drzwi, Player[gracz][pWyjezdzone], GetPlayerSkin(playerid));
- format(stats, sizeof(stats), "%s\nTelefon:\t\t%d\nPraca dorywcza:\t%s\nDoczepione obiekty:\t%d\nGrupy:\n%s\n----%s", stats, Player[playerid][pTelefon], jobs, useattachslot, grupy, other);
- return dShowPlayerDialog(playerid, 9990, DIALOG_STYLE_LIST, postac, stats, "Wybierz", "Anuluj");
- }
- CMD:pomoc(playerid, params[])
- {
- new info[1024];
- strcat(info, "1\tWprowadzenie do gry.\n", sizeof(info));
- strcat(info, "2\tModuł pojazdów.\n", sizeof(info));
- strcat(info, "3\tModuł przedmiotów.\n", sizeof(info));
- strcat(info, "4\tModuł grup.\n", sizeof(info));
- strcat(info, "5\tModuł drzwi.\n", sizeof(info));
- strcat(info, "6\tOferty.\n", sizeof(info));
- return dShowPlayerDialog(playerid, 9992, DIALOG_STYLE_LIST, ""ServName"Pomoc", info, "Wybierz", "Anuluj");
- }
- CMD:akceptujsmierc(playerid, params[])
- {
- if(Player[playerid][pBW] > 0)
- {
- new info[256];
- DodajPrzedmiot(playerid, Nick(playerid), 17, Player[playerid][pUID], gettime()+86400*2, 7, 0, 80000);
- if(sscanf(params, "s[256]", info))
- {
- return Kara(7, playerid, -1, "-", 9999);
- }
- return Kara(7, playerid, -1, info, 9999);
- }
- return Tip(playerid, "Twoja postać musi być w stanie BW.");
- }
- //komendy systemu przedmiotów
- CMD:p(playerid, params[])
- {
- if(isnull(params))
- return ShowPlayerItem(playerid);
- if(!strcmp(params, "podnies"))
- {
- new Itemy[1024], Item[128], list = 1;
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 7)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, Przedmiot[p][iPosX], Przedmiot[p][iPosY], Przedmiot[p][iPosZ]) && GetPlayerVirtualWorld(playerid) == Przedmiot[p][iVir])
- {
- format(Item, sizeof(Item), "%d\t\t%dg\t\t%s", p, Przedmiot[p][iWaga], Przedmiot[p][iNazwa]);
- format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
- ListItem[playerid][list] = p;
- list++;
- }
- }
- }
- if(list == 1) return InfoBoxShow(2, playerid, "W okolicy Twojej postaci nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
- format(Itemy, sizeof(Itemy), "%s", Itemy);
- return dShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, ""ServName"Przedmioty w pobliżu", Itemy, "Podnies", "Anuluj");
- }
- else if(!strcmp(params, "lista"))
- {
- if(GetPVarInt(playerid, "Grupa") != 4) return PlayerPlaySound(playerid, 1085, 0, 0, 0);
- new gracz = -1, Itemy[1024], Item[128], list = 1;
- if(IsPlayerLogged(gracz) == 0) return NoLogin(playerid);
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1 && Przedmiot[p][iOwner] == 1 && Przedmiot[p][iOwnerUID] == Player[gracz][pUID])
- {
- format(Item, sizeof(Item), "%d\t\t%dg\t\t%s", p, Przedmiot[p][iWaga], Przedmiot[p][iNazwa]);
- format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
- list++;
- }
- }
- if(list == 1) return InfoBoxShow(2, playerid, "Ten gracz nie posiada zadnych ~y~przedmiotow~w~.", 3);
- format(Itemy, sizeof(Itemy), "%s", Itemy);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, ""ServName"Przedmioty gracza", Itemy, "Rozumiem", "");
- }
- for(new i = 0; i < MAX_ITEM; i ++)
- {
- if(Przedmiot[i][iAktywny] == 1 && Przedmiot[i][iOwner] == 1 && Przedmiot[i][iOwnerUID] == Player[playerid][pUID])
- {
- if(strfind(Przedmiot[i][iNazwa], params, false, 0) != -1)
- return UseItem(playerid, i);
- if(i == MAX_ITEM - 1)
- return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
- }
- }
- return InfoBoxShow(2, playerid, "W Twoim ekwipunku nie odnaleziono ~y~przedmiotow~w~, ktore spelniaja dane kryteria.", 3);
- }
- CMD:u(playerid, params[])
- {
- if(GetPVarInt(playerid, "ItemTDPage") != 0)
- {
- SetPVarInt(playerid, "ItemTDPage", 0);
- TextDrawHideForPlayer(playerid, ItemTD0[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD1[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD2[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD3[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD4[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD5[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD6[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD7[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD8[playerid]);
- TextDrawHideForPlayer(playerid, ItemTD9[playerid]);
- return TextDrawHideForPlayer(playerid, ItemTD10[playerid]);
- }
- SetPVarInt(playerid, "ItemTDPage", 1);
- for(new i = 0; i < 100; i ++)
- {
- ListItemTD[playerid][i] = 0;
- }
- new found = 0;
- for(new i = 0; i < MAX_ITEM; i ++)
- {
- if(Przedmiot[i][iAktywny] == 1 && Przedmiot[i][iOwner] == 1 && Przedmiot[i][iOwnerUID] == Player[playerid][pUID])
- {
- ListItemTD[playerid][found] = i;
- found++;
- if(found == 99)
- {
- break;
- }
- }
- }
- if(GetPVarInt(playerid, "ItemTDPage") == 1)
- {
- TextDrawSetString(ItemTD0[playerid], "~<~ Przedmioty (1) ~>~");
- TextDrawShowForPlayer(playerid, ItemTD0[playerid]);
- new rekord = 1, StringItem[64];
- for(new i = 0; i < 10; i ++)
- {
- if(Przedmiot[ListItemTD[playerid][i]][iUsed] == 0)
- {
- format(StringItem, sizeof(StringItem), "~w~%02d %s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- else
- {
- format(StringItem, sizeof(StringItem), "~w~%02d ~g~~h~%s", rekord, Przedmiot[ListItemTD[playerid][i]][iNazwa]);
- }
- if(Przedmiot[ListItemTD[playerid][i]][iAktywny] == 0)
- {
- StringItem = "Brak przedmiotu";
- }
- if(rekord == 1)
- TextDrawSetString(ItemTD1[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD1[playerid]);
- else if(rekord == 2)
- TextDrawSetString(ItemTD2[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD2[playerid]);
- else if(rekord == 3)
- TextDrawSetString(ItemTD3[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD3[playerid]);
- else if(rekord == 4)
- TextDrawSetString(ItemTD4[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD4[playerid]);
- else if(rekord == 5)
- TextDrawSetString(ItemTD5[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD5[playerid]);
- else if(rekord == 6)
- TextDrawSetString(ItemTD6[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD6[playerid]);
- else if(rekord == 7)
- TextDrawSetString(ItemTD7[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD7[playerid]);
- else if(rekord == 8)
- TextDrawSetString(ItemTD8[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD8[playerid]);
- else if(rekord == 9)
- TextDrawSetString(ItemTD9[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD9[playerid]);
- else if(rekord == 10)
- TextDrawSetString(ItemTD10[playerid], StringItem), TextDrawShowForPlayer(playerid, ItemTD10[playerid]);
- if(rekord < 10)
- {
- rekord++;
- }
- }
- }
- return 1;
- }
- //telefon
- CMD:test(playerid, params[])
- {
- SpawnPlayer(playerid);
- return 1;
- }
- CMD:sms(playerid, params[])
- {
- new numer, tresc[128], sms[256];
- if(sscanf(params, "ds[128]", numer, tresc))
- return Tip(playerid, "/sms [numer] [treść]");
- if(numer == 444)//wiadomość dla organizacji
- {
- return 1;
- }
- foreach(Player, p)
- {
- if(Player[p][pTelefon] == numer && p != playerid && Login(p) == 1)
- {
- format(sms, sizeof(sms), "[SMS] » %d: %s", numer, tresc);
- SendClientMessage(p, 0xFFF000FF, sms);
- format(sms, sizeof(sms), "[SMS] « %d: %s", numer, tresc);
- SendClientMessage(p, 0xFFF000FF, sms);
- format(String, sizeof(String), "* %s wysyła SMS.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- format(String, sizeof(String), "** %s otrzymał SMS-a. **", CharName(p));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- break;
- }
- }
- return 1;
- }
- CMD:plac(playerid, params[])
- {
- new player, cash;
- if(sscanf(params, "ud", player, cash))
- return Tip(playerid, "/plac [gracz] [kwota]");
- if(IsPlayerLogged(player) == 0 || playerid == player) return NoLogin(playerid);
- if(!PlayerToPlayer(5.0, playerid, player))
- return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
- if(dKasa(playerid) < cash || cash <= 0)
- return Tip(playerid, "Nie posiadasz wystarczającej ilości gotówki lub podana kwota jest błędna.");
- ApplyAnimation(playerid, "DEALER", "shop_pay", 4.1, 0, 0, 0, 0, 0, 1);
- format(String, sizeof(String), "* %s podaje gotówkę %s.", CharName(playerid), CharName(player));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- return sKasa(playerid, -cash), sKasa(player, cash);
- }
- //komendy drzwi
- CMD:drzwi(playerid, params[])
- {
- new info[2048];
- for(new p = 0; p < MAX_DRZWI; p++)
- {
- if(Drzwi[p][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, Drzwi[p][dZewPosX], Drzwi[p][dZewPosY], Drzwi[p][dZewPosZ]) && Drzwi[p][dZewVir] == GetPlayerVirtualWorld(playerid) || Drzwi[p][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[p][dWewPosX], Drzwi[p][dWewPosY], Drzwi[p][dWewPosZ]) && Drzwi[p][dWewVir] == GetPlayerVirtualWorld(playerid))
- {
- SetPVarInt(playerid, "rpDrzwi", p);
- if(pDrzwiOwner(playerid, p) != 0 && Drzwi[p][dCreatePrice] == 0)
- {
- strcat(info, "1\tZmień nazwę drzwi\n", sizeof(info));
- strcat(info, "2\tPokaż informacje o drzwiach\n", sizeof(info));
- if(Drzwi[p][dOwner] == OWNER_PLAYER)
- {
- strcat(info, "3\tPrzekaż budynek dla gracza\n", sizeof(info));
- strcat(info, "4\tPrzypisz budynek pod grupę\n", sizeof(info));
- }
- else
- {
- strcat(info, "5\tPrzypisz budynek pod postać\n", sizeof(info));
- }
- strcat(info, "6\tZmień pozycję wewnętrzną\n", sizeof(info));
- strcat(info, "7\tPrzypisz obiekty do drzwi\n", sizeof(info));
- strcat(info, "8\tPrzypisz etykiety do drzwi\n", sizeof(info));
- strcat(info, "9\tZmień interior (widoczność na świat)\n", sizeof(info));
- if(Drzwi[p][dOwner] == OWNER_PLAYER)
- {
- strcat(info, "10\tWynajmij pokój dla gracza\n", sizeof(info));
- }
- }
- else
- {
- if(Drzwi[p][dCreatePrice] == 0 || Drzwi[p][dCreateTime] == 0)
- {
- strcat(info, "2\tPokaż informacje o drzwiach\n", sizeof(info));
- }
- }
- if(Drzwi[p][dCreatePrice] != 0 && Drzwi[p][dCreateTime] != 0)
- {
- strcat(info, "2\tPokaż informacje o drzwiach\n", sizeof(info));
- strcat(info, "9\tDokonaj zakupu drzwi\n", sizeof(info));
- }
- dShowPlayerDialog(playerid, 250, DIALOG_STYLE_LIST, ""ServName"Drzwi", info, "Wybierz", "Anuluj");
- break;
- }
- if(p >= MAX_DRZWI - 1)
- return InfoBoxShow(2, playerid, "W okolicy Twojej postaci nie odnaleziono zadnych ~y~budynkow~w~.", 3);
- }
- return 1;
- }
- CMD:v(playerid, params[])
- {
- new v;
- if(!strcmp(params, "zaparkuj") || !strcmp(params, "parkuj"))
- {
- v = CarUID(GetPlayerVehicleID(playerid));
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
- return InfoBoxShow(2, playerid, "Aby uzyc tej ~y~komendy~w~, musisz znajdowac sie za kierownica ~y~pojazdu~w~.", 3);
- if(pPojazd(playerid, GetPlayerVehicleID(playerid)) == 0)
- return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania tym ~y~pojazdem~w~.", 3);
- NadpiszParametryPojazdu(GetPlayerVehicleID(playerid));
- GetVehiclePos(GetPlayerVehicleID(playerid), Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ]);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), Pojazd[v][vRot]);
- DestroyVehicle(PojazdModel[v]);
- PojazdModel[v] = CreateVehicle(Pojazd[v][vModel], Pojazd[v][vPosX], Pojazd[v][vPosY], Pojazd[v][vPosZ], Pojazd[v][vRot], Pojazd[v][vKolor1], Pojazd[v][vKolor2], 99999999);
- Pojazd[v][vSpawn] = 1;
- PojazdUID[PojazdModel[v]] = v;
- if(Pojazd[v][vReje] == 0)
- {
- SetVehicleNumberPlate(PojazdModel[v], " ");
- }
- else if(Pojazd[v][vReje] == 1)
- {
- format(String, sizeof(String), "SA %04d", v);
- SetVehicleNumberPlate(PojazdModel[v], String);
- }
- SetVehicleToRespawn(PojazdModel[v]);
- UstawParametryPojazdu(PojazdModel[v]);
- return PutPlayerInVehicle(playerid, PojazdModel[v], 0);
- }
- else if(!strcmp(params, "z"))
- {
- new info[128], Float:vPos[3];
- for(new vv = 0; vv < MAX_VEHICLES; vv++)
- {
- GetVehiclePos(vv, vPos[0], vPos[1], vPos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 4.0, vPos[0], vPos[1], vPos[2]) && GetVehicleVirtualWorld(vv) == GetPlayerVirtualWorld(playerid) && pPojazd(playerid, vv) != 0)
- {
- GetVehicleParamsEx(vv, engine, lights, alarm, doors, bonnet, boot, objective);
- if(doors == 1)
- {
- format(info, sizeof(info), "Pojazd ~y~%s~w~ (UID: %d) zostaly ~g~otwarty~w~.", GetVehicleName(CarUID(vv)), CarUID(vv));
- SetVehicleParamsEx(vv, engine, lights, alarm, 0, bonnet, boot, objective);
- }
- else
- {
- format(info, sizeof(info), "Pojazd ~y~%s~w~ (UID: %d) zostaly ~r~zamkniety~w~.", GetVehicleName(CarUID(vv)), CarUID(vv));
- SetVehicleParamsEx(vv, engine, lights, alarm, 1, bonnet, boot, objective);
- }
- InfoBoxShow(2, playerid, info, 3);
- break;
- }
- }
- return 1;
- }
- else if(!strcmp(params, "info"))
- {
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
- return InfoBoxShow(2, playerid, "Aby uzyc tej ~y~komendy~w~, musisz znajdowac sie za kierownica ~y~pojazdu~w~.", 3);
- if(pPojazd(playerid, GetPlayerVehicleID(playerid)) == 0)
- return InfoBoxShow(2, playerid, "Brak uprawnien do zarzadzania tym ~y~pojazdem~w~.", 3);
- return VehInfo(playerid, GetPlayerVehicleID(playerid));
- }
- if(!IsPlayerInAnyVehicle(playerid))
- {
- new big_str[2048], type[128], pojazdy;
- for(new veh = 0; veh < MAX_POJAZDY; veh++)
- {
- if(Pojazd[veh][vAktywny] == 1)
- {
- if(Pojazd[veh][vOwner] == 1 && Pojazd[veh][vOwnerUID] == Player[playerid][pUID])
- {
- new spawned[32];
- if(Pojazd[veh][vSpawn] == 1)
- spawned = "{AAC5E3}Zespawnowany{FFFFFF}";
- else
- spawned = "{FFFFFF}Odspawnowany{FFFFFF}";
- format(type, sizeof(type), "%d\t%s\t\t%s", veh, spawned, GetVehicleName(veh));
- format(big_str, sizeof(big_str), "%s%s\n", big_str, type);
- ListItem[playerid][pojazdy] = veh;
- pojazdy++;
- }
- }
- }
- if(pojazdy) dShowPlayerDialog(playerid, 500, DIALOG_STYLE_LIST, ""ServName"Pojazdy", big_str, "(Un)Spawn", "");
- else InfoBoxShow(2, playerid, "Do tej ~y~postaci~w~ nie sa przypisane zadne ~y~pojazdy~w~.", 3);
- }
- else
- {
- }
- return Tip(playerid, "/v [info | zamknij (z) | parkuj]");
- }
- CMD:g(playerid, params[])
- {
- new opcja[16], grupa, parametry[60];
- if(!sscanf(params, "ds[16]S()[60]", grupa, opcja, parametry))
- {
- if(grupa < 1 || grupa > 5) return Tip(playerid, "Masz dostęp tylko do pięciu slotów grupowych.");
- if(strcmp(opcja, "sluzba", true) == 0 || strcmp(opcja, "duty", true) == 0)
- {
- if(pGrupa[playerid][grupa] == 0) return InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
- if(Grupa[pGrupa[playerid][grupa]][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa, na ktorej sluzbe chcesz wejsc prawdopodobnie zostala usunieta.", 3);
- if(Sluzba(playerid) != pGrupa[playerid][grupa])
- {
- setSluzba(playerid, pGrupa[playerid][grupa]);
- format(String, sizeof(String), "Pomyslnie rozpoczeto sluzbe w grupie ~y~%s~w~.", Grupa[pGrupa[playerid][grupa]][gNazwa]);
- return InfoBoxShow(2, playerid, String, 4);
- }
- if(Sluzba(playerid) == pGrupa[playerid][grupa])
- {
- setSluzba(playerid, 0);
- format(String, sizeof(String), "Pomyslnie zakonczono sluzbe w grupie ~y~%s~w~.", Grupa[pGrupa[playerid][grupa]][gNazwa]);
- return InfoBoxShow(2, playerid, String, 4);
- }
- return 1;
- }
- else if(strcmp(opcja, "info", true) == 0)
- {
- if(pGrupa[playerid][grupa] == 0) return InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
- if(Grupa[pGrupa[playerid][grupa]][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa, na ktorej sluzbe chcesz wejsc prawdopodobnie zostala usunieta.", 3);
- return GrupaInfo(playerid, pGrupa[playerid][grupa]);
- }
- else if(strcmp(opcja, "magazyn", true) == 0)
- {
- new Itemy[2048], list = 0, Item[64];
- if(pGrupa[playerid][grupa] == 0) return InfoBoxShow(2, playerid, "Na tym slocie nie posiadasz zadnej ~y~grupy~w~.", 3);
- if(Grupa[pGrupa[playerid][grupa]][gAktywna] == 0) return InfoBoxShow(2, playerid, "Grupa, na ktorej sluzbe chcesz wejsc prawdopodobnie zostala usunieta.", 3);
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1)
- {
- if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == pGrupa[playerid][grupa])
- {
- Przedmiot[p][iMagazyn] = 0;
- }
- }
- }
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1)
- {
- if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == pGrupa[playerid][grupa] && Przedmiot[p][iMagazyn] == 0)
- {
- ListItem[playerid][list] = p;
- new ilosc = 1;
- for(new i = 0; i < MAX_ITEM; i++)
- {
- if(Przedmiot[i][iAktywny] == 1)
- {
- if(Przedmiot[i][iOwner] == 3 && Przedmiot[i][iOwnerUID] == pGrupa[playerid][grupa] && Przedmiot[i][iMagazyn] == 0 && !strcmp(Przedmiot[p][iNazwa], Przedmiot[i][iNazwa]))
- {
- if(i != p)
- {
- Przedmiot[i][iMagazyn] = 1;
- ilosc++;
- }
- }
- }
- }
- format(Item, sizeof(Item), "%d\tx%d\t(€%d) $%d\t\t%s", p, ilosc, Przedmiot[p][iPremiumPrice], Przedmiot[p][iPrice], Przedmiot[p][iNazwa]);
- format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
- list++;
- }
- }
- }
- if(list == 0) return InfoBoxShow(2, playerid, "W magazynie ~y~grupy~w~, nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
- return dShowPlayerDialog(playerid, 1000, DIALOG_STYLE_LIST, ""ServName"Magazyn grupy", Itemy, "Wybierz", "Anuluj");
- }
- else if(strcmp(opcja, "v", true) == 0 || strcmp(opcja, "pojazdy", true) == 0)
- {
- new big_str[1024], type[128], pojazdy;
- for(new veh = 0; veh < MAX_POJAZDY; veh++)
- {
- if(Pojazd[veh][vAktywny] == 1)
- {
- if(Pojazd[veh][vOwner] == 2 && Pojazd[veh][vOwnerUID] == pGrupa[playerid][grupa])
- {
- format(type, sizeof(type), "%d\t%s", veh, GetVehicleName(veh));
- format(big_str, sizeof(big_str), "%s%s\n", big_str, type);
- ListItem[playerid][pojazdy] = veh;
- pojazdy++;
- }
- }
- }
- if(pojazdy) dShowPlayerDialog(playerid, 500, DIALOG_STYLE_LIST, ""ServName"Pojazdy", big_str, "(Un)Spawn", "");
- else return InfoBoxShow(2, playerid, "Do tej ~y~grupy~w~ nie sa przypisane zadne ~y~pojazdy~w~.", 3);
- }
- //Rozpoczynamy tworzenie komend dla lidera grupy.
- else if(strcmp(opcja, "opcje", true) == 0)
- {
- if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
- return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
- //opcje
- return 1;
- }
- else if(strcmp(opcja, "zapros", true) == 0)
- {
- if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
- return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
- //opcje
- return 1;
- }
- else if(strcmp(opcja, "wypros", true) == 0)
- {
- if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
- return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
- //opcje
- return 1;
- }
- else if(strcmp(opcja, "payday", true) == 0)
- {
- if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
- return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
- //opcje
- return 1;
- }
- else if(strcmp(opcja, "wplac", true) == 0)
- {
- if(InDoor(playerid) != 19)
- return Info(playerid, "Aby wpłacić pieniądze na konto grupy, musisz znajdować się w budynku banku.");
- new kwota;
- if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
- return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
- if(sscanf(parametry, "d", kwota))
- return Tip(playerid, "/g [slot] wplac [kwota]");
- if(dKasa(playerid) < kwota || kwota < 0)
- return Tip(playerid, "Nie posiadasz wystarczającej ilości gotówki.");
- format(String, sizeof(String), "* %s wpłaca pieniądze na konto grupy.", CharName(playerid));
- ProxDetector(10.0, playerid, String, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
- format(String, sizeof(String), "Wpłaciłeś $%d na konto organizacji %s (UID: %d).\nNowy stan konta to $%d.", kwota, Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], Grupa[pGrupa[playerid][grupa]][gBank] + kwota);
- return sKasa(playerid, -kwota), Grupa[pGrupa[playerid][grupa]][gBank] += kwota, Info(playerid, String), ZapiszGrupe(pGrupa[playerid][grupa]), SavePlayerStats(playerid, SAVE_PLAYER_CASH);
- }
- else if(strcmp(opcja, "wyplac", true) == 0)
- {
- if(InDoor(playerid) != 19)
- return Info(playerid, "Aby wpłacić pieniądze na konto grupy, musisz znajdować się w budynku banku.");
- new kwota;
- if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
- return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
- if(sscanf(parametry, "d", kwota))
- return Tip(playerid, "/g [slot] wyplac [kwota]");
- if(Grupa[pGrupa[playerid][grupa]][gBank] < kwota || kwota < 0)
- return Info(playerid, "Na koncie grupy nie ma wystarczającej ilości pieniędzy.");
- format(String, sizeof(String), "Wypłaciłeś $%d z konta organizacji %s (UID: %d).\nNowy stan konta to $%d.", kwota, Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], Grupa[pGrupa[playerid][grupa]][gBank] - kwota);
- return Grupa[pGrupa[playerid][grupa]][gBank] -= kwota, sKasa(playerid, kwota), Info(playerid, String), ZapiszGrupe(pGrupa[playerid][grupa]), SavePlayerStats(playerid, SAVE_PLAYER_CASH);
- }
- //uprawnienia
- else if(strcmp(opcja, "permlist", true) == 0)
- {
- new permlist[1024], permformat[512], perm = 0;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_IC))
- strcat(permformat, "1\tCzat InCharacter.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_OOC))
- strcat(permformat, "2\tCzat Out Of Character.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_COLOR))
- strcat(permformat, "4\tKolorowy nick na służbie.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_DEPARTMENT))
- strcat(permformat, "8\tTag grupy pod nickiem.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_SPAWN))
- strcat(permformat, "16\tSpawn w budynku organizacji.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_ARREST))
- strcat(permformat, "32\tAresztowanie / przetrzymywanie.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_BLOCADE))
- strcat(permformat, "64\tStawianie blokad na drodze.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_WEAPONS))
- strcat(permformat, "128\tUżywanie oflagowanych broni.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_911))
- strcat(permformat, "256\tListowanie na 911.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_RACE))
- strcat(permformat, "512\tTworzenie wyścigów.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_LEAVE))
- strcat(permformat, "1024\tOpuszczanie grupy.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_TAX))
- strcat(permformat, "2048\tObowiązkowy podatek.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_MASK))
- strcat(permformat, "4096\tUżywanie kominiarek.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_SEARCHING))
- strcat(permformat, "8192\tPrzeszukiwanie.\n", sizeof(permformat)), perm++;
- if((Grupa[pGrupa[playerid][grupa]][gFlagPerm] & G_FLAG_DRIVEBY))
- strcat(permformat, "16384\tDriveBy.\n", sizeof(permformat)), perm++;
- if(!perm)
- strcat(permformat, "0\tBrak przypisanych uprawnień dla grupy.\n", sizeof(permformat));
- format(permlist, sizeof(permlist), "Uprawnienia dla grupy %s (UID: %d) są następujące:\n%s", Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], permformat);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, ""ServName"Uprawnienia", permlist, "Zamknij", "");
- }
- else if(strcmp(opcja, "perm", true) == 0)
- {
- new permlist[512], permformat[256], perm = 0;
- if((pGrupaPerm[playerid][grupa] & PERM_OFFER))
- strcat(permformat, "1\tSkładanie ofert grupowych.\n", sizeof(permformat)), perm++;
- if((pGrupaPerm[playerid][grupa] & PERM_CARS))
- strcat(permformat, "2\tProwadzenie pojazdów grupowych.\n", sizeof(permformat)), perm++;
- if((pGrupaPerm[playerid][grupa] & PERM_DOORS))
- strcat(permformat, "4\tOtwieranie / zamykanie drzwi.\n", sizeof(permformat)), perm++;
- if((pGrupaPerm[playerid][grupa] & PERM_ORDER))
- strcat(permformat, "8\tZamawianie produktów.\n", sizeof(permformat)), perm++;
- if((pGrupaPerm[playerid][grupa] & PERM_CHAT))
- strcat(permformat, "16\tKorzystanie z czatu OOC.\n", sizeof(permformat)), perm++;
- if((pGrupaPerm[playerid][grupa] & PERM_LEADER))
- strcat(permformat, "32\tZarządzanie grupą.\n", sizeof(permformat)), perm++;
- if((pGrupaPerm[playerid][grupa] & PERM_MAYOR))
- strcat(permformat, "64\tGubernator / Burmistrz.\n", sizeof(permformat)), perm++;
- if(!perm)
- strcat(permformat, "0\tBrak przypisanych uprawnień w grupie.\n", sizeof(permformat));
- format(permlist, sizeof(permlist), "Uprawnienia członka grupy %s (UID: %d) są następujące:\n%s", Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], permformat);
- return dShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, ""ServName"Uprawnienia", permlist, "Zamknij", "");
- }
- else if(strcmp(opcja, "rank", true) == 0)
- {
- if(!(pGrupaPerm[playerid][grupa] & PERM_LEADER))
- return Info(playerid, "Nie masz uprawnień do użycia tej komendy jako członek grupy.");
- new permformat[1024], perm[2048];
- strcat(permformat, "1\tSkładanie ofert grupowych.\n", sizeof(permformat)), strcat(permformat, "2\tProwadzenie pojazdów grupowych.\n", sizeof(permformat));
- strcat(permformat, "4\tOtwieranie / zamykanie drzwi.\n", sizeof(permformat)), strcat(permformat, "8\tZamawianie produktów.\n", sizeof(permformat));
- strcat(permformat, "16\tKorzystanie z czatu OOC.\n", sizeof(permformat)), strcat(permformat, "32\tZarządzanie grupą.\n", sizeof(permformat));
- format(perm, sizeof(perm), "Witaj w panelu nadawania uprawnień dla członka grupy %s (UID: %d).\nAby ustawić uprawnienia dla członka grupy - dodaj dodaj poniższe liczby do siebie a następnie wpisz sumę w okienku.\n%s", Grupa[pGrupa[playerid][grupa]][gNazwa], pGrupa[playerid][grupa], permformat);
- return dShowPlayerDialog(playerid, 9998, DIALOG_STYLE_INPUT, ""ServName"Uprawnienia", perm, "Dalej", "Anuluj");
- }
- return 1;
- }
- Tip(playerid, "/g [slot] [duty, info, magazyn, pojazdy, zapros, wypros, opcje, wplac, wyplac, online, przebierz, perm]");
- new grupai[64], grupy[256], grupyx;
- for(new slot = 1; slot < 6; slot++)
- {
- if(pGrupa[playerid][slot] != 0 && Grupa[pGrupa[playerid][slot]][gAktywna] == 1)
- {
- grupyx ++;
- if((pGrupaPerm[playerid][slot] & PERM_LEADER))
- format(grupai, sizeof(grupai), "%d\t{AAC5E3}%s (%d){FFFFFF}", slot, Grupa[pGrupa[playerid][slot]][gNazwa], pGrupa[playerid][slot]);
- else
- format(grupai, sizeof(grupai), "%d\t{FFFFFF}%s (%d){FFFFFF}", slot, Grupa[pGrupa[playerid][slot]][gNazwa], pGrupa[playerid][slot]);
- format(grupy, sizeof(grupy), "%s%s\n", grupy, grupai);
- }
- }
- if(!grupyx) return InfoBoxShow(2, playerid, "Twoja postac nie jest czlonkiem zadnej z grup.", 3);
- return dShowPlayerDialog(playerid, 110, DIALOG_STYLE_LIST, ""ServName"Grupy", grupy, "Wybierz", "Anuluj");
- }
- CMD:blokuj(playerid, params[])
- {
- if(Sluzba(playerid) == 0)
- return Tip(playerid, "Wejdź na służbę grupy, aby móc skorzystać z tej komendy.");
- //robimy pętle itd.
- return 1;
- }
- //komendy dotyczące grup (/kup, /podaj, /ubranie)
- CMD:o(playerid, params[])
- {
- if(Offer[playerid][oBlock] == 1)
- return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej jesteś w trakcie wykonywania którejś.");
- new sub[80],rest[80], gracz = INVALID_PLAYER_ID, offeinfo[512], info[2048];
- if(sscanf(params, "s[80]S()[80]", sub, rest))
- {
- Tip(playerid, "/o [pojazd, powitanie, przedmiot] {parametry}");
- if(Sluzba(playerid) != 0)
- {
- new offecmd[256];
- if(Grupa[Sluzba(playerid)][gTyp] == 1 || Grupa[Sluzba(playerid)][gTyp] == 2 || Grupa[Sluzba(playerid)][gTyp] == 8 || Grupa[Sluzba(playerid)][gTyp] == 10)
- offecmd = "/o [produkt] {parametry}";
- else if(Grupa[Sluzba(playerid)][gTyp] == 13)
- offecmd = "/o [produkt, odblokowanie, mandat, przetrzymanie] {parametry}";
- else
- offecmd = "/o [produkt] {parametry}";
- format(String, sizeof(String), "%s", offecmd);
- return Tip(playerid, String);
- }
- return 1;
- }
- if(strcmp(sub, "pojazd", true) == 0 || strcmp(sub, "auto", true) == 0)//Typ oferty = 1, Parametry (UID, kwota)
- {
- if(!IsPlayerInAnyVehicle(playerid))
- return Tip(playerid, "Aby skorzystać z tej oferty, musisz znajdować się w pojeździe.");
- if(Pojazd[CarUID(GetPlayerVehicleID(playerid))][vOwner] == OWNER_PLAYER && Pojazd[CarUID(GetPlayerVehicleID(playerid))][vOwnerUID] == Player[playerid][pUID])
- {
- new kwota = 0;
- if(sscanf(rest, "ud", gracz, kwota))
- return Tip(playerid, "/o pojazd [gracz] [cena]");
- //warunki podstawowe
- if(IsPlayerLogged(gracz) == 0)// || gracz == playerid)
- return NoLogin(playerid);
- if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
- if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
- //warunki dodatkowe
- if(kwota < 0 || kwota > 9999999)
- return Tip(playerid, "Wprowadzona przez Ciebie kwota jest błędna.");
- //warunki zabezpieczające
- if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
- return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
- if(!PlayerToPlayer(5.0, playerid, gracz))
- return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
- //koniec warunków
- Tip(playerid, "Oferta została wysłana, poczekaj na odpowiedź gracza.");
- printf("[offe] %s wysłał ofertę dla %s. Typ oferty: Kupno pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(CarUID(GetPlayerVehicleID(playerid))), CarUID(GetPlayerVehicleID(playerid)), kwota);
- Offer[playerid][oCustomerID] = gracz;
- Offer[gracz][oCustomerID] = playerid;
- Offer[playerid][oType] = OFFER_VEHICLE;
- Offer[playerid][oItemUID] = CarUID(GetPlayerVehicleID(playerid));
- Offer[playerid][oPrice] = kwota;
- format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d, sampID: %d)\nSkładający:\t\t%s\nKoszt oferty:\t\t$%d\nInne:\n\tPrzebieg:\t%.02f km\n----\n1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", "Kupno pojazdu", GetVehicleName(CarUID(GetPlayerVehicleID(playerid))), CarUID(GetPlayerVehicleID(playerid)), GetPlayerVehicleID(playerid), cName(playerid), kwota, Pojazd[CarUID(GetPlayerVehicleID(playerid))][vPrzebieg]);
- dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_LIST, ""ServName"Oferta", info, "Akceptuj", "Odrzuc");
- }
- else
- {
- Info(playerid, "Nie posiadasz uprawnień do sprzedaży tego pojazdu.");
- }
- return 1;
- }
- else if(strcmp(sub, "drzwi", true) == 0)//Typ oferty = 2, Parametry (Gracz, powitanie)
- {
- if(InDoor(playerid) == 0)
- return Info(playerid, "Nie znajdujesz się w żadnym z budynków.");
- if(Drzwi[InDoor(playerid)][dOwner] == OWNER_PLAYER && Drzwi[InDoor(playerid)][dOwnerUID] == Player[playerid][pUID])
- {
- new kwota = 0;
- if(sscanf(rest, "ud", gracz, kwota))
- return Tip(playerid, "/o drzwi [gracz] [cena]");
- //warunki podstawowe
- if(IsPlayerLogged(gracz) == 0 || gracz == playerid)
- return NoLogin(playerid);
- if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
- if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
- //warunki dodatkowe
- if(kwota < 0 || kwota > 9999999)
- return Tip(playerid, "Wprowadzona przez Ciebie kwota jest błędna.");
- //warunki zabezpieczające
- if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
- return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
- if(!PlayerToPlayer(5.0, playerid, gracz))
- return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
- //koniec warunków
- Tip(playerid, "Oferta została wysłana, poczekaj na odpowiedź gracza.");
- printf("[offe] %s wysłał ofertę dla %s. Typ oferty: Kupno drzwi, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), Drzwi[InDoor(playerid)][dNazwa], InDoor(playerid), kwota);
- Offer[playerid][oCustomerID] = gracz;
- Offer[gracz][oCustomerID] = playerid;
- Offer[playerid][oType] = OFFER_DOORS;
- Offer[playerid][oItemUID] = InDoor(playerid);
- Offer[playerid][oPrice] = kwota;
- dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_MSGBOX, String, offeinfo, "Akceptuj", "Odrzuć");
- format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d)\nSkładający:\t\t%s\nKoszt oferty:\t\t$%d\n----\n1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", "Kupno drzwi", Drzwi[InDoor(playerid)][dNazwa], InDoor(playerid), cName(playerid), kwota);
- dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_LIST, ""ServName"Oferta", info, "Akceptuj", "Odrzuc");
- }
- else
- {
- Info(playerid, "Nie posiadasz uprawnień do sprzedaży tego budynku.");
- }
- return 1;
- }
- else if(strcmp(sub, "powitanie", true) == 0)//Typ oferty = 3, Parametry (Gracz, powitanie)
- {
- new typ = 0;
- if(sscanf(rest, "ud", gracz, typ))
- return Tip(playerid, "/o powitanie [gracz] [typ (0 - 7)]");
- //warunki podstawowe
- if(IsPlayerLogged(gracz) == 0 || gracz == playerid)
- return NoLogin(playerid);
- if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
- if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
- //warunki dodatkowe
- if(!IsPlayerInAnyVehicle(gracz))
- return Tip(playerid, "Gracz, któremu chcesz zaoferować usługę musi znajdować się w pojeździe.");
- //warunki zabezpieczające
- if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
- return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
- if(!PlayerToPlayer(5.0, playerid, gracz))
- return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
- //koniec warunków
- return 1;
- }
- else if(strcmp(sub, "produkt", true) == 0)//Typ oferty = 4, Parametry (Gracz)
- {
- if(Sluzba(playerid) == 0)
- return Info(playerid, "Wejdź na służbę grupy, z której chcesz zaoferować produkty.");
- if(InDoor(playerid) == 0)
- return Info(playerid, "Aby zaoferować jakikolwiek produkt, musisz znajdować się w budynku.");
- if(Drzwi[InDoor(playerid)][dOwner] == 2 && Drzwi[InDoor(playerid)][dOwnerUID] == Sluzba(playerid))
- {
- //oferta
- }
- else
- {
- Info(playerid, "W tym momencie nie możesz zaoferować żadnego produktu.\nDrzwi, w których się znajdujesz mogą nie być własnością grupy, z której produkt chcesz zaoferować.");
- }
- return 1;
- }
- else if(strcmp(sub, "przedmiot", true) == 0)//Typ oferty = 5, Parametry (Gracz, cena)
- {
- return 1;
- }
- else if(strcmp(sub, "przetrzymanie", true) == 0)//Typ oferty = 6, Parametr (Gracz)
- {
- return 1;
- }
- else if(strcmp(sub, "naprawe", true) == 0)//Typ oferty = 7, Parametr (Gracz)
- {
- if(Grupa[Sluzba(playerid)][gTyp] != 9)
- return Info(playerid, "Aby skorzystać z tej komendy musisz znajdować się na służbie grupy o typie Warsztat.");
- if(!(pGrupaPerm[playerid][GroupSlot(playerid, Sluzba(playerid))] & PERM_OFFER))
- return Info(playerid, "Nie posiadasz uprawnień do składania ofert.");
- if(sscanf(rest, "u", gracz))
- return Tip(playerid, "/o naprawe [gracz]");
- //warunki podstawowe
- if(IsPlayerLogged(gracz) == 0 || playerid == gracz)
- return NoLogin(playerid);
- if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
- if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
- //warunki dodatkowe
- if(!IsPlayerInAnyVehicle(gracz))
- return Tip(playerid, "Gracz, któremu chcesz zaoferować usługę musi znajdować się w pojeździe.");
- //warunki zabezpieczające
- if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
- return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
- if(!PlayerToPlayer(5.0, playerid, gracz))
- return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
- //koniec warunków
- Tip(playerid, "Oferta została wysłana, poczekaj na odpowiedź gracza.");
- new Float:HP;
- GetVehicleHealth(GetPlayerVehicleID(gracz), HP);
- new Float:hpdonaprawy = 1000 - HP;
- new price2 = floatval(hpdonaprawy)*1;
- Offer[playerid][oCustomerID] = gracz;
- Offer[gracz][oCustomerID] = playerid;
- Offer[playerid][oType] = OFFER_REPAIR;
- Offer[playerid][oItemUID] = CarUID(GetPlayerVehicleID(gracz));
- Offer[playerid][oPrice] = price2;
- Offer[playerid][oBlock] = 1;
- Offer[playerid][oGroupUID] = Sluzba(playerid);
- if(IsBoat(GetPlayerVehicleID(gracz)) == 1)
- {
- Offer[playerid][oPrice] = Offer[playerid][oPrice]/2;
- }
- printf("[offe] %s wysłał ofertę dla %s. Typ oferty: Naprawa pojazdu, Nazwa: %s (UID: %d), Cena: $%d.", cName(playerid), cName(gracz), GetVehicleName(Offer[playerid][oItemUID]), CarUID(Offer[playerid][oItemUID]), Offer[playerid][oPrice]);
- format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d, sampID: %d)\nSkładający:\t\t%s\nKoszt oferty:\t\t$%d\n----\n1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", "Naprawa pojazdu", GetVehicleName(CarUID(GetPlayerVehicleID(gracz))), CarUID(GetPlayerVehicleID(gracz)), GetPlayerVehicleID(gracz), cName(playerid), price2);
- return dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_LIST, ""ServName"Oferta", info, "Akceptuj", "Odrzuc");
- }
- else if(strcmp(sub, "rejestracja", true) == 0)//Typ oferty = 8, Parametr (Gracz, UID wozu)
- {
- new vUID = INVALID_VEHICLE_ID;
- if(Grupa[Sluzba(playerid)][gTyp] != 14)
- return Info(playerid, "Aby skorzystać z tej komendy musisz znajdować się na służbie grupy o typie Rząd.");
- if(!(pGrupaPerm[playerid][GroupSlot(playerid, Sluzba(playerid))] & PERM_OFFER))
- return Info(playerid, "Nie posiadasz uprawnień do składania ofert.");
- if(sscanf(rest, "ud", gracz, vUID))
- return Tip(playerid, "/o rejestracje [gracz] [identyfikator pojazdu]");
- //warunki podstawowe
- if(IsPlayerLogged(gracz) == 0 || gracz == playerid)
- return NoLogin(playerid);
- if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
- if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
- //warunki dodatkowe
- if(Drzwi[InDoor(playerid)][dOwner] == OWNER_GROUP && Drzwi[InDoor(playerid)][dOwnerUID] == Sluzba(playerid))
- {
- if(Pojazd[vUID][vOwner] == OWNER_PLAYER && Pojazd[vUID][vOwnerUID] == Player[gracz][pUID])//dodać do sprawdzenia czy jest w grupach, pod które podpisane jest auto
- {
- if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
- return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
- if(!PlayerToPlayer(5.0, playerid, gracz))
- return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
- if(Pojazd[vUID][vReje] == 1)
- return Tip(playerid, "Pojazd jest już zarejestrowany.");
- Tip(playerid, "Oferta została wysłana, poczekaj na odpowiedź gracza.");
- Offer[playerid][oCustomerID] = gracz;
- Offer[gracz][oCustomerID] = playerid;
- Offer[playerid][oType] = OFFER_REGISTER;
- Offer[playerid][oItemUID] = vUID;
- Offer[playerid][oPrice] = 200;
- Offer[playerid][oBlock] = 1;
- Offer[playerid][oGroupUID] = Sluzba(playerid);
- format(info, 2048, "Typ oferty:\t\t%s\nNazwa:\t\t\t%s (UID: %d)\nSkładający:\t\t%s\nKoszt oferty:\t\t$%d\n----\n1\tZapłać za pomocą gotówki\n2\tZapłać za pomocą karty płatniczej", "Rejestracja pojazdu", GetVehicleName(vUID), vUID, cName(playerid), Offer[playerid][oPrice]);
- dShowPlayerDialog(gracz, 8888, DIALOG_STYLE_LIST, ""ServName"Oferta", info, "Akceptuj", "Odrzuc");
- }
- else
- {
- Tip(playerid, "Gracz nie posiada uprawnień do rejestracji tego pojazdu.");
- }
- }
- else
- {
- Info(playerid, "Nie znajdujesz się w budynku, który należy do Rządu.");
- }
- return 1;
- }
- else if(strcmp(sub, "montaz", true) == 0)//Typ oferty = 9, Parametr (Gracz, wóz, komponent)
- {
- // new komponent, vuid;
- if(Grupa[Sluzba(playerid)][gTyp] != 9)
- return Info(playerid, "Aby skorzystać z tej komendy musisz znajdować się na służbie grupy o typie Warsztat.");
- if(!(pGrupaPerm[playerid][GroupSlot(playerid, Sluzba(playerid))] & PERM_OFFER))
- return Info(playerid, "Nie posiadasz uprawnień do składania ofert.");
- if(sscanf(rest, "udd", gracz))
- return Tip(playerid, "/o montaz [gracz] [identyfikator pojazdu] [komponent]");
- //warunki podstawowe
- if(IsPlayerLogged(gracz) == 0 || playerid == gracz)
- return NoLogin(playerid);
- if(Offer[playerid][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Już złożyłeś komuś ofertę, poczekaj na odpowiedź.");
- if(Offer[gracz][oCustomerID] != INVALID_PLAYER_ID)
- return Tip(playerid, "Temu graczu ktoś już złożył ofertę, spróbuj ponownie za chwilę.");
- //warunki dodatkowe
- if(!IsPlayerInAnyVehicle(gracz))
- return Tip(playerid, "Gracz, któremu chcesz zaoferować usługę musi znajdować się w pojeździe.");
- //owner pojazdu, owner komponentu
- //warunki zabezpieczające
- if(Offer[playerid][oBlock] == 1 || Offer[gracz][oBlock] == 1)
- return Info(playerid, "Możliwość składania ofert została zablokowana, najprawdopodobniej Gracz lub Ty jesteście w trakcie wykonywania jakiejś usługi.");
- if(!PlayerToPlayer(5.0, playerid, gracz))
- return Tip(playerid, "Gracz nie znajduje sie w pobliżu Ciebie.");
- //koniec warunków
- }
- else
- {
- new offe[64];
- format(offe, sizeof(offe), "System nie rozpoznał usługi '%s'.", params), Tip(playerid, offe);
- }
- return 1;
- }
- CMD:podaj(playerid, params[])
- {
- new Itemy[2048], list = 0, Item[64], gracz;
- for(new d = 0; d < MAX_DRZWI; d++)
- {
- if(Drzwi[d][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]) && Drzwi[d][dWewVir] == GetPlayerVirtualWorld(playerid))
- {
- if(Drzwi[d][dOwner] == 2)
- {
- if(pGrupa[playerid][1] == Drzwi[d][dOwnerUID] || pGrupa[playerid][2] == Drzwi[d][dOwnerUID] || pGrupa[playerid][3] == Drzwi[d][dOwnerUID] || pGrupa[playerid][4] == Drzwi[d][dOwnerUID] || pGrupa[playerid][5] == Drzwi[d][dOwnerUID])
- {
- //konfiguracja oferty
- if(sscanf(params, "d", gracz))
- return Tip(playerid, "/podaj [id / nick]");
- if(Sluzba(playerid) != Drzwi[d][dOwnerUID])
- return InfoBoxShow(2, playerid, "Aby zaoferowac jakikolwiek ~y~produkt~w~ w tym ~y~budynku~w~, musisz byc na sluzbie ~y~grupy~w~, do ktorej ten budynek nalezy.", 4);
- if(IsPlayerLogged(gracz) == 0 || gracz == playerid) return NoLogin(playerid);
- SetPVarInt(gracz, "rpOffePlayer", playerid);
- SetPVarInt(gracz, "rpOffeDoor", InDoor(playerid));
- SetPVarInt(gracz, "rpOffeGroup", Sluzba(playerid));
- SetPVarInt(playerid, "rpOffeClient", gracz);
- //koniec konfigurowania ofert
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1)
- {
- if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == Drzwi[d][dOwnerUID])
- {
- Przedmiot[p][iMagazyn] = 0;
- }
- }
- }
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1)
- {
- if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == Drzwi[d][dOwnerUID] && Przedmiot[p][iMagazyn] == 0)
- {
- ListItem[playerid][list] = p;
- new ilosc = 1;
- for(new i = 0; i < MAX_ITEM; i++)
- {
- if(Przedmiot[i][iAktywny] == 1)
- {
- if(Przedmiot[i][iOwner] == 3 && Przedmiot[i][iOwnerUID] == Drzwi[d][dOwnerUID] && Przedmiot[i][iMagazyn] == 0 && !strcmp(Przedmiot[p][iNazwa], Przedmiot[i][iNazwa]))
- {
- if(i != p)
- {
- Przedmiot[i][iMagazyn] = 1;
- ilosc++;
- }
- }
- }
- }
- format(Item, sizeof(Item), "%d\tx%d\t$%d\t%s", p, ilosc, Przedmiot[p][iPrice], Przedmiot[p][iNazwa]);
- format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
- list++;
- }
- }
- }
- if(list == 0) return InfoBoxShow(2, playerid, "W magazynie ~y~grupy~w~, nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
- return dShowPlayerDialog(playerid, 1002, DIALOG_STYLE_LIST, ""ServName"Składanie oferty", Itemy, "Wybierz", "Anuluj");
- }
- else
- {
- Tip(playerid, "Brak uprawnień do składania ofert w tym budynku.");
- }
- }
- break;
- }
- if(d >= MAX_DRZWI - 1)
- return InfoBoxShow(2, playerid, "Nie znajdujesz sie we wnetrzu ~y~budynku~w~.", 3);
- }
- return 1;
- }
- CMD:kup(playerid, params[])
- {
- new Itemy[2048], list = 0, Item[64], d = InDoor(playerid);
- if(Drzwi[d][dAktywne] == 1 && IsPlayerInRangeOfPoint(playerid, 50.0, Drzwi[d][dWewPosX], Drzwi[d][dWewPosY], Drzwi[d][dWewPosZ]) && Drzwi[d][dWewVir] == GetPlayerVirtualWorld(playerid))
- {
- if(Drzwi[d][dOwner] == 2)
- {
- if(Grupa[Drzwi[d][dOwnerUID]][gTyp] == 2)
- {
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1)
- {
- if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == Drzwi[d][dOwnerUID])
- {
- Przedmiot[p][iMagazyn] = 0;
- }
- }
- }
- for(new p = 0; p < MAX_ITEM; p++)
- {
- if(Przedmiot[p][iAktywny] == 1)
- {
- if(Przedmiot[p][iOwner] == 3 && Przedmiot[p][iOwnerUID] == Drzwi[d][dOwnerUID] && Przedmiot[p][iMagazyn] == 0)
- {
- ListItem[playerid][list] = p;
- new ilosc = 1;
- for(new i = 0; i < MAX_ITEM; i++)
- {
- if(Przedmiot[i][iAktywny] == 1)
- {
- if(Przedmiot[i][iOwner] == 3 && Przedmiot[i][iOwnerUID] == Drzwi[d][dOwnerUID] && Przedmiot[i][iMagazyn] == 0 && !strcmp(Przedmiot[p][iNazwa], Przedmiot[i][iNazwa]))
- {
- if(i != p)
- {
- Przedmiot[i][iMagazyn] = 1;
- ilosc++;
- }
- }
- }
- }
- format(Item, sizeof(Item), "%d\tx%d\t(€%d) $%d\t\t%s", p, ilosc, Przedmiot[p][iPremiumPrice], Przedmiot[p][iPrice], Przedmiot[p][iNazwa]);
- format(Itemy, sizeof(Itemy), "%s%s\n", Itemy, Item);
- list++;
- }
- }
- }
- if(list == 0) return InfoBoxShow(2, playerid, "W magazynie ~y~sklepu~w~, nie odnaleziono zadnych ~y~przedmiotow~w~.", 3);
- return dShowPlayerDialog(playerid, 1003, DIALOG_STYLE_LIST, ""ServName"Sklep", Itemy, "Wybierz", "Anuluj");
- }
- return InfoBoxShow(2, playerid, "Budynek, w ktorym sie znajdujesz nie nalezy do ~y~sklepu samoobslugowego~w~.", 3);
- }
- else
- {
- return InfoBoxShow(2, playerid, "Budynek, w ktorym sie znajdujesz nie nalezy do ~y~sklepu samoobslugowego~w~.", 3);
- }
- }
- return 1;
- }
- CMD:w(playerid, params[])
- {
- new gracz, text[200];
- if(sscanf(params, "us[200]", gracz, text))
- return Tip(playerid, "/w [ID gracza / część nicku] [wiadomość]");
- if(IsPlayerLogged(gracz) == 0 || gracz == playerid) return NoLogin(playerid);
- if(GetPVarInt(gracz, "AFK") > 3)
- {
- InfoBoxShow(2, playerid, "~y~Gracz~w~, do ktorego wyslales wiadomosc znajduje sie aktualnie zdala od komputera.", 3);
- }
- SetPVarInt(gracz, "ReplayPriv", playerid);
- if(strlen(text) > 75)
- {
- new linia[76];
- format(linia, sizeof(linia), text);
- strdel(linia, 76, strlen(linia));
- format(String, sizeof(String), "(( » [%d] %s: %s ... ))", gracz, CharName(gracz), linia);
- SendClientMessage(playerid, 0xFFC973FF, String);
- format(String, sizeof(String),"(( « [%d] %s: %s ... ))", playerid, CharName(playerid), linia);
- SendClientMessage(gracz, 0xFDAE33FF, String);
- strdel(text, 0, 75);
- format(String, sizeof(String), "(( ... %s ))", text);
- SendClientMessage(playerid, 0xFFC973FF, String);
- format(String, sizeof(String), "(( ... %s ))", text);
- SendClientMessage(gracz, 0xFDAE33FF, String);
- return 1;
- }
- else
- {
- format(String, sizeof(String),"(( » [%d] %s: %s ))", gracz, CharName(gracz), text);
- SendClientMessage(playerid,0xFFC973FF,String);
- format(String, sizeof(String),"(( « [%d] %s: %s ))", playerid, CharName(playerid), text);
- SendClientMessage(gracz, 0xFDAE33FF, String);
- }
- return SetPVarInt(gracz, "rpPriv", playerid);
- }
- CMD:re(playerid, params[])
- {
- new text[200];
- if(sscanf(params, "s[200]", text))
- return Tip(playerid, "/re [wiadomość]");
- if(IsPlayerLogged(GetPVarInt(playerid, "ReplayPriv") == 0 || GetPVarInt(playerid, "ReplayPriv") == playerid)) return NoLogin(playerid);
- if(GetPVarInt(GetPVarInt(playerid, "ReplayPriv"), "AFK") > 3)
- {
- InfoBoxShow(2, playerid, "~y~Gracz~w~, do ktorego wyslales wiadomosc znajduje sie aktualnie zdala od komputera.", 3);
- }
- SetPVarInt(GetPVarInt(playerid, "ReplayPriv"), "ReplayPriv", playerid);
- if(strlen(text) > 75)
- {
- new linia[76];
- format(linia, sizeof(linia), text);
- strdel(linia, 76, strlen(linia));
- format(String, sizeof(String), "(( » [%d] %s: %s ... ))", GetPVarInt(playerid, "ReplayPriv"), CharName(GetPVarInt(playerid, "ReplayPriv")), linia);
- SendClientMessage(playerid, 0xFFC973FF, String);
- format(String, sizeof(String),"(( « [%d] %s: %s ... ))", playerid, CharName(playerid), linia);
- SendClientMessage(GetPVarInt(playerid, "ReplayPriv"), 0xFDAE33FF, String);
- strdel(text, 0, 75);
- format(String, sizeof(String), "(( ... %s ))", text);
- SendClientMessage(playerid, 0xFFC973FF, String);
- format(String, sizeof(String), "(( ... %s ))", text);
- SendClientMessage(GetPVarInt(playerid, "ReplayPriv"), 0xFDAE33FF, String);
- return 1;
- }
- else
- {
- format(String, sizeof(String),"(( » [%d] %s: %s ))", GetPVarInt(playerid, "ReplayPriv"), CharName(GetPVarInt(playerid, "ReplayPriv")), text);
- SendClientMessage(playerid,0xFFC973FF,String);
- format(String, sizeof(String),"(( « [%d] %s: %s ))", playerid, CharName(playerid), text);
- SendClientMessage(GetPVarInt(playerid, "ReplayPriv"), 0xFDAE33FF, String);
- }
- return 1;
- }
- CMD:login(playerid, params[])
- {
- if(GetPVarInt(playerid, "LoginTime") > gettime())
- return Info(playerid, "Musisz odczekać minutę od ostatniego zalogowania.");
- SetPVarInt(playerid, "LoginTime", gettime()+60);
- SetPVarInt(playerid, "Teleport", 1);
- Player[playerid][pQuit] = 1;
- Player[playerid][pQuitTime] = gettime();
- Global_Data_Save(playerid);
- SavePlayerStats(playerid, SAVE_PLAYER_BASIC);
- SavePlayerStats(playerid, SAVE_PLAYER_POS);
- SavePlayerStats(playerid, SAVE_PLAYER_GROUP);
- OnPlayerDisconnect(playerid, 5);
- return OnPlayerConnect(playerid);
- }
- CMD:qs(playerid, params[])
- {
- GetPlayerPos(playerid, Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
- Player[playerid][pQuit] = 1;
- Player[playerid][pQuitTime] = gettime();
- SavePlayerStats(playerid, SAVE_PLAYER_BASIC);
- SavePlayerStats(playerid, SAVE_PLAYER_POS);
- SavePlayerStats(playerid, SAVE_PLAYER_GROUP);
- return Kick(playerid);
- }
- CMD:rx(playerid, params[])
- {
- new Float:Rot, Float:Pos[6];
- if(sscanf(params, "f", Rot))
- return Tip(playerid, "/rx [rotacja]");
- if(Obiekt(playerid) == 0)
- return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
- GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
- return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1], Pos[2], Pos[3]+Rot, Pos[4], Pos[5]);
- }
- CMD:ry(playerid, params[])
- {
- new Float:Rot, Float:Pos[6];
- if(sscanf(params, "f", Rot))
- return Tip(playerid, "/ry [rotacja]");
- if(Obiekt(playerid) == 0)
- return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
- GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
- return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1], Pos[2], Pos[3], Pos[4]+Rot, Pos[5]);
- }
- CMD:rz(playerid, params[])
- {
- new Float:Rot, Float:Pos[6];
- if(sscanf(params, "f", Rot))
- return Tip(playerid, "/rz [rotacja]");
- if(Obiekt(playerid) == 0)
- return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
- GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
- return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1], Pos[2], Pos[3], Pos[4], Pos[5]+Rot);
- }
- CMD:ox(playerid, params[])
- {
- new Float:Rot, Float:Pos[6];
- if(sscanf(params, "f", Rot))
- return Tip(playerid, "/ox [rotacja]");
- if(Obiekt(playerid) == 0)
- return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
- GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
- return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0]+Rot, Pos[1], Pos[2], Pos[3], Pos[4], Pos[5]);
- }
- CMD:oy(playerid, params[])
- {
- new Float:Rot, Float:Pos[6];
- if(sscanf(params, "f", Rot))
- return Tip(playerid, "/oy [rotacja]");
- if(Obiekt(playerid) == 0)
- return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
- GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
- return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1]+Rot, Pos[2], Pos[3], Pos[4], Pos[5]);
- }
- CMD:oz(playerid, params[])
- {
- new Float:Rot, Float:Pos[6];
- if(sscanf(params, "f", Rot))
- return Tip(playerid, "/oz [rotacja]");
- if(Obiekt(playerid) == 0)
- return Info(playerid, "Aktualnie nie edytujesz żadnego obiektu.");
- GetDynamicObjectPos(Obiekt(playerid), Pos[0], Pos[1], Pos[2]);
- GetDynamicObjectRot(Obiekt(playerid), Pos[3], Pos[4], Pos[5]);
- return OnPlayerEditDynamicObject(playerid, Obiekt(playerid), 3, Pos[0], Pos[1], Pos[2]+Rot, Pos[3], Pos[4], Pos[5]);
- }
- CMD:pasy(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(GetPVarInt(playerid, "rpPasy") == 0)
- {
- SetPVarInt(playerid, "rpPasy", 1);
- GameTextForPlayer(playerid, "~w~pasy ~r~zapiete", 3000, 6);
- PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
- }
- else
- {
- SetPVarInt(playerid, "rpPasy", 0);
- GameTextForPlayer(playerid, "~w~pasy ~g~odpiete", 3000, 6);
- PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
- }
- }
- else
- {
- Tip(playerid, "Musisz znajdować się w pojeździe.");
- }
- return 1;
- }
- //komendy organizacji
- ///live Siemanko, tutaj Wasz Admin co tam ciekawego slychac w jakze slonecznym Los Santos? Wszystko w porzadku ABC?
- CMD:live(playerid, params[])
- {
- if(Sluzba(playerid) == 0 || Grupa[Sluzba(playerid)][gTyp] != 16)
- return Info(playerid, "Musisz być na służbie grupy, aby móc nadawać audycje w Radio.");
- foreach(Player, p)
- {
- if(Player[p][pRadio] == Sluzba(playerid) || Player[p][pRadio] == 0)
- {
- format(String, sizeof(String), " ~y~~h~%s (LIVE):~w~ %s~n~", CharName(playerid), params);
- TextDrawSetString(PasekSanNews[p], String);
- }
- }
- return 1;
- }
- CMD:reklama(playerid, params[])
- {
- if(Sluzba(playerid) == 0 || Grupa[Sluzba(playerid)][gTyp] != 16)
- return Info(playerid, "Musisz być na służbie grupy, aby móc nadawać audycje w Radio.");
- foreach(Player, p)
- {
- if(Player[p][pRadio] == Sluzba(playerid) || Player[p][pRadio] == 0)
- {
- format(String, sizeof(String), " ~p~~h~%s (Reklama):~w~ %s~n~", CharName(playerid), params);
- TextDrawSetString(PasekSanNews[p], String);
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment