Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Rimon By Davidi12-LeTmE
- #include <a_samp>
- #pragma tabsize 0
- //====================================Defines===================================
- #define COLOR_RED 0xAA3333AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_LIGHTGREEN 0x24FF0AB9
- #define COLOR_PEACH 0xEECFA1AA //peach
- #define COLOR_YELLOW 0xFFFF00AA
- #define MinWarPlayers 1
- //=====================================News=====================================
- new RimonOn;
- new InRimon[MAX_PLAYERS];
- new RimonPlayers;
- new playername[MAX_PLAYER_NAME];
- new Count;
- new knoob;
- new CountFuc;
- new Reward;
- new knob[256];
- new RimonWinner;
- new CheckTime;
- new WS;
- new PP[MAX_PLAYERS];
- new RimonWeapons[] = {16};
- //=============================Random Rimon Spawns================================
- new Float:RandSpawn[] [] = {
- {-2564.538,1092.589,55.664,337.096},
- {-2356.0573,995.4032,50.8984,182.0485},
- {-1382.105224,-230.142044,14.148437,313.913299},
- {-2396.605468,-617.606628,132.737396,36.312511},
- {1867.630493,-1442.807006,13.540561,317.000457},
- {-2128.956298,925.477416,79.966804,93.446701},
- {2192.915283,1670.262939,12.367187,89.400100},
- {366.690490,2557.363281,16.856082,181.276748},
- {-2929.666992,453.267517,4.914062,270.580932},
- {-2422.023437,286.051605,35.257869,71.032470},
- {2495.416748,-1687.549682,13.516131,2.144218},
- {-1508.722045,1019.904846,7.187500,179.759155},
- {-1499.821166,715.792602,7.212387,89.336952},
- {-1619.134155,681.706298,7.190120,89.963623},
- {-1410.905273,456.152038,7.187500,1.245707},
- {-2408.289794,-2175.717285,33.289062,270.799926},
- {-1631.521606,-2239.001220,31.476562,91.180885},
- {-90.911148,-1159.593139,2.067930,58.911594},
- {-2246.060791,2284.073486,4.970916,359.469268},
- {-2543.482177,1216.352905,37.421875,3.426709},
- {-2650.885742,1361.723266,12.250000,179.712753},
- {-2841.463378,1301.068481,7.101562,181.569442},
- {-2899.006591,1063.880126,32.132812,266.714843},
- {-2758.178955,376.006683,4.333554,271.460571},
- {-2654.040527,206.110565,4.335937,0.469989},
- {-2026.803344,156.846771,29.039062,269.686340},
- {-1969.536743,159.899826,27.687500,180.095474},
- {-1959.827880,293.920349,35.468750,90.191314},
- {-2039.647705,-81.948585,35.320312,1.408744},
- {-1828.319213,108.475776,15.117187,264.632873},
- {-1710.443725,399.048828,7.187244,225.592437},
- {-1617.258666,1286.358520,7.184526,85.461174},
- {-2063.862304,1381.531005,7.100666,180.327468},
- {-2476.466308,1266.988769,28.159187,271.818572},
- {-2280.303710,1022.978637,83.932350,271.810791},
- {-2269.722900,535.506103,35.015625,268.893798},
- {-2212.083251,307.103424,35.117187,179.338928},
- {-2286.310546,150.778594,35.312500,270.636749},
- {-2656.270263,-278.185577,7.495392,43.365280},
- {-2721.727050,-317.288574,7.843750,45.895351},
- {708.769714,1926.467773,5.582498,358.166961},
- {-2540.925537,-596.941040,132.710937,268.919036},
- {-1995.975708,-859.088928,32.171875,94.306816},
- {-2136.151855,-388.964965,35.343013,359.299926},
- {-1421.252319,-514.835449,14.177608,203.312210},
- {-3102.738037,477.210845,35.113548,269.079071},
- {-2483.815429,1069.525390,55.766624,355.448913},
- {-2407.970703,722.858520,38.273437,91.772735},
- {-2445.706054,516.771789,30.108627,271.580230},
- {-2571.287597,556.769042,14.460937,359.057678},
- {-1658.594116,1207.322875,7.250000,19.374435},
- {-2660.122802,878.268493,79.773796,2.053548},
- {-2300.773437,1100.437500,79.993370,93.170181},
- {-2314.582031,1064.930664,65.585937,85.336761},
- {-2572.343017,1156.694091,63.390625,159.725082},
- {-2800.076416,1184.888183,20.273437,128.795059},
- {-2090.675537,2314.161621,25.914062,116.540672},
- {-2387.207519,2446.915283,10.169355,159.660369},
- {-2062.444824,1095.738037,55.614360,178.901611},
- {-1699.265380,1351.616210,7.179687,135.997940},
- {-2018.340576,952.518920,45.802761,269.142486},
- {-2304.288574,1544.356811,18.773437,90.848190},
- {-2646.972,1400.710,24.765,198.280},
- {}
- };
- new Float:gRandomRimonSpawns[][3] = {
- {-1399.2046,962.3701,1025.0680}, //WarRandomSpawn 1
- {-1427.0304,937.4364,1036.5261}, //WarRandomSpawn 2
- {-1430.2296,976.9035,1023.9880}, //WarRandomSpawn 3
- {-1432.1825,1007.2070,1024.3608}, //WarRandomSpawn 4
- {-1427.3069,1025.1040,1025.7916}, //WarRandomSpawn 5
- {-1398.1837,1054.6473,1038.4374}, //WarRandomSpawn 6
- {-1372.7314,1040.5634,1029.5721}, //WarRandomSpawn 7
- {-1351.1743,1011.9717,1024.7466}, //WarRandomSpawn 8
- {-1344.1238,984.6110,1024.3459}, //WarRandomSpawn 9
- {-1329.5845,957.0134,1030.1298}, //WarRandomSpawn 10
- {-1343.9712,935.3727,1036.3542}, //WarRandomSpawn 11
- {-1309.3192,950.7583,1036.5508}, //WarRandomSpawn 12
- {-1372.2295,958.0103,1025.9514}, //WarRandomSpawn 13
- {-1398.3308,955.6279,1026.6305}, //WarRandomSpawn 14
- {-1421.1644,955.9434,1026.5865}, //WarRandomSpawn 15
- {-1460.7736,969.6113,1026.1754}, //WarRandomSpawn 16
- {-1470.2109,999.2858,1025.7461}, //WarRandomSpawn 17
- {-1443.2224,988.0159,1024.0590}, //WarRandomSpawn 18
- {-1434.0100,997.4805,1024.2064}, //WarRandomSpawn 19
- {-1422.4056,985.5712,1023.9828} };
- //===============================OnFilterScriptInit=============================
- public OnFilterScriptInit() {
- print(" Rimon By Davidi12-LeTmE ");
- print("--- ok ---");
- print(" ** Loaded ** ");
- AllowInteriorWeapons(1);
- return 1; }
- //==============================OnFilterScriptExit==============================
- public OnFilterScriptExit() {
- print(" --Rimon-- ");
- print(" --- Davidi12-LeTmE --- ");
- print(" ** Unloaded **");
- return 1; }
- //=============================OnPlayerCommandText==============================
- public OnPlayerCommandText(playerid, cmdtext[]) {
- new cmd[256];
- new idx;
- new tmp[256];
- cmd = strtok(cmdtext, idx);
- new String[256];
- if(!strcmp(cmd, "/Kill", true)) return (playerid);
- format(String,sizeof(String),"{ffff00}/Kill ìà ðéúï ìáöò ô÷åãåú áæîï ôòéìåú, ìéöéàä ä÷ù/é");
- if(InRimon[playerid] == 1 && RimonOn == 1)return ShowPlayerDialog(playerid,11991,DIALOG_STYLE_MSGBOX,"{ffff00}Error",String,"äîùê","");
- //===============================WarStart Command===============================
- if(!strcmp(cmd, "/startRimon", true)) {
- tmp = strtok(cmdtext, idx);
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WHITE, " äô÷åãä ìà ðîöàä áîòøëú");
- if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_LIGHTGREEN, " /Rimonstart [Reward] :ùéîåù ");
- if(RimonOn == 1) return SendClientMessage(playerid, COLOR_RED, " éù ëáø îìçîä ôòéìä ");
- Reward = strval(tmp);
- WarStart();
- return 1; }
- //===============================WarJoin Command================================
- if(!strcmp(cmd, "/rimon", true)) {
- if(RimonOn == 0) return SendClientMessage(playerid, COLOR_RED, " àéï òëùéå ôòéìåú");
- if(WS == 1) return SendClientMessage(playerid, COLOR_RED, " äôòéìåú ëáø äçìä,ðñä ôòí äáàä");
- if(RimonPlayers == sizeof(gRandomRimonSpawns)) return SendClientMessage(playerid, COLOR_RED, " ëì äî÷åîåú ðúôñå, ðñä ôòí äáàä");
- if(InRimon[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "àúä ëáø ðøùîúä ìôòéìåú");
- SendClientMessage(playerid, COLOR_RED, "äöèøôúä ìîìçîú äøéîåðéí,áäöìçä");
- GetPlayerName(playerid, playername, sizeof(playername));
- format(knob,sizeof(knob),"äöèøó ìôòéìåú øéîåï %s", playername);
- SendClientMessageToAll(COLOR_YELLOW, knob);
- RimonPlayers ++; InRimon[playerid] = 1;
- return 1; }
- //===============================WarEnd Command================================
- if(!strcmp(cmd, "/Rimonend", true)) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "äô÷åãä ìà ðîöàä áîòøëú");
- if(RimonOn == 0) return SendClientMessage(playerid, COLOR_RED, " àéï ôòéìåú ëøâò");
- if(WS == 1) return SendClientMessage(playerid, COLOR_RED, "äôòéìåú ëáø äúçéìä");
- SendClientMessage(playerid, COLOR_RED, "--- äôòéìåú äúáèìä ---");
- Count = 0;
- WarEnd(2);
- return 1; }
- return 0; }
- //==================================WarStart====================================
- forward WarStart();
- public WarStart() {
- SendClientMessageToAll(COLOR_LIGHTGREEN, "~~~.--- Rimon äôòéìåú ----.~~~");
- format(knob, sizeof(knob), "$%d :äôøñ äåà ", Reward);
- SendClientMessageToAll(COLOR_PEACH, knob);
- SendClientMessageToAll(COLOR_YELLOW, "/rimon - ëãé ìäéöèøó ìôòéìåú");
- SendClientMessageToAll(COLOR_PEACH, "éù ìëí 60 ùðéåú ìäöèøó");
- format(knob, sizeof(knob), "î÷åîåú %d éù ø÷ ", sizeof(gRandomRimonSpawns));
- SendClientMessageToAll(COLOR_YELLOW, knob);
- SendClientMessageToAll(COLOR_LIGHTGREEN, "~~~.--- Rimon äôòéìåú ----.~~~");
- RimonOn = 1; RimonPlayers = 0;
- Count = 60; Countdown(); CountFuc = 1;
- return 1; }
- //==================================Countdown===================================
- forward Countdown();
- public Countdown() {
- new String[256];
- format(String, 256,"~R~/Rimon %d",Count); GameTextForAll(String,1000,4);
- if(Count > 0) {
- --Count;
- SetTimer("Countdown", 1000, 0);
- } else {
- if(CountFuc == 1) {
- TeleportPlayerToWar();
- if(knoob == 1) {
- Count = 10; Countdown(); CountFuc = 2;
- } }
- if(CountFuc == 2 && Count <= 0) {
- Unfreeze();
- } } }
- //==================================Unfreeze====================================
- forward Unfreeze();
- public Unfreeze() {
- for(new i;i<MAX_PLAYERS;i++) {
- if(PP[i] == 1) {
- TogglePlayerControllable(i, 1);
- SetCameraBehindPlayer(i);
- GameTextForAll("~g~Rimon Started", 3000, 0);
- } } }
- //=============================TeleportPlayerToWar==============================
- forward TeleportPlayerToWar();
- public TeleportPlayerToWar() {
- if(RimonPlayers < MinWarPlayers) {
- WarEnd(0);
- return 1; }
- for(new i;i<MAX_PLAYERS;i++) {
- if(InRimon[i] == 1) {
- new rand = random(sizeof(gRandomRimonSpawns));
- SetPlayerPos(i, gRandomRimonSpawns[rand][0], gRandomRimonSpawns[rand][1], gRandomRimonSpawns[rand][2]);
- SetPlayerInterior(i, 15);
- ResetPlayerWeapons(i);
- rand = random(sizeof(RimonWeapons));
- GivePlayerWeapon(i,RimonWeapons[rand],5000);
- SetPlayerVirtualWorld(i,1);
- SetPlayerArmour(i, 100.0);
- SetPlayerHealth(i, 100.0);
- WS = 1; PP[i] = 1; knoob = 1;
- TogglePlayerControllable(i, 0);
- CheckTime = SetTimer("Check",1000, 1);
- } }
- return 1; }
- //===================================WarEnd1====================================
- public OnPlayerDeath(playerid, killerid, reason) {
- if(PP[playerid] == 1) {
- RimonPlayers --; InRimon[playerid] = 0; PP[playerid] = 0;
- } return 1; }
- //===================================WarEnd=====================================
- forward WarEnd(status);
- public WarEnd(status) {
- if(status == 0) {
- SendClientMessageToAll(COLOR_WHITE, "äôòéìåú äúáèìä áâìì çåñø îùúúôéí");
- RimonOn = 0; RimonPlayers = 0;
- for(new i;i<MAX_PLAYERS;i++) {
- InRimon[i] = 0; PP[i] = 0; WS = 0; knoob = 0;
- KillTimer(CheckTime);
- } return 1; }
- else if(status == 1) {
- RimonOn = 0; RimonPlayers = 0;
- GivePlayerMoney(RimonWinner, Reward);
- GetPlayerName(RimonWinner, playername, sizeof(playername));
- ResetPlayerWeapons(RimonWinner);
- SetPlayerInterior(RimonWinner, 0);
- new rand = random(sizeof(RandSpawn));
- SetPlayerPos(RimonWinner, RandSpawn[rand][0], RandSpawn[rand][1], RandSpawn[rand][2]);
- SetPlayerVirtualWorld(RimonWinner,0);
- format(knob, sizeof(knob), "________________________",playername);
- SendClientMessageToAll(COLOR_LIGHTGREEN , knob);
- format(knob, sizeof(knob), "Rimon :ðéöç áôòéìåú %s",playername);
- SendClientMessageToAll(COLOR_WHITE, knob);
- format(knob, sizeof(knob), "________________________",playername);
- SendClientMessageToAll(COLOR_LIGHTGREEN , knob);
- format(knob, sizeof(knob), "--- $%d = ðéöçú áôòéìåú, ÷éáìú ---", Reward);
- SendClientMessage(RimonWinner,COLOR_WHITE, knob);
- SetPlayerArmour(RimonWinner, 100.0);
- SetPlayerHealth(RimonWinner, 100.0);
- for(new i;i<MAX_PLAYERS;i++) {
- InRimon[i] = 0; WS = 0; PP[i] = 0; knoob = 0;
- } return 1; }
- return 1; }
- //===================================Strtok=====================================
- stock strtok(const string[], &index) {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' ')) {
- index++; }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) {
- result[index - offset] = string[index];
- index++; }
- result[index - offset] = EOS;
- return result; }
- //===================================Check======================================
- forward Check();
- public Check() {
- if(WS == 1) {
- if(RimonPlayers == 1) {
- for(new i;i<MAX_PLAYERS;i++) {
- if(InRimon[i] == 1) {
- RimonWinner = i; WarEnd(1);
- } } } } return 1; }
- //Rimon By Davidi12-LeTmE
Advertisement
Add Comment
Please, Sign In to add comment