Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <zcmd>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 10 //Liczba slotów
- #define LICENCJA "Afghanistan/License.Dj"
- #define CONFIG "Afghanistan/Config.ini"
- #define AGU 56 // admin login gui
- #define WHITE 0xFFFFFFFF
- #define TALIB 0
- #define ARMIA 1
- new bool:adminlogin[MAX_PLAYERS];
- new countpos[MAX_PLAYERS];
- new timer[MAX_PLAYERS];
- new Text3D:laber[MAX_PLAYERS];
- new mine[MAX_PLAYERS][2];
- new status[MAX_PLAYERS];
- new minePickup[MAX_PLAYERS];
- static Team[MAX_PLAYERS];
- new PlayerClass[MAX_PLAYERS];
- new RoundTime = 3600000;
- main()
- {
- if(!dini_Exists(CONFIG))
- {
- print("Utwórz plik Config.ini o zawartości taką jaką podano w pliku Czytaj.txt");
- }
- if(dini_Exists(LICENCJA))
- {
- print("Wczytano licencje");
- print("Sprawdzanie poprawności klucza...");
- if(strcmp("2012TEA", dini_Get(LICENCJA, "Klucz"), true) == 0)
- {
- print("Klucz poprawny. Start mapy...");
- }
- else
- {
- print("Klucz zly.Zamkniencie serwera nastąpi za 10 sek.");
- SetTimer("SERVER_OFF", false, 10000);
- }
- }
- else
- {
- print("Brak licencji.Zamkniencie serwera nastąpi za 10 sek.");
- SetTimer("SERVER_OFF", false, 10000);
- }
- print("\n----------------------------------");
- print("Afghanistan Mod By Dj KaSkIeR");
- print("----------------------------------\n");
- }
- AntiDeAMX()
- {
- new a[][] =
- {
- "Unarmed (Fist)",
- "Brass K"
- };
- #pragma unused a
- }
- public OnGameModeInit()
- {
- AntiDeAMX();
- SetGameModeText("++Afghanistan++");
- ShowPlayerMarkers(0);
- SetNameTagDrawDistance(dini_Float(CONFIG, "OdlegloscNicki"));
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 38, 9999, 0, 0, 0, 0);
- SetTimer("SERVER_GMX", true, RoundTime);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerClass(playerid, classid);
- SetupPlayerForClassSelection(playerid);
- PlayerClass[playerid] = classid;
- switch (classid)
- {
- case 0:
- {
- GameTextForPlayer(playerid, "~r~Talibowie", 500, 3);
- }
- case 1:
- {
- GameTextForPlayer(playerid, "~g~Armia", 500, 3);
- }
- }
- return 1;
- }
- forward SetupPlayerForClassSelection(playerid);
- public SetupPlayerForClassSelection(playerid)
- {
- SetPlayerInterior(playerid,14);
- SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
- SetPlayerFacingAngle(playerid, 90.0);
- SetPlayerCameraPos(playerid,256.0815,-43.0475,1003.0234);
- SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
- }
- SetPlayerClass(playerid, classid) {
- if(classid == 0) {
- Team[playerid] = TALIB;
- }
- else if(classid == 1) {
- Team[playerid] = ARMIA;
- }
- }
- public OnPlayerConnect(playerid)
- {
- GivePlayerMoney(playerid, 5000);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(status[playerid] == 1)
- {
- DestroyPickup(minePickup[playerid]);
- DestroyObject(mine[playerid][0]);
- DestroyObject(mine[playerid][1]);
- status[playerid] = 0;
- KillTimer(timer[playerid]);
- Delete3DTextLabel(laber[playerid]);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid == INVALID_PLAYER_ID)
- {
- SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
- }
- else
- {
- if(Team[killerid] != Team[playerid])
- {
- // Valid kill
- SendDeathMessage(killerid,playerid,reason);
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- GivePlayerMoney(killerid, 1000);
- }
- else
- {
- //Team Killer!
- new warning[256];
- format(warning, sizeof(warning), "Uważaj.Nie wolno zabijać kolegów z teamu.");
- SendClientMessage(killerid, 0xFFFF00AA, warning);
- SendDeathMessage(killerid,playerid,reason);
- GivePlayerMoney(killerid, -1000);
- SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
- }
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i)) {continue;}
- if(status[i] == 0) {continue;}
- if(pickupid == minePickup[i])
- {
- new Float:X, Float:Y, Float:Z;
- GetObjectPos(mine[i][0], X, Y, Z);
- CreateExplosion(X, Y, Z, 7, 1000);
- DestroyPickup(minePickup[i]);
- DestroyObject(mine[i][0]);
- DestroyObject(mine[i][1]);
- status[i] = 0;
- }
- }
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == AGU && response)
- {
- if(!strcmp(dini_Get(CONFIG, "AdminPass"), inputtext, true))
- {
- adminlogin[playerid] = true;
- SendClientMessage(playerid, 0xF50A0AAA, "Zalogowano poprawnie na admina");
- }
- else
- {
- SendClientMessage(playerid, 0xF50A0AAA, "Złe hasło");
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- forward SERVER_OFF();
- public SERVER_OFF()
- {
- SendRconCommand("exit");
- }
- forward SERVER_GMX();
- public SERVER_GMX()
- {
- SendRconCommand("gmx");
- }
- CMD:alogin(playerid, params[])
- {
- ShowPlayerDialog(playerid, AGU, DIALOG_STYLE_PASSWORD, "Logowanie na Admina", "Podaj hasło aby uzyskać uprawnienia Admina.", "Loguj", "Wyjdź");
- return 1;
- }
- CMD:alogout(playerid, params[])
- {
- if(adminlogin[playerid] == true)
- {
- adminlogin[playerid] = false;
- SendClientMessage(playerid, 0xF50A0AAA, "Zostałeś poprawnie wylogowany z admina");
- }
- else if(adminlogin[playerid] == false)
- {
- SendClientMessage(playerid, 0xF50A0AAA, "Nie jesteś zalogowany!");
- }
- return 1;
- }
- CMD:mina(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, WHITE, "Jesteś w aucie więc nie możesz położyć miny!!");
- return 1;
- }
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- mine[playerid][0] = CreateObject(2992, X, Y, Z-0.85, 0.0, 0.0, 0.0);
- mine[playerid][1] = CreateObject(19290, X, Y, Z-0.85, 0.0, 0.0, 0.0);
- status[playerid] = 1;
- countpos[playerid] = 11;
- dtext(playerid);
- return 1;
- }
- forward dtext(playerid);
- public dtext(playerid)
- {
- timer[playerid] = SetTimerEx("dtext", 1000, 0, "i", playerid);
- new Float:X, Float:Y, Float:Z;
- GetObjectPos(mine[playerid][0], X, Y, Z);
- if(countpos[playerid] == 11)
- {
- laber[playerid] = Create3DTextLabel("Do aktywacji pozostało: \n10 sekund!",0x00F900AA,X,Y,Z+1,40.0,0);
- countpos[playerid] = 10;
- }
- else if(countpos[playerid] == 10)
- {
- Update3DTextLabelText(laber[playerid], 0x64F801AA, "Do aktywacji pozostało: \n9 sekund!");
- countpos[playerid] = 9;
- }
- else if(countpos[playerid] == 9)
- {
- Update3DTextLabelText(laber[playerid], 0xBAF801AA, "Do aktywacji pozostało: \n8 sekund!");
- countpos[playerid] = 8;
- }
- else if(countpos[playerid] == 8)
- {
- Update3DTextLabelText(laber[playerid], 0xDAF900AA, "Do aktywacji pozostało: \n7 sekund!");
- countpos[playerid] = 7;
- }
- else if(countpos[playerid] == 7)
- {
- Update3DTextLabelText(laber[playerid], 0xFCEB18AA, "Do aktywacji pozostało: \n6 sekund!");
- countpos[playerid] = 6;
- }
- else if(countpos[playerid] == 6)
- {
- Update3DTextLabelText(laber[playerid], 0xFCCE18AA, "Do aktywacji pozostało: \n5 sekund!");
- countpos[playerid] = 5;
- }
- else if(countpos[playerid] == 5)
- {
- Update3DTextLabelText(laber[playerid], 0xFBA71AAA, "Do aktywacji pozostało: \n4 sekundy!");
- countpos[playerid] = 4;
- }
- else if(countpos[playerid] == 4)
- {
- Update3DTextLabelText(laber[playerid], 0xFA6F1BAA, "Do aktywacji pozostało: \n3 sekundy!");
- countpos[playerid] = 3;
- }
- else if(countpos[playerid] == 3)
- {
- Update3DTextLabelText(laber[playerid], 0xFA421BAA, "Do aktywacji pozostało: \n2 sekundy!");
- countpos[playerid] = 2;
- }
- else if(countpos[playerid] == 2)
- {
- Update3DTextLabelText(laber[playerid], 0xFF0F0FAA, "Do aktywacji pozostało: \n1 sekunda!");
- countpos[playerid] = 1;
- }
- else if(countpos[playerid] == 1)
- {
- KillTimer(timer[playerid]);
- Delete3DTextLabel(laber[playerid]);
- countpos[playerid] = 0;
- minePickup[playerid] = CreatePickup(0, 1, X, Y, Z, -1);
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment