Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS (200)
- #pragma tabsize (4)
- #pragma dynamic (10000)
- #include <fixes>
- #include <izcmd>
- #include <sscanf2>
- #include <dialogs>
- #include <streamer>
- #include <attachments>
- #define COLOR_DODGER_BLUE (0x1E90FFFF)
- #define COLOR_FIREBRICK (0xB22222FF)
- #define COLOR_STEEL_BLUE (0x4682B4FF)
- #define COLOR_RED (0xFF0000FF)
- #define COLOR_GREY (0x808080FF)
- #define COLOR_GREEN (0x00CC00FF)
- #define COLOR_LIME (0xCCFF99FF)
- #define COLOR_BLACK (0x000000FF)
- #define COLOR_WHITE (0xFFFFFFFF)
- #define COLOR_ORANGE (0xFF9933FF)
- #define COLOR_YELLOW (0xFFFF66FF)
- #define COLOR_BLUE (0x0099CCFF)
- #define COLOR_PURPLE (0x6600FFFF)
- #define COLOR_BROWN (0x663300FF)
- #define COLOR_PINK (0xCC99FFFF)
- #define COLOR_HOT_PINK (0xFF99FFFF)
- #define COLOR_THISTLE (0xD8BFD8FF)
- #define COLOR_KHAKI (0x999966FF)
- #define COLOR_ORANGE_RED (0xFF4500FF)
- #define SAMP_BLUE "{A9C4E4}"
- #define WHITE "{FFFFFF}"
- #define MARONE "{800000}"
- #define RED "{FF0000}"
- #define HOT_PINK "{FF99FF}"
- #define LIME "{CCFF99}"
- #define TOMATO "{FF6347}"
- #define PINK "{CC99FF}"
- #define BLACK "{000000}"
- #define ORANGE "{FF9933}"
- #define YELLOW "{FFFF66}"
- #define GREEN "{00CC00}"
- #define VIOLET "{EE82EE}"
- #define BROWN "{663300}"
- #define CORAL "{993333}"
- #if !defined FLOAT_INFINITY
- #define FLOAT_INFINITY (Float:0x7F800000)
- #endif
- #define DIALOG_ID_COMMON (0)
- #define DIALOG_ID_SHOP (1)
- #define DIALOG_ID_CONFIRM (2)
- main() {
- SetGameModeText("LSGW v1.0 - TDM/DM");
- }
- enum e_TEAM {
- teamId,
- teamName[45],
- teamSkin,
- teamColor,
- teamWeapon1[2],
- teamWeapon2[2],
- teamWeapon3[2],
- teamWeaponThrown[2],
- teamWeaponMelle
- };
- enum e_SERVER {
- serverPlayers
- };
- enum e_PLAYER {
- playerClass,
- PlayerText: playerClassTxt[2],
- PlayerText: playerSpawnTxt,
- playerSpawnTxtTimer,
- playerSpawnProtectTimer,
- Text3D: playerSpawnProtectLabel,
- PlayerText: playerOffradarTxt,
- playerOffradarTimer,
- playerLastOffradar,
- playerLastRefill,
- playerWeaponSelc,
- playerLastAmmoBoost,
- bool: playerHelmet,
- bool: playerMask
- };
- new const g_Team[][e_TEAM] = {
- {0, "Groves", 105, 0x00FF00AA, {30, 300}, {25, 100}, {24, 100}, {17, 3}, 1},
- {0, "Groves", 106, 0x00FF00AA, {34, 300}, {25, 100}, {24, 100}, {17, 3}, 1},
- {0, "Groves", 107, 0x00FF00AA, {29, 300}, {27, 100}, {24, 100}, {17, 3}, 1},
- {1, "Ballas", 102, 0x800080AA, {30, 300}, {25, 100}, {22, 100}, {16, 3}, 2},
- {1, "Ballas", 103, 0x800080AA, {34, 300}, {25, 100}, {22, 100}, {16, 3}, 2},
- {1, "Ballas", 104, 0x800080AA, {29, 300}, {26, 100}, {22, 100}, {16, 3}, 2},
- {2, "Cops", 283, 0x0080FFAA, {31, 300}, {25, 100}, {24, 100}, {17, 3}, 3},
- {2, "Cops", 285, 0x0080FFAA, {34, 300}, {25, 100}, {24, 100}, {17, 3}, 3},
- {2, "Cops", 286, 0x0080FFAA, {29, 300}, {27, 100}, {24, 100}, {17, 3}, 3},
- {3, "Vagos", 108, 0xFFFF00AA, {29, 300}, {27, 100}, {23, 100}, {18, 3}, 4},
- {3, "Vagos", 109, 0xFFFF00AA, {34, 300}, {27, 100}, {23, 100}, {18, 3}, 4},
- {3, "Vagos", 110, 0xFFFF00AA, {30, 300}, {26, 100}, {23, 100}, {18, 3}, 4},
- {4, "Aztecas", 114, 0x00FFFFAA, {30, 300}, {26, 100}, {22, 100}, {16, 3}, 5},
- {4, "Aztecas", 115, 0x00FFFFAA, {34, 300}, {26, 100}, {22, 100}, {16, 3}, 5},
- {4, "Aztecas", 116, 0x00FFFFAA, {29, 300}, {27, 100}, {22, 100}, {16, 3}, 5},
- {5, "Bikers", 247, 0xFF4B00AA, {30, 300}, {25, 100}, {24, 100}, {17, 3}, 6},
- {5, "Bikers", 248, 0xFF4B00AA, {34, 300}, {25, 100}, {24, 100}, {17, 3}, 6},
- {5, "Bikers", 249, 0xFF4B00AA, {33, 300}, {27, 100}, {24, 100}, {17, 5}, 6},
- {6, "Barbers", 156, 0xA52A2AAA, {32, 300}, {25, 100}, {23, 100}, {16, 3}, 8},
- {6, "Barbers", 176, 0xA52A2AAA, {34, 300}, {25, 100}, {23, 100}, {16, 3}, 8},
- {6, "Barbers", 177, 0xA52A2AAA, {31, 300}, {27, 100}, {23, 100}, {16, 3}, 8}
- };
- new const Float:g_SpawnGroves[][4] = {
- {2487.5906, -1647.0276, 14.0703, 178.2233},
- {2495.2595, -1688.7878, 14.0247, 0.9613},
- {2524.2061, -1677.3821, 19.9302, 90.2623}
- };
- new const Float:g_SpawnBallas[][4] = {
- {1939.1927, -1115.8624, 27.3786, 179.3580},
- {1925.6742, -1115.6378, 27.0883, 176.7902},
- {1889.9614, -1114.2015, 26.2758, 179.2984}
- };
- new const Float:g_SpawnCops[][4] = {
- {1579.7522, -1635.7533, 13.5603, 87.5415},
- {1543.9868, -1631.9741, 13.3828, 90.7054},
- {1543.9868, -1631.9741, 13.3828, 90.7054}
- };
- new const Float:g_SpawnVagos[][4] = {
- {2436.6279, -1303.5195, 24.6401, 271.6647},
- {2462.8672, -1323.4487, 27.3906, 84.9144}
- };
- new const Float:g_SpawnAztecas[][4] = {
- {1782.1407, -2124.7839, 13.7495, 0.6275},
- {1781.4502, -2103.3040, 13.5469, 177.3490},
- {1762.4257, -2103.8257, 13.5469, 179.8791}
- };
- new const Float:g_SpawnBikers[][4] = {
- {489.6188, -1796.1342, 6.0625, 0.0445},
- {520.1090, -1779.3583, 5.7522, 94.9854},
- {477.2205, -1764.4628, 5.5330, 178.0196}
- };
- new const Float:g_SpawnBarbers[][4] = {
- {1480.9514, -1414.0276, 11.8828, 89.9471},
- {1473.1471, -1334.2107, 11.8828, 178.2417},
- {1564.7397, -1423.0775, 11.8828, 88.7463}
- };
- new
- g_Server[e_SERVER],
- g_Player[MAX_PLAYERS][e_PLAYER]
- ;
- public OnGameModeInit() {
- for (new i, j = sizeof(g_Team); i < j; i++) {
- AddPlayerClass(g_Team[i][teamSkin], -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
- }
- return 1;
- }
- public OnGameModeExit() {
- return 1;
- }
- public OnPlayerConnect(playerid) {
- g_Server[serverPlayers]++;
- new
- szBuffer[156]
- ;
- format(szBuffer, sizeof(szBuffer), "Thanks for joining, now its %i players!", g_Server[serverPlayers]);
- SendClientMessage(playerid, COLOR_YELLOW, szBuffer);
- SendClientMessage(playerid, COLOR_PINK, "If you are new here, do read /help, /rules.");
- //SendClientMessage(playerid, COLOR_PINK, "Now you can pick dead player's weapons by pressing key \"N\" near one.");
- g_Player[playerid][playerClassTxt][0] = CreatePlayerTextDraw(playerid,130.000000, 230.000000, "GROVE");
- PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][playerClassTxt][0], 255);
- PlayerTextDrawFont(playerid,g_Player[playerid][playerClassTxt][0], 1);
- PlayerTextDrawLetterSize(playerid,g_Player[playerid][playerClassTxt][0], 0.400000, 2.000000);
- PlayerTextDrawColor(playerid,g_Player[playerid][playerClassTxt][0], 16711935);
- PlayerTextDrawSetOutline(playerid,g_Player[playerid][playerClassTxt][0], 1);
- PlayerTextDrawSetProportional(playerid,g_Player[playerid][playerClassTxt][0], 1);
- PlayerTextDrawSetSelectable(playerid,g_Player[playerid][playerClassTxt][0], 0);
- g_Player[playerid][playerClassTxt][1] = CreatePlayerTextDraw(playerid,130.000000, 247.000000, "Players: ~r~17 ~w~~h~out of ~r~122~n~~w~~h~You will be spawning with ~r~Ak-47, Combat shotgun, Desert eagle, Tear gas");
- PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][playerClassTxt][1], 255);
- PlayerTextDrawFont(playerid,g_Player[playerid][playerClassTxt][1], 1);
- PlayerTextDrawLetterSize(playerid,g_Player[playerid][playerClassTxt][1], 0.160000, 0.799999);
- PlayerTextDrawColor(playerid,g_Player[playerid][playerClassTxt][1], -1);
- PlayerTextDrawSetOutline(playerid,g_Player[playerid][playerClassTxt][1], 1);
- PlayerTextDrawSetProportional(playerid,g_Player[playerid][playerClassTxt][1], 1);
- PlayerTextDrawSetSelectable(playerid,g_Player[playerid][playerClassTxt][1], 0);
- g_Player[playerid][playerSpawnTxt] = CreatePlayerTextDraw(playerid,10.000000, 160.000000, "Team ~b~~h~~h~Grove~n~~n~Weapons recieved!~n~Ak-47, Shotgun, Desert Eagle, Grenade, Brass knuckle~n~~n~You have spawn protection");
- PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][playerSpawnTxt], 255);
- PlayerTextDrawFont(playerid,g_Player[playerid][playerSpawnTxt], 1);
- PlayerTextDrawLetterSize(playerid,g_Player[playerid][playerSpawnTxt], 0.180000, 1.000000);
- PlayerTextDrawColor(playerid,g_Player[playerid][playerSpawnTxt], -1);
- PlayerTextDrawSetOutline(playerid,g_Player[playerid][playerSpawnTxt], 1);
- PlayerTextDrawSetProportional(playerid,g_Player[playerid][playerSpawnTxt], 1);
- PlayerTextDrawUseBox(playerid,g_Player[playerid][playerSpawnTxt], 1);
- PlayerTextDrawBoxColor(playerid,g_Player[playerid][playerSpawnTxt], 200);
- PlayerTextDrawTextSize(playerid,g_Player[playerid][playerSpawnTxt], 140.000000, 0.000000);
- PlayerTextDrawSetSelectable(playerid,g_Player[playerid][playerSpawnTxt], 0);
- g_Player[playerid][playerOffradarTxt] = CreatePlayerTextDraw(playerid,10.000000, 238.000000, "You are now off the radar, that means not visible on game map/radar~n~~n~/Offradar: ~r~~h~~h~50..");
- PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][playerOffradarTxt], 255);
- PlayerTextDrawFont(playerid,g_Player[playerid][playerOffradarTxt], 1);
- PlayerTextDrawLetterSize(playerid,g_Player[playerid][playerOffradarTxt], 0.180000, 1.000000);
- PlayerTextDrawColor(playerid,g_Player[playerid][playerOffradarTxt], -1);
- PlayerTextDrawSetOutline(playerid,g_Player[playerid][playerOffradarTxt], 1);
- PlayerTextDrawSetProportional(playerid,g_Player[playerid][playerOffradarTxt], 1);
- PlayerTextDrawUseBox(playerid,g_Player[playerid][playerOffradarTxt], 1);
- PlayerTextDrawBoxColor(playerid,g_Player[playerid][playerOffradarTxt], 336860360);
- PlayerTextDrawTextSize(playerid,g_Player[playerid][playerOffradarTxt], 140.000000, 0.000000);
- PlayerTextDrawSetSelectable(playerid,g_Player[playerid][playerOffradarTxt], 0);
- g_Player[playerid][playerSpawnProtectTimer] = -1;
- g_Player[playerid][playerOffradarTimer] = -1;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason) {
- g_Server[serverPlayers]--;
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid) {
- PlayerTextDrawColor(playerid, g_Player[playerid][playerClassTxt][0], g_Team[classid][teamColor]);
- PlayerTextDrawSetString(playerid, g_Player[playerid][playerClassTxt][0], g_Team[classid][teamName]);
- PlayerTextDrawShow(playerid, g_Player[playerid][playerClassTxt][0]);
- new
- iTeamPlayer,
- szBuffer[450],
- szWeaponName[35]
- ;
- for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
- if (GetPlayerTeam(i) == g_Team[classid][teamId]) {
- iTeamPlayer++;
- }
- }
- format(szBuffer, sizeof(szBuffer), "Players: ~r~%i ~w~~h~out of ~r~%i~n~", iTeamPlayer, g_Server[serverPlayers]);
- strcat(szBuffer, "~w~~h~You will be spawning with ~r~");
- GetWeaponName(g_Team[classid][teamWeapon1][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[classid][teamWeapon2][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[classid][teamWeapon3][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[classid][teamWeaponThrown][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[classid][teamWeaponMelle], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- PlayerTextDrawSetString(playerid, g_Player[playerid][playerClassTxt][1], szBuffer);
- PlayerTextDrawShow(playerid, g_Player[playerid][playerClassTxt][1]);
- if (g_Player[playerid][playerSpawnProtectTimer] != -1) {
- KillTimer(g_Player[playerid][playerSpawnProtectTimer]);
- }
- if (IsValidDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel])) {
- DestroyDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel]);
- }
- if (g_Player[playerid][playerSpawnTxtTimer] != -1) {
- KillTimer(g_Player[playerid][playerSpawnTxtTimer]);
- }
- OnSpawnTextdrawHide(playerid);
- if (g_Player[playerid][playerOffradarTimer] != -1) {
- KillTimer(g_Player[playerid][playerOffradarTimer]);
- }
- g_Player[playerid][playerOffradarTimer] = -1;
- g_Player[playerid][playerLastOffradar] = 0;
- PlayerTextDrawHide(playerid, g_Player[playerid][playerOffradarTxt]);
- switch (g_Team[classid][teamId]) {
- case 0: {
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid, 2524.1550, -1671.1104, 19.9203);
- SetPlayerCameraLookAt(playerid, 2520.1550, -1671.1104, 19.4203);
- SetPlayerPos(playerid, 2520.1550, -1671.1104, 19.4203);
- SetPlayerFacingAngle(playerid, 270.0000);
- }
- case 1: {
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid, 1948.655639, -1114.651733, 31.215576);
- SetPlayerCameraLookAt(playerid, 1944.464599, -1117.156250, 30.137393);
- SetPlayerPos(playerid,1945.0365,-1116.4506,30.7578);
- SetPlayerFacingAngle(playerid,295.8885);
- }
- case 2: {
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid, 1512.555541, -1638.949829, 19.780670);
- SetPlayerCameraLookAt(playerid, 1515.505371, -1642.952270, 19.252750);
- SetPlayerPos(playerid,1514.8364,-1642.3707,19.2422);
- SetPlayerFacingAngle(playerid,31.5911);
- }
- case 3: {
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid, 2631.425781, -1068.947387, 77.147903);
- SetPlayerCameraLookAt(playerid, 2626.514404, -1068.871337, 76.214347);
- SetPlayerPos(playerid,2626.9626,-1068.8726,75.9696);
- SetPlayerFacingAngle(playerid,269.8981);
- }
- case 4: {
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid, 1785.895385, -2094.484130, 18.303087);
- SetPlayerCameraLookAt(playerid, 1787.589721, -2099.043457, 17.144950);
- SetPlayerPos(playerid,1787.6921,-2099.0662,17.4470);
- SetPlayerFacingAngle(playerid,31.6718);
- }
- case 5: {
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid, 1124.762329, -1191.299682, 33.810428);
- SetPlayerCameraLookAt(playerid, 1122.427734, -1195.331298, 31.995071);
- SetPlayerPos(playerid,1122.2896,-1195.3792,32.0313);
- SetPlayerFacingAngle(playerid,326.1501);
- }
- case 6: {
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid, 869.850463, -973.024658, 41.405673);
- SetPlayerCameraLookAt(playerid, 873.374816, -969.478149, 41.434577);
- SetPlayerPos(playerid,873.1442,-969.5593,41.0649);
- SetPlayerFacingAngle(playerid,141.9807);
- }
- default: {
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid, 2466.381591, -1644.103027, 18.203895);
- SetPlayerCameraLookAt(playerid, 2470.127685, -1647.413452, 18.117961);
- SetPlayerPos(playerid,2469.7090,-1646.9497,18.2023);
- SetPlayerFacingAngle(playerid,53.1127);
- }
- }
- g_Player[playerid][playerClass] = classid;
- return 1;
- }
- public OnPlayerRequestSpawn(playerid) {
- SendClientMessage(playerid, COLOR_KHAKI, "* You can change your team using /ct or /st or Press F4 key.");
- return 1;
- }
- public OnPlayerSpawn(playerid) {
- PlayerTextDrawHide(playerid, g_Player[playerid][playerClassTxt][0]);
- PlayerTextDrawHide(playerid, g_Player[playerid][playerClassTxt][1]);
- RemovePlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 1);
- g_Player[playerid][playerHelmet] = false;
- RemovePlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 2);
- g_Player[playerid][playerMask] = false;
- new
- iRandom
- ;
- switch (g_Team[g_Player[playerid][playerClass]][teamId]) {
- case 0: {
- iRandom = random(sizeof(g_SpawnGroves));
- SetPlayerPos(playerid, g_SpawnGroves[iRandom][0], g_SpawnGroves[iRandom][1], g_SpawnGroves[iRandom][2]);
- SetPlayerFacingAngle(playerid, g_SpawnGroves[iRandom][3]);
- }
- case 1: {
- iRandom = random(sizeof(g_SpawnBallas));
- SetPlayerPos(playerid, g_SpawnBallas[iRandom][0], g_SpawnBallas[iRandom][1], g_SpawnBallas[iRandom][2]);
- SetPlayerFacingAngle(playerid, g_SpawnBallas[iRandom][3]);
- }
- case 2: {
- iRandom = random(sizeof(g_SpawnCops));
- SetPlayerPos(playerid, g_SpawnCops[iRandom][0], g_SpawnCops[iRandom][1], g_SpawnCops[iRandom][2]);
- SetPlayerFacingAngle(playerid, g_SpawnCops[iRandom][3]);
- }
- case 3: {
- iRandom = random(sizeof(g_SpawnVagos));
- SetPlayerPos(playerid, g_SpawnVagos[iRandom][0], g_SpawnVagos[iRandom][1], g_SpawnVagos[iRandom][2]);
- SetPlayerFacingAngle(playerid, g_SpawnVagos[iRandom][3]);
- }
- case 4: {
- iRandom = random(sizeof(g_SpawnAztecas));
- SetPlayerPos(playerid, g_SpawnAztecas[iRandom][0], g_SpawnAztecas[iRandom][1], g_SpawnAztecas[iRandom][2]);
- SetPlayerFacingAngle(playerid, g_SpawnAztecas[iRandom][3]);
- }
- case 5: {
- iRandom = random(sizeof(g_SpawnBikers));
- SetPlayerPos(playerid, g_SpawnBikers[iRandom][0], g_SpawnBikers[iRandom][1], g_SpawnBikers[iRandom][2]);
- SetPlayerFacingAngle(playerid, g_SpawnBikers[iRandom][3]);
- }
- case 6: {
- iRandom = random(sizeof(g_SpawnBarbers));
- SetPlayerPos(playerid, g_SpawnBarbers[iRandom][0], g_SpawnBarbers[iRandom][1], g_SpawnBarbers[iRandom][2]);
- SetPlayerFacingAngle(playerid, g_SpawnBarbers[iRandom][3]);
- }
- }
- SetPlayerTeam(playerid, g_Team[g_Player[playerid][playerClass]][teamId]);
- SetPlayerSkin(playerid, g_Team[g_Player[playerid][playerClass]][teamSkin]);
- SetPlayerColor(playerid, g_Team[g_Player[playerid][playerClass]][teamColor]);
- ResetPlayerWeapons(playerid);
- GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeapon1][0], g_Team[g_Player[playerid][playerClass]][teamWeapon1][1]);
- GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeapon2][0], g_Team[g_Player[playerid][playerClass]][teamWeapon2][1]);
- GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeapon3][0], g_Team[g_Player[playerid][playerClass]][teamWeapon3][1]);
- GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeaponThrown][0], g_Team[g_Player[playerid][playerClass]][teamWeaponThrown][1]);
- GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeaponMelle], 1);
- for (new i; i < MAX_PLAYERS; i++) {
- SetPlayerMarkerForPlayer(i, playerid, (g_Team[g_Player[playerid][playerClass]][teamColor] | 0xFFFFFFFF));
- }
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerHealth(playerid, FLOAT_INFINITY);
- new
- szBuffer[450],
- szWeaponName[35]
- ;
- strcat(szBuffer, "Team ~b~~h~~h~");
- strcat(szBuffer, g_Team[g_Player[playerid][playerClass]][teamName]);
- strcat(szBuffer, "~n~~n~Weapons recieved!~n~");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon1][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon2][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon3][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeaponThrown][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeaponMelle], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, "~n~~n~You have spawn protection [5 secs]");
- PlayerTextDrawSetString(playerid, g_Player[playerid][playerSpawnTxt], szBuffer);
- PlayerTextDrawShow(playerid, g_Player[playerid][playerSpawnTxt]);
- if (g_Player[playerid][playerSpawnProtectTimer] != -1) {
- KillTimer(g_Player[playerid][playerSpawnProtectTimer]);
- }
- if (IsValidDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel])) {
- DestroyDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel]);
- }
- g_Player[playerid][playerSpawnProtectLabel] = CreateDynamic3DTextLabel("Spawn Protection", COLOR_RED, 0.0, 0.0, 0.7, 20.0, playerid, _, 1);
- g_Player[playerid][playerSpawnProtectTimer] = SetTimerEx("OnSpawnProtectionOver", 5000, false, "iff", playerid, 100.0, 10.0);
- if (g_Player[playerid][playerSpawnTxtTimer] != -1) {
- KillTimer(g_Player[playerid][playerSpawnTxtTimer]);
- }
- g_Player[playerid][playerSpawnTxtTimer] = SetTimerEx("OnSpawnTextdrawHide", 15000, false, "i", playerid);
- if (g_Player[playerid][playerOffradarTimer] != -1) {
- KillTimer(g_Player[playerid][playerOffradarTimer]);
- }
- g_Player[playerid][playerOffradarTimer] = -1;
- g_Player[playerid][playerLastOffradar] = 0;
- PlayerTextDrawHide(playerid, g_Player[playerid][playerOffradarTxt]);
- g_Player[playerid][playerLastRefill] = 0;
- g_Player[playerid][playerLastAmmoBoost] = 0;
- SendClientMessage(playerid, COLOR_YELLOW, "* If you want to go off the radar, use the command /offradar.");
- SendClientMessage(playerid, COLOR_YELLOW, "* Use /hp in case you are injured, /ar for an additional armour and /shop for other instant stuff.");
- return 1;
- }
- forward OnSpawnProtectionOver(playerid, Float:h, Float:a);
- public OnSpawnProtectionOver(playerid, Float:h, Float:a) {
- SetPlayerHealth(playerid, h);
- SetPlayerArmour(playerid, a);
- g_Player[playerid][playerSpawnProtectTimer] = -1;
- if (IsValidDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel])) {
- DestroyDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel]);
- }
- new
- szBuffer[450],
- szWeaponName[35]
- ;
- strcat(szBuffer, "Team ~b~~h~~h~");
- strcat(szBuffer, g_Team[g_Player[playerid][playerClass]][teamName]);
- strcat(szBuffer, "~n~~n~Weapons recieved!~n~");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon1][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon2][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon3][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeaponThrown][0], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, ", ");
- GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeaponMelle], szWeaponName, sizeof(szWeaponName));
- strcat(szBuffer, szWeaponName);
- strcat(szBuffer, "~n~~n~~r~~h~~h~Spawn protection over!");
- PlayerTextDrawSetString(playerid, g_Player[playerid][playerSpawnTxt], szBuffer);
- PlayerTextDrawShow(playerid, g_Player[playerid][playerSpawnTxt]);
- }
- forward OnSpawnTextdrawHide(playerid);
- public OnSpawnTextdrawHide(playerid) {
- PlayerTextDrawHide(playerid, g_Player[playerid][playerSpawnTxt]);
- g_Player[playerid][playerSpawnTxtTimer] = -1;
- }
- public OnPlayerDeath(playerid, killerid, reason) {
- SendClientMessage(killerid, COLOR_ORANGE, "Good job gangsta! You smoked the nigga! [+$2500 +1 Score]");
- GivePlayerMoney(killerid, 2500);
- SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
- GivePlayerMoney(playerid, -1000);
- return 1;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart) {
- if (GetPlayerTeam(playerid) != NO_TEAM && GetPlayerTeam(playerid) == GetPlayerTeam(damagedid)) {
- GameTextForPlayer(playerid, "~r~Don't attack your teammates", 3000, 3);
- return 0;
- }
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) {
- if ((GetPlayerTeam(playerid) == NO_TEAM && GetPlayerTeam(issuerid) == NO_TEAM) || GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) {
- if (bodypart == 9 && ! g_Player[playerid][playerHelmet]) {
- SetPlayerHealth(playerid, 0.0);
- SendClientMessage(issuerid, COLOR_ORANGE, "Good job gangsta! You made a perfect headshot over that nigga! [+$3000 +1 Score]");
- GivePlayerMoney(issuerid, 3000);
- SetPlayerScore(issuerid, GetPlayerScore(issuerid) + 1);
- return 0;
- }
- }
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
- if (hittype == BULLET_HIT_TYPE_VEHICLE) {
- new
- target = INVALID_PLAYER_ID
- ;
- for (new i; i < MAX_PLAYERS; i++) {
- if (i != playerid && IsPlayerConnected(i) && GetPlayerVehicleID(i) == hitid && GetPlayerVehicleSeat(i) == 0) {
- target = i;
- break;
- }
- }
- if (target != INVALID_PLAYER_ID && GetPlayerTeam(playerid) != NO_TEAM && GetPlayerTeam(playerid) == GetPlayerTeam(target)) {
- GameTextForPlayer(playerid, "~r~Don't attack a team vehicle", 3000, 3);
- return 0;
- }
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
- if (! ispassenger) {
- new
- target = INVALID_PLAYER_ID
- ;
- for (new i; i < MAX_PLAYERS; i++) {
- if (i != playerid && IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid && GetPlayerVehicleSeat(i) == 0) {
- target = i;
- break;
- }
- }
- if (target != INVALID_PLAYER_ID && GetPlayerTeam(playerid) != NO_TEAM && GetPlayerTeam(playerid) == GetPlayerTeam(target)) {
- ClearAnimations(playerid);
- new
- Float:x,
- Float:y,
- Float:z
- ;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(playerid, x, y, z);
- GameTextForPlayer(playerid, "~r~Don't jack your team vehicle", 3000, 3);
- return 0;
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid) {
- if (GetPlayerWeapon(playerid) == 4) {
- if (GetPlayerAnimationIndex(playerid) != 0) {
- new
- animation[2][35]
- ;
- GetAnimationName(GetPlayerAnimationIndex(playerid), animation[0], 35, animation[1], 35);
- if (!strcmp(animation[0], "KNIFE", true) && !strcmp(animation[1], "KILL_Knife_Player", true)) {
- new
- target = GetPlayerTargetPlayer(playerid)
- ;
- if (IsPlayerConnected(target)) {
- new
- Float:x,
- Float:y,
- Float:z
- ;
- GetPlayerPos(target, x, y, z);
- if (IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)) {
- if (GetPlayerTeam(playerid) == GetPlayerTeam(target)) {
- ClearAnimations(playerid);
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(playerid, x, y, z);
- GameTextForPlayer(playerid, "~r~Don't knife your Teammates", 5000, 3);
- GameTextForPlayer(playerid, "~r~You got team knifed!~n~~r~Type /sync to synchronize", 5000, 3);
- return 0;
- }
- }
- }
- }
- }
- }
- return 1;
- }
- bool:IsPlayerInInvalidState(playerid) {
- new
- Float:fHealth
- ;
- GetPlayerHealth(playerid, fHealth);
- if (fHealth <= 0.0) {
- return true;
- }
- else if (GetPlayerState(playerid) == PLAYER_STATE_WASTED) {
- return true;
- }
- else if (GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) {
- return true;
- }
- else {
- return false;
- }
- }
- CMD:hp(playerid) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- if (GetPlayerMoney(playerid) < 5000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 for health refill.");
- }
- if (gettime() - g_Player[playerid][playerLastRefill] <= 5 * 60) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must wait for atleast 5 minutes before using this command again.");
- }
- SetPlayerHealth(playerid, 100.0);
- GivePlayerMoney(playerid, -5000);
- SendClientMessage(playerid, COLOR_ORANGE_RED, "HEALTH: You have refilled your player's health [-$5000].");
- GameTextForPlayer(playerid, "~g~+100 Health", 3000, 3);
- g_Player[playerid][playerLastRefill] = gettime();
- return 1;
- }
- CMD:health(playerid) {
- return cmd_hp(playerid);
- }
- CMD:heal(playerid) {
- return cmd_hp(playerid);
- }
- CMD:ar(playerid) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- if (GetPlayerMoney(playerid) < 5000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 for armour refill.");
- }
- if (gettime() - g_Player[playerid][playerLastRefill] <= 5 * 60) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must wait for atleast 5 minutes before using this command again.");
- }
- SetPlayerArmour(playerid, 100.0);
- GivePlayerMoney(playerid, -5000);
- SendClientMessage(playerid, COLOR_ORANGE_RED, "ARMOUR: You have refilled your player's armour [-$5000].");
- GameTextForPlayer(playerid, "~g~+100 Armour", 3000, 3);
- g_Player[playerid][playerLastRefill] = gettime();
- return 1;
- }
- CMD:armour(playerid) {
- return cmd_ar(playerid);
- }
- CMD:shop(playerid, params[]) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- if (IsPlayerInAnyVehicle(playerid)) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must be on foot to use this command.");
- }
- if (! sscanf(params, "i", g_Player[playerid][playerWeaponSelc]) && 0 <= g_Player[playerid][playerWeaponSelc] <= 20) {
- switch (g_Player[playerid][playerWeaponSelc]) {
- case 0: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Knife "SAMP_BLUE"for "WHITE"-$1000 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
- }
- case 1: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Chainsaw "SAMP_BLUE"for "WHITE"-$2500 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
- }
- case 2: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Grenade "SAMP_BLUE"for "WHITE"-$2500 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
- }
- case 3: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Moltove Cocktail "SAMP_BLUE"for "WHITE"-$2000 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
- }
- case 4: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Silenced 9mm "SAMP_BLUE"for "WHITE"-$3000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 5: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Desert Eagle "SAMP_BLUE"for "WHITE"-$4500 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 6: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Sawnoff Shotgun "SAMP_BLUE"for "WHITE"-$6500 "SAMP_BLUE"[50 ammo] ?", "Yes", "No");
- }
- case 7: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Combat Shotgun "SAMP_BLUE"for "WHITE"-$6000 "SAMP_BLUE"[50 ammo] ?", "Yes", "No");
- }
- case 8: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"UZI "SAMP_BLUE"for "WHITE"-$4500 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 9: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"MP5 "SAMP_BLUE"for "WHITE"-$4000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 10: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Tec-9 "SAMP_BLUE"for "WHITE"-$4500 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 11: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Sniper Rifle "SAMP_BLUE"for "WHITE"-$7000 "SAMP_BLUE"[50 ammo] ?", "Yes", "No");
- }
- case 12: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Ak-47 "SAMP_BLUE"for "WHITE"-$5000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 13: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"M4 "SAMP_BLUE"for "WHITE"-$5500 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 14: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"RPG. "SAMP_BLUE"for "WHITE"-$3500 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
- }
- case 15: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"HS. Rocket "SAMP_BLUE"for "WHITE"-$4000 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
- }
- case 16: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Flamethrower "SAMP_BLUE"for "WHITE"-$5000 "SAMP_BLUE"[200 ammo] ?", "Yes", "No");
- }
- case 17: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "RED"MINIGUN "SAMP_BLUE"for "WHITE"-$15000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 18: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Satchel Charge "SAMP_BLUE"for "WHITE"-$2000 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
- }
- case 19: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Spray Can "SAMP_BLUE"for "WHITE"-$1000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- case 20: {
- ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Fire Extinguisher "SAMP_BLUE"for "WHITE"-$1000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
- }
- }
- SendClientMessage(playerid, COLOR_KHAKI, "TIP: You can also see the full weapons list by just typing /shop.");
- return 1;
- }
- new
- szInfo[2024]
- ;
- strcat(szInfo, "335\n0. Knife~n~1 Ammo~n~-$1000\n");
- strcat(szInfo, "341\n1. Chainsaw~n~1 Ammo~n~-$2500\n");
- strcat(szInfo, "342\n2. Grenade~n~1 Ammo~n~-$2000\n");
- strcat(szInfo, "343\n3. Moltove~n~1 Ammo~n~-$2000\n");
- strcat(szInfo, "347\n4. Silenced 9mm~n~100 Ammo~n~-$3000\n");
- strcat(szInfo, "348\n5. Desert Eagle~n~50 Ammo~n~-$4500\n");
- strcat(szInfo, "350\n6. Sawnoff Shotgun~n~50 Ammo~n~-$6500\n");
- strcat(szInfo, "351\n7. Combat Shotgun~n~50 Ammo~n~-$6000\n");
- strcat(szInfo, "352\n8. UZI~n~100 Ammo~n~-$4500\n");
- strcat(szInfo, "353\n9. MP5~n~100 Ammo~n~-$4000\n");
- strcat(szInfo, "372\n10. Tec-9~n~100 Ammo~n~-$4500\n");
- strcat(szInfo, "358\n11. Sniper Rifle~n~50 Ammo~n~-$7000\n");
- strcat(szInfo, "355\n12. Ak-47~n~100 Ammo~n~-$5000\n");
- strcat(szInfo, "356\n13. M4~n~100 Ammo~n~-$5500\n");
- strcat(szInfo, "359\n14. RPG.~n~1 Ammo~n~-$3500\n");
- strcat(szInfo, "360\n15. HS. Rocket~n~1 Ammo~n~-$4000\n");
- strcat(szInfo, "361\n16. Flamethrower~n~200 Ammo~n~-$5000\n");
- strcat(szInfo, "362\n17. MINIGUN~n~~w~~h~100 Ammo~n~-$15000\n");
- strcat(szInfo, "363\n18. Satchel Charge~n~1 Ammo~n~-$2000\n");
- strcat(szInfo, "365\n19. Spray Can~n~100 Ammo~n~-$1000\n");
- strcat(szInfo, "366\n20. Fire Extinguisher~n~100 Ammo~n~-$1000");
- ShowPlayerDialog(playerid, DIALOG_ID_SHOP, DIALOG_STYLE_PREVMODEL, "Game shop", szInfo, "Buy", "Close");
- SendClientMessage(playerid, COLOR_KHAKI, "TIP: You also instanly buy weapons by specifing the listitem in front of /shop [eg. /shop 0 - for knife].");
- return 1;
- }
- CMD:helmet(playerid) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- if (g_Player[playerid][playerHelmet]) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You already have a helmet, over your head!");
- }
- if (GetPlayerMoney(playerid) < 8000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $8000 for helmet.");
- }
- GivePlayerMoney(playerid, -8000);
- g_Player[playerid][playerHelmet] = true;
- SetPlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 1, 18638, 2, 0.128000, 0.049999, 0.006000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
- SendClientMessage(playerid, COLOR_LIME, "HELMET: You won't instantly die from headshots, now onwards. [-$8000]");
- return 1;
- }
- CMD:mask(playerid) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- if (g_Player[playerid][playerMask]) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You already have a mask, sticked on your face!");
- }
- if (GetPlayerMoney(playerid) < 5000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 for mask.");
- }
- GivePlayerMoney(playerid, -5000);
- g_Player[playerid][playerMask] = true;
- SetPlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 2, 19472, 2, -0.022000, 0.137000, 0.018999, 3.899994, 85.999961, 92.999984, 0.923999, 1.141000, 1.026999);
- SendClientMessage(playerid, COLOR_LIME, "HELMET: You won't get effected or feel cough from teargas, now onwards. [-$5000]");
- return 1;
- }
- CMD:ep(playerid) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- GivePlayerWeapon(playerid, 46, 1);
- GameTextForPlayer(playerid, "~g~Parachute", 3000, 3);
- return 1;
- }
- CMD:para(playerid) {
- return cmd_ep(playerid);
- }
- CMD:parachute(playerid) {
- return cmd_ep(playerid);
- }
- CMD:offradar(playerid) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- if (g_Player[playerid][playerOffradarTimer] != -1) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You are already off the radar.");
- }
- if (GetPlayerMoney(playerid) < 7000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $7000 for going off radar.");
- }
- if (gettime() - g_Player[playerid][playerLastOffradar] <= 3 * 60) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must wait for atleast 3 minutes before using this command again.");
- }
- for (new i; i < MAX_PLAYERS; i++) {
- SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
- }
- GivePlayerMoney(playerid, -7000);
- PlayerTextDrawShow(playerid, g_Player[playerid][playerOffradarTxt]);
- SendClientMessage(playerid, COLOR_ORANGE_RED, "OFF-RADAR: You are now invisible on map for 2 minutes [-$7000].");
- GameTextForPlayer(playerid, "~b~Off Radar", 3000, 3);
- g_Player[playerid][playerLastOffradar] = 2 * 60;
- g_Player[playerid][playerOffradarTimer] = SetTimerEx("OnPlayerOffRadarTimeExpire", 1000, true, "i", playerid);
- return 1;
- }
- CMD:offradars(playerid) {
- new
- szBuffer[MAX_PLAYER_NAME],
- szInfo[MAX_PLAYER_NAME * MAX_PLAYERS]
- ;
- for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
- if (IsPlayerConnected(i) && g_Player[i][playerOffradarTimer] != -1) {
- format(szInfo, sizeof(szInfo), "%i. ", i);
- GetPlayerName(i, szBuffer, MAX_PLAYER_NAME);
- strcat(szInfo, szBuffer);
- strcat(szInfo, " ");
- format(szBuffer, sizeof(szBuffer), "[For %i secs.]", g_Player[playerid][playerLastOffradar]);
- strcat(szInfo, szBuffer);
- strcat(szInfo, "\n");
- }
- }
- if (! szInfo[0]) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: No players /offradar currently.");
- }
- else {
- ShowPlayerDialog(playerid, DIALOG_ID_COMMON, DIALOG_STYLE_LIST, "Player currently /offradar:", szBuffer, "Close", "");
- }
- return 1;
- }
- CMD:kill(playerid) {
- SetPlayerHealth(playerid, 0.0);
- return 1;
- }
- CMD:die(playerid) {
- return cmd_kill(playerid);
- }
- CMD:ammo(playerid) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- if (GetPlayerMoney(playerid) < 4500) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4500 for ammo boost (all weapons).");
- }
- if (gettime() - g_Player[playerid][playerLastAmmoBoost] <= 2 * 60) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must wait for atleast 2 minutes before using this command again.");
- }
- new
- iWeapon[2]
- ;
- for (new i; i < 13; i++) {
- GetPlayerWeaponData(playerid, i, iWeapon[0], iWeapon[1]);
- GivePlayerWeapon(playerid, iWeapon[0], -iWeapon[1]);
- switch (iWeapon[0]) {
- case 0..15: {
- iWeapon[1] += 1;
- }
- case 16..18: {
- iWeapon[1] += 1;
- }
- case 22..31: {
- iWeapon[1] += 50;
- }
- case 33..34: {
- iWeapon[1] += 10;
- }
- case 35..36: {
- iWeapon[1] += 1;
- }
- case 37: {
- iWeapon[1] += 50;
- }
- default: {
- iWeapon[1] += 1;
- }
- }
- GivePlayerWeapon(playerid, iWeapon[0], iWeapon[1]);
- }
- GivePlayerMoney(playerid, -4500);
- SendClientMessage(playerid, COLOR_ORANGE_RED, "AMMO: You have boosted all of your weapons' ammo [-$4500].");
- GameTextForPlayer(playerid, "~g~+Ammo boost", 3000, 3);
- g_Player[playerid][playerLastAmmoBoost] = gettime();
- return 1;
- }
- CMD:boost(playerid) {
- return cmd_ammo(playerid);
- }
- bool:IsPlayerNearAnyEnemy(playerid) {
- new
- Float:x,
- Float:y,
- Float:z
- ;
- GetPlayerPos(playerid, x, y, z);
- for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
- if (IsPlayerConnected(i) && GetPlayerTeam(i) != GetPlayerTeam(playerid) && IsPlayerInRangeOfPoint(i, 50.0, x, y, z)) {
- return true;
- }
- }
- return false;
- }
- CMD:changeteam(playerid) {
- if (IsPlayerInInvalidState(playerid)) {
- return 1;
- }
- if (IsPlayerNearAnyEnemy(playerid)) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You cannot use this command near enemies (50 units range).");
- }
- ForceClassSelection(playerid);
- SpawnPlayer(playerid);
- return 1;
- }
- CMD:ct(playerid) {
- return cmd_changeteam(playerid);
- }
- CMD:st(playerid) {
- return cmd_changeteam(playerid);
- }
- CMD:help(playerid) {
- new
- szBuffer[1024]
- ;
- strcat(szBuffer, ""WHITE"/hp "SAMP_BLUE"- Buy health for your player\n\n");
- strcat(szBuffer, ""WHITE"/ar "SAMP_BLUE"- Buy armour for your player\n\n");
- strcat(szBuffer, ""WHITE"/shop "SAMP_BLUE"- Open weapons shop\n\n");
- strcat(szBuffer, ""WHITE"/helmet "SAMP_BLUE"- Buy anti headshot helmet\n\n");
- strcat(szBuffer, ""WHITE"/mask "SAMP_BLUE"- Buy anti tear gas mask\n\n");
- strcat(szBuffer, ""WHITE"/ep "SAMP_BLUE"- Spawn a parachute\n\n");
- strcat(szBuffer, ""WHITE"/offradar "SAMP_BLUE"- Go invisible on the map\n\n");
- strcat(szBuffer, ""WHITE"/offradars "SAMP_BLUE"- See off radar players\n\n");
- strcat(szBuffer, ""WHITE"/kill "SAMP_BLUE"- Sucide\n\n");
- strcat(szBuffer, ""WHITE"/ammo "SAMP_BLUE"- Refill/Boost ammo for all your weapons\n\n");
- strcat(szBuffer, ""WHITE"/ct "SAMP_BLUE"- Change team without dying\n\n");
- strcat(szBuffer, ""WHITE"/acmds "SAMP_BLUE"- Admin system commands\n\n");
- ShowPlayerDialog(playerid, DIALOG_ID_COMMON, DIALOG_STYLE_MSGBOX, "Server help", szBuffer, "Close", "");
- return 1;
- }
- forward OnPlayerOffRadarTimeExpire(playerid);
- public OnPlayerOffRadarTimeExpire(playerid) {
- if (g_Player[playerid][playerLastOffradar] == 0) {
- for (new i; i < MAX_PLAYERS; i++) {
- SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) | 0xFFFFFFFF));
- }
- SendClientMessage(playerid, COLOR_ORANGE_RED, "ON-RADAR: You are now On the radar.");
- GameTextForPlayer(playerid, "~b~On Radar", 3000, 3);
- KillTimer(g_Player[playerid][playerOffradarTimer]);
- g_Player[playerid][playerOffradarTimer] = -1;
- g_Player[playerid][playerLastOffradar] = gettime();
- PlayerTextDrawHide(playerid, g_Player[playerid][playerOffradarTxt]);
- }
- else {
- g_Player[playerid][playerLastOffradar]--;
- new
- szBuffer[150]
- ;
- format(szBuffer, sizeof(szBuffer), "You are now off the radar, that means not visible on game map/radar~n~~n~/Offradar: ~r~~h~~h~%i..", g_Player[playerid][playerLastOffradar]);
- PlayerTextDrawSetString(playerid, g_Player[playerid][playerOffradarTxt], szBuffer);
- }
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- switch (dialogid) {
- case DIALOG_ID_SHOP, DIALOG_ID_CONFIRM: {
- if (response) {
- if (dialogid == DIALOG_ID_CONFIRM) {
- listitem = g_Player[playerid][playerWeaponSelc];
- }
- switch (listitem) {
- case 0: {
- if (GetPlayerMoney(playerid) < 1000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $1000 to buy Knife.");
- }
- GivePlayerWeapon(playerid, 4, 1);
- GivePlayerMoney(playerid, -1000);
- GameTextForPlayer(playerid, "~g~Knife~n~~g~-$1000", 3000, 3);
- }
- case 1: {
- if (GetPlayerMoney(playerid) < 1000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $1000 to buy Chainsaw.");
- }
- GivePlayerWeapon(playerid, 9, 1);
- GivePlayerMoney(playerid, -1000);
- GameTextForPlayer(playerid, "~g~Chainsaw~n~~g~-$1000", 3000, 3);
- }
- case 2: {
- if (GetPlayerMoney(playerid) < 2500) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $2500 to buy Grenade.");
- }
- GivePlayerWeapon(playerid, 16, 1);
- GivePlayerMoney(playerid, -2500);
- GameTextForPlayer(playerid, "~g~Grenade~n~~g~-$2500", 3000, 3);
- }
- case 3: {
- if (GetPlayerMoney(playerid) < 2000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $2000 to buy Moltove Cocktail.");
- }
- GivePlayerWeapon(playerid, 18, 1);
- GivePlayerMoney(playerid, -2000);
- GameTextForPlayer(playerid, "~g~Grenade~n~~g~-$2500", 3000, 3);
- }
- case 4: {
- if (GetPlayerMoney(playerid) < 3000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $3000 to buy Silenced 9mm.");
- }
- GivePlayerWeapon(playerid, 23, 100);
- GivePlayerMoney(playerid, -3000);
- GameTextForPlayer(playerid, "~g~Silenced 9mm~n~~g~-$3000", 3000, 3);
- }
- case 5: {
- if (GetPlayerMoney(playerid) < 4500) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4500 to buy Desert Eagle.");
- }
- GivePlayerWeapon(playerid, 24, 100);
- GivePlayerMoney(playerid, -4500);
- GameTextForPlayer(playerid, "~g~Desert Eagle~n~~g~-$4500", 3000, 3);
- }
- case 6: {
- if (GetPlayerMoney(playerid) < 6500) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $6500 to buy Sawnoff Shotgun.");
- }
- GivePlayerWeapon(playerid, 26, 50);
- GivePlayerMoney(playerid, -6500);
- GameTextForPlayer(playerid, "~g~Sawnoff Shotgun~n~~g~-$6500", 3000, 3);
- }
- case 7: {
- if (GetPlayerMoney(playerid) < 6000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $6000 to buy Combat Shotgun.");
- }
- GivePlayerWeapon(playerid, 27, 50);
- GivePlayerMoney(playerid, -6000);
- GameTextForPlayer(playerid, "~g~Combat Shotgun~n~~g~-$6000", 3000, 3);
- }
- case 8: {
- if (GetPlayerMoney(playerid) < 4500) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4500 to buy UZI.");
- }
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerMoney(playerid, -4500);
- GameTextForPlayer(playerid, "~g~UZI~n~~g~-$4500", 3000, 3);
- }
- case 9: {
- if (GetPlayerMoney(playerid) < 4000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4000 to buy MP5.");
- }
- GivePlayerWeapon(playerid, 29, 100);
- GivePlayerMoney(playerid, -4000);
- GameTextForPlayer(playerid, "~g~MP5~n~~g~-$4000", 3000, 3);
- }
- case 10: {
- if (GetPlayerMoney(playerid) < 4500) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4500 to buy Tec-9.");
- }
- GivePlayerWeapon(playerid, 32, 100);
- GivePlayerMoney(playerid, -4500);
- GameTextForPlayer(playerid, "~g~Tec-9~n~~g~-$4500", 3000, 3);
- }
- case 11: {
- if (GetPlayerMoney(playerid) < 7000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $7000 to buy Sniper Rifle.");
- }
- GivePlayerWeapon(playerid, 34, 50);
- GivePlayerMoney(playerid, -7000);
- GameTextForPlayer(playerid, "~g~Sniper Rifle~n~~g~-$7000", 3000, 3);
- }
- case 12: {
- if (GetPlayerMoney(playerid) < 5000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 to buy Ak-47.");
- }
- GivePlayerWeapon(playerid, 30, 100);
- GivePlayerMoney(playerid, -5000);
- GameTextForPlayer(playerid, "~g~Ak-47~n~~g~-$5000", 3000, 3);
- }
- case 13: {
- if (GetPlayerMoney(playerid) < 5500) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5500 to buy M4.");
- }
- GivePlayerWeapon(playerid, 31, 100);
- GivePlayerMoney(playerid, -5500);
- GameTextForPlayer(playerid, "~g~M4~n~~g~-$5500", 3000, 3);
- }
- case 14: {
- if (GetPlayerMoney(playerid) < 3500) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $3500 to buy RPG..");
- }
- GivePlayerWeapon(playerid, 35, 1);
- GivePlayerMoney(playerid, -3500);
- GameTextForPlayer(playerid, "~g~RPG.~n~~g~-$3500", 3000, 3);
- }
- case 15: {
- if (GetPlayerMoney(playerid) < 4000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4000 to buy HS. Rocket.");
- }
- GivePlayerWeapon(playerid, 36, 1);
- GivePlayerMoney(playerid, -4000);
- GameTextForPlayer(playerid, "~g~HS. Rocket~n~~g~-$4000", 3000, 3);
- }
- case 16: {
- if (GetPlayerMoney(playerid) < 5000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 to buy Flamethrower.");
- }
- GivePlayerWeapon(playerid, 37, 200);
- GivePlayerMoney(playerid, -5000);
- GameTextForPlayer(playerid, "~g~Flamethrower~n~~g~-$5000", 3000, 3);
- }
- case 17: {
- if (GetPlayerMoney(playerid) < 15000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $15000 to buy MINIGUN.");
- }
- GivePlayerWeapon(playerid, 38, 100);
- GivePlayerMoney(playerid, -15000);
- GameTextForPlayer(playerid, "~g~MINIGUN~n~~g~-$15000", 3000, 3);
- }
- case 18: {
- if (GetPlayerMoney(playerid) < 2000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $2000 to buy Satchel Charge.");
- }
- GivePlayerWeapon(playerid, 39, 1);
- GivePlayerMoney(playerid, -2000);
- GameTextForPlayer(playerid, "~g~Satchel Charge~n~~g~-$2000", 3000, 3);
- }
- case 19: {
- if (GetPlayerMoney(playerid) < 1000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $1000 to buy Spray Can.");
- }
- GivePlayerWeapon(playerid, 41, 100);
- GivePlayerMoney(playerid, -1000);
- GameTextForPlayer(playerid, "~g~Spray Can~n~~g~-$1000", 3000, 3);
- }
- case 20: {
- if (GetPlayerMoney(playerid) < 1000) {
- return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $1000 to buy Fire Extinguisher.");
- }
- GivePlayerWeapon(playerid, 42, 100);
- GivePlayerMoney(playerid, -1000);
- GameTextForPlayer(playerid, "~g~Fire Extinguisher~n~~g~-$1000", 3000, 3);
- }
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerText(playerid, text[]) {
- new
- szName[MAX_PLAYER_NAME],
- szBuffer[156]
- ;
- GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
- format(szBuffer, sizeof(szBuffer), "%i> %s: "SAMP_BLUE"%s", playerid, szName, text);
- SendClientMessageToAll(GetPlayerColor(playerid), szBuffer);
- return 0;
- }
- public OnVehicleDeath(vehicleid, killerid) {
- if (killerid != INVALID_PLAYER_ID) {
- for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
- if (i != killerid, IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid) {
- return OnPlayerDeath(i, killerid, GetPlayerWeapon(killerid));
- }
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
- if (newkeys & KEY_FIRE) {
- if(GetPlayerWeapon(playerid) == 17) {
- new
- Float:x,
- Float:y,
- Float:z
- ;
- GetPlayerPos(playerid, x, y, z);
- for (new i, j = GetPlayerPoolSize(); i < j; i++) {
- if (IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 7.0, x, y, z) && i != playerid && GetPlayerState(i) == PLAYER_STATE_ONFOOT && ((GetPlayerTeam(playerid) == NO_TEAM && GetPlayerTeam(i) == NO_TEAM) || GetPlayerTeam(i) != GetPlayerTeam(playerid)) && ! g_Player[i][playerMask]) {
- ApplyAnimation(i, "ped", "gas_cwr", 1.0, 0, 0, 0, 0, 0);
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement