UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Help with moment (SP)

broken avatar :(
Created 7 years ago
by artsergo
0 Members and 1 Guest are viewing this topic.
2,129 views
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
Signature
Believe in your strength, anytime, anywhere!
Only you can force yourself to change something in your life!
But In general, the world itself is beautiful if  you be optimist :)
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
hi!  :)

Anybody knows, how to block the movement for player and hide his hand with weapon at the time of the first 5-10 seconds (for example) in loaded of map?

Something easy example (no large) for try understand and make on the map

in advance, very thank

-----------------------------------
with respect,
Sergei   
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Hide weapon = just take it away then give it back
Stop movement = link him to a object - then unlink
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
ok.   :)

but for an understandable it's need simple example code  ::)

Last Edit: January 15, 2017, 12:54:42 pm by artsergo
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
Harry Bo21 thanks you!  :)

but already found that  i wait   ::) 
this is parts code:


Code Snippet
Plaintext

..../// other code ////

disableWeapons();             // hide weapons
freezecontrols_all( true );  // Locking movement for Player

wait 5;

freezecontrols_all( false ); //Movement for Player
enableWeapons();             // show weapons

..../// next other code ////



Last Edit: January 31, 2017, 05:17:27 pm by artsergo
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
 
  Sorry.
  function
 
 
Code Snippet
Plaintext
disableWeapons();             
// and
enableWeapons();

  don't working  :-\   but others map is working. Why?
Last Edit: February 01, 2017, 06:14:50 pm by artsergo
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Not working in like, it does nothing? Or you get an error?
Are you actually calling it on something:

Code Snippet
Plaintext
self disableWeapons();
player disableWeapons();

You need to get the player(s) you want to call it on first. For all players do this:

Code Snippet
Plaintext
players = get_players();
for( i=0 ; i<players.size ; i++ )
{
   players[i] disableweapons();
}
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
hi!  :)

but if need and

Code Snippet
Plaintext

freezecontrols_all(true );

and

freezecontrols_all( false );


where is this function write ?

Last Edit: February 01, 2017, 07:57:52 pm by artsergo
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Again: It does nothing?  Or you get an error?
If you get an error, what error?



I dont know that function to be honest, i only know

Code Snippet
Plaintext
player freezecontrols( true );

and again you have to call that on a player.


Could be your function is included in some sp-script in wich case it could be you have to add the

Code Snippet
Plaintext
#include maps\NAME_OF_THE_GSC;

at the top of the script.


broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
generally, all parts code such:   :)

Code Snippet
Plaintext

main()
{

        thread hide();
timelock();
}


////////////////////////////////// start  ////////////////////////////
timelock()
{

wait( 9 );

thread show();
}

hide()
{
           setdvar( "hud_showStance", "0" );
       setdvar( "compass", "0" );
       setdvar( "ammoCounterHide", "1" );
       setdvar("miniscoreboardhide","1");

               players = get_players();
               for( i=0 ; i<players.size ; i++ )
               {
                  players[i] freezecontrols_all( true );
                  players[i] disableweapons();
               }
}

show()
{
       setdvar( "hud_showStance", "1" );
       setdvar( "compass", "1" );
       setdvar( "ammoCounterHide", "0" );
       setdvar("miniscoreboardhide","0");

               players = get_players();
               for( i=0 ; i<players.size ; i++ )
               {
                 players[i] freezecontrols_all( false );
                 players[i] EnableWeapons();
               }
}


and now, this is no working. When I starting in this test map.
Its no show errors but this functions no working too.   :(



Double Post Merge: February 01, 2017, 08:19:05 pm


  :) but now, this code no show any errors )

  and no say that it need any "NAME_OF_THE_GSC"  ::)

  :)
  I understand when "a pet" needs than,
  I always was giving it: #include maps\NAME_OF_THE_GSC;  :)
Last Edit: February 01, 2017, 08:23:50 pm by artsergo
Marked as best answer by artsergo 7 years ago
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
and you also call the main() function from some other function/script?



If you did it's prob running the function before you have spawned, try this:

Code Snippet
Plaintext
hide()
{
flag_wait( "all_players_connected" );

           setdvar( "hud_showStance", "0" );
       setdvar( "compass", "0" );
       setdvar( "ammoCounterHide", "1" );
       setdvar("miniscoreboardhide","1");

               players = get_players();
               for( i=0 ; i<players.size ; i++ )
               {
                  players[i] freezecontrols_all( true );
                  players[i] disableweapons();
               }
}
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
 but for show()

write  flag_wait( "all_players_connected" ); again?


Double Post Merge: February 01, 2017, 08:39:24 pm
its working. movement is blocked.


but i have new problem (and its problem i often have)

when i started in the map, weapon self no show with hand, and after i moving ring of mouse then weapon is showed.
how can make that weapons show self  for me without movement mouse?
Last Edit: February 01, 2017, 08:40:31 pm by artsergo
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
 

  Thanks you BluntStuffy, very much!  :)
  I can make working example with help BluntStuffy. 
  Thanks and Respect you! I add respect option!

  this is script. Add in main gsc script:


Code Snippet
Plaintext

       main()
          {
           //// other parts codes /////
     
           // only after  maps\_load::main(); //
           maps\_load::main();

           thread hide_hud();
           custom_introscreen();     

           set_loadout();

          }

       custom_introscreen()
           {
              wait( 9 );

      thread show_hud();
           }

       hide_hud()
          {
               flag_wait( "all_players_connected" );

           setdvar( "hud_showStance", "0" );
       setdvar( "compass", "0" );
       setdvar( "ammoCounterHide", "1" );
       setdvar("miniscoreboardhide","1");

               players = get_players();
               for( i=0 ; i<players.size ; i++ )
                     {
                             players[i] freezecontrols_all( true );
                             players[i] disableweapons();
                     }
          }

       show_hud()
          {
       setdvar( "hud_showStance", "1" );
       setdvar( "compass", "1" );
       setdvar( "ammoCounterHide", "0" );
       setdvar("miniscoreboardhide","0");

               players = get_players();
               for( i=0 ; i<players.size ; i++ )
                         {
                                   players[i] freezecontrols_all( false );
                                   players[i] enableWeapons();
                         }
          }

    //// other parts codes /////

      set_loadout()
         {
      maps\_loadout::add_weapon( "colt");
      maps\_loadout::add_weapon( "thompson" );
      maps\_loadout::add_weapon( "m1carbine" );
      maps\_loadout::add_weapon( "fraggrenade" );
      maps\_loadout::set_secondary_offhand( "smoke" );
      maps\_loadout::set_laststand_pistol( "colt" );

              game["allies"] = "marines";
              game["axis"] = "japanese";
              game["attackers"] = "allies";
              game["defenders"] = "axis";
              game["allies_soldiertype"] = "pacific";
              game["axis_soldiertype"] = "pacific";

      maps\_loadout::set_player_viewmodel( "viewmodel_usa_marine_arms");
      maps\_loadout::set_player_interactive_hands( "viewmodel_usa_marine_player" );
      maps\_loadout::set_switch_weapon( "m1garand_bayonet" );
      level.campaign = "american";
      mptype\player_usa_marine::precache();

players = get_players();
for( i = 0; i < players.size; i++ )
       {
       player = players[i];
       players[i] TakeWeapon( "springfield" );
       }
          }

 
    //// other parts codes /////


   


 
Loading ...