You like Ferraris?
Yes
38.10%
8
No
14.29%
3
I prefer Pineapples
47.62%
10
21 vote(s)
* You voted for this item. [Show Results]

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Random Things 2
#1
Rainbow 
Hello, OMA

This is a random tutorial about some random functions.

First of all, some precaching commands, they need to go in Init() and will allow you to use different parametres in your mods:

Code:
PrecacheTurret("turretname");
PrecacheModel("modelname");
PrecacheShader("shadername");
PrecacheMiniMapIcon("minimapiconname");
PrecacheVehicle("vehiclename"); //forget about this one, all vehicles in MP are already precached
PrecacheMenu("menuname");
PrecacheItem("itemname"); //forget about this one too
PrecacheShellShock("shellshockname");
PrecacheRumble("rumblename");

There are a few more, but those are enough. Now Ill explain the command PlayFXonTag, it will play a certain FX in a model tag.

Code:
FX = PlayFXonTag(effect name, model, tag to play effect on);

Example: this will play a FX called level.omafx on your head.

Code:
FX = PlayFXonTag(level.omafx,self,"j_head");

If you want to stop the FX from previous example use this:

Code:
FX = StopFXonTag(level.omafx,self,"j_head");

You can also play a FX on tag on a certain player

Code:
FX = PlayFXonTagForClients(level.omafx,self,"j_head",level.players[1]);

Now, how to set a perk or unset it

Code:
self _setperk("perkname");
self _unsetperk("perkname");

This is a command to change player speed:

Code:
self SetMoveSpeedScale(speed);

Now Ill explain the use of the command GetPersStat, this command what it does is to take a player stadistics such as the number of assists, kills or headshots. You use it like this:

self GetPersStat("stat");

Example of headshots, this could be a aimbotter kicker example:

Code:
if(self GetPersStat("headshots") > 10)
{
kick(self GetEntityNumber(),"PLATFORM_STEAM_KICK_CHEAT");
}

The kick command I used in previous example works like this:

Code:
kick(player,message);

The GetEntityNumber() command what it does is to take a certain player id, like when you take them with console. Ill explain now a physics command, this one is perfect to make gravity objects.

Code:
model PhysicsLaunchServer(vector,origin);

Example:

Code:
OMA PhysicsLaunchServer((0,0,0),self.origin); //this one will make the object fall, it will interact with world

Now a command that is really useless, is only good to annoy players, it makes a certain player get EMPed, with false you make the EMP effects stop

Code:
self SetEMPJammed(true);

Now Ill explain how to play Loop sounds and how to stop them, this is a sound that will repeat all the time until you stop it:

Code:
thing PlayLoopSound(sound);
thing StopLoopSound(sound); //to stop it

This is a random thing I found once while editing weapons, this are weapons that IW was going to add in MW2

Code:
[spoiler]WEAPON_MP44
WEAPON_RAPPEL_KNIFE
WEAPON_MP5_SILENCER
WEAPON_MAC10
WEAPON_G36C
WEAPON_M14
WEAPON_WINCHESTER1200
WEAPON_SAW
WEAPON_AW50
WEAPON_AG36
WEAPON_HK79
WEAPON_EGLM
WEAPON_M21_SOCOM
WEAPON_BINOCULARS
WEAPON_G3_SILENCER
WEAPON_AK74U_ACOG
WEAPON_UMP45_BURST
WEAPON_ANACONDA_SILENCER
WEAPON_ICE_AXE
WEAPON_AA12SP_HB_SILENCER
WEAPON_SCAR_ROF
WEAPON_G36_LMG
WEAPON_AUG_SCOPE
WEAPON_M14EBR
WEAPON_P90_HEARTBEAT
WEAPON_M79_BOOM
WEAPON_RPG_BLING[/spoiler]

This is a command that allows you to fade in a shellshock, it makes the shellshock like weaker.

Code:
self FadeOutShellShock();

While looking through game code I found this different csv info commands, they already brought a info that IW left there. In BO you can use them more, in MW2 you dont need any kind of command like this.

Code:
tableLookup( filename, searchColumnNum, searchValue, returnValueColumnNum )
tableLookupByRow( filename, rowNum, returnValueColumnNum )
tableLookupRowNum( filename, searchColumnNum, searchValue )

There is also a better way to give many dvars, they will reduce your code lenght:

Code:
self SetClientDvars("dvar1",dvar1 value,"dvar2",dvar2 value,"dvar3",dvar3 value, etc);

I cant remember very well, but I think that setDvars works like this too

Now some HUD Info, this are the different game fonts you can use:

Code:
default
objective
bigfixed
smallfixed

Now the positions in screen of HUD

In X:

Code:
Left         Center       Right

In Y:

Code:
Top

Middle

Bottom

In alignx you can find all this:

Code:
subleft
left
center
right
fullscreen
noscale
alignto640
center_safearea

In aligny you can find all this:

Code:
subtop
top
middle
bottom
fullscreen
noscale
alignto480
center_safearea

Thats all, OMA
  Reply
#2
try this font too:
consolefont
Also you forgot:
weapon_oma
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
  Reply
#3
Randoms shit's nice Smile
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  GTA V fun things RaZ 4 4,198 05-06-2015, 18:55
Last Post: RaZ
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 3,872 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,289 11-08-2013, 05:25
Last Post: [HARD] Tony.
  Help choose 2 random players?(1 each team) 26hz 6 4,303 09-12-2013, 17:32
Last Post: Yamato
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 30,330 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,370 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Receiving a random primary & secondary DidUknowiPwn 5 4,068 07-22-2013, 09:47
Last Post: Yamato
  What script controls the "random" aspect to care packages? akillj 2 3,017 06-05-2013, 11:24
Last Post: akillj
  Random anims master131 14 9,950 05-24-2013, 09:45
Last Post: [HARD] Tony.
  [Request] Random player model hillbilly 1 2,537 05-12-2013, 08:30
Last Post: archit

Forum Jump:


Users browsing this thread: 1 Guest(s)