ItsMods

Full Version: Random Things 4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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


nice Nyan Cat
Code:
waittillframeend;

also waits 0.05 seconds .. I think atleast

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

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

JA U R 1337