Add GSC: New functions and methods
parent
e5d06058c8
commit
f5ade7cb9d
72
GSC%3A-New-functions-and-methods.md
Normal file
72
GSC%3A-New-functions-and-methods.md
Normal file
@ -0,0 +1,72 @@
|
||||
# Introduction
|
||||
if you are a beginner modder and don't know the difference between functions and methods then there will be a brief explanation.
|
||||
|
||||
**Function** - game command which doesn't request the entity for calling. You not need using the level.player or some entity for use this function, otherwise you get error about that function is not exists.
|
||||
|
||||
Example:
|
||||
* ``cinematic("cod_end");``
|
||||
* ``earthquake(0.3, 3, self.origin, 850);``
|
||||
|
||||
**Methods** - game command which request the entity, if you will not use the entity then you get the error about that method is not exists.
|
||||
|
||||
Methods have several categories:
|
||||
* Player methods
|
||||
* AI methods
|
||||
* Vehicle methods
|
||||
|
||||
Example:
|
||||
* ``level.player allowAds(false);``: Player method
|
||||
* ``if (self canSee(player))``: AI method
|
||||
* ``bomber attachPath(aBomberPaths[i]);``: Vehicle method
|
||||
|
||||
> All examples was taken from here: [Link](https://docs.raid-gaming.net/cod4)
|
||||
|
||||
Mostly the new methods use the player only. Next, you can see the new features that have been added specifically for IW3SP-MOD and can't be called for stock game version.
|
||||
|
||||
# Functions
|
||||
* ``exec(<string> command)``: Executes a console command
|
||||
* ``ToUpper(<string> text)``: Converts text to uppercase
|
||||
|
||||
## Weapon
|
||||
* ``getweapondamage(<string> weapon name)``: Gets damage from a specific weapon
|
||||
* ``setweapondamage(<string> weapon name, <int> value)``: Sets the damage for a specific weapon
|
||||
* ``PlayViewmodelFX(<string> FX, <string> tag_name)``: Plays the FX on viewmodel weapon. Do not use loop FX, otherwise you can't delete this fx.
|
||||
|
||||
Example:
|
||||
```c
|
||||
player_play_fx_test()
|
||||
{
|
||||
level._effect["flashlight"] = loadfx("misc/flashlight");
|
||||
PlayViewmodelFX(level._effect["flashlight"], "tag_flash");
|
||||
}
|
||||
```
|
||||
|
||||
## Discord
|
||||
* ``setdiscorddetails(<string> detail_name)``: Sets the detail status in discord rpc
|
||||
* ``setdiscordstate(<string> state_name)``: Sets the state status in discord rpc
|
||||
* ``setbuttoninformation(<string> label, <string> url)``: Setup the second button in discord rpc
|
||||
* ``setdiscordimage(<string> image_url)``: Sets the image in discord rpc
|
||||
|
||||
Example:
|
||||
```c
|
||||
main()
|
||||
{
|
||||
maps\_load::main();
|
||||
wait 4;
|
||||
// Localized strings also supported
|
||||
setdiscorddetails("I go sleep!");
|
||||
setdiscordstate("I'm serious...");
|
||||
setbuttoninformation("MEGA MOD (YouTube link)", "https://www.youtube.com/watch?v=2Z4m4lnjxkY");
|
||||
setdiscordimage("https://media.tenor.com/fym4GQjsCRcAAAAM/kekwtf.gif");
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
# Player methods
|
||||
* ``allowFire <bool value>``: Enables/Disables player fire
|
||||
* ``IsReloading()``: Checks state if player is reloading
|
||||
* ``IsSprinting()``: Checks state if player is sprinting
|
||||
* ``IsUsingNVG()``: Checks state if player is uses NVG
|
||||
* ``isMantling()``: Checks state if player is mantling
|
||||
* ``isSwapping()``: Checks state if player is swapping the weapon
|
||||
|
Loading…
x
Reference in New Issue
Block a user