Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define RNPC_NO_VERSION_CHECK
- #include <RNPC>
- #define MAX_OTOCAN 10
- #define GetRandomPos(%1,%2) %1 = (-744.0 - random(44)); %2 = (-1969.2 - random(35))
- enum OTOCAN_enum
- {
- Timer,
- Float:Health,
- bool:IsDead
- };
- static OtocanInfo[MAX_OTOCAN][OTOCAN_enum];
- main() {}
- public OnGameModeInit()
- {
- //El infierno
- CreateObject(18759, -767.42926, -1981.55005, 39.57150, 0.00000, 0.00000, 0.00000);
- CreateObject(704, -824.98560, -2026.47717, 67.19260, -125.00000, 0.00000, 303.70905);
- CreateObject(704, -834.75928, -2002.42920, 72.77048, -125.00000, 0.00000, 299.39023);
- CreateObject(704, -789.39569, -1901.72607, 70.01269, -125.00000, 0.00000, 205.77780);
- CreateObject(704, -788.54712, -1935.57080, 46.23990, -110.00000, 0.00000, 181.46280);
- CreateObject(704, -733.16882, -1915.93359, 68.81982, -125.00000, 0.00000, 163.86092);
- CreateObject(704, -693.33319, -1955.30225, 74.24191, -125.00000, 0.00000, 109.62669);
- CreateObject(704, -688.31378, -2014.21545, 82.70863, -125.00000, 0.00000, 61.19062);
- CreateObject(704, -789.39569, -1901.72607, 69.94617, -125.00000, 0.00000, 181.46284);
- CreateObject(704, -834.75928, -2002.42920, 69.94617, -125.00000, 0.00000, 268.12457);
- CreateObject(704, -688.31378, -2014.21545, 78.16839, -125.00000, 0.00000, 77.75431);
- CreateObject(704, -693.33319, -1955.30225, 73.62672, -125.00000, 0.00000, 94.92651);
- CreateObject(704, -814.64697, -1990.18909, 55.31329, -95.50000, 0.00000, 337.08340);
- CreateObject(704, -791.92889, -1902.29468, 51.00562, -95.50000, 0.00000, 233.85573);
- CreateObject(704, -718.68518, -2012.90173, 56.81020, -95.50000, 0.00000, 7.14715);
- CreateObject(3279, -713.41101, -2013.39148, 21.61770, 0.00000, 0.00000, 267.64673);
- CreateObject(3279, -714.89667, -2013.16357, 7.53995, 0.00000, 0.00000, 176.92107);
- CreateObject(3279, -816.00806, -2042.67822, 23.97438, 0.00000, 0.00000, 30.45559);
- CreateObject(3279, -816.01300, -2042.65881, 38.21647, 0.00000, 0.00000, 120.19669);
- CreateObject(3279, -695.21753, -2021.65674, 17.99723, 0.00000, 0.00000, 185.94908);
- CreateObject(3279, -693.07544, -2021.36877, 32.17956, 0.00000, 0.00000, 276.76498);
- CreateObject(3279, -748.47504, -2054.60034, 7.38144, 0.00000, 0.00000, 185.94908);
- CreateObject(3279, -747.23572, -2054.71265, 21.45761, 0.00000, 0.00000, 276.76498);
- CreateObject(3279, -830.97968, -1976.59814, 7.38144, 0.00000, 0.00000, 176.92102);
- CreateObject(3279, -830.80511, -1976.32666, 21.45761, 0.00000, 0.00000, 267.64667);
- CreateObject(3279, -805.96313, -1932.37354, 7.38144, 0.00000, 0.00000, 92.77055);
- CreateObject(3279, -805.33911, -1931.12927, 21.45761, 0.00000, 0.00000, 182.65479);
- CreateObject(3279, -733.10101, -1916.71753, 0.64966, 0.00000, 0.00000, 92.77055);
- CreateObject(3279, -731.38342, -1915.39990, 14.65851, 0.00000, 0.00000, 182.65479);
- CreateObject(3279, -715.03723, -1964.66138, 7.53995, 0.00000, 0.00000, 92.77055);
- CreateObject(3279, -713.20178, -1964.18628, 21.61770, 0.00000, 0.00000, 182.65479);
- CreateObject(3267, -746.97797, -2054.52930, 37.08360, 0.00000, 0.00000, 0.00000);
- CreateObject(3267, -693.54968, -2021.19409, 47.52684, 0.00000, 0.00000, 61.80023);
- CreateObject(3267, -713.45734, -2012.97766, 37.25429, 0.00000, 0.00000, 61.80023);
- CreateObject(3267, -713.25116, -1964.00464, 37.25429, 0.00000, 0.00000, 111.60461);
- CreateObject(3267, -731.57617, -1914.92664, 30.50204, 0.00000, 0.00000, 144.85730);
- CreateObject(3267, -805.52625, -1930.94019, 37.06062, 0.00000, 0.00000, 214.87155);
- CreateObject(3267, -830.62469, -1976.48206, 37.06062, 0.00000, 0.00000, 267.76056);
- CreateObject(3267, -815.90320, -2042.72131, 53.93014, 0.00000, 0.00000, 323.76425);
- CreateObject(19377, -784.89807, -1961.38196, 44.34390, 0.00000, 0.00000, 0.00000);
- CreateObject(19377, -749.39807, -1961.38196, 44.34390, 0.00000, 0.00000, 0.00000);
- CreateObject(19377, -788.53760, -1969.01050, 38.42820, 0.00000, 0.00000, 308.89050);
- CreateObject(19377, -745.88489, -1969.31604, 38.31544, 0.00000, 0.00000, 228.43469);
- CreateObject(19325, -781.54596, -1966.15210, 41.53012, 0.00000, 0.00000, 90.00000);
- CreateObject(19325, -775.04602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
- CreateObject(19325, -768.54602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
- CreateObject(19325, -762.04602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
- CreateObject(19325, -755.54602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
- CreateObject(19325, -749.04602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
- CreateObject(19377, -779.89807, -1961.38196, 43.54660, 0.00000, 90.00000, 0.00000);
- CreateObject(19377, -769.39807, -1961.38196, 43.54660, 0.00000, 90.00000, 0.00000);
- CreateObject(19377, -758.89807, -1961.38196, 43.54660, 0.00000, 90.00000, 0.00000);
- CreateObject(19377, -751.89807, -1961.38196, 43.49066, 0.00000, 90.00000, 0.00000);
- new text1 = CreateObject(19325, -746.0397, -1969.3499, 41.5714, 0.0000, 0.0000, 48.0430);
- new text2 = CreateObject(19325, -788.4275, -1969.0405, 41.6114, 0.0000, 0.0000, 128.9335);
- SetObjectMaterialText(text1, "OTOCAN KILLER", 0, 90, "Arial", 35, 1, -65536, -16776961, 1);
- SetObjectMaterialText(text2, "OTOCAN KILLER", 0, 90, "Arial", 35, 1, -65536, -16776961, 1);
- for(new i = 0; i < MAX_OTOCAN; i++)
- {
- new str[21];
- format(str, 21, "OTOCAN_%d", i);
- ConnectRNPC(str);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(IsPlayerRNPC(playerid))
- {
- SpawnPlayer(playerid);
- RNPC_SetShootable(playerid, true);
- return 1;
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(!IsPlayerRNPC(playerid))
- {
- GivePlayerWeapon(playerid, 31, 50000);
- GivePlayerWeapon(playerid, 36, 50000);
- GivePlayerWeapon(playerid, 22, 50000);
- SetPlayerPos(playerid, -784.2378, -1982.0018, 41.0);
- return 1;
- }
- RNPC_CreateBuild(playerid, PLAYER_RECORDING_TYPE_ONFOOT);
- RNPC_AddMovement(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- RNPC_FinishBuild();
- RNPC_StartBuildPlayback(playerid);
- SetPlayerSkin(playerid, 5);
- OtocanInfo[playerid][Health] = 100.0;
- OtocanInfo[playerid][IsDead] = false;
- SetTimerEx("SpawnEx", 500, false, "d", playerid);
- return 1;
- }
- forward SpawnEx(npcid);
- public SpawnEx(npcid)
- {
- new Float:randx, Float:randy;
- GetRandomPos(randx, randy);
- RNPC_CreateBuild(npcid, PLAYER_RECORDING_TYPE_ONFOOT);
- RNPC_AddMovement(randx, randy, 40.67380, randx, randy, 40.67380);
- RNPC_FinishBuild();
- RNPC_StartBuildPlayback(npcid);
- SetTimerEx("SpawnEx2", 100, false, "d", npcid);
- return 1;
- }
- forward SpawnEx2(npcid);
- public SpawnEx2(npcid)
- {
- new Float:randx, Float:randy;
- GetRandomPos(randx, randy);
- RNPC_CreateBuild(npcid, PLAYER_RECORDING_TYPE_ONFOOT);
- RNPC_AddMovement(randx, randy, 40.67380, randx, randy, 40.67380);
- RNPC_FinishBuild();
- RNPC_StartBuildPlayback(npcid);
- OtocanInfo[npcid][Timer] = SetTimerEx("OTOCAN_MoveFatAss", random(7000) + 3000, false, "d", npcid);
- return 1;
- }
- forward OTOCAN_MoveFatAss(otocanid);
- public OTOCAN_MoveFatAss(otocanid)
- {
- ClearAnimations(otocanid);
- new Float:Pos[3];
- new Float:randx, Float:randy;
- GetPlayerPos(otocanid, Pos[0], Pos[1], Pos[2]);
- GetRandomPos(randx, randy);
- RNPC_CreateBuild(otocanid, PLAYER_RECORDING_TYPE_ONFOOT);
- RNPC_AddMovement(Pos[0], Pos[1], 40.67380, randx, randy, 40.67380);
- RNPC_FinishBuild();
- RNPC_StartBuildPlayback(otocanid);
- SetPlayerCheckpoint(otocanid, randx, randy, 40.67380, 5.0);
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid) // OTOCANs will repose they fat ass
- {
- ClearAnimations(playerid);
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- RNPC_CreateBuild(playerid, PLAYER_RECORDING_TYPE_ONFOOT);
- RNPC_AddMovement(Pos[0], Pos[1], Pos[2], Pos[0], Pos[1], Pos[2]);
- RNPC_FinishBuild();
- RNPC_StartBuildPlayback(playerid);
- ApplyAnimation(playerid, "FAT", "IDLE_tired", 4.1, 1, 0, 0, 0, 10000, 1);
- ApplyAnimation(playerid, "FAT", "IDLE_tired", 4.1, 1, 0, 0, 0, 10000, 1);
- KillTimer(OtocanInfo[playerid][Timer]);
- OtocanInfo[playerid][Timer] = SetTimerEx("OTOCAN_MoveFatAss", random(5000), false, "d", playerid);
- return 1;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
- {
- new Float:health = OtocanInfo[damagedid][Health] -= amount;
- if(health <= 0.0 && OtocanInfo[damagedid][IsDead] == false)
- {
- health = OtocanInfo[damagedid][Health] = 0;
- OtocanInfo[damagedid][IsDead] = false;
- KillTimer(OtocanInfo[damagedid][Timer]);
- ApplyAnimation(damagedid, "PED", "FLOOR_hit_f", 4.0, 0, 1, 1, 1, 1);
- ApplyAnimation(damagedid, "PED", "FLOOR_hit_f", 4.0, 0, 1, 1, 1, 1);
- }
- new str[10];
- format(str, sizeof(str), "~w~%0.2f", health);
- GameTextForPlayer(playerid, str, 2000, 3);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement