Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #define PUTIH 0xFFFFFFFF
- stock GetName(otherID)
- {
- new nama[MAX_PLAYER_NAME];
- GetPlayerName(otherID, nama, MAX_PLAYER_NAME);
- return nama;
- }
- new glassObject[189], GlassEvent, inEvent[MAX_PLAYERS], eventTimer, destroyTimer, nextglass, timez, blub;
- public OnFilterScriptInit()
- {
- GlassEvent = false;
- destroyTimer = -1;
- timez = 0;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- inEvent[playerid] = false;
- return 1;
- }
- forward blubglass();
- public blubglass()
- {
- new i = random(6);
- if(i == 1)
- SetObjectRot(glassObject[nextglass], -100.00000, 0.00000, -90.60000);
- if(i == 2)
- SetObjectRot(glassObject[nextglass], -90.00000, 0.00000, -90.60000);
- if(i == 3)
- SetObjectRot(glassObject[nextglass], -75.00000, 0.00000, -90.60000);
- if(i == 4)
- SetObjectRot(glassObject[nextglass], -95.00000, 0.00000, -90.60000);
- else
- SetObjectRot(glassObject[nextglass], -80.00000, 0.00000, -90.60000);
- }
- forward destroyone();
- public destroyone()
- {
- if(timez > 0)
- {
- timez--;
- if(timez == 7 || timez == 5)
- {
- if(!IsValidObject(glassObject[nextglass]))
- nextglass = random(62);
- }
- if(timez == 6 || timez == 4)
- {
- if(!IsValidObject(glassObject[nextglass]))
- nextglass = random(62);
- }
- if(timez == 3)
- {
- blub = SetTimer("blubglass", 250, true);
- }
- if(timez == 1)
- {
- KillTimer(blub);
- if(IsValidObject(glassObject[nextglass]))
- DestroyObject(glassObject[nextglass]);
- timez = 7;
- }
- }
- }
- forward checkPlay();
- public checkPlay()
- {
- new Float:x, Float:y, Float:z;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (inEvent[i])
- {
- if (GetPlayerVirtualWorld(i) == 500)
- {
- GetPlayerPos(i, x, y, z);
- if (z < 385.00)
- {
- SpawnPlayer(i);
- inEvent[i] = false;
- for (new p=0; p<MAX_PLAYERS; p++)
- {
- if(inEvent[p])
- {
- new eliminated[100];
- format(eliminated, sizeof(eliminated), "{FAAC58}%s(%i) {FFFFFF}was eliminated from the event.", GetName(i), i);
- SendClientMessage(p, PUTIH, eliminated);
- }
- }
- }
- }
- }
- }
- }
- }
- stock createGlass()
- {
- glassObject[0] = CreateObject(1649, -1740.44092, 845.66888, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[1] = CreateObject(1649, -1737.18042, 845.63318, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[2] = CreateObject(1649, -1740.48816, 841.32959, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[3] = CreateObject(1649, -1737.22803, 841.29327, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[4] = CreateObject(1649, -1743.76868, 841.38629, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[5] = CreateObject(1649, -1743.70081, 845.68628, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[6] = CreateObject(1649, -1743.67358, 850.00671, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[7] = CreateObject(1649, -1740.37341, 849.96948, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[8] = CreateObject(1649, -1737.11243, 849.93317, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[9] = CreateObject(1649, -1733.85181, 849.89679, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[10] = CreateObject(1649, -1733.93787, 845.51715, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[11] = CreateObject(1649, -1733.96399, 841.24866, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[12] = CreateObject(1649, -1730.74585, 841.14685, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[13] = CreateObject(1649, -1730.63953, 845.54553, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[14] = CreateObject(1649, -1730.59717, 849.84680, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[15] = CreateObject(1649, -1743.81250, 837.06433, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[16] = CreateObject(1649, -1740.53174, 837.00037, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[17] = CreateObject(1649, -1737.23096, 836.97479, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[18] = CreateObject(1649, -1734.09045, 836.91614, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[19] = CreateObject(1649, -1730.79199, 836.81165, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[20] = CreateObject(1649, -1747.12341, 837.09131, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[21] = CreateObject(1649, -1747.06689, 841.43445, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[22] = CreateObject(1649, -1747.01526, 845.75745, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[23] = CreateObject(1649, -1746.95740, 849.99884, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[24] = CreateObject(1649, -1730.82996, 832.48993, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[25] = CreateObject(1649, -1734.09753, 832.52924, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[26] = CreateObject(1649, -1737.34229, 832.58447, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[27] = CreateObject(1649, -1740.63342, 832.60742, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[28] = CreateObject(1649, -1743.83813, 832.65540, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[29] = CreateObject(1649, -1747.13342, 832.65881, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[30] = CreateObject(1649, -1750.43262, 832.73029, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[31] = CreateObject(1649, -1750.41174, 837.09027, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[32] = CreateObject(1649, -1750.32996, 841.42944, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[33] = CreateObject(1649, -1750.28845, 845.78906, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[34] = CreateObject(1649, -1750.24622, 850.10901, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[35] = CreateObject(1649, -1730.54651, 854.22644, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[36] = CreateObject(1649, -1733.78687, 854.29486, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[37] = CreateObject(1649, -1737.08728, 854.30304, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[38] = CreateObject(1649, -1740.26367, 854.29370, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[39] = CreateObject(1649, -1743.52954, 854.32788, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[40] = CreateObject(1649, -1746.84167, 854.36127, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[41] = CreateObject(1649, -1750.14624, 854.45685, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[42] = CreateObject(1649, -1753.71252, 832.77502, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[43] = CreateObject(1649, -1753.56506, 837.16809, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[44] = CreateObject(1649, -1753.59863, 841.46564, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[45] = CreateObject(1649, -1753.53516, 845.80377, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[46] = CreateObject(1649, -1753.46643, 850.09772, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[47] = CreateObject(1649, -1753.44092, 854.44940, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[48] = CreateObject(1649, -1730.49390, 858.64581, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[49] = CreateObject(1649, -1733.77344, 858.66431, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[50] = CreateObject(1649, -1737.05298, 858.68329, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[51] = CreateObject(1649, -1740.31287, 858.70197, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[52] = CreateObject(1649, -1743.45178, 858.75903, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[53] = CreateObject(1649, -1746.75024, 858.76831, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[54] = CreateObject(1649, -1750.05212, 858.79803, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[55] = CreateObject(1649, -1753.37537, 858.88470, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[56] = CreateObject(1649, -1756.61438, 858.90198, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[57] = CreateObject(1649, -1756.71008, 854.54590, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[58] = CreateObject(1649, -1756.71973, 850.21057, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[59] = CreateObject(1649, -1756.76819, 845.92291, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[60] = CreateObject(1649, -1756.84387, 841.63708, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[61] = CreateObject(1649, -1756.79749, 837.29614, 428.79611, -90.00000, 0.00000, -90.60000);
- glassObject[62] = CreateObject(1649, -1756.81995, 832.97583, 428.79611, -90.00000, 0.00000, -90.60000);
- }
- stock destroyGlass()
- {
- for(new i = 0; i < 63; i++)
- {
- if(IsValidObject(glassObject[nextglass])) DestroyObject(glassObject[nextglass]);
- }
- KillTimer(eventTimer);
- KillTimer(destroyTimer);
- }
- COMMAND:toggleevent(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- if (GlassEvent)
- {
- GlassEvent = 0;
- SendClientMessageToAll(PUTIH, "{B7B7B7}[EVENT CLOSED] {FFFFFF}An administrator has closed the fallout event.");
- }
- else
- {
- destroyGlass();
- createGlass();
- GlassEvent = 1;
- SendClientMessageToAll(PUTIH, "{B7B7B7}[EVENT OPENED] {FFFFFF}An administrator has started a fallout event! Type {FFDC2E}/joinevent{FFFFFF} to participate.");
- }
- }
- else
- {
- return 0;
- }
- return 1;
- }
- COMMAND:startevent(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (inEvent[nextglass])
- {
- TogglePlayerControllable(i, 1);
- GameTextForPlayer(i, "FALLOUT EVENT STARTED!", 5000, 5);
- eventTimer = SetTimer("checkPlay", 3000, true);
- destroyTimer = SetTimer("destroyone", 1000, true);
- timez = 10;
- nextglass = random(62);
- }
- }
- }
- }
- else
- {
- return 0;
- }
- return 1;
- }
- COMMAND:destroyevent(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerAdmin(playerid))
- {
- destroyGlass();
- SendClientMessage(playerid, PUTIH, "{B7B7B7}[SERVER] {FFFFFF}Glass destroyed.");
- }
- else
- {
- return 0;
- }
- }
- else
- {
- SendClientMessage(playerid, PUTIH, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands.");
- }
- return 1;
- }
- COMMAND:joinevent(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- if (!inEvent[playerid])
- {
- if (GlassEvent)
- {
- new randSpawn = random(16);
- switch(randSpawn)
- {
- case 0:
- {
- SetPlayerPos(playerid, -1756.6765, 833.0526, 429.7961);
- }
- case 1:
- {
- SetPlayerPos(playerid, -1756.7405, 841.5081, 429.7961);
- }
- case 2:
- {
- SetPlayerPos(playerid, -1756.7408, 850.0634, 429.7961);
- }
- case 3:
- {
- SetPlayerPos(playerid, -1756.7194, 858.9014, 429.7961);
- }
- case 4:
- {
- SetPlayerPos(playerid, -1750.2263, 859.0184, 429.7961);
- }
- case 5:
- {
- SetPlayerPos(playerid, -1743.9375, 859.0184, 429.7961);
- }
- case 6:
- {
- SetPlayerPos(playerid, -1736.6906, 859.0184, 429.7961);
- }
- case 7:
- {
- SetPlayerPos(playerid, -1730.7318, 859.0184, 429.7961);
- }
- case 8:
- {
- SetPlayerPos(playerid, -1730.4872, 850.3536, 429.7961);
- }
- case 9:
- {
- SetPlayerPos(playerid, -1730.5259, 841.1364, 429.7961);
- }
- case 10:
- {
- SetPlayerPos(playerid, -1730.6837, 832.7377, 429.7961);
- }
- case 11:
- {
- SetPlayerPos(playerid, -1736.8262, 832.4484, 429.7961);
- }
- case 12:
- {
- SetPlayerPos(playerid, -1744.0161, 832.5099, 429.7961);
- }
- case 13:
- {
- SetPlayerPos(playerid, -1749.9906, 832.5613, 429.7961);
- }
- case 14:
- {
- SetPlayerPos(playerid, -1750.1062, 840.8447, 429.7961);
- }
- case 15:
- {
- SetPlayerPos(playerid, -1750.0922, 849.1535, 429.7961);
- }
- case 16:
- {
- SetPlayerPos(playerid, -1744.1351, 849.7830, 429.7961);
- }
- case 17:
- {
- SetPlayerPos(playerid, -1743.6621, 842.0274, 429.7961);
- }
- case 18:
- {
- SetPlayerPos(playerid, -1737.4501, 841.3073, 429.7961);
- }
- case 19:
- {
- SetPlayerPos(playerid, -1737.0245, 849.3864, 429.7961);
- }
- }
- SetPlayerTeam(playerid, NO_TEAM);
- SetPlayerVirtualWorld(playerid, 500);
- inEvent[playerid] = true;
- TogglePlayerControllable(playerid, 0);
- SetPlayerArmour(playerid, 0);
- SetPlayerHealth(playerid, 999999);
- ResetPlayerWeapons(playerid);
- GameTextForPlayer(playerid, "THE EVENT WILL START SHORTLY!~n~~r~You are temporarily frozen", 10000, 5);
- }
- else
- {
- SendClientMessage(playerid, PUTIH, "{B7B7B7}[SERVER] {FFFFFF}There is no fallout event open right now.");
- }
- }
- else
- {
- SendClientMessage(playerid, PUTIH, "{B7B7B7}[SERVER] {FFFFFF}You cannot join event.");
- }
- }
- else
- {
- SendClientMessage(playerid, PUTIH, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands.");
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment