Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Text not working and stuff?
#1
C++ Code
  1. #include common_scripts\utility;
  2. #include maps\mp\_utility;
  3. #include maps\mp\gametypes\_hud_util;
  4.  
  5. init()
  6. {
  7. level thread onPlayerConnect();
  8. }
  9.  
  10. onPlayerConnect()
  11. {
  12. while( true )
  13. {
  14. level waittill( "connected", player );
  15. player thread onPlayerSpawned();
  16. }
  17. }
  18.  
  19. onPlayerSpawned()
  20. {
  21. self endon( "disconnect" );
  22.  
  23. while( true )
  24. {
  25. self waittill( "spawned_player" );
  26. self thread spotEnemies();
  27. }
  28. }
  29.  
  30. spotEnemies()
  31. {
  32. self endon( "disconnect" );
  33. self endon( "death" );
  34.  
  35. distanceText = self createFontString( "smallfixed", 1 );
  36. distanceText setPoint( "CENTER", "CENTER", 10, 7 );
  37. distanceText.color = ( 51/255, 215/255, 54/255 );
  38. self thread destroyOnDeath( distanceText );
  39.  
  40. while( true )
  41. {
  42. wait .05;
  43.  
  44. //if( self getCurrentWeapon() != "binoculars_mp" )
  45. // continue;
  46.  
  47. if( !self playerADS() )
  48. continue;
  49.  
  50. start = self getTagOrigin( "tag_eye" );
  51. end = start + vector_scale( anglesToForward( self getPlayerAngles() ), 50000 );
  52. trace = bulletTrace( start, end, true, self );
  53.  
  54. meters = inchesToMetres( distance( start, trace["position"] ) );
  55. distanceText setText( meters + "m" );
  56.  
  57. if( !isDefined( trace["entity"] ) )
  58. continue;
  59.  
  60. if( !isPlayer( trace["entity"] ) )
  61. continue;
  62.  
  63. spottedEnemy = trace["entity"];
  64. spotFailed = false;
  65. for( i = 0; i < 30; i++ )
  66. {
  67. start = self getTagOrigin( "tag_eye" );
  68. end = start + vector_scale( anglesToForward( self getPlayerAngles() ), 50000 );
  69. trace = bulletTrace( start, end, true, self );
  70.  
  71. meters = inchesToMetres( distance( start, trace["position"] ) );
  72. distanceText setText( meters + "m" );
  73.  
  74. if( !isPlayer( trace["entity"] ) || ( trace["entity"] != spottedEnemy ) || !self playerADS() )
  75. {
  76. spotFailed = true;
  77. break;
  78. }
  79.  
  80. wait .05;
  81. }
  82.  
  83. if( spotFailed )
  84. continue;
  85.  
  86. self maps\mp\gametypes\_battlechatter_mp::mpSayLocalSound( self, "enemy", "infantry", false );
  87. self iPrintLnBold( "^2You spotted: " + trace["entity"].name );
  88. }
  89. }
  90.  
  91. destroyOnDeath( hudElem )
  92. {
  93. self waittill( "death" );
  94. hudElem destroy();
  95. }
  96.  
  97. inchesToMetres( inches )
  98. {
  99. return ( inches * 0.0254 );
  100. }


so .. it doesn't display a number at all and when I set developer to 1 it gives me a shitload of runtime errors which shouldn't cause problems.

whenever I look at a player for like 3 seconds it doesn't do anything either, and the player should shout "Enemy spotted!" and show which player u spotted.
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#2
not sure but:

change
Code:
distanceText.color = ( 51/255, 215/255, 54/255 );
to
Code:
distanceText.color = ( 0.2, 0.843, 0.211 );

did you ever check if the sound works at all before this?
make checks to see if pieces of code even get called (self iPrintLnBold())

not sure if this is the case now but with self getPlayerAngles() I have had problems before so I just used self.angles

and finally try changing
Code:
end = start + vector_scale( anglesToForward( self getPlayerAngles() ), 50000 );
to
Code:
end = start + anglestoforward(self.angles)*50000;
[Image: b_560_95_1.png]
Reply

#3
None of them worked .. =.=
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Plugins are not working clemi555 7 4,832 11-03-2013, 10:55
Last Post: d0h!
  [Release] Working Aimbot The Clay Man 17 20,373 10-21-2013, 15:10
Last Post: zurasaur
  Getting text from a website JustDoingThisShit 2 2,855 10-21-2013, 08:00
Last Post: JustDoingThisShit
  Infected Stuff is semi broken DidUknowiPwn 2 3,456 09-21-2013, 20:22
Last Post: surtek
Information How to change text messages in MP (.ff edit) giofrida 5 4,826 05-02-2013, 20:05
Last Post: Pozzuh
  How to get models working? Erik The Born 2 3,056 04-28-2013, 08:19
Last Post: Erik The Born
  Upload Clipboard Text data to a server DidUknowiPwn 14 8,203 04-13-2013, 14:48
Last Post: SuperNovaAO
  text book [HARD] Tony. 2 2,688 03-13-2013, 19:39
Last Post: Nekochan
  Your favorite stuff Nekochan 19 8,865 01-18-2013, 08:48
Last Post: AZUMIKKEL
Question Help Print text on screen koro35 4 4,681 11-18-2012, 00:24
Last Post: koro35

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.