It's Mods

Full Version: Different !speed on different map?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Is it currently possible to have a mod that can auto set different speed and even jumpheight, to a different map?
it doesn't have to be for every map, but outpost, and mission come to mind.
You mean for each map there's a set jumpheight/speed?
(07-02-2012 00:28)DidUknowiPwn Wrote: [ -> ]You mean for each map there's a set jumpheight/speed?

yes.
Yes it is possible
(07-02-2012 05:04)litgar Wrote: [ -> ]Yes it is possible

anyone who is capable willing to do it please?

cough*
just add an if/else check to onmapchanged()

that sets the settings in the Speed plugin Smile

example:

CSHARP Code
  1. public override void OnMapChange()
  2. {
  3. currmap = GetDvar("mapname");
  4.  
  5. if (currmap == "mp_radar")
  6. {
  7. g_speed_var = 190;
  8. jump_height_var = 39;
  9. fall_damage_var = 1;
  10. gravity_var = 800;
  11. infammo_var = 1;
  12. } else if (currmap == "mp_village")
  13. {
  14. g_speed_var = 220;
  15. jump_height_var = 79;
  16. fall_damage_var = 1;
  17. gravity_var = 600;
  18. infammo_var = 1;
  19. } else if (currmap == "mp_seatown")
  20. {
  21. g_speed_var = 190;
  22. jump_height_var = 39;
  23. fall_damage_var = 1;
  24. gravity_var = 800;
  25. infammo_var = 1;
  26. } else if (currmap == "mp_bravo")
  27. {
  28. g_speed_var = 190;
  29. jump_height_var = 39;
  30. fall_damage_var = 1;
  31. gravity_var = 800;
  32. infammo_var = 1;
  33. } else // if map not defined
  34. {
  35. g_speed_var = 190;
  36. jump_height_var = 39;
  37. fall_damage_var = 1;
  38. gravity_var = 800;
  39. infammo_var = 1;
  40. }
  41. }


it really isnt that hard (oh ignore the infammo setting lol)
thanks i'll try now Wink

hmm keep getting currmap does not exist in the current content?
Change
CSHARP Code
  1. currmap = GetDvar("mapname");

to
CSHARP Code
  1. string currmap = GetDvar("mapname");
(07-02-2012 11:36)zxz0O0 Wrote: [ -> ]Change
CSHARP Code
  1. currmap = GetDvar("mapname");

to
CSHARP Code
  1. string currmap = GetDvar("mapname");

that sorted out the error, but it's still defaulting to the jumpheight, speed that is set in the speedplugin, which is this..

g_speed_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "Speed", "220"));
jump_height_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "JumpHeight", "240"));
fall_damage_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "FallDamage", "0"));
gravity_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "Gravity", "800"));
Add this
CSHARP Code
  1. set_g_speed(g_speed_var);
  2. set_jump_height(jump_height_var);
  3. set_g_gravity(gravity_var);
  4.  
  5. if (fall_damage_var == 0)
  6. disableFallDamage();
  7. else
  8. enableFallDamage();

after
CSHARP Code
  1. else // if map not defined
  2. {
  3. g_speed_var = 190;
  4. jump_height_var = 39;
  5. fall_damage_var = 1;
  6. gravity_var = 800;
  7. infammo_var = 1;
  8. }
Pages: 1 2 3
Reference URL's