Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- MiniDM v11.1 - A simple DM GameMode, but it's funny (A)
- Every round has a duration of 10 minutes, and there are 2 rounds:
- in round 1 you have light weapons, and in round 2 heavier weapons :')
- Enjoy the script
- CHANGELOG:
- v1
- - All Objects added
- - Commands added: /help /rules /warn /kick /ban
- - Basic Script Created
- v1.1
- - Some objects fixed (They where floating in the air)
- - Command added: /nextround
- KNOWN BUGS:
- - If you spam the command /nextround you will be spam spawned :P
- */
- #include <a_samp>
- #include <sscanf2> //By Y_Less
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_RED 0xFF0000AA
- #define COLOR_GREEN 0x00FF00AA
- #define COLOR_LIGHTBLUE 0x00FFFFAA
- #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- new Score[MAX_PLAYERS];
- new Warnings[MAX_PLAYERS];
- new RoundID = 0;
- new NewGameTimer;
- new Float:RandomSpawns[7][4] = {
- {1435.382934,2280.698242,13.033525,344.327789},
- {1415.960937,2096.947998,11.001707,180.533401},
- {1315.572387,2111.987304,11.015625,131.966842},
- {1303.281738,2196.681884,11.037096,277.331512},
- {1410.766845,2102.556884,12.015625,1.073378},
- {1370.210083,2194.327636,9.757812,358.108337},
- {1330.223266,2215.177490,19.406250,184.223739}
- };
- new RandomMsgs[][] = {
- "* Are you new here? Use /help",
- "* Please follow our /rules",
- "* This GameMode has been created by Kwarde",
- "* If you don't follow our /rules you will be banned/kicked/warned!"
- };
- forward ShowCamera(playerid);
- forward ResetPlayer(playerid);
- forward SendRandomMsg();
- forward ResetGame();
- forward StartNewRound();
- main()
- {
- print("\n");
- print("** MiniDM LasVenturas - Football Field loaded");
- print("** Created by Kwarde, please don't remove any credits");
- print(" ");
- print("**** Enjoy the GameMode :D");
- print("\n");
- return 1;
- }
- public OnGameModeInit()
- {
- SetGameModeText("MiniDM v1");
- SendRconCommand("mapname LV - Football Field");
- ShowPlayerMarkers(true);
- ShowNameTags(true);
- DisableInteriorEnterExits();
- CreateObject(8263, 1318.149536, 2063.798340, 12.821341, 0.0000, 0.0000, 0.0000);
- CreateObject(8263, 1438.042725, 2063.778076, 12.795986, 0.0000, 0.0000, 0.0000);
- CreateObject(8263, 1497.476196, 2123.434082, 12.771341, 0.0000, 0.0000, 90.2409);
- CreateObject(8263, 1498.739746, 2243.222168, 12.871340, 0.0000, 0.0000, 88.5220);
- CreateObject(8263, 1440.653809, 2302.424072, 12.896339, 0.0000, 0.0000, 180.4818);
- CreateObject(8263, 1334.415405, 2264.187988, 12.913771, 0.0000, 0.0000, 219.1565);
- CreateObject(8263, 1278.840332, 2166.981201, 12.932245, 0.0000, 0.0000, 261.2688);
- CreateObject(8263, 1270.986328, 2122.315918, 12.791477, 0.0000, 0.0000, 257.8311);
- CreateObject(11443, 1492.566284, 2293.657227, 9.992058, 0.0000, 0.0000, 271.4780);
- CreateObject(11428, 1312.393311, 2113.099121, 14.919098, 0.0000, 0.0000, 219.0523);
- CreateObject(16093, 1303.785156, 2196.073730, 9.904284, 0.0000, 0.0000, 0.0000);
- CreateObject(16782, 1300.760742, 2197.145508, 10.979322, 0.0000, 0.8594, 359.9999);
- CreateObject(4724, 1302.832397, 2196.314453, 11.800414, 0.0000, 0.0000, 269.8631);
- CreateObject(4724, 1305.940308, 2196.336426, 11.814077, 0.0000, 0.0000, 269.8631);
- CreateObject(4724, 1309.259033, 2196.355713, 11.825418, 0.0000, 0.0000, 269.8631);
- CreateObject(4724, 1314.312378, 2197.133057, 8.376222, 0.0000, 271.4780, 269.8631);
- CreateObject(4724, 1311.080811, 2197.123535, 8.375280, 0.0000, 271.4780, 269.8631);
- CreateObject(4724, 1307.792114, 2197.312256, 8.389070, 0.0000, 271.4780, 269.8631);
- CreateObject(4724, 1301.155151, 2196.976563, 8.414076, 0.0000, 271.4780, 90.3447);
- CreateObject(4724, 1308.573730, 2191.544434, 8.035886, 0.0000, 271.4780, 179.7262);
- CreateObject(4724, 1305.310425, 2191.531494, 8.089073, 0.0000, 271.4780, 179.7262);
- CreateObject(4724, 1302.463013, 2191.543945, 8.420501, 0.0000, 271.4780, 179.7262);
- CreateObject(1411, 1312.945557, 2190.937500, 11.632692, 0.0000, 0.0000, 0.8594);
- CreateObject(1411, 1318.079468, 2190.931152, 11.682692, 0.0000, 0.0000, 0.8594);
- CreateObject(1411, 1315.623291, 2198.974121, 15.200565, 0.0000, 0.0000, 177.9035);
- CreateObject(1411, 1310.533081, 2198.892334, 15.216631, 0.0000, 0.0000, 180.4818);
- CreateObject(1411, 1305.330200, 2198.895996, 15.303722, 0.0000, 0.0000, 180.4818);
- CreateObject(1411, 1300.103394, 2198.820557, 15.234255, 0.0000, 0.0000, 180.4818);
- CreateObject(1411, 1320.679077, 2193.446777, 11.632692, 0.0000, 0.0000, 85.9437);
- CreateObject(3586, 1330.500488, 2192.587158, 11.050318, 0.0000, 0.0000, 180.3776);
- CreateObject(17061, 1382.349121, 2139.080322, 9.932911, 0.0000, 0.0000, 87.6625);
- CreateObject(12920, 1383.289429, 2124.404297, 10.001697, 0.0000, 0.0000, 178.7628);
- CreateObject(17059, 1376.500854, 2127.575439, 13.372147, 0.0000, 0.0000, 0.0000);
- CreateObject(18267, 1436.013916, 2284.692139, 11.955400, 0.0000, 0.0000, 356.5623);
- CreateObject(16326, 1421.181274, 2099.179443, 7.388551, 0.0000, 0.0000, 90.2409);
- CreateObject(6965, 1341.116089, 2155.819580, 13.728113, 0.0000, 0.0000, 0.0000);
- for(new skins = 0; skins < 299; skins++)
- {
- AddPlayerClass(skins, 0, 0, 0, 270, 0, 0, 0, 0, 0, 0);
- }
- SetTimer("SendRandomMsg", 60000, true);
- NewGameTimer = SetTimer("ResetGame", 600000, true);
- return 1;
- }
- public OnPlayerRequestClass(playerid)
- {
- ShowCamera(playerid);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- new string[128],pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- if(GetPlayerMoney(playerid) > 0 || GetPlayerMoney(playerid) < 0)
- {
- format(string, sizeof(string), "** %s has been banned: Money Hack", pName);
- SendClientMessageToAll(COLOR_RED, string);
- BanEx(playerid, "Money Hack");
- }
- if(GetPlayerScore(playerid) > Score[playerid])
- {
- format(string, sizeof(string), "** %s has been banned: Score Hack", pName);
- SendClientMessageToAll(COLOR_RED, string);
- BanEx(playerid, "Score Hack");
- }
- if(GetPlayerWeapon(playerid) == 38)
- {
- format(string, sizeof(string), "** %s has been banned: Minigun", pName);
- SendClientMessageToAll(COLOR_RED, string);
- BanEx(playerid, "Minigun");
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- new rand = random(sizeof(RandomSpawns));
- SetPlayerPos(playerid, RandomSpawns[rand][0], RandomSpawns[rand][1], RandomSpawns[rand][2]);
- SetPlayerFacingAngle(playerid, RandomSpawns[rand][3]);
- if(RoundID == 0)
- {
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 0);
- GivePlayerWeapon(playerid, 4, 1);
- GivePlayerWeapon(playerid, 16, 4);
- GivePlayerWeapon(playerid, 22, 450);
- GivePlayerWeapon(playerid, 33, 150);
- return 1;
- }
- if(RoundID == 1)
- {
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 150);
- GivePlayerWeapon(playerid, 4, 1);
- GivePlayerWeapon(playerid, 18, 15);
- GivePlayerWeapon(playerid, 24, 250);
- GivePlayerWeapon(playerid, 27, 75);
- GivePlayerWeapon(playerid, 35, 2);
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(help, 4, cmdtext);
- dcmd(rules, 5, cmdtext);
- dcmd(ah, 2, cmdtext);
- dcmd(kick, 4, cmdtext);
- dcmd(ban, 3, cmdtext);
- dcmd(warn, 4, cmdtext);
- dcmd(nextround, 9, cmdtext);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendDeathMessage(killerid, playerid, reason);
- Score[killerid] ++;
- SetPlayerScore(killerid, Score[killerid]);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- ResetPlayer(playerid);
- return 1;
- }
- public ShowCamera(playerid)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid, -853.4641,-881.7031,149.6406);
- SetPlayerCameraPos(playerid, -850.4641,-878.7031,149.6406);
- SetPlayerCameraLookAt(playerid, -853.4641,-881.7031,149.6406);
- return 1;
- }
- public ResetPlayer(playerid)
- {
- Score[playerid] = 0;
- Warnings[playerid] = 0;
- SetPlayerScore(playerid, 0);
- SetPlayerHealth(playerid, 100);
- return 1;
- }
- public SendRandomMsg()
- {
- new rand = random(sizeof(RandomMsgs));
- SendClientMessageToAll(COLOR_LIGHTBLUE, RandomMsgs[rand][0]);
- return 1;
- }
- public ResetGame()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- TogglePlayerControllable(i, false);
- }
- if(RoundID == 0){
- RoundID = 1;
- }
- else{
- RoundID = 0;
- }
- SendClientMessageToAll(COLOR_GREEN, "** This round has been ended! The new round will start in +- 5 seconds");
- SetTimer("StartNewRound", 5000, false);
- return 1;
- }
- public StartNewRound()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- TogglePlayerControllable(i, true);
- SpawnPlayer(i);
- }
- SendClientMessageToAll(COLOR_GREEN, "** The new round has been started");
- return 1;
- }
- dcmd_help(playerid, params[])
- {
- #pragma unused params
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "|----- Help! -----|");
- SendClientMessage(playerid, COLOR_WHITE, "All you have to do here is: Kill EVERYONE!");
- SendClientMessage(playerid, COLOR_WHITE, "This is a DeathMatch server, no cheats allowed! And listen to the /rules");
- if(IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_GREEN, "Admin Commands: /ah");
- }
- dcmd_rules(playerid, params[])
- {
- #pragma unused params
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "|----- Rules -----|");
- SendClientMessage(playerid, COLOR_WHITE, "1) Don't cheat/hack");
- SendClientMessage(playerid, COLOR_WHITE, "2) Don't spawnkill please!");
- SendClientMessage(playerid, COLOR_WHITE, "3) Don't spam or flood the server, making advertisements is forbidden too!");
- SendClientMessage(playerid, COLOR_WHITE, "4) Play well, don't curse and threat everyone (except rules-breakers) with respect!");
- }
- dcmd_ah(playerid, params[])
- {
- #pragma unused params
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, COLOR_RED, "|----- Admin Commands -----|");
- SendClientMessage(playerid, COLOR_WHITE, "/kick [playerid] [reason]");
- SendClientMessage(playerid, COLOR_WHITE, "/ban [playerid] [reason]");
- SendClientMessage(playerid, COLOR_WHITE, "/warn [playerid] [reason]");
- SendClientMessage(playerid, COLOR_WHITE, "/nextround");
- }
- }
- dcmd_kick(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new id,reason[50],string[128],aName[MAX_PLAYER_NAME],pName[MAX_PLAYER_NAME];
- if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
- if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "That player isn't connected");
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME); GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, sizeof(string), "** %s has been kicked by %s, Reason: %s", pName, aName, reason);
- SendClientMessageToAll(COLOR_RED, string);
- Kick(id);
- }
- return 2;
- }
- dcmd_ban(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new id,reason[50],string[128],aName[MAX_PLAYER_NAME],pName[MAX_PLAYER_NAME];
- if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [playerid] [reason]");
- if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "That player isn't connected");
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME); GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, sizeof(string), "** %s has been banned by %s, Reason: %s", pName, aName, reason);
- SendClientMessageToAll(COLOR_RED, string);
- BanEx(id, reason);
- }
- return 1;
- }
- dcmd_warn(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new id,reason[50],string[128],aName[MAX_PLAYER_NAME],pName[MAX_PLAYER_NAME];
- if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /warn [playerid] [reason]");
- if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "That player isn't connected");
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME); GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, sizeof(string), "** %s has been warned by %s, Reason: %s", pName, aName, reason);
- SendClientMessageToAll(COLOR_RED, string);
- Warnings[id] ++;
- if(Warnings[id] >= 3){
- format(string, sizeof(string), "** %s has been kicked by %s, Reason: Last Warnings [Last warn: %s]", pName, aName, reason);
- Kick(id);
- return 1;
- }
- }
- return 1;
- }
- dcmd_nextround(playerid, params[])
- {
- #pragma unused params
- if(IsPlayerAdmin(playerid))
- {
- KillTimer(NewGameTimer);
- ResetGame();
- NewGameTimer = SetTimer("ResetGame", 600000, true);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement