Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Random Function isn't working. - SOLVED
#1
C++ Code
  1. generate()
  2. {
  3. if( level.gennumber == 0 )
  4. {
  5. level.gennumber = randomIntRange( 1, 3 );
  6.  
  7. if( level.gc_gennumber == 1 ) //TEST
  8. { self thread maps\mp\gametypes\mods\sniping_god::load(); }
  9. if( level.gc_gennumber == 2 ) // TEST 1
  10. { self thread maps\mp\gametypes\mods\test::load(); }
  11. if( level.gc_gennumber == 3 ) // TEST 2
  12. { self thread maps\mp\gametypes\mods\test2::load(); }
  13. if( level.gc_gennumber == 4 ) // TEST 3
  14. { self thread maps\mp\gametypes\mods\test3::load(); }
  15. if( level.gc_gennumber == 5 ) // TEST 4
  16. { self thread maps\mp\gametypes\mods\test4::load(); }
  17. if( level.gc_gennumber == 6 ) // TEST 5
  18. { self thread maps\mp\gametypes\mods\test5::load(); }
  19. if( level.gc_gennumber == 7 ) // TEST 6
  20. { self thread maps\mp\gametypes\mods\test6::load(); }
  21. if( level.gc_gennumber == 8 ) // TEST 7
  22. { self thread maps\mp\gametypes\mods\test7::load(); }
  23. if( level.gc_gennumber == 9 ) // TEST 8
  24. { self thread maps\mp\gametypes\mods\test8::load(); }
  25. if( level.gc_gennumber == 10 ) // TEST 9
  26. { self thread maps\mp\gametypes\mods\test9::load(); }
  27.  
  28. }
  29. }


(the function is execute by connecting to server)
But exerytime, i execute the Function, the function is loading "self thread maps\mp\gametypes\mods\test9::load". But this can't be, because of the code
C++ Code
  1. level.gennumber = randomIntRange( 1, 3 );

should level.gennumber be a number from the field 1 - 3...

What did i make false?
Sorry for bad English Blush -> *GERMAN*
Reply

#2
You're setting the random integer to the variable 'level.gennumber' and then checking the value of the variable 'level.gc_gennumber'.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 3,896 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,351 11-08-2013, 05:25
Last Post: [HARD] Tony.
  Plugins are not working clemi555 7 4,407 11-03-2013, 10:55
Last Post: d0h!
  Help Help Function Fire dargula 1 1,974 10-31-2013, 23:03
Last Post: Nekochan
  [Release] Working Aimbot The Clay Man 17 19,425 10-21-2013, 15:10
Last Post: zurasaur
  Help choose 2 random players?(1 each team) 26hz 6 4,341 09-12-2013, 17:32
Last Post: Yamato
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 30,737 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Help [C#] WebClient how to know real url [solved] narkos 21 11,871 09-09-2013, 15:21
Last Post: surtek
Information Help How to edit new derived entry? (Solved) SSonic70 1 2,483 08-20-2013, 15:29
Last Post: Nekochan
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,432 07-27-2013, 23:53
Last Post: DidUknowiPwn

Forum Jump:


Users browsing this thread:
1 Guest(s)

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