Poll: Interesting?
You do not have permission to vote in this poll.
Yes
42.86%
3 42.86%
No
0%
0 0%
You suck
14.29%
1 14.29%
OMA is cool
42.86%
3 42.86%
Total 7 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Random Things 4
#1
Bug 
Hello guys

A new tutorial of things that you arent going to use, Tongue

The first command: PhysicsLaunchClient, this will launch an object with a vector force from a origin, you have to call it on a entity, if you call it on a player, you will see weird player fails, Smile

Code:
object PhysicsLaunchClient(origin,vector);

Example:

Code:
OMA PhysicsLaunchClient(self.origin,(90,45,130));

Now the second command: PointOnSegmentNearestToPoint, this is a maths command. I am not good at explaining this and worse in english, Tongue, the first 2 parametres you put in the function make a segment and then from the 3 parametre it calculates the closest point on the segment to the point you put.

Code:
point = PointOnSegmentNearestToPoint(a,b,point);

Example with picture, Big Grin

Code:
A________O__________B      This is an example on: point = PointOnSegmentNearestToPoint(A,B,P); //It will return the point O
            |
            |
            |
            P

Now the command AssertMsg, it will make the game crash like sintax errors with a error you make

Code:
AssertMsg("message");

Example:

Code:
AssertMsg("This mod fails");

Now the command WaitFrame, is a professional way of waiting 0.05 seconds(1 frame), Troll , you use it like this:

Code:
self GiveWeapon("onemanarmy_mp",0,true);
WaitFrame();
self SwitchToWeapon("onemanarmy_mp",0,true);

The next are 2 functions to get a tag origin + an extra one that is similar:

Code:
self GetTagOrigin("tag name"); //gets the tag origin
self GetTagAngles("tag name"); //gets the tag angles
self GetEye(); //gets the tag_eye origin

Now 2 interesting math commands: Min and Max, they will return the minimum value beetween 2 values or the max.

Work like this:
Code:
maxnumber = Max(number1,number2);
minnumber = Min(number1,number2);

Examples:

Code:
maxnumber = Max(5,1); //maxnumber will be equal to 5
minnumber = Min(1337,50); //minnumber will be equal to 50

More precaching Commands, Big Grin:

Code:
PrecacheStatusIcon("icon name");
PrecacheString("string name");
PrecacheLeaderboards("leaderboards"); // this one is 100% useless
PrecacheLocationSelector("location selector icon name");

Now, dvar getting commands:

Code:
getDvar(dvar name);
getDvarVector(dvar name);
getDvarInt(dvar name);
getDvarFloat(dvar name);

Also a last command, Cointoss, is used like a coin throw or a randomint(2)

Code:
if(cointoss())
    //something

Thats all guys, Nyan Cat and OMA


Reply

#2
nice Nyan Cat
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
Code:
waittillframeend;

also waits 0.05 seconds .. I think atleast

Keep doing these things, they are really helpfull Tongue
(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

#4
(10-07-2011, 18:58)iAegle Wrote:
Code:
waittillframeend;

also waits 0.05 seconds .. I think atleast

Keep doing these things, they are really helpfull Tongue
waittillframeend; waits till the frame is ended.. it's to make sure that _load.gsc has ran. But since all the scripts run every 0.05; seconds waitillframeend; also waits exactly .05; sec. but to look pro I'd just use
Code:
Wait(0.05);
[Image: MaEIQ.png]
Reply

#5
(10-07-2011, 19:04)Pozzuh Wrote:
(10-07-2011, 18:58)iAegle Wrote:
Code:
waittillframeend;

also waits 0.05 seconds .. I think atleast

Keep doing these things, they are really helpfull Tongue
waittillframeend; waits till the frame is ended.. it's to make sure that _load.gsc has ran. But since all the scripts run every 0.05; seconds waitillframeend; also waits exactly .05; sec. but to look pro I'd just use
Code:
Wait(0.05);

Code:
Wait( 0.05 );
look more pro Troll
(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

#6
(10-07-2011, 19:05)iAegle Wrote:
(10-07-2011, 19:04)Pozzuh Wrote:
(10-07-2011, 18:58)iAegle Wrote:
Code:
waittillframeend;

also waits 0.05 seconds .. I think atleast

Keep doing these things, they are really helpfull Tongue
waittillframeend; waits till the frame is ended.. it's to make sure that _load.gsc has ran. But since all the scripts run every 0.05; seconds waitillframeend; also waits exactly .05; sec. but to look pro I'd just use
Code:
Wait(0.05);

Code:
Wait( 0.05 );
look more pro Troll

Code:
wait .05;

...
Reply

#7
waitframe(); is the most pro of all, Fuu all, I R 1337
Reply

#8
(10-07-2011, 20:40)Yamato Wrote: waitframe(); is the most pro of all, Fuu all, I R 1337

JA U R 1337
[Image: 1fxsnb.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  GTA V fun things RaZ 4 4,248 05-06-2015, 18:55
Last Post: RaZ
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 3,895 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,350 11-08-2013, 05:25
Last Post: [HARD] Tony.
  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,735 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,432 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Receiving a random primary & secondary DidUknowiPwn 5 4,098 07-22-2013, 09:47
Last Post: Yamato
  What script controls the "random" aspect to care packages? akillj 2 3,047 06-05-2013, 11:24
Last Post: akillj
  Random anims master131 14 10,037 05-24-2013, 09:45
Last Post: [HARD] Tony.
  [Request] Random player model hillbilly 1 2,556 05-12-2013, 08:30
Last Post: archit

Forum Jump:


Users browsing this thread:
1 Guest(s)

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