Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Made by lokii.
- //Credits to SA-MP team for samp, Ziggi for fcnpc and Incognito for streamer.
- #include <a_samp>
- #include <streamer>
- #include <fcnpc>
- static Area51;
- static Solider[25];
- static const Float:Positions[][] =
- {
- {99.8491,1931.7933,18.2811},
- {108.5983,1931.3282,18.6246},
- {105.2435,1907.0781,18.4694},
- {132.1906,1912.8110,18.8366},
- {168.0923,1926.9628,18.4076},
- {177.1358,1927.6698,18.1062},
- {200.2923,1916.5547,17.6406},
- {202.3618,1902.2300,17.6406},
- {201.8292,1863.2948,19.9082},
- {166.8584,1819.4879,17.6406},
- {187.8508,1803.8325,17.6406},
- {207.3230,1814.3622,21.8672},
- {158.4858,1929.3832,27.8438},
- {265.2886,1893.9838,33.8984},
- {250.5889,1889.2881,20.6406},
- {236.3748,1885.1506,17.6406},
- {169.9098,1903.9590,18.4284},
- {148.9974,1866.4457,17.7895},
- {132.1002,1861.5874,17.7845},
- {136.1683,1849.6047,17.6870},
- {109.9748,1817.0808,22.9922},
- {279.1203,1850.9598,17.6406},
- {278.2896,1872.3582,17.6481},
- {279.7938,1903.9222,17.6481},
- {259.3168,1920.9006,17.6406}
- };
- public OnFilterScriptInit()
- {
- new string[12];
- Area51 = CreateDynamicSphere(189.9946, 1871.6069, 17.6406, 150.0, -1, -1, -1);
- for(new i = 0; i < 25; i++)
- {
- format(string, sizeof(string), "Solider_%i", i);
- Solider[i] = FCNPC_Create(string);
- FCNPC_Spawn(Solider[i], 287, Positions[i][0], Positions[i][1], Positions[i][2]);
- FCNPC_SetInvulnerable(Solider[i], true);
- FCNPC_SetWeaponAccuracy(Solider[i], 31, 0.1);
- FCNPC_SetWeapon(Solider[i], 31);
- FCNPC_SetAmmo(Solider[i], 9999);
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- DestroyDynamicArea(Area51);
- for(new i = 0; i < 25; i++)
- {
- FCNPC_Destroy(Solider[i]);
- }
- return 1;
- }
- public OnPlayerEnterDynamicArea(playerid, areaid)
- {
- new player, Float: last = 99999, Float:x, Float:y, Float:z;
- if(IsPlayerNPC(playerid)) return 1;
- GameTextForPlayer(playerid, "~h~~r~Leave the area!", 3000, 4);
- SetPlayerWantedLevel(playerid, 4);
- if(areaid == Area51)
- {
- for(new c = 0; c < 25; c++)
- {
- for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
- {
- if(!IsPlayerConnected(i)) continue;
- FCNPC_GetPosition(Solider[c], x, y, z);
- if(IsPlayerNPC(i) || !IsPlayerInRangeOfPoint(i, 150.0, 189.9946, 1871.6069, 17.6406) || GetPlayerDistanceFromPoint(i, x, y, z) > last) continue;
- last = GetPlayerDistanceFromPoint(i, x, y, z);
- player = i;
- }
- FCNPC_AimAtPlayer(Solider[c], player, true, -1, true, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- }
- }
- return 1;
- }
- public OnPlayerLeaveDynamicArea(playerid, areaid)
- {
- new player, Float: last = 99999, Float:x, Float:y, Float:z;
- if(IsPlayerNPC(playerid)) return 1;
- SetPlayerWantedLevel(playerid, 0);
- if(areaid == Area51)
- {
- for(new c = 0; c < 25; c++)
- {
- for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
- {
- if(!IsPlayerConnected(i)) continue;
- FCNPC_GetPosition(Solider[c], x, y, z);
- if(IsPlayerNPC(i) || !IsPlayerInRangeOfPoint(i, 150.0, 189.9946, 1871.6069, 17.6406) || GetPlayerDistanceFromPoint(i, x, y, z) > last) continue;
- last = GetPlayerDistanceFromPoint(i, x, y, z);
- player = i;
- }
- FCNPC_AimAtPlayer(Solider[c], player, true, 2000, true, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- }
- }
- return 1;
- }
- //EOF.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement