Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp> // SA-MP Team
- #include <MapAndreas> // Kalcor
- #include <cnpc> //009, updated to 0.3c by m0niSx and adamis
- #include <AI_NPCS> //By Skorch
- #define public: public
- #define private:%0(%1) forward %0(%1); public %0(%1)
- /*
- There are 6 Assassins with a CHAINSAW. Locations:
- When you are near one of them, he will follow you and when it's very near he
- will use his chainsaw to kill you
- 1 - The Panopticon
- 2 - Palomino Creek
- 3 - Angel Pine
- 4 - Mount Chilliad
- 5 - Mount Chilliad
- 6 - Shady Creeks
- */
- public: OnGameModeInit()
- {
- CreateBOT(0, -1, "[CNPC]Leatherface1", 162, 0, -525.3379, -102.2816, 63.2968, 270.0000);
- SetTimerEx("AI_AttackNearestPlayer", 500, true, "ii", FindLastFreeSlot()+1, 9);
- CreateBOT(1, -1, "[CNPC]Leatherface2", 162, 0, 2160.6884, -98.3574, 2.8141, 270.0000);
- SetTimerEx("AI_AttackNearestPlayer", 500, true, "ii", FindLastFreeSlot()+1, 9);
- CreateBOT(2, -1, "[CNPC]Leatherface3", 162, 0, -503.8879, -573.3398, 24.4884, 270.0000);
- SetTimerEx("AI_AttackNearestPlayer", 500, true, "ii", FindLastFreeSlot()+1, 9);
- CreateBOT(3, -1, "[CNPC]Leatherface4", 162, 0, -2004.5357, -2371.2932, 30.6250, 270.0000);
- SetTimerEx("AI_AttackNearestPlayer", 500, true, "ii", FindLastFreeSlot()+1, 9);
- CreateBOT(4, -1, "[CNPC]Leatherface5", 162, 0, -2302.1198, -1675.4301, 483.6986, 270.0000);
- SetTimerEx("AI_AttackNearestPlayer", 500, true, "ii", FindLastFreeSlot()+1, 9);
- CreateBOT(5, -1, "[CNPC]Leatherface6", 162, 0, -2798.7006, -1523.5063, 139.2609, 270.0000);
- SetTimerEx("AI_AttackNearestPlayer", 500, true, "ii", FindLastFreeSlot()+1, 9);
- return 1;
- }
- stock CreateBOT(botid, playerid, npcName[MAX_PLAYER_NAME], skin, worldid, Float:X, Float:Y, Float:Z, Float:Rot)
- {
- if(playerid == -1) playerid = FindLastFreeSlot();
- CreateNPC(playerid, npcName);
- SetSpawnInfo(playerid, 0, skin, X, Y, Z, Rot, 0, 0, 0, 0, 0, 0);
- SpawnNPC(playerid);
- SetPVarInt(playerid, "botid", botid);
- SetNPCFacingAngle(playerid, Rot);
- SetPlayerVirtualWorld(playerid, worldid);
- }
- private: AI_AttackNearestPlayer(npcid, weapon)
- {
- Loop(playerid, 300)
- {
- if(!IsPlayerConnected(playerid)) continue;
- new Float:Distance;
- Distance = GetDistanceBetweenTwoPlayers(npcid, playerid);
- if(Distance <= 2.0)
- {
- CancelAllNPCActions(npcid);
- SetNPCShootPlayer(npcid, playerid, weapon);
- break;
- }
- else if(Distance > 2.0 && Distance <= 50.0)
- {
- CancelAllNPCActions(npcid);
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- NPC_RunTo(npcid, X, Y, Z, 1);
- break;
- }
- else
- {
- StopNPC(npcid);
- }
- continue;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement