CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
My Custom Scripts
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="BullyWiiPlaza" data-source="post: 3139" data-attributes="member: 543"><p>Since none of you skids realized how crap the enemy warning script was while still praising this release, I felt free to fix it. Enjoy <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /></p><p>[CODE]sixthSense()</p><p>{</p><p> level endon("game_ended");</p><p> self endon("disconnect");</p><p></p><p> while(true)</p><p> {</p><p> foreach(player in getEnemies())</p><p> {</p><p> if (distance(self.origin, player.origin) <= 550)</p><p> {</p><p> self iPrintlnBold("^1Enemy is near");</p><p> wait 2;</p><p> }</p><p> </p><p> wait 0.1;</p><p> }</p><p> </p><p> wait 0.1;</p><p> }</p><p>}</p><p></p><p>isEnemy(player)</p><p>{</p><p> // We are not an enemy of ourself</p><p> if(player == self)</p><p> {</p><p> return false;</p><p> }</p><p></p><p> // On non team-based modes everyone except us must be an enemy</p><p> if(!level.teamBased)</p><p> {</p><p> return true;</p><p> }</p><p></p><p> // On team-based, decide whether teammate or not</p><p> return player.team != self.team;</p><p>}</p><p></p><p>getEnemies()</p><p>{</p><p> enemies = [];</p><p></p><p> foreach(player in level.players)</p><p> {</p><p> if(self isEnemy(player))</p><p> {</p><p> enemies[enemies.size] = player;</p><p> }</p><p> }</p><p></p><p> return enemies;</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="BullyWiiPlaza, post: 3139, member: 543"] Since none of you skids realized how crap the enemy warning script was while still praising this release, I felt free to fix it. Enjoy :grinning: [CODE]sixthSense() { level endon("game_ended"); self endon("disconnect"); while(true) { foreach(player in getEnemies()) { if (distance(self.origin, player.origin) <= 550) { self iPrintlnBold("^1Enemy is near"); wait 2; } wait 0.1; } wait 0.1; } } isEnemy(player) { // We are not an enemy of ourself if(player == self) { return false; } // On non team-based modes everyone except us must be an enemy if(!level.teamBased) { return true; } // On team-based, decide whether teammate or not return player.team != self.team; } getEnemies() { enemies = []; foreach(player in level.players) { if(self isEnemy(player)) { enemies[enemies.size] = player; } } return enemies; }[/CODE] [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
My Custom Scripts
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top