diff --git a/app/resources/server/db.go b/app/resources/server/db.go index 8247a794bf90..89233fd0ce91 100644 --- a/app/resources/server/db.go +++ b/app/resources/server/db.go @@ -53,7 +53,7 @@ func (s *DB) Upsert(ctx context.Context, e All) error { svr, err = s.client.Server. FindUnique(db.Server.IP.Equals(e.IP)). - Update( + Update(append([]db.ServerSetParam{ db.Server.IP.Set(e.IP), db.Server.Hn.Set(e.Core.Hostname), db.Server.Pc.Set(db.BigInt(e.Core.Players)), @@ -68,7 +68,7 @@ func (s *DB) Upsert(ctx context.Context, e All) error { db.Server.Banner.SetOptional(e.Banner), db.Server.Active.Set(e.Active), db.Server.LastActive.Set(time.Now()), - ).Exec(ctx) + }, extraParams(e.Extra)...)...).Exec(ctx) if errors.Is(err, db.ErrNotFound) { if !e.Active { // don't store inactive servers that don't exist. @@ -84,12 +84,14 @@ func (s *DB) Upsert(ctx context.Context, e All) error { db.Server.Pa.Set(e.Core.Password), db.Server.Vn.Set(e.Core.Version), db.Server.Active.Set(e.Active), - db.Server.Omp.Set(e.Core.IsOmp), - db.Server.Pending.Set(true), - db.Server.Domain.SetOptional(e.Domain), - db.Server.Description.SetOptional(e.Description), - db.Server.Banner.SetOptional(e.Banner), - db.Server.LastActive.Set(time.Now()), + append([]db.ServerSetParam{ + db.Server.Omp.Set(e.Core.IsOmp), + db.Server.Pending.Set(true), + db.Server.Domain.SetOptional(e.Domain), + db.Server.Description.SetOptional(e.Description), + db.Server.Banner.SetOptional(e.Banner), + db.Server.LastActive.Set(time.Now()), + }, extraParams(e.Extra)...)..., ).Exec(ctx); err != nil { return errors.Wrapf(err, "failed to create '%v'", e) } @@ -121,6 +123,26 @@ func (s *DB) Upsert(ctx context.Context, e All) error { return nil } +// extraParams writes the open.mp extra info when this query got it. Without it +// (a SA-MP server, or the extra query failed) the stored values are left alone. +func extraParams(extra *Extra) []db.ServerSetParam { + if extra == nil { + return nil + } + optional := func(value string) *string { + if value == "" { + return nil + } + return &value + } + return []db.ServerSetParam{ + db.Server.Discord.SetOptional(optional(extra.Discord)), + db.Server.BannerLight.SetOptional(optional(extra.BannerLight)), + db.Server.BannerDark.SetOptional(optional(extra.BannerDark)), + db.Server.Logo.SetOptional(optional(extra.Logo)), + } +} + func (s *DB) GetByID(ctx context.Context, id string) (*All, error) { r, err := s.client.Server.FindUnique(db.Server.ID.Equals(id)).Exec(ctx) if err != nil { diff --git a/app/resources/server/model.go b/app/resources/server/model.go index 0228c29bd1a5..25e99591ac35 100644 --- a/app/resources/server/model.go +++ b/app/resources/server/model.go @@ -16,12 +16,23 @@ type All struct { Rules map[string]string `json:"ru,omitempty"` Description *string `json:"description"` Banner *string `json:"banner"` + Extra *Extra `json:"extra,omitempty"` Active bool `json:"active"` Pending bool `json:"pending"` LastUpdated time.Time `json:"lastUpdated"` LastActive *time.Time `json:"lastActive"` } +// Extra holds what an open.mp server publishes about itself beyond the SA:MP +// query: the same Discord link, banners and logo the launcher shows. Empty +// strings mean the server didn't set that field. +type Extra struct { + Discord string `json:"discord,omitempty"` + BannerLight string `json:"bannerLight,omitempty"` + BannerDark string `json:"bannerDark,omitempty"` + Logo string `json:"logo,omitempty"` +} + // Essential stores the standard SA:MP 'info' query fields necessary for server // lists. The json keys are short to cut down on network traffic since these are // the objects returned to a listing request which could contain hundreds of @@ -105,6 +116,7 @@ func dbToAPI(r db.ServerModel) *All { Rules: transformRules(r.Ru()), Description: r.InnerServer.Description, Banner: r.InnerServer.Banner, + Extra: extraFromDB(r), Active: r.Active, Pending: r.Pending, LastUpdated: r.UpdatedAt, @@ -112,6 +124,26 @@ func dbToAPI(r db.ServerModel) *All { } } +func extraFromDB(r db.ServerModel) *Extra { + e := Extra{ + Discord: valueOr(r.InnerServer.Discord), + BannerLight: valueOr(r.InnerServer.BannerLight), + BannerDark: valueOr(r.InnerServer.BannerDark), + Logo: valueOr(r.InnerServer.Logo), + } + if e == (Extra{}) { + return nil + } + return &e +} + +func valueOr(s *string) string { + if s == nil { + return "" + } + return *s +} + func dbToAPISlice(r []db.ServerModel) []All { result := []All{} for _, s := range r { diff --git a/app/services/queryer/extrainfo.go b/app/services/queryer/extrainfo.go new file mode 100644 index 000000000000..03928c7b4cfb --- /dev/null +++ b/app/services/queryer/extrainfo.go @@ -0,0 +1,138 @@ +package queryer + +import ( + "bytes" + "context" + "encoding/binary" + "errors" + "fmt" + "net" + "net/url" + "strconv" + "strings" + "time" +) + +// ExtraInfo is what an open.mp server returns to the 'o' query: the Discord +// invite, banners and logo set in its config.json. The launcher reads the same +// packet (src-tauri/src/query.rs in the launcher repo). Empty fields were not set. +type ExtraInfo struct { + Discord string + BannerLight string + BannerDark string + Logo string +} + +// Limits the launcher applies to each field. +const ( + maxDiscordLength = 50 + maxURLLength = 160 +) + +var errExtraInfoMalformed = errors.New("malformed extra info packet") + +// QueryExtraInfo sends the open.mp 'o' query to address. Only open.mp servers +// answer it; SA-MP servers ignore it and the call times out. +func QueryExtraInfo(ctx context.Context, address string) (ExtraInfo, error) { + host, portText, err := net.SplitHostPort(address) + if err != nil { + return ExtraInfo{}, err + } + port, err := strconv.ParseUint(portText, 10, 16) + if err != nil { + return ExtraInfo{}, fmt.Errorf("invalid port %q: %w", portText, err) + } + + ips, err := net.DefaultResolver.LookupIP(ctx, "ip4", host) + if err != nil || len(ips) == 0 { + return ExtraInfo{}, fmt.Errorf("could not resolve %q: %w", host, err) + } + ip := ips[0].To4() + + ctx, cancel := context.WithTimeout(ctx, 3*time.Second) + defer cancel() + + var d net.Dialer + conn, err := d.DialContext(ctx, "udp4", net.JoinHostPort(ip.String(), portText)) + if err != nil { + return ExtraInfo{}, err + } + defer conn.Close() + if deadline, ok := ctx.Deadline(); ok { + _ = conn.SetDeadline(deadline) + } + + request := make([]byte, 0, 11) + request = append(request, 'S', 'A', 'M', 'P') + request = append(request, ip...) + request = append(request, byte(port&0xFF), byte(port>>8&0xFF)) + request = append(request, 'o') + if _, err := conn.Write(request); err != nil { + return ExtraInfo{}, err + } + + buf := make([]byte, 2048) + n, err := conn.Read(buf) + if err != nil { + return ExtraInfo{}, err + } + + return parseExtraInfo(buf[:n]) +} + +// parseExtraInfo reads the reply: the 11-byte query header, then the Discord +// link, light banner and dark banner, each a little-endian uint32 length +// followed by that many bytes, then an optional logo in the same form. +func parseExtraInfo(packet []byte) (ExtraInfo, error) { + if len(packet) < 11 || !bytes.Equal(packet[:4], []byte("SAMP")) || packet[10] != 'o' { + return ExtraInfo{}, errExtraInfoMalformed + } + r := bytes.NewReader(packet[11:]) + + readString := func(limit uint32) (string, error) { + var length uint32 + if err := binary.Read(r, binary.LittleEndian, &length); err != nil { + return "", errExtraInfoMalformed + } + if length > limit || int(length) > r.Len() { + return "", errExtraInfoMalformed + } + value := make([]byte, length) + if _, err := r.Read(value); err != nil && length > 0 { + return "", errExtraInfoMalformed + } + return strings.TrimSpace(string(value)), nil + } + + var info ExtraInfo + var err error + if info.Discord, err = readString(maxDiscordLength); err != nil { + return ExtraInfo{}, err + } + if info.BannerLight, err = readString(maxURLLength); err != nil { + return ExtraInfo{}, err + } + if info.BannerDark, err = readString(maxURLLength); err != nil { + return ExtraInfo{}, err + } + // Older open.mp versions stop before the logo. + if r.Len() > 4 { + if info.Logo, err = readString(maxURLLength); err != nil { + return ExtraInfo{}, err + } + } + + info.BannerLight = webURL(info.BannerLight) + info.BannerDark = webURL(info.BannerDark) + info.Logo = webURL(info.Logo) + return info, nil +} + +// webURL keeps only absolute http(s) addresses, since these end up in . +func webURL(value string) string { + u, err := url.Parse(value) + if err != nil || (u.Scheme != "http" && u.Scheme != "https") || u.Host == "" { + return "" + } + return u.String() +} diff --git a/app/services/queryer/extrainfo_test.go b/app/services/queryer/extrainfo_test.go new file mode 100644 index 000000000000..9d20a3c052c4 --- /dev/null +++ b/app/services/queryer/extrainfo_test.go @@ -0,0 +1,85 @@ +package queryer + +import ( + "encoding/binary" + "testing" +) + +// appendLength adds a little-endian uint32 (binary.LittleEndian.AppendUint32 +// needs Go 1.19, and CI runs 1.17). +func appendLength(p []byte, n int) []byte { + var b [4]byte + binary.LittleEndian.PutUint32(b[:], uint32(n)) + return append(p, b[:]...) +} + +func packetWith(fields ...string) []byte { + p := []byte{'S', 'A', 'M', 'P', 127, 0, 0, 1, 0x61, 0x1e, 'o'} + for _, f := range fields { + p = appendLength(p, len(f)) + p = append(p, f...) + } + return p +} + +func TestParseExtraInfo(t *testing.T) { + info, err := parseExtraInfo(packetWith( + "discord.gg/example", + "https://example.com/light.png", + "https://example.com/dark.png", + "https://example.com/logo.png", + )) + if err != nil { + t.Fatal(err) + } + want := ExtraInfo{ + Discord: "discord.gg/example", + BannerLight: "https://example.com/light.png", + BannerDark: "https://example.com/dark.png", + Logo: "https://example.com/logo.png", + } + if info != want { + t.Fatalf("got %+v, want %+v", info, want) + } +} + +func TestParseExtraInfoWithoutLogo(t *testing.T) { + info, err := parseExtraInfo(packetWith("", "https://example.com/light.png", "")) + if err != nil { + t.Fatal(err) + } + if info.BannerLight != "https://example.com/light.png" || info.Logo != "" || info.BannerDark != "" { + t.Fatalf("unexpected %+v", info) + } +} + +func TestParseExtraInfoDropsNonWebURLs(t *testing.T) { + info, err := parseExtraInfo(packetWith("", "javascript:alert(1)", "example.com/dark.png", "data:image/png;base64,AAAA")) + if err != nil { + t.Fatal(err) + } + if info.BannerLight != "" || info.BannerDark != "" || info.Logo != "" { + t.Fatalf("non-web URLs kept: %+v", info) + } +} + +func TestParseExtraInfoRejectsBadPackets(t *testing.T) { + tooLong := make([]byte, maxURLLength+1) + for i := range tooLong { + tooLong[i] = 'a' + } + truncated := packetWith("discord.gg/x") + truncated = appendLength(truncated, 40) // claims 40 bytes, has none + + cases := map[string][]byte{ + "short": []byte("SAMP"), + "wrong type": append(packetWith()[:10], 'r'), + "too long": packetWith("", string(tooLong), ""), + "truncated": truncated, + } + for name, p := range cases { + if _, err := parseExtraInfo(p); err == nil { + t.Errorf("%s: expected an error", name) + } + } +} diff --git a/app/services/queryer/queryer.go b/app/services/queryer/queryer.go index c24fe3f4fc40..045e5107a28b 100644 --- a/app/services/queryer/queryer.go +++ b/app/services/queryer/queryer.go @@ -10,6 +10,8 @@ import ( type Queryer interface { Query(ctx context.Context, address string) (sampquery.Server, error) + // ExtraInfo asks an open.mp server for its Discord link, banners and logo. + ExtraInfo(ctx context.Context, address string) (ExtraInfo, error) } type SAMPQueryer struct{} @@ -24,6 +26,10 @@ func (q *SAMPQueryer) Query(ctx context.Context, address string) (sampquery.Serv return sampquery.GetServerInfo(ctx, address, true) } +func (q *SAMPQueryer) ExtraInfo(ctx context.Context, address string) (ExtraInfo, error) { + return QueryExtraInfo(ctx, address) +} + // Mock for testing type MockQueryer struct{} @@ -66,3 +72,7 @@ func (q *MockQueryer) Query(ctx context.Context, address string) (sampquery.Serv } return sampquery.Server{}, errors.New("not found") } + +func (q *MockQueryer) ExtraInfo(ctx context.Context, address string) (ExtraInfo, error) { + return ExtraInfo{}, errors.New("not found") +} diff --git a/app/services/scraper/pooled.go b/app/services/scraper/pooled.go index 5143cf9908df..39f344d507f2 100644 --- a/app/services/scraper/pooled.go +++ b/app/services/scraper/pooled.go @@ -41,6 +41,19 @@ func (s *PooledScraper) Scrape(ctx context.Context, addresses []string) chan ser result.Core.IP = result.IP + // Only open.mp servers answer the extra info query. A failed or + // timed-out query leaves Extra nil, which keeps the stored values. + if result.Active && result.Core.IsOmp { + if info, err := s.Q.ExtraInfo(c, addr); err == nil { + result.Extra = &server.Extra{ + Discord: info.Discord, + BannerLight: info.BannerLight, + BannerDark: info.BannerDark, + Logo: info.Logo, + } + } + } + out <- result }(a) } diff --git a/frontend/blog/2026-10-14-server-v1-6-7-launcher-v1-7-0.md b/frontend/blog/2026-10-14-server-v1-6-7-launcher-v1-7-0.md new file mode 100644 index 000000000000..8e8a77d767d0 --- /dev/null +++ b/frontend/blog/2026-10-14-server-v1-6-7-launcher-v1-7-0.md @@ -0,0 +1,68 @@ +--- +slug: server-v1-6-7-launcher-v1-7-0 +title: open.mp Server v1.6.7 and Launcher v1.7.0 +authors: [itsneufox] +--- + +New versions of both the open.mp server and the launcher are out. Server **v1.6.7.3218** brings new NPC vehicle natives, a round of networking fixes and Conan 2 builds with macOS ARM support. Launcher **v1.7.0** makes the in-game overlay smoother, adds nickname history and a models cache setting, and improves connection stability. + + + +Get them from the [server](/downloads/server) and [launcher](/downloads/launcher) download pages. + +## Server v1.6.7.3218 + +### NPCs + +- New natives to move NPCs while they're in a vehicle: `NPC_SetVehiclePos`, `NPC_SetVehicleRot`, `NPC_GetVehiclePos` and `NPC_GetVehicleRot`. +- NPC vehicles no longer look flat or teleport when driving on slopes, and their movement is synchronized better. +- Fixed NPCs looking like they're on foot in boats after `NPC_PutInVehicle`, and dead NPCs appearing to stand when streamed in. `NPC_Respawn` now clears the death state. +- Fixed infinite ammo when `NPC_SetAmmo` was never called, the value `NPC_GetSkin` returns, and the angle from `NPC_SetAngleToPos`. + +:::warning Behaviour change + +`NPC_SetPos` now takes an NPC out of its vehicle. To move an NPC that should stay seated, use `NPC_SetVehiclePos` instead. + +::: + +### Networking and server operation + +- `reloadbans` works again: reloaded bans are enforced, and matching players who are connected are removed. +- Fixed servers wrongly reporting they were full after kicks, and connections being rejected right after the server starts. +- Fixed broadcast messages getting cut short when a plugin read them first, which affected things like weather changes, messages and game text. +- Fixed Linux servers hanging or crashing on shutdown when running without a terminal, for example under `nohup`. +- Environment variables in the server configuration now work for numeric and boolean settings too. +- Vehicle paintjobs reset when vehicles respawn. +- New `artwork.show_crc_logs` option to log TXD and DFF CRCs when you need them. It's off by default. + +### Scripting + +- Fixed `%q` escaping in `format()`, a crash when reading a missing console variable as a string, and crashes from invalid `SetTimerEx` arguments. +- Fixed spawning after leaving spectator mode, and `TogglePlayerSpectating` reliably turns spectating back on. +- Components now reset after the main script unloads, so callbacks and timers can't refer to a script that's gone. +- `AttachPlayerObjectToObject` respects its `syncRotation` argument again. +- Object editing and attached-object editing are now checked separately. +- Clearer messages when a script-loading console command is missing a filename, or a legacy plugin is missing. + +### Building + +- Builds moved to Conan 2, with a new [build guide](https://github.com/openmultiplayer/open.mp/blob/master/BUILD.md) for Windows, Linux and macOS. +- Added macOS ARM build support, and fixed compatibility with newer Microsoft toolchains. +- Fixed the 32-bit Docker image missing libraries `omp-server` needs to start. + +Every change is listed in the [full changelog](https://github.com/openmultiplayer/open.mp/compare/v1.5.8.3079...v1.6.7.3218). + +## Launcher v1.7.0 + +- The in-game launcher overlay is smoother and more reliable, and works better with ENB and other graphics mods. +- The launcher remembers your last five nicknames. Pick one from the main window or the join prompt. +- A new **Models cache folder** setting in Advanced settings. +- Joining and reconnecting to servers is more stable, and nicknames or passwords with special characters connect correctly. +- New `--no-omp` command-line option to launch without the open.mp client. +- Armenian, Korean and Bulgarian translations, plus updates to Spanish, Lithuanian, Georgian, Italian and Serbian. + +See the [full changelog](https://github.com/openmultiplayer/launcher/compare/v1.6.1...v1.7.0) for everything else. + +## Thank you + +These releases include work from 21 first-time contributors: 14 on the server and 7 on the launcher. Thanks to everyone who reported bugs, tested and sent pull requests. diff --git a/frontend/docs/awesome.md b/frontend/docs/awesome.md index 95dbbc079cc4..699ea18c04b8 100644 --- a/frontend/docs/awesome.md +++ b/frontend/docs/awesome.md @@ -2,6 +2,7 @@ title: Awesome sidebar_label: Awesome description: A curated list of useful tools, libraries, gamemodes, filterscripts and plugins for SA-MP/open.mp development. +tags: ["community", "resources"] --- ## Tools @@ -134,10 +135,12 @@ Now you can make your scripts in languages other than pawn without any plugin us - **[sampsdk](https://github.com/maddinat0r/samp-plugin-sdk)** - This is the bare minimum that you need to develop plugins. - **[sampgdk](https://github.com/Foundation-PAWN/sampgdk-backup)** - C/C++ Language Support for writing a gamemode for SA:MP -- **[SampSharp](https://github.com/ikkentim/SampSharp)** - C# Language Support for writing a gamemode for SA:MP +- **[SampSharp](https://github.com/ikkentim/SampSharp)** - C# Language Support for writing a gamemode for open.mp and SA:MP - **[.NET Plugin](https://github.com/Seregamil/.NET-plugin)** - C# Language Support for writing a plugin for SA:MP - **[sampgo](https://github.com/sampgo/sampgo)** - Go Language Support for writing a gamemode/plugins for SA:MP - **[ompgo](https://github.com/ompgo-dev/ompgo)** - Go Language Support for writing a gamemode/components for open.mp +- **[omprs](https://github.com/Sreyas-Sreelal/omprs)** - Rust Language Support for writing a gamemode for open.mp +- **[omp-node](https://github.com/AmyrAhmady/omp-node)** - Javascript/Typescript Language Support for writing a gamemode for open.mp - **[samp-node](https://github.com/AmyrAhmady/samp-node)** - Javascript/Typescript Language Support for writing a gamemode for SA:MP - **[Shoebill Project](https://github.com/Shoebill/ShoebillPlugin)** - Java Language Support for writing a gamemode for SA:MP - **[pySAMP](https://github.com/habecker/PySAMP)** - Python Language Support for writing a gamemode for SA:MP diff --git a/frontend/docs/changelog.md b/frontend/docs/changelog.md index e1ca4e78492e..434f25081f52 100644 --- a/frontend/docs/changelog.md +++ b/frontend/docs/changelog.md @@ -2,6 +2,7 @@ title: Changelog sidebar_label: Changelog description: open.mp development progress and changelog. +tags: ["changelog"] --- ## **[v1.5.8.3079](https://github.com/openmultiplayer/open.mp/releases/tag/v1.5.8.3079) (Latest)** diff --git a/frontend/docs/client/ClientCommands.md b/frontend/docs/client/ClientCommands.md index 69640302c9f7..3b628415005d 100644 --- a/frontend/docs/client/ClientCommands.md +++ b/frontend/docs/client/ClientCommands.md @@ -2,6 +2,7 @@ title: "Client Commands" sidebar_label: "Client Commands" description: List of all client commands. +tags: ["client", "commands"] --- ## Commands diff --git a/frontend/docs/client/ClientOnLinux.md b/frontend/docs/client/ClientOnLinux.md index 74884133cb11..d5c465b5b62c 100644 --- a/frontend/docs/client/ClientOnLinux.md +++ b/frontend/docs/client/ClientOnLinux.md @@ -2,6 +2,7 @@ title: "open.mp client on linux" sidebar_label: "open.mp client on linux" description: Guide on how to run the open.mp client on Linux. +tags: ["client", "linux", "installation"] --- # Guide on how to run the open.mp client on Linux diff --git a/frontend/docs/client/CommonClientIssues.md b/frontend/docs/client/CommonClientIssues.md index c16c80dff6a8..c97507748a62 100644 --- a/frontend/docs/client/CommonClientIssues.md +++ b/frontend/docs/client/CommonClientIssues.md @@ -1,6 +1,7 @@ --- title: Common Client Issues sidebar_label: Common Client Issues +tags: ["client", "troubleshooting"] --- ### I get the error "San Andreas cannot be found" diff --git a/frontend/docs/client/CrashAddresses.md b/frontend/docs/client/CrashAddresses.md index df4543f7545f..4bc382ef4f10 100644 --- a/frontend/docs/client/CrashAddresses.md +++ b/frontend/docs/client/CrashAddresses.md @@ -1,6 +1,7 @@ --- title: Crash Addresses sidebar_label: Crash Addresses +tags: ["client", "troubleshooting", "crash"] --- The below table lists some common crash addresses which you can use to help trace the problem and prevent it from occurring in future. In most cases client crashes occur because of a problem in the script. Although, it is worth mentioning that SA:MP is pretty stable nowadays. diff --git a/frontend/docs/client/sa-mp.cfg.md b/frontend/docs/client/sa-mp.cfg.md index 7f165e135723..838053b7c941 100644 --- a/frontend/docs/client/sa-mp.cfg.md +++ b/frontend/docs/client/sa-mp.cfg.md @@ -2,6 +2,7 @@ title: sa-mp.cfg sidebar_label: sa-mp.cfg description: sa-mp client configuration file. +tags: ["client", "configuration"] --- ## Description diff --git a/frontend/docs/faq.md b/frontend/docs/faq.md new file mode 100644 index 000000000000..2bacfbd29a7e --- /dev/null +++ b/frontend/docs/faq.md @@ -0,0 +1,238 @@ +--- +title: FAQ +sidebar_label: FAQ +description: Quick answers to common questions about open.mp, its server, scripting and playing. +sidebar_position: 0.5 +tags: ["getting started", "faq"] +--- + +import { Faq, FaqGroup, FaqItem } from "@site/src/components/Faq"; + +# Frequently asked questions + +Quick answers about playing on open.mp, running a server and scripting. + + + +## General + + + + + +open.mp (Open Multiplayer) is a multiplayer mod for Grand Theft Auto: San Andreas. It's a rewrite of the SA-MP (San Andreas Multiplayer) server that stays fully backwards compatible: + +- **Players** join open.mp servers with the client they already have. +- **Server owners** keep their gamemodes, filterscripts and most plugins. +- **Scripters** get hundreds of new functions and callbacks, and long-standing SA-MP bugs fixed. + + + + + +Yes. The server, the launcher and these docs cost nothing, and the code is open source on [GitHub](https://github.com/openmultiplayer/open.mp). If you'd like to support development, you can [donate on Open Collective](https://opencollective.com/openmultiplayer). + + + + + +SA-MP stopped being developed, so its bugs and limits stayed. open.mp is actively developed by the community. In short: + +- Known exploits and crash bugs are fixed. +- Many new [functions and callbacks](server/omp-functions), for example getters for almost everything you can set. +- A built-in [NPC component](scripting/functions/NPC_Create), so you no longer need FCNPC. +- A new [config.json](server/config.json) with more settings than `server.cfg`. +- The [open.mp launcher](/downloads/launcher) for finding and joining servers. + + + + + +## Playing + + + + + +1. Have the PC version of GTA: San Andreas **v1.0** installed. Steam and Rockstar Games Launcher copies need to be [downgraded first](#which-version-of-gta-san-andreas-do-i-need). +2. Download and install the [open.mp launcher](/downloads/launcher). +3. Pick a server from the launcher's list, or from the [servers page](/servers), and join. + + + + + +The PC version **v1.0 (US or EU)**. Other versions, such as v2.0 and the copies sold on Steam or through the Rockstar Games Launcher, won't work until you downgrade them to v1.0 with a downgrader patch. [Common client issues](client/CommonClientIssues#i-get-the-error-san-andreas-cannot-be-found) links one. + + + + + +Yes. open.mp servers accept SA-MP clients, so you can join with the client you already have. The [open.mp launcher](/downloads/launcher) is still worth installing for its server browser. + + + + + +Most problems are covered in [Common client issues](client/CommonClientIssues), including "San Andreas cannot be found", singleplayer loading instead, and crashes when a vehicle explodes. If the crash shows an address, look it up in [Crash addresses](client/CrashAddresses). + + + + + +Yes, through Wine. [Playing on Linux](client/ClientOnLinux) walks through the setup. + + + + + +## Running a server + + + + + +1. Download the server for Windows or Linux from the [server downloads](/downloads/server). +2. Extract it, put your gamemode in `gamemodes` and set it in `config.json`: + + ```json + "pawn": { + "main_scripts": ["your_gamemode 1"] + } + ``` + +3. Run `omp-server.exe` on Windows, or `./omp-server` on Linux. + +The [installation guide](server/Installation) has every step with screenshots. For a Linux machine, see the [Linux server guide](server/LinuxServerInstallation). + + + + + +Yes. Replace the SA-MP include with the open.mp one and recompile: + +```pawn +// #include +#include +``` + +The compiler may now warn about tag mismatches or deprecated spellings. They don't stop your script from working. You can fix them, or quiet them while you migrate: + +```pawn +#define NO_TAGS +#define MIXED_SPELLINGS +#include +``` + +See [compiler errors and warnings](server/Installation#compiler-errors-and-warnings) for the common ones. + + + + + +Most do. Put them in the `plugins` folder and list them in `config.json`: + +```json +"pawn": { + "legacy_plugins": ["crashdetect", "mysql", "streamer"] +} +``` + +A few need extra care: + +- **Pawn.CMD, Pawn.RakNet, sampvoice, sscanf and a few others** have open.mp builds that go in the `components` folder instead. +- **YSF** isn't needed: open.mp already has most of its natives. +- **FCNPC** is replaced by the built-in NPC component. + +The [installation guide](server/Installation#step-5) lists each plugin and where to get the right version. + + + + + +Both work, but [config.json](server/config.json) has many more settings. To convert an existing `server.cfg`, run this in your server folder: + +```bash +omp-server --dump-config +``` + + + + + +Check these in order: + +1. The server is running and shows no errors in its console. +2. The server's port (`network.port` in `config.json`, 7777 by default) is open in your firewall. +3. If you host at home, the port is forwarded on your router. See [Port forwarding](tutorials/PortForwarding). + +[Common server issues](server/CommonServerIssues) covers more, such as "Packet was modified" and missing `MSVCR` DLLs. + + + + + +Servers announce themselves to the open.mp server list by default (`announce` in `config.json`). Make sure players can reach the server from the internet, then give it a `name`, `language` and `website` so it stands out in the list. + + + + + +Up to 1000. Set `max_players` in `config.json` (50 by default). NPCs take player slots too, and are limited by `max_bots`. + + + + + +## Scripting + + + + + +Most servers use Pawn, a small C-like language. Gamemodes and filterscripts are compiled from `.pwn` files into `.amx` files that the server runs. Start with the [Pawn language](scripting/language/Variables) pages. To try code without setting up a server, use the [Pawn Playground](https://pg.open.mp/). + +You're not limited to Pawn, though. Through open.mp's [C API](https://github.com/openmultiplayer/open.mp-capi), community projects let you write a whole gamemode in other languages: + +- **C#**: [SampSharp](https://github.com/ikkentim/SampSharp) +- **JavaScript and TypeScript**: [omp-node](https://github.com/AmyrAhmady/omp-node) +- **Go**: [ompgo](https://github.com/ompgo-dev/ompgo) +- **Rust**: [omprs](https://github.com/Sreyas-Sreelal/omprs) + +These are made by the community, not the open.mp team, so check each project's docs and how actively it's maintained. More projects exist: search [Packages](https://packages.open.mp/) to find them, or see [GDK/SDKs](awesome#gdksdks) on the Awesome page. + + + + + +New functions and callbacks for players, vehicles, objects, textdraws, gang zones and more, such as getters for values SA-MP could only set. They're all listed in [open.mp functions](server/omp-functions). + + + + + +open.mp has NPCs built in: create one with [NPC_Create](scripting/functions/NPC_Create) and control it with the other `NPC_` functions. Raise `max_bots` in `config.json` first, since it's 0 by default. + + + + + +Enable `artwork.enable` in `config.json`, put your `.dff` and `.txd` files in the `models` folder, and register them with [AddSimpleModel](scripting/functions/AddSimpleModel) for objects or [AddCharModel](scripting/functions/AddCharModel) for skins. Call these in `OnGameModeInit`, so every player gets the models. + + + + + +Search [Packages](https://packages.open.mp/), the Pawn package index, or browse the community list in [Awesome](awesome). + + + + + +In the scripting resources: [vehicles](scripting/resources/vehicleid), [skins](scripting/resources/skins), [weapons](scripting/resources/weaponids) and many more lists. For object models, use the [Model Viewer](https://models.open.mp/). + + + + + + diff --git a/frontend/docs/index.md b/frontend/docs/index.md index 06d34dc6473f..2a1b8afd2099 100644 --- a/frontend/docs/index.md +++ b/frontend/docs/index.md @@ -1,25 +1,29 @@ --- title: Introduction sidebar_label: Introduction -description: Documentations for open.mp and SA-MP modifications -sidebar_position: 1 +description: "Documentation for open.mp and SA-MP: running a server, scripting in Pawn and playing." +sidebar_position: 0 +tags: ["getting started"] --- -# SA-MP Wiki and open.mp Documentation +import DocsIntroCards, { DocsIntroTools } from "@site/src/components/DocsIntro"; -Welcome to the SA-MP/open.mp wiki, maintained by the open.mp team and wider SA-MP community! +# open.mp documentation -This site aims to provide an easily accessible, easy to contribute to documentation source for SA-MP and open.mp. +Everything for running a server, scripting in Pawn and playing on open.mp, including the full SA-MP wiki. Press Ctrl + K to search every page, or check the [FAQ](/docs/faq) for quick answers. -## The SA-MP wiki is gone +:::tip[Coming from SA-MP?] -Unfortunately, the SA-MP wiki was taken offline in late september of 2020 and then restored as uneditable archive. +open.mp is backwards compatible with SA-MP, so your gamemode, filterscripts and players' clients keep working. The [installation guide](/docs/server/Installation) shows how to move a server over, and [open.mp functions](/docs/server/omp-functions) lists what's new. -~Alas, we need the community's help to transfer the old wiki's content to its new home, here!~ -Big thanks to the community! The old wiki's contents have been migrated here. +::: -If you're interested, check out [this page](/docs/meta/Contributing) for more information. + -If you're not experienced with using GitHub, don't worry! You can help by just letting us know about issues (via [Discord](https://discord.gg/samp), [forum](https://forum.open.mp) or social media) and the most important thing: _spreading the word!_ So be sure to bookmark this site and share it with anyone you know who's wondering where the SA-MP Wiki went. +## Tools -We welcome contributions for improvements to documentation as well as tutorials and guides for common tasks such as building simple gamemodes and using common libraries and plugins. If you're interested in contributing then head over to the [GitHub page](https://github.com/openmultiplayer/web). + + +## Help improve these docs + +These docs started as the SA-MP wiki, which went offline in 2020, and every page can be edited. See [Contributing](/docs/meta/Contributing), or use **Edit on GitHub** on any page. You can also report mistakes on [Discord](https://discord.gg/samp) or the [forum](https://forum.open.mp). diff --git a/frontend/docs/meta/Contributing.md b/frontend/docs/meta/Contributing.md index b1f3e12d99a0..ed4aefb14f68 100644 --- a/frontend/docs/meta/Contributing.md +++ b/frontend/docs/meta/Contributing.md @@ -1,165 +1,197 @@ --- title: Contributing sidebar_label: Contributing -description: How to contribute to the SA-MP Wiki and open.mp documentation. +description: How to fix, add and translate pages in the open.mp documentation. +tags: ["contributing", "documentation"] --- -This documentation source is open for anyone to contribute changes to! All you need is a [GitHub](https://github.com) account and some spare time. You don't even need to know Git, you can do it all from the web interface! +Anyone can improve these docs. All you need is a [GitHub](https://github.com) account: small fixes can be made entirely in the browser, without knowing Git. -If you want to help maintain a specific language, open a PR against the [`CODEOWNERS`](https://github.com/openmultiplayer/web/blob/master/CODEOWNERS) file and add a line for your language directory with your username. +Not into GitHub? Reporting a mistake on [Discord](https://discord.gg/samp) or the [forum](https://forum.open.mp) helps just as much. -## Editing Content +## Fixing a page -On the bottom of each page, there's a button that takes you to the GitHub page for editing: +Every page has an **Edit on GitHub** link: in the right-hand column on desktop, and under the page content on phones. It opens the page's file in GitHub's editor (you'll need to be signed in). -![Edit this page link present on each wiki page](https://assets.open.mp/assets/images/contributing/edit-this-page.png) +For example, on [SetVehicleAngularVelocity](../scripting/functions/SetVehicleAngularVelocity) it opens [this file](https://github.com/openmultiplayer/web/edit/master/frontend/docs/scripting/functions/SetVehicleAngularVelocity.md). -For example, clicking this on [SetVehicleAngularVelocity](../scripting/functions/SetVehicleAngularVelocity) takes you to [this page](https://github.com/openmultiplayer/web/edit/master/frontend/docs/scripting/functions/SetVehicleAngularVelocity.md) which presents you with a text editor to make changes to the file (assuming you're logged in to GitHub). +Make your change and propose it as a **pull request**. Maintainers and other community members review it, may suggest changes, and then merge it. -Make your edit and submit a "Pull Request" this means the Wiki maintainers and other community members can review your change, discuss whether it needs additional changes and then merge it. +## Adding a page -## Adding New Content +### In the browser -Adding new content is a little more involved. You can do it two ways: +Open the folder the page belongs in on [GitHub](https://github.com/openmultiplayer/web/tree/master/frontend/docs), then use **Add file → Create new file** (or **Upload files** for a file you've already written). -### GitHub Interface +The file must end in `.md` and be written in Markdown ([guide](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)). Then choose **Propose new file** to open a pull request. -When browsing a directory on GitHub, there's an Add file button on the top right corner of the file list: +### On your computer -![Add file button](https://assets.open.mp/assets/images/contributing/add-new-file.png) +Clone the repository and start the site locally: -You can either upload a Markdown file you've written already or write it directly into the GitHub text editor. +```sh +git clone https://github.com/openmultiplayer/web.git +cd web/frontend +npm install +npm start +``` -The file _must_ have a `.md` extension and contain Markdown. For more information about Markdown, check out [this guide](https://guides.github.com/features/mastering-markdown/). +The site runs at `http://localhost:3000` and reloads as you save. -Once that's done, hit "Propose new file" and a Pull Request will be opened for review. +Any editor works. [Visual Studio Code](https://code.visualstudio.com) with the [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) extension catches most Markdown mistakes, and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) keeps formatting consistent. -### Git +#### Previewing a translation -If you want to use Git, all you need to do is clone the Wiki repository with: +The local site shows one language at a time, English by default. To check a translation, stop it (Ctrl + C) and start it in that language, from the same `frontend` folder: ```sh -git clone https://github.com/openmultiplayer/web.git +npm start -- --locale pt-BR ``` -Open it in your favourite editor. I recommend Visual Studio Code as it has some great tooling for editing and formatting Markdown files. As you can see, I'm writing this using Visual Studio Code! +It then runs at `http://localhost:3000/pt-BR/`. Use the language's folder name from `frontend/i18n/` (`pt-BR`, `de`, `zh-CN`...). The `--` passes the option on to the site; without it, npm keeps it for itself. -![Visual Studio Code markdown preview](https://assets.open.mp/assets/images/contributing/vscode.png) +While previewing, the language menu won't switch languages: other languages show "Page not found" until you restart in them. Run `npm start` again to go back to English. -I recommend two extensions to make your experience better: +## Translating -- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) by David Anson - this is an extension that makes sure your Markdown is formatted correctly. It prevents some syntactical and semantic mistakes. Not all the warnings are important, but some can help improve readability. Use best judgement and if in doubt, just ask a reviewer! -- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) by the Prettier.js Team - this is a formatter that will automatically format your Markdown files so they all use a consistent style. The Wiki repository has some settings in its `package.json` that the extension should automatically use. Be sure to enable "Format On Save" in your editor settings so your Markdown files will be automatically formatted every time you save! +Each language has its own copy of the docs in `frontend/i18n//docusaurus-plugin-content-docs/current/`, with the same folders and file names as the English `frontend/docs/`. To translate a page, add or edit the file at the same path there. Pages without a translation show the English version. -## Notes, Tips and Conventions +Interface text (buttons, labels, the homepage) lives in `frontend/i18n//code.json`; the [repository README](https://github.com/openmultiplayer/web/blob/master/frontend/README.md#ui-translations-codejson) explains how to update it. -### Internal Links +To help maintain a language, open a pull request adding your GitHub username to its line in [`CODEOWNERS`](https://github.com/openmultiplayer/web/blob/master/CODEOWNERS), so you're asked to review changes to it. -Don't use absolute URLs for inter-site links. Use relative paths. +## Conventions -- ❌ +To see everything a page can use (admonitions, code blocks, tables and more) rendered next to its Markdown, see [Formatting examples](Examples). - ```md - To be used with [OnPlayerClickPlayer](https://www.open.mp/docs/scripting/callbacks/OnPlayerClickPlayer) - ``` +### Front matter -- ✔ +Every page starts with front matter: - ```md - To be used with [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer) - ``` +```md +--- +title: SetPlayerPos +sidebar_label: SetPlayerPos +description: Set a player's position. +tags: ["player"] +--- +``` -`../` means "go up one directory" so if the file you're editing is inside the `functions` directory and you're linking to `callbacks` you use `../` to go up to `scripting/` then `callbacks/` to enter the callbacks directory, then the filename (without `.md`) of the callback you want to link. +- `title` and `description` are required. The description is what search engines and link previews show. +- `tags` matter for functions and callbacks: the **first tag decides which group** the page appears under in the sidebar (Player, Vehicles, NPCs, Strings, Server...). Use an existing tag; a page with an unknown first tag ends up under "Other". +- Wrap a value in quotes if it contains a colon, or the page won't build. -### Images +See the [Docusaurus documentation](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter) for everything else that can go there. -Images go inside a subdirectory inside `/static/images`. Then when you link an image in a `![]()` you just use `/images/` as the base path (no need for `static` that's just for the repository). +### New resource pages -If in doubt, read another page that uses images and copy how its done there. +Pages in `scripting/resources/` are grouped in the sidebar by a list in [`src/lib/resourceGroups.ts`](https://github.com/openmultiplayer/web/blob/master/frontend/src/lib/resourceGroups.ts). When you add one, add its file name to the right group there, or it appears under "Other". -### Metadata +### Headings -The first thing in _any_ document here should be metadata: +The page title is shown automatically from the front matter, so don't start with a `#` heading. Sections start at `##`: -```mdx ---- -title: My Documentation -sidebar_label: My Documentation -description: This is a page about stuff and things and burgers, yay! ---- +**Don't:** + +```md +# My Title + +This is documentation for ... + +# Sub-Section ``` -Every page should include a title and a description. +**Do:** -For a full list of what can go between the `---`, check out [the Docusaurus documentation](https://docusaurus.io/docs/markdown-features#markdown-headers). +```md +This is documentation for ... -### Headings +## Sub-Section +``` -Don't create a level 1 heading (`

`) with `#` as this is generated automatically. Your first heading should _always_ be `##` +### Internal links -- ❌ +Link to other pages with relative paths, not full URLs, so links keep working in every language and in local previews: - ```md - # My Title +**Don't:** - This is documentation for ... +```md +To be used with [OnPlayerClickPlayer](https://www.open.mp/docs/scripting/callbacks/OnPlayerClickPlayer) +``` - # Sub-Section - ``` +**Do:** -- ✔ +```md +To be used with [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer) +``` + +`../` goes up one folder: from a page in `functions/`, `../callbacks/` reaches the callbacks folder. Leave off the `.md`. + +### Code + +Mark code blocks as `pawn` (` ```pawn `) to get Pawn highlighting: tags like `Float:`, `format()` placeholders and `{FFFFFF}` colours included. Existing pages use `c`, which is highlighted the same way. Use `cpp` for C/C++ plugin code. + +In sentences, put function names, values and anything else that isn't plain language in \`backticks\`: + +**Don't:** + +> The fopen function returns a value with a tag of File:, and on the next line 4 is added to it. + +**Do:** - ```md - This is documentation for ... +> The `fopen` function returns a value with a tag of `File:`, and on the next line `4` is added to it. - ## Sub-Section - ``` +### Notes and warnings -### Use `Code` Snippets For Technical References +Use admonitions for things readers must not miss: -When writing a paragraph that contains function names, numbers, expressions or anything that's not standard written language, surround them with \`backticks\` like that. This makes it easier to separate language for describing things from references to technical elements such as function names and pieces of code. +```md +:::warning -- ❌ +This function was removed in open.mp. Use [SetPlayerPos](../functions/SetPlayerPos) instead. - > The fopen function will return a value with a tag of type File:, there is no problem on that line as the return value is being stored to a variable also with a tag of File: (note the cases are the same too). However on the next line the value 4 is added to the file handle. 4 has no tag [...] +::: +``` + +Available kinds: `note`, `info`, `tip`, `warning` and `danger`. Keep them short and use them sparingly, or they stop standing out. -- ✔ +### Version notes - > The `fopen` function will return a value with a tag of type `File:`, there is no problem on that line as the return value is being stored to a variable also with a tag of `File:` (note the cases are the same too). However on the next line the value `4` is added to the file handle. `4` has no tag +Functions that only exist from a certain version start with a version banner: -In the above example, `fopen` is a function name, not an English word, so surrounding it with `code` snippet markers helps distinguish it from other content. +```md + +``` -Also, if the paragraph is referring to a block of example code, this helps the reader associate the words with the example. +Use the version the function was added in, for example `omp v1.1.0.2612` or `SA-MP 0.3.7`. ### Tables -If a table has headings, they go in the top part: +Put column names in the header row, not in the first row of data: + +**Don't:** -- ❌ +```md +| | | +| ------- | --------------- | +| Health | Engine Status | +| 650 | Undamaged | +| 650-550 | White Smoke | +``` + +**Do:** - ```md - | | | - | ------- | ------------------------------------ | - | Health | Engine Status | - | 650 | Undamaged | - | 650-550 | White Smoke | - | 550-390 | Grey Smoke | - | 390-250 | Black Smoke | - | < 250 | On fire (will explode seconds later) | - ``` +```md +| Health | Engine Status | +| ------- | --------------- | +| 650 | Undamaged | +| 650-550 | White Smoke | +``` -- ✔ +### Images - ```md - | Health | Engine Status | - | ------- | ------------------------------------ | - | 650 | Undamaged | - | 650-550 | White Smoke | - | 550-390 | Grey Smoke | - | 390-250 | Black Smoke | - | < 250 | On fire (will explode seconds later) | - ``` +Put images in a folder under `frontend/public/images/` and link them from `/images/`, for example `![Description](/images/your-folder/picture.png)`. When in doubt, copy how an existing page with images does it. -## License Agreement +## License agreement -All open.mp projects have a [Contributor License Agreement](https://cla-assistant.io/openmultiplayer/homepage). This basically just means you agree to let us use your work, and put it under an open-source license. When you open a Pull Request for the first time, the CLA-Assistant bot will post a link where you can sign the agreement. +All open.mp projects have a [Contributor License Agreement](https://cla-assistant.io/openmultiplayer/homepage): you agree to let us use your work and publish it under an open-source license. On your first pull request, the CLA Assistant bot posts a link to sign it. diff --git a/frontend/docs/meta/Examples.md b/frontend/docs/meta/Examples.md new file mode 100644 index 000000000000..f163a72253e7 --- /dev/null +++ b/frontend/docs/meta/Examples.md @@ -0,0 +1,299 @@ +--- +title: Formatting examples +sidebar_label: Formatting examples +description: Everything you can use when writing a docs page, each shown rendered with the Markdown that makes it. +tags: ["contributing", "documentation"] +--- + +Everything you can use on a docs page, each shown as it looks and with the Markdown that makes it. Copy what you need. For the writing conventions (front matter, headings, links), see [Contributing](Contributing). + +## Admonitions + +Boxes for things readers must not miss. Keep them short and use them sparingly, or they stop standing out. + +:::note + +A side remark: useful, but fine to skip. + +::: + +:::info + +Background that helps make sense of the page. + +::: + +:::tip + +A better way to do something, or a shortcut. + +::: + +:::warning + +Something that can break a script or surprise the reader. + +::: + +:::danger + +Something that can crash the server or lose data. + +::: + +```md +:::note + +A side remark: useful, but fine to skip. + +::: +``` + +Swap `note` for `info`, `tip`, `warning` or `danger`. Leave a blank line after the opening `:::` and before the closing one, or the content may not render as Markdown. + +### With a title + +:::tip[Coming from SA-MP?] + +Put the title in square brackets straight after the kind. + +::: + +```md +:::tip[Coming from SA-MP?] + +Put the title in square brackets straight after the kind. + +::: +``` + +### With lists and code + +:::warning + +- Skin **74** doesn't exist. +- Skins **300 to 311** don't work on older clients. + +```pawn +SetPlayerSkin(playerid, 0); +``` + +::: + +````md +:::warning + +- Skin **74** doesn't exist. +- Skins **300 to 311** don't work on older clients. + +```pawn +SetPlayerSkin(playerid, 0); +``` + +::: +```` + +## Version banners + +Pages for functions and callbacks that only exist from a certain version start with a banner. Use the version it was added in. + + + +```md + +``` + +For a callback, say so, and the banner reads "callback" instead of "function": + + + +```md + +``` + +NPC callbacks get their own note: + + + +```md + +``` + +## Code + +### Code blocks + +Mark Pawn code as `pawn`: + +```pawn +public OnPlayerConnect(playerid) +{ + new name[MAX_PLAYER_NAME]; + GetPlayerName(playerid, name, sizeof(name)); + + new string[64]; + format(string, sizeof(string), "Welcome, {FFFF00}%s{FFFFFF}!", name); + SendClientMessage(playerid, -1, string); + return 1; +} +``` + +````md +```pawn +public OnPlayerConnect(playerid) +{ + ... +} +``` +```` + +Other languages work the same way: `json` for config files, `bash` for terminal commands, `cpp` for C/C++ plugin code. + +```json +"pawn": { + "main_scripts": ["gungame 1"] +} +``` + +```bash +./omp-server --dump-config +``` + +### With a title + +```pawn title="gamemodes/mygamemode.pwn" +#include + +main() {} +``` + +````md +```pawn title="gamemodes/mygamemode.pwn" +#include +``` +```` + +### Highlighting lines + +Point out the lines that matter, by number in the opening line or with a comment in the code: + +```pawn {3} +public OnPlayerSpawn(playerid) +{ + SetPlayerPos(playerid, 1958.33, 1343.12, 15.36); + return 1; +} +``` + +```pawn +public OnPlayerSpawn(playerid) +{ + // highlight-next-line + GivePlayerWeapon(playerid, WEAPON_DEAGLE, 50); + return 1; +} +``` + +````md +```pawn {3} +... +``` + +```pawn +// highlight-next-line +GivePlayerWeapon(playerid, WEAPON_DEAGLE, 50); +``` +```` + +Use `// highlight-start` and `// highlight-end` around several lines. + +### Inline code + +Put function names, values and file names in backticks: `SetPlayerPos`, `Float:`, `config.json`. + +```md +Put function names, values and file names in backticks: `SetPlayerPos`, `Float:`, `config.json`. +``` + +## Tables + +| Health | Engine status | +| ------- | ------------- | +| 650 | Undamaged | +| 650-550 | White smoke | +| 550-390 | Grey smoke | + +```md +| Health | Engine status | +| ------- | ------------- | +| 650 | Undamaged | +| 650-550 | White smoke | +| 550-390 | Grey smoke | +``` + +## Text + +**Bold** for words that must stand out, _italics_ for emphasis, and [links](Contributing) to other pages. Keys look like Ctrl + K. + +```md +**Bold** for words that must stand out, _italics_ for emphasis, and [links](Contributing) to other pages. Keys look like Ctrl + K. +``` + +- Lists with a dash +- One item per line + +1. Numbered steps +2. In the order to follow them + +```md +- Lists with a dash +- One item per line + +1. Numbered steps +2. In the order to follow them +``` + +> A quote, for text taken from somewhere else. + +```md +> A quote, for text taken from somewhere else. +``` + +## Collapsible sections + +For long content most readers can skip, such as a full example script: + +
+Show the full script + +```pawn +#include + +main() +{ + print("Hello, world!"); +} +``` + +
+ +````md +
+Show the full script + +```pawn +... +``` + +
+```` + +## Images + +![The body parts reference image](https://assets.open.mp/assets/images/bodyParts/Body_parts.jpg) + +```md +![The body parts reference image](https://assets.open.mp/assets/images/bodyParts/Body_parts.jpg) +``` + +Put your own images in a folder under `frontend/public/images/` and link them as `/images/your-folder/picture.png`. Always describe the image in the square brackets. diff --git a/frontend/docs/scripting/callbacks/OnActorStreamIn.md b/frontend/docs/scripting/callbacks/OnActorStreamIn.md index f8358a29b493..2a92dd31171c 100644 --- a/frontend/docs/scripting/callbacks/OnActorStreamIn.md +++ b/frontend/docs/scripting/callbacks/OnActorStreamIn.md @@ -22,7 +22,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnActorStreamIn(actorid, forplayerid) { new string[48]; @@ -32,7 +32,7 @@ public OnActorStreamIn(actorid, forplayerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnActorStreamOut.md b/frontend/docs/scripting/callbacks/OnActorStreamOut.md index 5057311fc248..9721a711da98 100644 --- a/frontend/docs/scripting/callbacks/OnActorStreamOut.md +++ b/frontend/docs/scripting/callbacks/OnActorStreamOut.md @@ -22,7 +22,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnActorStreamOut(actorid, forplayerid) { new string[48]; @@ -32,7 +32,7 @@ public OnActorStreamOut(actorid, forplayerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnClientCheckResponse.md b/frontend/docs/scripting/callbacks/OnClientCheckResponse.md index d8f620edb997..111806c1c6fc 100644 --- a/frontend/docs/scripting/callbacks/OnClientCheckResponse.md +++ b/frontend/docs/scripting/callbacks/OnClientCheckResponse.md @@ -2,7 +2,7 @@ title: OnClientCheckResponse sidebar_label: OnClientCheckResponse description: This callback is called when a SendClientCheck request completes -tags: [] +tags: ["player", "anti-cheat"] --- ## Description @@ -22,7 +22,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { SendClientCheck(playerid, 0x48, 0, 0, 2); @@ -39,7 +39,7 @@ public OnClientCheckResponse(playerid, actionid, memaddr, retndata) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnClientMessage.md b/frontend/docs/scripting/callbacks/OnClientMessage.md index 151b5539d498..4fade53d0dfb 100644 --- a/frontend/docs/scripting/callbacks/OnClientMessage.md +++ b/frontend/docs/scripting/callbacks/OnClientMessage.md @@ -2,7 +2,7 @@ title: OnClientMessage sidebar_label: OnClientMessage description: This callback gets called whenever the NPC sees a ClientMessage. -tags: [] +tags: ["npc", "chat"] --- :::warning @@ -26,7 +26,7 @@ This callback does not handle returns. ## Examples -```c +```pawn public OnClientMessage(color, text[]) { if (strfind(text, "Bank Balance: $0") != -1) diff --git a/frontend/docs/scripting/callbacks/OnDialogResponse.md b/frontend/docs/scripting/callbacks/OnDialogResponse.md index 0d7a2c540060..541595cf1527 100644 --- a/frontend/docs/scripting/callbacks/OnDialogResponse.md +++ b/frontend/docs/scripting/callbacks/OnDialogResponse.md @@ -25,7 +25,7 @@ This callback is always called first in filterscripts. Returning 1 blocks other **DIALOG_STYLE_MSGBOX** -```c +```pawn // Define the dialog ID for handling responses #define DIALOG_RULES 1 @@ -53,7 +53,7 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) **DIALOG_STYLE_INPUT** -```c +```pawn #define DIALOG_LOGIN 2 // In some command @@ -90,7 +90,7 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) **DIALOG_STYLE_LIST** -```c +```pawn #define DIALOG_WEAPONS 3 // In some command @@ -128,7 +128,7 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) **DIALOG_STYLE_TABLIST_HEADERS** -```c +```pawn #define DIALOG_WEAPONS 3 // In some command @@ -169,7 +169,7 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnEnterExitModShop.md b/frontend/docs/scripting/callbacks/OnEnterExitModShop.md index 0b43bab092e9..9aaf51e5f2f9 100644 --- a/frontend/docs/scripting/callbacks/OnEnterExitModShop.md +++ b/frontend/docs/scripting/callbacks/OnEnterExitModShop.md @@ -21,7 +21,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnEnterExitModShop(playerid, enterexit, interiorid) { if (enterexit == 0) // If enterexit is 0, this means they are exiting @@ -33,7 +33,7 @@ public OnEnterExitModShop(playerid, enterexit, interiorid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnFilterScriptExit.md b/frontend/docs/scripting/callbacks/OnFilterScriptExit.md index 59248cf1747b..5b2a542468a4 100644 --- a/frontend/docs/scripting/callbacks/OnFilterScriptExit.md +++ b/frontend/docs/scripting/callbacks/OnFilterScriptExit.md @@ -2,7 +2,7 @@ title: OnFilterScriptExit sidebar_label: OnFilterScriptExit description: This callback is called when a filterscript is unloaded. -tags: [] +tags: ["filterscript"] --- ## Description @@ -11,7 +11,7 @@ This callback is called when a filterscript is unloaded. It is only called insid ## Examples -```c +```pawn public OnFilterScriptExit() { print("\n--------------------------------------"); diff --git a/frontend/docs/scripting/callbacks/OnFilterScriptInit.md b/frontend/docs/scripting/callbacks/OnFilterScriptInit.md index efa89113e325..6ba54584f374 100644 --- a/frontend/docs/scripting/callbacks/OnFilterScriptInit.md +++ b/frontend/docs/scripting/callbacks/OnFilterScriptInit.md @@ -2,7 +2,7 @@ title: OnFilterScriptInit sidebar_label: OnFilterScriptInit description: This callback is called when a filterscript is initialized (loaded). -tags: [] +tags: ["filterscript"] --- ## Description @@ -11,7 +11,7 @@ This callback is called when a filterscript is **init**ialized (loaded). It is o ## Examples -```c +```pawn public OnFilterScriptInit() { print("\n--------------------------------------"); diff --git a/frontend/docs/scripting/callbacks/OnGameModeExit.md b/frontend/docs/scripting/callbacks/OnGameModeExit.md index 4caa723a93a4..3332eb6720be 100644 --- a/frontend/docs/scripting/callbacks/OnGameModeExit.md +++ b/frontend/docs/scripting/callbacks/OnGameModeExit.md @@ -2,7 +2,7 @@ title: OnGameModeExit sidebar_label: OnGameModeExit description: This callback is called when a gamemode ends, either through 'gmx', the server being shut down, or GameModeExit. -tags: [] +tags: ["gamemode"] --- ## Description @@ -17,7 +17,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnGameModeExit() { print("Gamemode ended."); @@ -25,7 +25,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/callbacks/OnGameModeInit.md b/frontend/docs/scripting/callbacks/OnGameModeInit.md index 32639e41e641..23c8b836913f 100644 --- a/frontend/docs/scripting/callbacks/OnGameModeInit.md +++ b/frontend/docs/scripting/callbacks/OnGameModeInit.md @@ -2,7 +2,7 @@ title: OnGameModeInit sidebar_label: OnGameModeInit description: This callback is triggered when the gamemode starts. -tags: [] +tags: ["gamemode"] --- ## Description @@ -17,7 +17,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnGameModeInit() { print("Gamemode started!"); @@ -25,7 +25,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/callbacks/OnIncomingConnection.md b/frontend/docs/scripting/callbacks/OnIncomingConnection.md index 62fa3f2f5862..feb1785c6906 100644 --- a/frontend/docs/scripting/callbacks/OnIncomingConnection.md +++ b/frontend/docs/scripting/callbacks/OnIncomingConnection.md @@ -2,7 +2,7 @@ title: OnIncomingConnection sidebar_label: OnIncomingConnection description: This callback is called when an IP address attempts a connection to the server. -tags: [] +tags: ["player", "network monitoring", "ip address"] --- ## Description @@ -25,7 +25,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnIncomingConnection(playerid, ip_address[], port) { printf("Incoming connection for player ID %i [IP/port: %s:%i]", playerid, ip_address, port); diff --git a/frontend/docs/scripting/callbacks/OnNPCChangeNode.md b/frontend/docs/scripting/callbacks/OnNPCChangeNode.md index a858ce73e486..68736b500fc8 100644 --- a/frontend/docs/scripting/callbacks/OnNPCChangeNode.md +++ b/frontend/docs/scripting/callbacks/OnNPCChangeNode.md @@ -23,7 +23,7 @@ Return `true` to allow the node change, or `false` to deny it. ## Examples -```c +```pawn public OnNPCChangeNode(npcid, newnodeid, oldnodeid) { printf("[NPC] NPC %d changed from node %d to node %d", npcid, oldnodeid, newnodeid); @@ -43,7 +43,7 @@ public OnNPCChangeNode(npcid, newnodeid, oldnodeid) } ``` -## Notes +## Good to know - This callback is only called when NPCs are using node-based navigation via `NPC_PlayNode` - Returning `false` will prevent the NPC from changing nodes and may cause it to stop navigation diff --git a/frontend/docs/scripting/callbacks/OnNPCCreate.md b/frontend/docs/scripting/callbacks/OnNPCCreate.md index 23818b7d2107..b8e689779ba7 100644 --- a/frontend/docs/scripting/callbacks/OnNPCCreate.md +++ b/frontend/docs/scripting/callbacks/OnNPCCreate.md @@ -17,7 +17,7 @@ This callback is called when an NPC is successfully created and added to the ser ## Examples -```c +```pawn public OnNPCCreate(npcid) { printf("[NPC] NPC %d has been created", npcid); @@ -34,7 +34,7 @@ public OnNPCCreate(npcid) } ``` -## Notes +## Good to know - This callback is called immediately after the NPC is created but before it's spawned - The NPC will need to be spawned using `NPC_Spawn` to become visible in the game world diff --git a/frontend/docs/scripting/callbacks/OnNPCDeath.md b/frontend/docs/scripting/callbacks/OnNPCDeath.md index 902ad809ebfe..9de022904d55 100644 --- a/frontend/docs/scripting/callbacks/OnNPCDeath.md +++ b/frontend/docs/scripting/callbacks/OnNPCDeath.md @@ -19,7 +19,7 @@ This callback is called when an NPC dies. ## Examples -```c +```pawn public OnNPCDeath(npcid, killerid, WEAPON:reason) { printf("[NPC] NPC %d died (killer: %d, weapon: %d)", npcid, killerid, _:reason); @@ -46,7 +46,7 @@ public OnNPCDeath(npcid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know - The `killerid` parameter will be `INVALID_PLAYER_ID` if the NPC death was not player inflicted - The `reason` parameter contains the weapon ID that caused the death (255 for unknown/other causes) diff --git a/frontend/docs/scripting/callbacks/OnNPCDestroy.md b/frontend/docs/scripting/callbacks/OnNPCDestroy.md index 531e3ff4d1c4..0c2bbd08f924 100644 --- a/frontend/docs/scripting/callbacks/OnNPCDestroy.md +++ b/frontend/docs/scripting/callbacks/OnNPCDestroy.md @@ -17,7 +17,7 @@ This callback is called when an NPC is destroyed and removed from the server. ## Examples -```c +```pawn public OnNPCDestroy(npcid) { printf("[NPC] NPC %d has been destroyed", npcid); @@ -43,7 +43,7 @@ public OnNPCDestroy(npcid) ``` -## Notes +## Good to know - This callback is called immediately before the NPC is removed from the server - The NPC will be disconnected and its player slot freed after this callback diff --git a/frontend/docs/scripting/callbacks/OnNPCFinishMove.md b/frontend/docs/scripting/callbacks/OnNPCFinishMove.md index beeb2c039d0d..94c3686f553c 100644 --- a/frontend/docs/scripting/callbacks/OnNPCFinishMove.md +++ b/frontend/docs/scripting/callbacks/OnNPCFinishMove.md @@ -17,7 +17,7 @@ This callback is called when an NPC finishes moving to its target destination. ## Examples -```c +```pawn public OnNPCFinishMove(npcid) { // Find all players tracking this NPC @@ -37,7 +37,7 @@ public OnNPCFinishMove(npcid) } ``` -## Notes +## Good to know - This callback is called for all types of NPC movement (walk, run, sprint, drive) - It is called when the NPC reaches the target position set by movement functions diff --git a/frontend/docs/scripting/callbacks/OnNPCFinishMovePath.md b/frontend/docs/scripting/callbacks/OnNPCFinishMovePath.md index 004fa8d6c77f..a6069deb40c0 100644 --- a/frontend/docs/scripting/callbacks/OnNPCFinishMovePath.md +++ b/frontend/docs/scripting/callbacks/OnNPCFinishMovePath.md @@ -18,7 +18,7 @@ This callback is called when an NPC finishes moving along a predefined path. ## Examples -```c +```pawn public OnNPCFinishMovePath(npcid, pathid) { // Find all players tracking this NPC @@ -37,7 +37,7 @@ public OnNPCFinishMovePath(npcid, pathid) ``` -## Notes +## Good to know - This callback is triggered when an NPC reaches the final point of a path - The NPC stops moving automatically when this callback is called diff --git a/frontend/docs/scripting/callbacks/OnNPCFinishMovePathPoint.md b/frontend/docs/scripting/callbacks/OnNPCFinishMovePathPoint.md index 1798ace6db84..a633800ac19a 100644 --- a/frontend/docs/scripting/callbacks/OnNPCFinishMovePathPoint.md +++ b/frontend/docs/scripting/callbacks/OnNPCFinishMovePathPoint.md @@ -19,7 +19,7 @@ This callback is called when an NPC finishes moving to a specific point in a pat ## Examples -```c +```pawn public OnNPCFinishMovePathPoint(npcid, pathid, pointid) { // Find all players tracking this NPC @@ -38,7 +38,7 @@ public OnNPCFinishMovePathPoint(npcid, pathid, pointid) ``` -## Notes +## Good to know - This callback is triggered for each point in the path - Use [OnNPCFinishMovePath](OnNPCFinishMovePath) to detect when the entire path is completed diff --git a/frontend/docs/scripting/callbacks/OnNPCFinishNode.md b/frontend/docs/scripting/callbacks/OnNPCFinishNode.md index c0a2045eba02..8730dd4be8a3 100644 --- a/frontend/docs/scripting/callbacks/OnNPCFinishNode.md +++ b/frontend/docs/scripting/callbacks/OnNPCFinishNode.md @@ -18,7 +18,7 @@ This callback is called when an NPC finishes navigating a complete node during n ## Examples -```c +```pawn public OnNPCFinishNode(npcid, nodeid) { printf("[NPC] NPC %d finished node %d", npcid, nodeid); @@ -38,7 +38,7 @@ public OnNPCFinishNode(npcid, nodeid) } ``` -## Notes +## Good to know - This callback is only called when NPCs are using node-based navigation via `NPC_PlayNode` - It's called when the NPC has completed navigation through all points in the node diff --git a/frontend/docs/scripting/callbacks/OnNPCFinishNodePoint.md b/frontend/docs/scripting/callbacks/OnNPCFinishNodePoint.md index 8e216ef62fca..6cfd0eb4980e 100644 --- a/frontend/docs/scripting/callbacks/OnNPCFinishNodePoint.md +++ b/frontend/docs/scripting/callbacks/OnNPCFinishNodePoint.md @@ -19,7 +19,7 @@ This callback is called when an NPC reaches a specific point during node-based n ## Examples -```c +```pawn public OnNPCFinishNodePoint(npcid, nodeid, pointid) { // Notify players tracking this NPC @@ -37,7 +37,7 @@ public OnNPCFinishNodePoint(npcid, nodeid, pointid) } ``` -## Notes +## Good to know - This callback is only called when NPCs are using node-based navigation via `NPC_PlayNode` - It's called each time the NPC reaches a waypoint within the node diff --git a/frontend/docs/scripting/callbacks/OnNPCGiveDamage.md b/frontend/docs/scripting/callbacks/OnNPCGiveDamage.md index 5468dd45d183..6a867d0127e6 100644 --- a/frontend/docs/scripting/callbacks/OnNPCGiveDamage.md +++ b/frontend/docs/scripting/callbacks/OnNPCGiveDamage.md @@ -29,7 +29,7 @@ It is always called first in filterscripts so returning 1 there blocks other fil ## Examples -```c +```pawn public OnNPCGiveDamage(npcid, damagedid, Float:amount, WEAPON:weaponid, bodypart) { // Only notify players tracking this NPC @@ -48,7 +48,7 @@ public OnNPCGiveDamage(npcid, damagedid, Float:amount, WEAPON:weaponid, bodypart } ``` -## Notes +## Good to know - This callback is called before the damage is actually applied to the player - Returning `false` will NOT prevent the damage from being applied diff --git a/frontend/docs/scripting/callbacks/OnNPCPlaybackEnd.md b/frontend/docs/scripting/callbacks/OnNPCPlaybackEnd.md index 7a9a318e8a95..879eccd52302 100644 --- a/frontend/docs/scripting/callbacks/OnNPCPlaybackEnd.md +++ b/frontend/docs/scripting/callbacks/OnNPCPlaybackEnd.md @@ -18,7 +18,7 @@ This callback is called when an NPC finishes playback of a recorded file. ## Examples -```c +```pawn public OnNPCPlaybackEnd(npcid, recordid) { printf("[NPC] NPC %d finished playback (record: %d)", npcid, recordid); @@ -39,7 +39,7 @@ public OnNPCPlaybackEnd(npcid, recordid) ``` -## Notes +## Good to know - This callback is called when the recording reaches its end naturally - It's also called when playback is stopped manually using `NPC_StopPlayback` diff --git a/frontend/docs/scripting/callbacks/OnNPCPlaybackStart.md b/frontend/docs/scripting/callbacks/OnNPCPlaybackStart.md index d86282eb71c1..7849adc73dcd 100644 --- a/frontend/docs/scripting/callbacks/OnNPCPlaybackStart.md +++ b/frontend/docs/scripting/callbacks/OnNPCPlaybackStart.md @@ -18,7 +18,7 @@ This callback is called when an NPC starts playback of a recorded file. ## Examples -```c +```pawn public OnNPCPlaybackStart(npcid, recordid) { printf("[NPC] NPC %d started playback (record: %d)", npcid, recordid); @@ -39,7 +39,7 @@ public OnNPCPlaybackStart(npcid, recordid) ``` -## Notes +## Good to know - This callback is called immediately when `NPC_StartPlayback` is successfully executed - The `recordid` corresponds to the loaded record file diff --git a/frontend/docs/scripting/callbacks/OnNPCRespawn.md b/frontend/docs/scripting/callbacks/OnNPCRespawn.md index 7a0f8cc55186..5d3e15a39b46 100644 --- a/frontend/docs/scripting/callbacks/OnNPCRespawn.md +++ b/frontend/docs/scripting/callbacks/OnNPCRespawn.md @@ -17,7 +17,7 @@ This callback is called when an NPC respawns. ## Examples -```c +```pawn public OnNPCRespawn(npcid) { printf("[NPC] NPC %d has respawned", npcid); @@ -37,7 +37,7 @@ public OnNPCRespawn(npcid) } ``` -## Notes +## Good to know - This callback is called after the NPC has been respawned using `NPC_Respawn` - The NPC's health and armor are automatically restored during respawn diff --git a/frontend/docs/scripting/callbacks/OnNPCSpawn.md b/frontend/docs/scripting/callbacks/OnNPCSpawn.md index 7a1b599b960e..fc118e49a548 100644 --- a/frontend/docs/scripting/callbacks/OnNPCSpawn.md +++ b/frontend/docs/scripting/callbacks/OnNPCSpawn.md @@ -15,7 +15,7 @@ This callback is called when an NPC spawns. ## Examples -```c +```pawn public OnNPCSpawn(npcid) { printf("[NPC] NPC %d has spawned", npcid); @@ -37,7 +37,7 @@ public OnNPCSpawn(npcid) } ``` -## Notes +## Good to know - This callback is called when `NPC_Spawn` is successfully executed - The NPC becomes visible and interactive in the game world diff --git a/frontend/docs/scripting/callbacks/OnNPCTakeDamage.md b/frontend/docs/scripting/callbacks/OnNPCTakeDamage.md index 8a07e4730da7..0220f3a0d8fe 100644 --- a/frontend/docs/scripting/callbacks/OnNPCTakeDamage.md +++ b/frontend/docs/scripting/callbacks/OnNPCTakeDamage.md @@ -29,7 +29,7 @@ It is always called first in filterscripts so returning 1 there blocks other fil ## Examples -```c +```pawn public OnNPCTakeDamage(npcid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { // Only notify players tracking this NPC @@ -56,7 +56,7 @@ public OnNPCTakeDamage(npcid, issuerid, Float:amount, WEAPON:weaponid, bodypart) } ``` -## Notes +## Good to know - This callback is called before the damage is actually applied to the NPC - Returning `false` will NOT prevent the damage from being applied diff --git a/frontend/docs/scripting/callbacks/OnNPCWeaponShot.md b/frontend/docs/scripting/callbacks/OnNPCWeaponShot.md index ff68f73766da..6481503bd89f 100644 --- a/frontend/docs/scripting/callbacks/OnNPCWeaponShot.md +++ b/frontend/docs/scripting/callbacks/OnNPCWeaponShot.md @@ -27,7 +27,7 @@ Return `false` to prevent the shot from being processed, or `true` to allow it. ## Examples -```c +```pawn public OnNPCWeaponShot(npcid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hitid, Float:fX, Float:fY, Float:fZ) { // Only notify players tracking this NPC @@ -54,7 +54,7 @@ public OnNPCWeaponShot(npcid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hitid, F } ``` -## Notes +## Good to know - This callback is called for each shot fired by the NPC - The `hittype` parameter indicates what was hit (none, player, vehicle, object, etc.) diff --git a/frontend/docs/scripting/callbacks/OnNPCWeaponStateChange.md b/frontend/docs/scripting/callbacks/OnNPCWeaponStateChange.md index 597a475e536f..53307cdd5c05 100644 --- a/frontend/docs/scripting/callbacks/OnNPCWeaponStateChange.md +++ b/frontend/docs/scripting/callbacks/OnNPCWeaponStateChange.md @@ -19,7 +19,7 @@ This callback is called when an NPC's weapon state changes (e.g., reloading, run ## Examples -```c +```pawn public OnNPCWeaponStateChange(npcid, newState, oldState) { static weaponStates[5][64] = { @@ -46,7 +46,7 @@ public OnNPCWeaponStateChange(npcid, newState, oldState) } ``` -## Notes +## Good to know - This callback is triggered automatically based on NPC's ammo count and weapon actions - Weapon states include: no bullets, reloading, more bullets, last bullet, unknown diff --git a/frontend/docs/scripting/callbacks/OnObjectMoved.md b/frontend/docs/scripting/callbacks/OnObjectMoved.md index 38b778eb9450..faa6fab8443e 100644 --- a/frontend/docs/scripting/callbacks/OnObjectMoved.md +++ b/frontend/docs/scripting/callbacks/OnObjectMoved.md @@ -19,7 +19,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnObjectMoved(objectid) { printf("Object %d finished moving.", objectid); @@ -27,7 +27,7 @@ public OnObjectMoved(objectid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPickupStreamIn.md b/frontend/docs/scripting/callbacks/OnPickupStreamIn.md index af017def514e..4340a02dafed 100644 --- a/frontend/docs/scripting/callbacks/OnPickupStreamIn.md +++ b/frontend/docs/scripting/callbacks/OnPickupStreamIn.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn new g_PickupHealth; public OnGameModeInit() diff --git a/frontend/docs/scripting/callbacks/OnPickupStreamOut.md b/frontend/docs/scripting/callbacks/OnPickupStreamOut.md index b88655bd5b06..aee1f48c0714 100644 --- a/frontend/docs/scripting/callbacks/OnPickupStreamOut.md +++ b/frontend/docs/scripting/callbacks/OnPickupStreamOut.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn new g_PickupHealth; public OnGameModeInit() diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickGangZone.md b/frontend/docs/scripting/callbacks/OnPlayerClickGangZone.md index 1e2f836c67c6..a53b507abd49 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickGangZone.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickGangZone.md @@ -24,7 +24,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerClickGangZone(playerid, zoneid) { new string[128]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickMap.md b/frontend/docs/scripting/callbacks/OnPlayerClickMap.md index 85650daa587c..0f84ead7c1cc 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickMap.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickMap.md @@ -26,7 +26,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) { SetPlayerPosFindZ(playerid, fX, fY, fZ); @@ -34,7 +34,7 @@ public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickPlayer.md b/frontend/docs/scripting/callbacks/OnPlayerClickPlayer.md index 08cc3139d8ef..becee2e3325a 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickPlayer.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickPlayer.md @@ -25,7 +25,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) { new string[32]; @@ -35,7 +35,7 @@ public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickPlayerGangZone.md b/frontend/docs/scripting/callbacks/OnPlayerClickPlayerGangZone.md index 86d0fb0fccc0..eae445a664cc 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickPlayerGangZone.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickPlayerGangZone.md @@ -24,7 +24,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerClickPlayerGangZone(playerid, zoneid) { new string[128]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md b/frontend/docs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md index 5d25800b915a..0a2234020921 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md @@ -22,7 +22,7 @@ It is always called first in filterscripts so returning 1 there also blocks othe ## Examples -```c +```pawn new PlayerText:gPlayerTextDraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -67,7 +67,7 @@ public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/docs/scripting/callbacks/OnPlayerClickTextDraw.md index 389fa061066c..2139fb50a4b1 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickTextDraw.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickTextDraw.md @@ -22,7 +22,7 @@ It is always called first in filterscripts so returning 1 there also blocks othe ## Examples -```c +```pawn new Text:gTextDraw; public OnGameModeInit() @@ -62,7 +62,7 @@ public OnPlayerClickTextDraw(playerid, Text:clickedid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnPlayerCommandText.md b/frontend/docs/scripting/callbacks/OnPlayerCommandText.md index 919db7311cf9..f9178958d8e2 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerCommandText.md +++ b/frontend/docs/scripting/callbacks/OnPlayerCommandText.md @@ -24,7 +24,7 @@ It is always called first in filterscripts so returning 1 there blocks other scr ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/help", true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerConnect.md b/frontend/docs/scripting/callbacks/OnPlayerConnect.md index 9fdccf8735fe..45a4c45fd26c 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerConnect.md +++ b/frontend/docs/scripting/callbacks/OnPlayerConnect.md @@ -23,7 +23,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { new @@ -37,7 +37,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerDeath.md b/frontend/docs/scripting/callbacks/OnPlayerDeath.md index 78097b507e4c..9e65c502242f 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/docs/scripting/callbacks/OnPlayerDeath.md @@ -25,7 +25,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn new PlayerDeaths[MAX_PLAYERS]; new PlayerKills[MAX_PLAYERS]; @@ -45,7 +45,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerDisconnect.md b/frontend/docs/scripting/callbacks/OnPlayerDisconnect.md index 8c2b72d98d03..f3842e332a73 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerDisconnect.md +++ b/frontend/docs/scripting/callbacks/OnPlayerDisconnect.md @@ -32,7 +32,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerDisconnect(playerid, reason) { new @@ -55,7 +55,7 @@ public OnPlayerDisconnect(playerid, reason) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerEditAttachedObject.md b/frontend/docs/scripting/callbacks/OnPlayerEditAttachedObject.md index ffbb0e9bfead..7b0a3795ff18 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerEditAttachedObject.md +++ b/frontend/docs/scripting/callbacks/OnPlayerEditAttachedObject.md @@ -36,7 +36,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn enum attached_object_data { Float:ao_x, @@ -81,7 +81,7 @@ public OnPlayerEditAttachedObject(playerid, EDIT_RESPONSE:response, index, model } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnPlayerEditObject.md b/frontend/docs/scripting/callbacks/OnPlayerEditObject.md index 87d23714d1b7..aff41e0558a7 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerEditObject.md +++ b/frontend/docs/scripting/callbacks/OnPlayerEditObject.md @@ -32,7 +32,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerEditObject(playerid, playerobject, objectid, EDIT_RESPONSE:response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ) { new @@ -83,7 +83,7 @@ public OnPlayerEditObject(playerid, playerobject, objectid, EDIT_RESPONSE:respon } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnPlayerEnterCheckpoint.md b/frontend/docs/scripting/callbacks/OnPlayerEnterCheckpoint.md index 38bd7ed5bc57..9a82e3145fbb 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerEnterCheckpoint.md +++ b/frontend/docs/scripting/callbacks/OnPlayerEnterCheckpoint.md @@ -19,7 +19,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn //In this example, a checkpoint is created for the player when spawning, //which creates a vehicle and disables the checkpoint. public OnPlayerSpawn(playerid) @@ -36,7 +36,7 @@ public OnPlayerEnterCheckpoint(playerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerEnterGangZone.md b/frontend/docs/scripting/callbacks/OnPlayerEnterGangZone.md index 5b8799f7d3ef..30efe08b23e4 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerEnterGangZone.md +++ b/frontend/docs/scripting/callbacks/OnPlayerEnterGangZone.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerEnterGangZone(playerid, zoneid) { new string[128]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerEnterPlayerGangZone.md b/frontend/docs/scripting/callbacks/OnPlayerEnterPlayerGangZone.md index 6adba13fd9d7..ee57cff62758 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerEnterPlayerGangZone.md +++ b/frontend/docs/scripting/callbacks/OnPlayerEnterPlayerGangZone.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerEnterPlayerGangZone(playerid, zoneid) { new string[128]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md b/frontend/docs/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md index 2ce622720b40..222ffb61c71a 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md +++ b/frontend/docs/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md @@ -19,7 +19,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerEnterRaceCheckpoint(playerid) { printf("Player %d entered a race checkpoint!", playerid); @@ -27,7 +27,7 @@ public OnPlayerEnterRaceCheckpoint(playerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerEnterVehicle.md b/frontend/docs/scripting/callbacks/OnPlayerEnterVehicle.md index f9dd0f206c22..36a64c52f387 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerEnterVehicle.md +++ b/frontend/docs/scripting/callbacks/OnPlayerEnterVehicle.md @@ -23,7 +23,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new string[128]; @@ -33,7 +33,7 @@ public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerExitVehicle.md b/frontend/docs/scripting/callbacks/OnPlayerExitVehicle.md index 889b130dba69..205091324a78 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerExitVehicle.md +++ b/frontend/docs/scripting/callbacks/OnPlayerExitVehicle.md @@ -20,7 +20,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerExitVehicle(playerid, vehicleid) { new string[64]; @@ -30,7 +30,7 @@ public OnPlayerExitVehicle(playerid, vehicleid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnPlayerExitedMenu.md b/frontend/docs/scripting/callbacks/OnPlayerExitedMenu.md index 3baec993f649..fdf52ba10d42 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerExitedMenu.md +++ b/frontend/docs/scripting/callbacks/OnPlayerExitedMenu.md @@ -19,7 +19,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerExitedMenu(playerid) { TogglePlayerControllable(playerid, true); // unfreeze the player when they exit a menu diff --git a/frontend/docs/scripting/callbacks/OnPlayerFinishedDownloading.md b/frontend/docs/scripting/callbacks/OnPlayerFinishedDownloading.md index 808591aa5308..bdb2a5b05099 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerFinishedDownloading.md +++ b/frontend/docs/scripting/callbacks/OnPlayerFinishedDownloading.md @@ -22,7 +22,7 @@ This callback does not handle returns. ## Examples -```c +```pawn public OnPlayerFinishedDownloading(playerid, virtualworld) { SendClientMessage(playerid, 0xFFFFFFFF, "Downloads finished."); @@ -30,7 +30,7 @@ public OnPlayerFinishedDownloading(playerid, virtualworld) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerGiveDamage.md b/frontend/docs/scripting/callbacks/OnPlayerGiveDamage.md index e3c8d90b87c9..608e6fd4fef5 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerGiveDamage.md +++ b/frontend/docs/scripting/callbacks/OnPlayerGiveDamage.md @@ -27,7 +27,7 @@ It is always called first in filterscripts so returning 1 there blocks other fil ## Examples -```c +```pawn public OnPlayerGiveDamage(playerid, damagedid, Float:amount, WEAPON:weaponid, bodypart) { new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME]; @@ -42,7 +42,7 @@ public OnPlayerGiveDamage(playerid, damagedid, Float:amount, WEAPON:weaponid, bo } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerGiveDamageActor.md b/frontend/docs/scripting/callbacks/OnPlayerGiveDamageActor.md index 6c45611461e5..fcbe46a8bc12 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerGiveDamageActor.md +++ b/frontend/docs/scripting/callbacks/OnPlayerGiveDamageActor.md @@ -29,7 +29,7 @@ It is always called first in filterscripts so returning 1 there blocks other fil ## Examples -```c +```pawn public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, WEAPON:weaponid, bodypart) { new string[128]; @@ -45,7 +45,7 @@ public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, WEAPON:w } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerInteriorChange.md b/frontend/docs/scripting/callbacks/OnPlayerInteriorChange.md index 9f5e1ad14d03..552644435850 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerInteriorChange.md +++ b/frontend/docs/scripting/callbacks/OnPlayerInteriorChange.md @@ -21,7 +21,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { new string[42]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerKeyStateChange.md b/frontend/docs/scripting/callbacks/OnPlayerKeyStateChange.md index a20c0e57909a..3e9eb755d6b6 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerKeyStateChange.md +++ b/frontend/docs/scripting/callbacks/OnPlayerKeyStateChange.md @@ -20,7 +20,7 @@ This callback is called when the state of any [supported](../resources/keys) key - This callback does not handle returns. - It is always called first in gamemode. -## Notes +## Good to know @@ -50,7 +50,7 @@ The parameters to this function are a list of all keys currently being held down Let's presume that you want to detect when a player presses their FIRE button, the obvious code would be: -```c +```pawn if (newkeys == KEY_FIRE) ``` @@ -60,7 +60,7 @@ This code may even work in your testing, but it is wrong and your testing is ins So, if the variable can contain multiple keys at once, how do you check for just a single one? The answer is bit masking. Each key has its own bit in the variable (some keys have the same bit, but they are onfoot/incar keys, so can never be pressed at the same time anyway) and you need to check for just that single bit: -```c +```pawn if (newkeys & KEY_FIRE) ``` @@ -72,7 +72,7 @@ Now if you test this code it will work whether you are crouching or standing whe This is where "oldkeys" comes in. To check if a key has just been pressed you need to first check whether it is set in "newkeys" - meaning it's held down, and then check that it's NOT in "oldkeys" - meaning it's only just been held down. The following code does this: -```c +```pawn if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE)) ``` @@ -82,7 +82,7 @@ That will ONLY be true when the FIRE key is first pressed, not when it's held an Exactly the same principle as above, but reversed: -```c +```pawn if ((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) ``` @@ -90,19 +90,19 @@ if ((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) If you want to check for players HOLDING crouch and fire then the following code will work fine: -```c +```pawn if ((newkeys & KEY_FIRE) && (newkeys & KEY_CROUCH)) ``` However if you want to detect when they FIRST press fire and crouch the following code WILL NOT work. It will work if they manage to press the two keys at exactly the same time, but if they're fractionally out (far less than half a second) it won't: -```c +```pawn if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE) && (newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH)) ``` Why not? Because OnPlayerKeyStateChange is called every time a single key changes. So they press "KEY_FIRE" - OnPlayerKeyStateChange is called with "KEY_FIRE" in "newkeys" and not in "oldkeys", then they press "KEY_CROUCH" - OnPlayerKeyStateChange is called with "KEY_CROUCH" and "KEY_FIRE" in "newkeys", but "KEY_FIRE" is now also in "oldkeys" as it's already been pressed, so "!(oldkeys & KEY_FIRE)" will fail. Fortunately the solution is very simple (in fact simpler than the original code): -```c +```pawn if ((newkeys & (KEY_FIRE | KEY_CROUCH)) == (KEY_FIRE | KEY_CROUCH) && (oldkeys & (KEY_FIRE | KEY_CROUCH)) != (KEY_FIRE | KEY_CROUCH)) ``` @@ -114,7 +114,7 @@ This may look complicated, but it checks that both keys are set in "newkeys" and The define: -```c +```pawn // HOLDING(keys) #define HOLDING(%0) \ ((newkeys & (%0)) == (%0)) @@ -122,13 +122,13 @@ The define: Holding one key: -```c +```pawn if (HOLDING( KEY_FIRE )) ``` Holding multiple keys: -```c +```pawn if (HOLDING( KEY_FIRE | KEY_CROUCH )) ``` @@ -136,7 +136,7 @@ if (HOLDING( KEY_FIRE | KEY_CROUCH )) The define: -```c +```pawn // PRESSED(keys) #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) @@ -144,13 +144,13 @@ The define: Pressed one key: -```c +```pawn if (PRESSED( KEY_FIRE )) ``` Pressed multiple keys: -```c +```pawn if (PRESSED( KEY_FIRE | KEY_CROUCH )) ``` @@ -158,7 +158,7 @@ if (PRESSED( KEY_FIRE | KEY_CROUCH )) The define: -```c +```pawn // PRESSING(keyVariable, keys) #define PRESSING(%0,%1) \ (%0 & (%1)) @@ -166,13 +166,13 @@ The define: Pressing one key: -```c +```pawn if (PRESSING( newkeys, KEY_FIRE )) ``` Pressing multiple keys: -```c +```pawn if (PRESSING( newkeys, KEY_FIRE | KEY_CROUCH )) ``` @@ -180,7 +180,7 @@ if (PRESSING( newkeys, KEY_FIRE | KEY_CROUCH )) The define: -```c +```pawn // RELEASED(keys) #define RELEASED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) @@ -188,13 +188,13 @@ The define: Released one key: -```c +```pawn if (RELEASED( KEY_FIRE )) ``` Released multiple keys: -```c +```pawn if (RELEASED( KEY_FIRE | KEY_CROUCH )) ``` @@ -202,7 +202,7 @@ if (RELEASED( KEY_FIRE | KEY_CROUCH )) ### Attach NOS when the player presses fire -```c +```pawn public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (PRESSED(KEY_FIRE)) @@ -218,7 +218,7 @@ public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) ### Super jump -```c +```pawn public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (PRESSED(KEY_JUMP)) @@ -236,7 +236,7 @@ public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) ### God mode while holding use -```c +```pawn new Float:gPlayerHealth[MAX_PLAYERS]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerLeaveCheckpoint.md b/frontend/docs/scripting/callbacks/OnPlayerLeaveCheckpoint.md index 55226534d719..40d084c0f153 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerLeaveCheckpoint.md +++ b/frontend/docs/scripting/callbacks/OnPlayerLeaveCheckpoint.md @@ -19,7 +19,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerLeaveCheckpoint(playerid) { printf("Player %i left a checkpoint!", playerid); @@ -27,7 +27,7 @@ public OnPlayerLeaveCheckpoint(playerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerLeaveGangZone.md b/frontend/docs/scripting/callbacks/OnPlayerLeaveGangZone.md index 946dd7510b65..31886bf15363 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerLeaveGangZone.md +++ b/frontend/docs/scripting/callbacks/OnPlayerLeaveGangZone.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerLeaveGangZone(playerid, zoneid) { new string[128]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerLeavePlayerGangZone.md b/frontend/docs/scripting/callbacks/OnPlayerLeavePlayerGangZone.md index abdbbe9d8cbf..f8c479ff0fd5 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerLeavePlayerGangZone.md +++ b/frontend/docs/scripting/callbacks/OnPlayerLeavePlayerGangZone.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn public OnPlayerLeavePlayerGangZone(playerid, zoneid) { new string[128]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md b/frontend/docs/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md index 9240ae91d23e..c268c9b98416 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md +++ b/frontend/docs/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md @@ -19,7 +19,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerLeaveRaceCheckpoint(playerid) { printf("Player %d left a race checkpoint!", playerid); @@ -27,7 +27,7 @@ public OnPlayerLeaveRaceCheckpoint(playerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerObjectMoved.md b/frontend/docs/scripting/callbacks/OnPlayerObjectMoved.md index 2ec7ee983595..36a14b29e6cf 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerObjectMoved.md +++ b/frontend/docs/scripting/callbacks/OnPlayerObjectMoved.md @@ -20,7 +20,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerObjectMoved(playerid, objectid) { printf("Player object moved: objectid: %d playerid: %d", objectid, playerid); @@ -28,7 +28,7 @@ public OnPlayerObjectMoved(playerid, objectid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerPickUpPickup.md b/frontend/docs/scripting/callbacks/OnPlayerPickUpPickup.md index 99e443fa352f..aef07705d930 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerPickUpPickup.md +++ b/frontend/docs/scripting/callbacks/OnPlayerPickUpPickup.md @@ -20,7 +20,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn new pickup_Cash; new pickup_Health; diff --git a/frontend/docs/scripting/callbacks/OnPlayerPickUpPlayerPickup.md b/frontend/docs/scripting/callbacks/OnPlayerPickUpPlayerPickup.md index 78d51dc2142e..903f5b59c706 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerPickUpPlayerPickup.md +++ b/frontend/docs/scripting/callbacks/OnPlayerPickUpPlayerPickup.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn new player_pickup_Cash[MAX_PLAYERS]; new player_pickup_Health[MAX_PLAYERS]; diff --git a/frontend/docs/scripting/callbacks/OnPlayerPickupStreamIn.md b/frontend/docs/scripting/callbacks/OnPlayerPickupStreamIn.md index dfceb0228d88..7ceff589792a 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerPickupStreamIn.md +++ b/frontend/docs/scripting/callbacks/OnPlayerPickupStreamIn.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn new g_PlayerPickupHealth[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/callbacks/OnPlayerPickupStreamOut.md b/frontend/docs/scripting/callbacks/OnPlayerPickupStreamOut.md index 32f66520b7de..5cf52cc69327 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerPickupStreamOut.md +++ b/frontend/docs/scripting/callbacks/OnPlayerPickupStreamOut.md @@ -22,7 +22,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn new g_PlayerPickupHealth[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/callbacks/OnPlayerRequestClass.md b/frontend/docs/scripting/callbacks/OnPlayerRequestClass.md index a3a0a63f075e..a285103069cd 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerRequestClass.md +++ b/frontend/docs/scripting/callbacks/OnPlayerRequestClass.md @@ -22,7 +22,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerRequestClass(playerid, classid) { if (classid == 3 && !IsPlayerAdmin(playerid)) @@ -34,7 +34,7 @@ public OnPlayerRequestClass(playerid, classid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerRequestDownload.md b/frontend/docs/scripting/callbacks/OnPlayerRequestDownload.md index fb794c2e9c63..8bbcc4f8181e 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerRequestDownload.md +++ b/frontend/docs/scripting/callbacks/OnPlayerRequestDownload.md @@ -25,7 +25,7 @@ This callback is called when a player request for custom model downloads. ## Examples -```c +```pawn #define DOWNLOAD_REQUEST_EMPTY (DOWNLOAD_REQUEST:0) #define DOWNLOAD_REQUEST_MODEL_FILE (DOWNLOAD_REQUEST:1) #define DOWNLOAD_REQUEST_TEXTURE_FILE (DOWNLOAD_REQUEST:2) diff --git a/frontend/docs/scripting/callbacks/OnPlayerRequestSpawn.md b/frontend/docs/scripting/callbacks/OnPlayerRequestSpawn.md index 03cdf625aa8b..2cbc9a2c09fc 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerRequestSpawn.md +++ b/frontend/docs/scripting/callbacks/OnPlayerRequestSpawn.md @@ -21,7 +21,7 @@ It is always called first in filterscripts so returning 0 there also blocks othe ## Examples -```c +```pawn public OnPlayerRequestSpawn(playerid) { if (!IsPlayerAdmin(playerid)) @@ -33,7 +33,7 @@ public OnPlayerRequestSpawn(playerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerSelectObject.md b/frontend/docs/scripting/callbacks/OnPlayerSelectObject.md index 3157334f4134..d923c5002e9d 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerSelectObject.md +++ b/frontend/docs/scripting/callbacks/OnPlayerSelectObject.md @@ -29,7 +29,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerSelectObject(playerid, SELECT_OBJECT:type, objectid, modelid, Float:fX, Float:fY, Float:fZ) { printf("Player %d selected object %d", playerid, objectid); diff --git a/frontend/docs/scripting/callbacks/OnPlayerSelectedMenuRow.md b/frontend/docs/scripting/callbacks/OnPlayerSelectedMenuRow.md index 6bdfd64d66ee..e931f83fcccc 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerSelectedMenuRow.md +++ b/frontend/docs/scripting/callbacks/OnPlayerSelectedMenuRow.md @@ -20,7 +20,7 @@ It is always called first in gamemode. ## Examples -```c +```pawn new Menu:MyMenu; public OnGameModeInit() @@ -51,7 +51,7 @@ public OnPlayerSelectedMenuRow(playerid, row) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerSpawn.md b/frontend/docs/scripting/callbacks/OnPlayerSpawn.md index 45175a6fc5c0..f8c006206704 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerSpawn.md +++ b/frontend/docs/scripting/callbacks/OnPlayerSpawn.md @@ -23,7 +23,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { new PlayerName[MAX_PLAYER_NAME]; @@ -37,13 +37,13 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::note When a player dies in San Andreas they get $100 deducted from them to cover hospital bills automatically. This feature remains in SA:MP, but is removed from open.mp to allow scripts to manage all their own money. Several scripts attempt to fix this already by adding $100 to a player after death, or on spawn. If this is your script simply delete the additional fix, although the code in open.mp does attempt to account for scripts that do this. If your script relied on this feature, simply add the following code to [OnPlayerDeath](OnPlayerDeath): -```c +```pawn GivePlayerMoney(playerid, -100); ``` diff --git a/frontend/docs/scripting/callbacks/OnPlayerStateChange.md b/frontend/docs/scripting/callbacks/OnPlayerStateChange.md index 64f89240cd52..7761cdbde2cc 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerStateChange.md +++ b/frontend/docs/scripting/callbacks/OnPlayerStateChange.md @@ -21,7 +21,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver @@ -33,7 +33,7 @@ public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstat } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerStreamIn.md b/frontend/docs/scripting/callbacks/OnPlayerStreamIn.md index f55995155dac..73268d348d60 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerStreamIn.md +++ b/frontend/docs/scripting/callbacks/OnPlayerStreamIn.md @@ -20,7 +20,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerStreamIn(playerid, forplayerid) { new string[40]; @@ -30,7 +30,7 @@ public OnPlayerStreamIn(playerid, forplayerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerStreamOut.md b/frontend/docs/scripting/callbacks/OnPlayerStreamOut.md index e88525d3aae9..fa44fd668894 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerStreamOut.md +++ b/frontend/docs/scripting/callbacks/OnPlayerStreamOut.md @@ -20,7 +20,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnPlayerStreamOut(playerid, forplayerid) { new string[80]; @@ -30,7 +30,7 @@ public OnPlayerStreamOut(playerid, forplayerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md b/frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md index 4e161008ca96..5fa6334c6637 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md +++ b/frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md @@ -29,7 +29,7 @@ It is always called first in filterscripts so returning 1 there blocks other fil **Example - Debugging** -```c +```pawn public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID) // If not self-inflicted @@ -56,7 +56,7 @@ public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bod **Example - One-shot-kill sniper headshots** -```c +```pawn public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) @@ -68,7 +68,7 @@ public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bod } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnPlayerText.md b/frontend/docs/scripting/callbacks/OnPlayerText.md index 5c0209e96fd9..3f2ac9ad3906 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerText.md +++ b/frontend/docs/scripting/callbacks/OnPlayerText.md @@ -22,7 +22,7 @@ It is always called first in filterscripts so returning 0 on it blocks other scr ## Examples -```c +```pawn public OnPlayerText(playerid, text[]) { new string[144]; @@ -35,7 +35,7 @@ public OnPlayerText(playerid, text[]) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerUpdate.md b/frontend/docs/scripting/callbacks/OnPlayerUpdate.md index 834dede462d7..96d3c872c0b0 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/docs/scripting/callbacks/OnPlayerUpdate.md @@ -25,7 +25,7 @@ It is always called first in filterscripts. **Example 1** -```c +```pawn new WEAPON:gPlayerCurrentWeapon[MAX_PLAYERS]; public OnPlayerUpdate(playerid) @@ -61,7 +61,7 @@ In this example you will probably also want to reset `gPlayerCurrentWeapon[playe **Example 2** -```c +```pawn public OnPlayerUpdate(playerid) { new Float:fHealth; @@ -87,7 +87,7 @@ public OnPlayerUpdate(playerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnPlayerWeaponShot.md b/frontend/docs/scripting/callbacks/OnPlayerWeaponShot.md index e391acef8f0d..f54912394806 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerWeaponShot.md +++ b/frontend/docs/scripting/callbacks/OnPlayerWeaponShot.md @@ -29,7 +29,7 @@ It is always called first in filterscripts so returning 0 there also blocks othe ## Examples -```c +```pawn public OnPlayerWeaponShot(playerid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hitid, Float:fX, Float:fY, Float:fZ) { new string[144]; @@ -39,7 +39,7 @@ public OnPlayerWeaponShot(playerid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hi } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnRconCommand.md b/frontend/docs/scripting/callbacks/OnRconCommand.md index f4e882dd5b87..a46fd575d035 100644 --- a/frontend/docs/scripting/callbacks/OnRconCommand.md +++ b/frontend/docs/scripting/callbacks/OnRconCommand.md @@ -23,7 +23,7 @@ It is always called first in filterscripts so returning 1 on it blocks the main ## Examples -```c +```pawn public OnRconCommand(cmd[]) { printf("[RCON]: You typed '/rcon %s'!", cmd); @@ -31,7 +31,7 @@ public OnRconCommand(cmd[]) } ``` -```c +```pawn public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) @@ -44,7 +44,7 @@ public OnRconCommand(cmd[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnRconLoginAttempt.md b/frontend/docs/scripting/callbacks/OnRconLoginAttempt.md index 846197e6d8cc..d1e5970d81a2 100644 --- a/frontend/docs/scripting/callbacks/OnRconLoginAttempt.md +++ b/frontend/docs/scripting/callbacks/OnRconLoginAttempt.md @@ -21,7 +21,7 @@ This callback is always called first in filterscripts. ## Examples -```c +```pawn public OnRconLoginAttempt(ip[], password[], success) { if (!success) // If the password was incorrect @@ -51,7 +51,7 @@ public OnRconLoginAttempt(ip[], password[], success) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnRecordingPlaybackEnd.md b/frontend/docs/scripting/callbacks/OnRecordingPlaybackEnd.md index 39e4221eae9f..f6ab23529693 100644 --- a/frontend/docs/scripting/callbacks/OnRecordingPlaybackEnd.md +++ b/frontend/docs/scripting/callbacks/OnRecordingPlaybackEnd.md @@ -2,7 +2,7 @@ title: OnRecordingPlaybackEnd sidebar_label: OnRecordingPlaybackEnd description: This callback is called when a recorded file being reproduced with StartRecordingPlayback has reached to its end. -tags: [] +tags: ["npc", "recording", "playback"] --- ## Description @@ -11,7 +11,7 @@ This callback is called when a .rec file, being played with [StartRecordingPlayb ## Examples -```c +```pawn public OnRecordingPlaybackEnd() { StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER, "all_around_lv_bus"); // This will play the recording again once it has reached its end. diff --git a/frontend/docs/scripting/callbacks/OnScriptLoadPlayer.md b/frontend/docs/scripting/callbacks/OnScriptLoadPlayer.md index 0a394f817c59..a97e016fe24d 100644 --- a/frontend/docs/scripting/callbacks/OnScriptLoadPlayer.md +++ b/frontend/docs/scripting/callbacks/OnScriptLoadPlayer.md @@ -22,14 +22,14 @@ This callback does not handle returns. ## Examples -```c +```pawn public OnScriptLoadPlayer(playerid, bool:isEntryScript) { printf("Script loaded for player ID %d (isEntryScript: %s)", playerid, isEntryScript ? "Yes" : "No"); } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnScriptUnloadPlayer.md b/frontend/docs/scripting/callbacks/OnScriptUnloadPlayer.md index 491922570b90..6dcbfec70488 100644 --- a/frontend/docs/scripting/callbacks/OnScriptUnloadPlayer.md +++ b/frontend/docs/scripting/callbacks/OnScriptUnloadPlayer.md @@ -22,14 +22,14 @@ This callback does not handle returns. ## Examples -```c +```pawn public OnScriptUnloadPlayer(playerid, bool:isEntryScript) { printf("Script unloaded for player ID %d (isEntryScript: %s)", playerid, isEntryScript ? "Yes" : "No"); } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnTrailerUpdate.md b/frontend/docs/scripting/callbacks/OnTrailerUpdate.md index 3a8a74cf9d80..3758d2476cec 100644 --- a/frontend/docs/scripting/callbacks/OnTrailerUpdate.md +++ b/frontend/docs/scripting/callbacks/OnTrailerUpdate.md @@ -24,7 +24,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnTrailerUpdate(playerid, vehicleid) { DetachTrailerFromVehicle(GetPlayerVehicleID(playerid)); @@ -32,7 +32,7 @@ public OnTrailerUpdate(playerid, vehicleid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnUnoccupiedVehicleUpdate.md b/frontend/docs/scripting/callbacks/OnUnoccupiedVehicleUpdate.md index 95a6fc278798..ba1aeca9bf41 100644 --- a/frontend/docs/scripting/callbacks/OnUnoccupiedVehicleUpdate.md +++ b/frontend/docs/scripting/callbacks/OnUnoccupiedVehicleUpdate.md @@ -29,7 +29,7 @@ It is always called first in filterscripts so returning 0 there also blocks othe ## Examples -```c +```pawn public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z) { // Check if it moved far @@ -43,7 +43,7 @@ public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_ } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/callbacks/OnVehicleDamageStatusUpdate.md b/frontend/docs/scripting/callbacks/OnVehicleDamageStatusUpdate.md index 89f23b0bdd74..937ad7b46265 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleDamageStatusUpdate.md +++ b/frontend/docs/scripting/callbacks/OnVehicleDamageStatusUpdate.md @@ -30,7 +30,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnVehicleDamageStatusUpdate(vehicleid, playerid) { // Get the damage status of all the components @@ -51,7 +51,7 @@ public OnVehicleDamageStatusUpdate(vehicleid, playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnVehicleDeath.md b/frontend/docs/scripting/callbacks/OnVehicleDeath.md index 84d3d1053639..08b65821e8fa 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleDeath.md +++ b/frontend/docs/scripting/callbacks/OnVehicleDeath.md @@ -20,7 +20,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnVehicleDeath(vehicleid, killerid) { new string[64]; @@ -30,7 +30,7 @@ public OnVehicleDeath(vehicleid, killerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnVehicleMod.md b/frontend/docs/scripting/callbacks/OnVehicleMod.md index 7c7764d66fc2..e43a54815a3b 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleMod.md +++ b/frontend/docs/scripting/callbacks/OnVehicleMod.md @@ -23,7 +23,7 @@ It is always called first in gamemode so returning 0 there also blocks other fil ## Examples -```c +```pawn public OnVehicleMod(playerid, vehicleid, componentid) { printf("Vehicle %d was modded by ID %d with the componentid %d", vehicleid, playerid, componentid); @@ -38,7 +38,7 @@ public OnVehicleMod(playerid, vehicleid, componentid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnVehiclePaintjob.md b/frontend/docs/scripting/callbacks/OnVehiclePaintjob.md index 77c158032620..d253a9a34e81 100644 --- a/frontend/docs/scripting/callbacks/OnVehiclePaintjob.md +++ b/frontend/docs/scripting/callbacks/OnVehiclePaintjob.md @@ -21,7 +21,7 @@ It is always called first in gamemode so returning 0 there blocks other filtersc ## Examples -```c +```pawn public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { new string[128]; @@ -31,7 +31,7 @@ public OnVehiclePaintjob(playerid, vehicleid, paintjobid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnVehicleRespray.md b/frontend/docs/scripting/callbacks/OnVehicleRespray.md index 54534352e72f..641ecfe56aac 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleRespray.md +++ b/frontend/docs/scripting/callbacks/OnVehicleRespray.md @@ -24,7 +24,7 @@ It is always called first in gamemode so returning 0 there also blocks other fil ## Examples -```c +```pawn public OnVehicleRespray(playerid, vehicleid, color1, color2) { new string[48]; @@ -34,7 +34,7 @@ public OnVehicleRespray(playerid, vehicleid, color1, color2) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnVehicleSirenStateChange.md b/frontend/docs/scripting/callbacks/OnVehicleSirenStateChange.md index f47f9845819d..9f5dd109cfa9 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleSirenStateChange.md +++ b/frontend/docs/scripting/callbacks/OnVehicleSirenStateChange.md @@ -27,7 +27,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnVehicleSirenStateChange(playerid, vehicleid, newstate) { if (newstate) @@ -42,7 +42,7 @@ public OnVehicleSirenStateChange(playerid, vehicleid, newstate) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/callbacks/OnVehicleSpawn.md b/frontend/docs/scripting/callbacks/OnVehicleSpawn.md index 97172474eac6..a051de4e6ad7 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleSpawn.md +++ b/frontend/docs/scripting/callbacks/OnVehicleSpawn.md @@ -29,7 +29,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnVehicleSpawn(vehicleid) { printf("Vehicle %i spawned!", vehicleid); diff --git a/frontend/docs/scripting/callbacks/OnVehicleStreamIn.md b/frontend/docs/scripting/callbacks/OnVehicleStreamIn.md index bb6df18819cb..458871735e82 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleStreamIn.md +++ b/frontend/docs/scripting/callbacks/OnVehicleStreamIn.md @@ -20,7 +20,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnVehicleStreamIn(vehicleid, forplayerid) { new string[32]; @@ -30,7 +30,7 @@ public OnVehicleStreamIn(vehicleid, forplayerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/callbacks/OnVehicleStreamOut.md b/frontend/docs/scripting/callbacks/OnVehicleStreamOut.md index dc6a136c214c..a2d46ebcb32a 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleStreamOut.md +++ b/frontend/docs/scripting/callbacks/OnVehicleStreamOut.md @@ -20,7 +20,7 @@ It is always called first in filterscripts. ## Examples -```c +```pawn public OnVehicleStreamOut(vehicleid, forplayerid) { new string[48]; @@ -30,7 +30,7 @@ public OnVehicleStreamOut(vehicleid, forplayerid) } ``` -## Notes +## Good to know diff --git a/frontend/docs/scripting/functions/AddCharModel.md b/frontend/docs/scripting/functions/AddCharModel.md index 43d5b332013b..7f408b1b2b4a 100644 --- a/frontend/docs/scripting/functions/AddCharModel.md +++ b/frontend/docs/scripting/functions/AddCharModel.md @@ -26,7 +26,7 @@ Adds a new custom [character model](SetPlayerSkin) for download. The model files ## Examples -```c +```pawn public OnGameModeInit() { AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); @@ -35,7 +35,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AddMenuItem.md b/frontend/docs/scripting/functions/AddMenuItem.md index f4c0853ee380..734649f81e6a 100644 --- a/frontend/docs/scripting/functions/AddMenuItem.md +++ b/frontend/docs/scripting/functions/AddMenuItem.md @@ -22,7 +22,7 @@ The index of the row this item was added to. ## Examples -```c +```pawn new Menu:gExampleMenu; public OnGameModeInit() @@ -34,7 +34,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/AddPlayerClass.md b/frontend/docs/scripting/functions/AddPlayerClass.md index 60458b824a56..9d4c57870211 100644 --- a/frontend/docs/scripting/functions/AddPlayerClass.md +++ b/frontend/docs/scripting/functions/AddPlayerClass.md @@ -31,7 +31,7 @@ The **ID of the class** which was just added. ## Examples -```c +```pawn public OnGameModeInit() { // Players can spawn with either the CJ skin (0) or The Truth skin (1). @@ -41,7 +41,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AddPlayerClassEx.md b/frontend/docs/scripting/functions/AddPlayerClassEx.md index cf119912288c..7d683d21aefc 100644 --- a/frontend/docs/scripting/functions/AddPlayerClassEx.md +++ b/frontend/docs/scripting/functions/AddPlayerClassEx.md @@ -32,7 +32,7 @@ The **ID of the class** which was just added. ## Examples -```c +```pawn public OnGameModeInit() { // Players can spawn as either: @@ -44,7 +44,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AddServerRule.md b/frontend/docs/scripting/functions/AddServerRule.md index ba6e4ed7ebb2..3fa587143a1b 100644 --- a/frontend/docs/scripting/functions/AddServerRule.md +++ b/frontend/docs/scripting/functions/AddServerRule.md @@ -23,7 +23,7 @@ Returns true if the function executed successfully, otherwise false. ## Examples -```c +```pawn public OnGameModeInit() { AddServerRule("discord", "discord.gg/samp"); diff --git a/frontend/docs/scripting/functions/AddSimpleModel.md b/frontend/docs/scripting/functions/AddSimpleModel.md index 357368007246..84ea9f468e42 100644 --- a/frontend/docs/scripting/functions/AddSimpleModel.md +++ b/frontend/docs/scripting/functions/AddSimpleModel.md @@ -27,7 +27,7 @@ Adds a new custom simple [object model](CreateObject) for download. The model fi ## Examples -```c +```pawn public OnGameModeInit() { AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); @@ -35,7 +35,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AddSimpleModelTimed.md b/frontend/docs/scripting/functions/AddSimpleModelTimed.md index e1b64921b537..c5283bb40d08 100644 --- a/frontend/docs/scripting/functions/AddSimpleModelTimed.md +++ b/frontend/docs/scripting/functions/AddSimpleModelTimed.md @@ -29,7 +29,7 @@ Adds a new custom simple [object model](CreateObject) for download. The model fi ## Examples -```c +```pawn public OnGameModeInit() { AddSimpleModelTimed(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd", 9, 18); // This wall only renders from 9:00 am to 6:00 pm @@ -37,7 +37,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AddStaticPickup.md b/frontend/docs/scripting/functions/AddStaticPickup.md index 9900a4579ed1..bf7750583f94 100644 --- a/frontend/docs/scripting/functions/AddStaticPickup.md +++ b/frontend/docs/scripting/functions/AddStaticPickup.md @@ -26,7 +26,7 @@ This function adds a 'static' pickup to the game. These pickups support weapons, ## Examples -```c +```pawn public OnGameModeInit() { // Create a pickup for armor @@ -39,7 +39,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AddStaticVehicle.md b/frontend/docs/scripting/functions/AddStaticVehicle.md index 717a35662fb4..fd13872dbcf9 100644 --- a/frontend/docs/scripting/functions/AddStaticVehicle.md +++ b/frontend/docs/scripting/functions/AddStaticVehicle.md @@ -27,7 +27,7 @@ The vehicle ID of the vehicle created (between 1 and MAX_VEHICLES). ## Examples -```c +```pawn public OnGameModeInit() { // Add a Hydra to the game diff --git a/frontend/docs/scripting/functions/AddStaticVehicleEx.md b/frontend/docs/scripting/functions/AddStaticVehicleEx.md index 4203a645bed8..467c4e8199f9 100644 --- a/frontend/docs/scripting/functions/AddStaticVehicleEx.md +++ b/frontend/docs/scripting/functions/AddStaticVehicleEx.md @@ -31,7 +31,7 @@ The vehicle ID of the vehicle created (1 - MAX_VEHICLES). ## Examples -```c +```pawn public OnGameModeInit() { // Add a Hydra (520) to the game that will respawn 15 seconds after being left diff --git a/frontend/docs/scripting/functions/AddVehicleComponent.md b/frontend/docs/scripting/functions/AddVehicleComponent.md index a06bf43ce6fc..c5e2224f9ef6 100644 --- a/frontend/docs/scripting/functions/AddVehicleComponent.md +++ b/frontend/docs/scripting/functions/AddVehicleComponent.md @@ -22,7 +22,7 @@ Adds a 'component' (often referred to as a 'mod' (modification)) to a vehicle. V ## Examples -```c +```pawn new gTaxi; public OnGameModeInit() @@ -45,7 +45,7 @@ public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstat } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/AllowAdminTeleport.md b/frontend/docs/scripting/functions/AllowAdminTeleport.md index d5da92fe885b..1338a91bdeb2 100644 --- a/frontend/docs/scripting/functions/AllowAdminTeleport.md +++ b/frontend/docs/scripting/functions/AllowAdminTeleport.md @@ -2,7 +2,7 @@ title: AllowAdminTeleport sidebar_label: AllowAdminTeleport description: This function will determine whether RCON admins will be teleported to their waypoint when they set one. -tags: [] +tags: ["rcon", "administration"] --- :::warning @@ -25,7 +25,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { AllowAdminTeleport(true); diff --git a/frontend/docs/scripting/functions/AllowInteriorWeapons.md b/frontend/docs/scripting/functions/AllowInteriorWeapons.md index ff922d788ae1..d1ff3f0fc3cb 100644 --- a/frontend/docs/scripting/functions/AllowInteriorWeapons.md +++ b/frontend/docs/scripting/functions/AllowInteriorWeapons.md @@ -2,7 +2,7 @@ title: AllowInteriorWeapons sidebar_label: AllowInteriorWeapons description: Toggle whether the usage of weapons in interiors is allowed or not. -tags: [] +tags: ["weapon", "interior"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { // This will allow weapons inside interiors. @@ -28,7 +28,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/AllowNickNameCharacter.md b/frontend/docs/scripting/functions/AllowNickNameCharacter.md index 01b7f866eead..18a6d8682e7b 100644 --- a/frontend/docs/scripting/functions/AllowNickNameCharacter.md +++ b/frontend/docs/scripting/functions/AllowNickNameCharacter.md @@ -2,7 +2,7 @@ title: AllowNickNameCharacter sidebar_label: AllowNickNameCharacter description: Allows a character to be used in the nick name. -tags: [] +tags: ["player", "name"] --- @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { AllowNickNameCharacter('*', true); // Allow char * diff --git a/frontend/docs/scripting/functions/AllowPlayerTeleport.md b/frontend/docs/scripting/functions/AllowPlayerTeleport.md index 823844a59ac2..9c93dcceb6c9 100644 --- a/frontend/docs/scripting/functions/AllowPlayerTeleport.md +++ b/frontend/docs/scripting/functions/AllowPlayerTeleport.md @@ -26,7 +26,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { // Allows the Player to teleport by right-clicking on the map @@ -36,7 +36,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/AllowPlayerWeapons.md b/frontend/docs/scripting/functions/AllowPlayerWeapons.md index 821317e9735a..572e405a4414 100644 --- a/frontend/docs/scripting/functions/AllowPlayerWeapons.md +++ b/frontend/docs/scripting/functions/AllowPlayerWeapons.md @@ -22,7 +22,7 @@ This function always returns true. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { AllowPlayerWeapons(playerid, true); diff --git a/frontend/docs/scripting/functions/ApplyActorAnimation.md b/frontend/docs/scripting/functions/ApplyActorAnimation.md index d30cd5eb6e70..e1c3bbec5167 100644 --- a/frontend/docs/scripting/functions/ApplyActorAnimation.md +++ b/frontend/docs/scripting/functions/ApplyActorAnimation.md @@ -31,7 +31,7 @@ Apply an animation to an actor. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() @@ -49,7 +49,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/ApplyAnimation.md b/frontend/docs/scripting/functions/ApplyAnimation.md index 34d7b02d07c1..13880bdd3713 100644 --- a/frontend/docs/scripting/functions/ApplyAnimation.md +++ b/frontend/docs/scripting/functions/ApplyAnimation.md @@ -28,13 +28,13 @@ This function always returns **true**, even if the player specified does not exi ## Examples -```c +```pawn ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, true, true, true, true, 1, 1); ``` An example for open.mp: -```c +```pawn ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, true, true, true, true, 1, SYNC_NONE); // SYNC_NONE: Don't force sync to anyone else. @@ -45,7 +45,7 @@ ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, true, true, true, true, 1, SY // SYNC_OTHER: Sync to all streamed-in players, except the player with the animation. ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AreAllAnimationsEnabled.md b/frontend/docs/scripting/functions/AreAllAnimationsEnabled.md index cda7a39284e6..c0ff026cd4ae 100644 --- a/frontend/docs/scripting/functions/AreAllAnimationsEnabled.md +++ b/frontend/docs/scripting/functions/AreAllAnimationsEnabled.md @@ -19,7 +19,7 @@ false: Disabled. ## Examples -```c +```pawn if (AreAllAnimationsEnabled()) { // Do something diff --git a/frontend/docs/scripting/functions/AreInteriorWeaponsAllowed.md b/frontend/docs/scripting/functions/AreInteriorWeaponsAllowed.md index 03a15dcffe58..99a011bfd7ab 100644 --- a/frontend/docs/scripting/functions/AreInteriorWeaponsAllowed.md +++ b/frontend/docs/scripting/functions/AreInteriorWeaponsAllowed.md @@ -2,7 +2,7 @@ title: AreInteriorWeaponsAllowed sidebar_label: AreInteriorWeaponsAllowed description: Can weapons be used in interiors? -tags: [] +tags: ["weapon", "interior"] --- @@ -19,7 +19,7 @@ false: Not allowed. ## Examples -```c +```pawn if (AreInteriorWeaponsAllowed()) { // Do something diff --git a/frontend/docs/scripting/functions/ArePlayerWeaponsAllowed.md b/frontend/docs/scripting/functions/ArePlayerWeaponsAllowed.md index 132f147fe9aa..73d266dc9f6e 100644 --- a/frontend/docs/scripting/functions/ArePlayerWeaponsAllowed.md +++ b/frontend/docs/scripting/functions/ArePlayerWeaponsAllowed.md @@ -23,7 +23,7 @@ Can the player use weapons? ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { if (ArePlayerWeaponsAllowed(playerid)) diff --git a/frontend/docs/scripting/functions/Attach3DTextLabelToPlayer.md b/frontend/docs/scripting/functions/Attach3DTextLabelToPlayer.md index d808d0ff5d36..72e1782a934d 100644 --- a/frontend/docs/scripting/functions/Attach3DTextLabelToPlayer.md +++ b/frontend/docs/scripting/functions/Attach3DTextLabelToPlayer.md @@ -25,7 +25,7 @@ Attach a [3D text label](Create3DTextLabel) to a player. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { new Text3D:textLabel = Create3DTextLabel("Hello, I am new here!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); diff --git a/frontend/docs/scripting/functions/Attach3DTextLabelToVehicle.md b/frontend/docs/scripting/functions/Attach3DTextLabelToVehicle.md index 1815516f3747..21a79175c62d 100644 --- a/frontend/docs/scripting/functions/Attach3DTextLabelToVehicle.md +++ b/frontend/docs/scripting/functions/Attach3DTextLabelToVehicle.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text3D:gVehicle3dText[MAX_VEHICLES], // Creating the TextLabel for later use gVehicleId; diff --git a/frontend/docs/scripting/functions/AttachCameraToObject.md b/frontend/docs/scripting/functions/AttachCameraToObject.md index 77fa7f952dc6..8f76d0c06049 100644 --- a/frontend/docs/scripting/functions/AttachCameraToObject.md +++ b/frontend/docs/scripting/functions/AttachCameraToObject.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/attach", false)) @@ -34,7 +34,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AttachCameraToPlayerObject.md b/frontend/docs/scripting/functions/AttachCameraToPlayerObject.md index dbd2fd270b40..19fe228a8df5 100644 --- a/frontend/docs/scripting/functions/AttachCameraToPlayerObject.md +++ b/frontend/docs/scripting/functions/AttachCameraToPlayerObject.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/attach", false)) @@ -34,7 +34,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AttachObjectToObject.md b/frontend/docs/scripting/functions/AttachObjectToObject.md index 2353840cc9bd..65f75e715497 100644 --- a/frontend/docs/scripting/functions/AttachObjectToObject.md +++ b/frontend/docs/scripting/functions/AttachObjectToObject.md @@ -29,14 +29,14 @@ You can use this function to attach objects to other objects. The objects will f ## Examples -```c +```pawn new gObjectId = CreateObject(...); new gAttachToId = CreateObject(...); AttachObjectToObject(gObjectId, gAttachToId, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AttachObjectToPlayer.md b/frontend/docs/scripting/functions/AttachObjectToPlayer.md index cd9ff2315279..7d9ea6526d09 100644 --- a/frontend/docs/scripting/functions/AttachObjectToPlayer.md +++ b/frontend/docs/scripting/functions/AttachObjectToPlayer.md @@ -26,7 +26,7 @@ This function always returns **false**. ## Examples -```c +```pawn new gMyObject; gMyObject = CreateObject(19341, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToPlayer(gMyObject, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2); diff --git a/frontend/docs/scripting/functions/AttachObjectToVehicle.md b/frontend/docs/scripting/functions/AttachObjectToVehicle.md index 401bc87f6098..9aa8b969e43e 100644 --- a/frontend/docs/scripting/functions/AttachObjectToVehicle.md +++ b/frontend/docs/scripting/functions/AttachObjectToVehicle.md @@ -26,13 +26,13 @@ This function does not return any specific values. ## Examples -```c +```pawn new objectid = CreateObject(...); new vehicleid = GetPlayerVehicleID(playerid); AttachObjectToVehicle(objectid, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AttachPlayerObjectToObject.md b/frontend/docs/scripting/functions/AttachPlayerObjectToObject.md index 1b87cf6d9f59..75c04df14cce 100644 --- a/frontend/docs/scripting/functions/AttachPlayerObjectToObject.md +++ b/frontend/docs/scripting/functions/AttachPlayerObjectToObject.md @@ -32,14 +32,14 @@ You can use this function to attach player-objects to other player-objects. The ## Examples -```c +```pawn new objectid = CreatePlayerObject(...); new parentid = CreatePlayerObject(...); AttachPlayerObjectToObject(playerid, objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AttachPlayerObjectToPlayer.md b/frontend/docs/scripting/functions/AttachPlayerObjectToPlayer.md index f1345af55571..fd2bb5b14e7f 100644 --- a/frontend/docs/scripting/functions/AttachPlayerObjectToPlayer.md +++ b/frontend/docs/scripting/functions/AttachPlayerObjectToPlayer.md @@ -27,7 +27,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerSpawn(playerid) @@ -39,7 +39,7 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/AttachPlayerObjectToVehicle.md b/frontend/docs/scripting/functions/AttachPlayerObjectToVehicle.md index 34a52acccd9a..9ed5f9e11afc 100644 --- a/frontend/docs/scripting/functions/AttachPlayerObjectToVehicle.md +++ b/frontend/docs/scripting/functions/AttachPlayerObjectToVehicle.md @@ -27,7 +27,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (newstate == PLAYER_STATE_DRIVER) // If player enters vehicle @@ -42,7 +42,7 @@ public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstat } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/AttachTrailerToVehicle.md b/frontend/docs/scripting/functions/AttachTrailerToVehicle.md index 1f566b18d733..f7a733468cf0 100644 --- a/frontend/docs/scripting/functions/AttachTrailerToVehicle.md +++ b/frontend/docs/scripting/functions/AttachTrailerToVehicle.md @@ -20,14 +20,14 @@ This function always returns **true**, even if neither of the vehicle IDs passed ## Examples -```c +```pawn new vehicleId = CreateVehicle(403, 657.8788, 1721.9125, 7.7199, 41.0000, -1, -1, 100); new trailerId = CreateVehicle(435, 651.8154, 1716.3301, 7.7700, 41.0000, -1, -1, 100); AttachTrailerToVehicle(trailerId, vehicleId); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/Ban.md b/frontend/docs/scripting/functions/Ban.md index 4a6bea97e737..27ff6225edbf 100644 --- a/frontend/docs/scripting/functions/Ban.md +++ b/frontend/docs/scripting/functions/Ban.md @@ -23,7 +23,7 @@ IP bans can be added/removed using the [RCON](../../server/RemoteConsole) `banip This function does not return any specific values. -## Notes +## Good to know :::warning @@ -33,7 +33,7 @@ Any action taken directly before Ban (such as sending a message with [SendClient ## Examples -```c +```pawn // In order to display a message (eg. reason) for the player before the connection is closed // you have to use a timer to create a delay. This delay needs only to be a few milliseconds long, // but this example uses a full second just to be on the safe side. diff --git a/frontend/docs/scripting/functions/BanEx.md b/frontend/docs/scripting/functions/BanEx.md index 5b621f0d78a0..e9811b8359de 100644 --- a/frontend/docs/scripting/functions/BanEx.md +++ b/frontend/docs/scripting/functions/BanEx.md @@ -18,7 +18,7 @@ Ban a player with a reason. This function does not return any specific values. -## Notes +## Good to know :::warning @@ -28,7 +28,7 @@ Any action taken directly before BanEx (such as sending a message with [SendClie ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/banme", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) The following code snippet shows a way of displaying a message for the player before they are banned: -```c +```pawn // In order to display a message (eg. reason) for the player before the connection is closed // you have to use a timer to create a delay. This delay needs only to be a few milliseconds long, // but this example uses a full second just to be on the safe side. diff --git a/frontend/docs/scripting/functions/BeginObjectEditing.md b/frontend/docs/scripting/functions/BeginObjectEditing.md index 019835ccb205..54c459e33943 100644 --- a/frontend/docs/scripting/functions/BeginObjectEditing.md +++ b/frontend/docs/scripting/functions/BeginObjectEditing.md @@ -24,7 +24,7 @@ Allows a player to edit an object (position and rotation) using their mouse on a ## Examples -```c +```pawn new objectid; public OnGameModeInit() @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/BeginObjectSelecting.md b/frontend/docs/scripting/functions/BeginObjectSelecting.md index d06a2116e22c..15af46be72b8 100644 --- a/frontend/docs/scripting/functions/BeginObjectSelecting.md +++ b/frontend/docs/scripting/functions/BeginObjectSelecting.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/select", true)) diff --git a/frontend/docs/scripting/functions/BeginPlayerObjectEditing.md b/frontend/docs/scripting/functions/BeginPlayerObjectEditing.md index 9775eb017d9d..65eaa797fef2 100644 --- a/frontend/docs/scripting/functions/BeginPlayerObjectEditing.md +++ b/frontend/docs/scripting/functions/BeginPlayerObjectEditing.md @@ -24,7 +24,7 @@ Allows players to edit a player-object (position and rotation) with a GUI and th ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerSpawn(playerid) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/BlockIpAddress.md b/frontend/docs/scripting/functions/BlockIpAddress.md index f14adb537ef9..e52d95ca35b1 100644 --- a/frontend/docs/scripting/functions/BlockIpAddress.md +++ b/frontend/docs/scripting/functions/BlockIpAddress.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnRconLoginAttempt(ip[], password[], success) { if (!success) // if they supplied a bad password @@ -31,7 +31,7 @@ public OnRconLoginAttempt(ip[], password[], success) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/CallLocalFunction.md b/frontend/docs/scripting/functions/CallLocalFunction.md index 57296792a347..162c22d451b4 100644 --- a/frontend/docs/scripting/functions/CallLocalFunction.md +++ b/frontend/docs/scripting/functions/CallLocalFunction.md @@ -36,7 +36,7 @@ The values for the placeholders follow in the exact same order as parameters in ## Examples -```c +```pawn forward publicFunc(number, Float:flt, const string[]); public publicFunc(number, Float:flt, const string[]) { @@ -47,7 +47,7 @@ public publicFunc(number, Float:flt, const string[]) CallLocalFunction("publicFunc", "ifs", 420, 68.999999999, "Hello world"); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/CallRemoteFunction.md b/frontend/docs/scripting/functions/CallRemoteFunction.md index 4ba19612c9ed..88cdade01e2c 100644 --- a/frontend/docs/scripting/functions/CallRemoteFunction.md +++ b/frontend/docs/scripting/functions/CallRemoteFunction.md @@ -34,7 +34,7 @@ The values for the placeholders follow in the exact same order as parameters in ## Examples -```c +```pawn forward CallMe(number, const string[]); public CallMe(number, const string[]) { @@ -46,7 +46,7 @@ public CallMe(number, const string[]) CallRemoteFunction("CallMe", "is", 69, "this is a string"); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/CancelEdit.md b/frontend/docs/scripting/functions/CancelEdit.md index 646e80f18fd1..d38e5cbaf19e 100644 --- a/frontend/docs/scripting/functions/CancelEdit.md +++ b/frontend/docs/scripting/functions/CancelEdit.md @@ -2,7 +2,7 @@ title: CancelEdit sidebar_label: CancelEdit description: Cancel object edition mode for a player. -tags: [] +tags: ["player", "object"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/stopedit", true)) diff --git a/frontend/docs/scripting/functions/CancelSelectTextDraw.md b/frontend/docs/scripting/functions/CancelSelectTextDraw.md index d7e3beab044c..7a7ed9321f6f 100644 --- a/frontend/docs/scripting/functions/CancelSelectTextDraw.md +++ b/frontend/docs/scripting/functions/CancelSelectTextDraw.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/cancelselect", true)) @@ -32,7 +32,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/ChangeVehicleColor.md b/frontend/docs/scripting/functions/ChangeVehicleColor.md index aa20a699d917..1defe91f129d 100644 --- a/frontend/docs/scripting/functions/ChangeVehicleColor.md +++ b/frontend/docs/scripting/functions/ChangeVehicleColor.md @@ -23,7 +23,7 @@ Change a vehicle's primary and secondary colors. ## Examples -```c +```pawn public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { // Change the primary color to black and the secondary color to white @@ -34,7 +34,7 @@ public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) ## Snippets -```c +```pawn new VehicleColoursTableRGBA[256] = { // The existing colours from San Andreas 0x000000FF, 0xF5F5F5FF, 0x2A77A1FF, 0x840410FF, 0x263739FF, 0x86446EFF, 0xD78E10FF, 0x4C75B7FF, 0xBDBEC6FF, 0x5E7072FF, @@ -67,7 +67,7 @@ new VehicleColoursTableRGBA[256] = { }; ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/ChangeVehicleColours.md b/frontend/docs/scripting/functions/ChangeVehicleColours.md index 045f86921f6c..aba089259f79 100644 --- a/frontend/docs/scripting/functions/ChangeVehicleColours.md +++ b/frontend/docs/scripting/functions/ChangeVehicleColours.md @@ -25,7 +25,7 @@ Change a vehicle's primary and secondary colours. ## Examples -```c +```pawn public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { // Change the primary colour to black and the secondary colour to white @@ -36,7 +36,7 @@ public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) ## Snippets -```c +```pawn new VehicleColoursTableRGBA[256] = { // The existing colours from San Andreas @@ -70,7 +70,7 @@ new VehicleColoursTableRGBA[256] = }; ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/ChangeVehiclePaintjob.md b/frontend/docs/scripting/functions/ChangeVehiclePaintjob.md index 23a6e8e5b049..82baa1778a5b 100644 --- a/frontend/docs/scripting/functions/ChangeVehiclePaintjob.md +++ b/frontend/docs/scripting/functions/ChangeVehiclePaintjob.md @@ -20,7 +20,7 @@ This function always returns **true** (success), even if the vehicle passed is n ## Examples -```c +```pawn new rand = random(3); // Will either be 0 1 or 2 (all valid) new vehicleid = GetPlayerVehicleID(playerid); @@ -28,13 +28,13 @@ ChangeVehicleColor(vehicleid, 1, 1); // making sure it is white for better resul ChangeVehiclePaintjob(vehicleid, rand); // changes the paintjob of the player's current vehicle to a random one ``` -## Notes +## Good to know :::warning If vehicle's color is black, paintjob may not be visible. Better to make vehicle white before applying paintjob by using: -```c +```pawn ChangeVehicleColor(vehicleid, 1, 1); ``` diff --git a/frontend/docs/scripting/functions/ChatTextReplacementToggled.md b/frontend/docs/scripting/functions/ChatTextReplacementToggled.md index d06b1c3476af..d1cde8f394af 100644 --- a/frontend/docs/scripting/functions/ChatTextReplacementToggled.md +++ b/frontend/docs/scripting/functions/ChatTextReplacementToggled.md @@ -2,7 +2,7 @@ title: ChatTextReplacementToggled sidebar_label: ChatTextReplacementToggled description: Checks if the chat input filtering is enabled or disabled. -tags: [] +tags: ["chat"] --- @@ -19,7 +19,7 @@ false: Disable. ## Examples -```c +```pawn printf("Chat input filter is %s", ChatTextReplacementToggled() ? "Enable" : "Disable"); ``` diff --git a/frontend/docs/scripting/functions/ClearActorAnimations.md b/frontend/docs/scripting/functions/ClearActorAnimations.md index 5cb47639027f..ff1672cef088 100644 --- a/frontend/docs/scripting/functions/ClearActorAnimations.md +++ b/frontend/docs/scripting/functions/ClearActorAnimations.md @@ -23,7 +23,7 @@ Clear any animations applied to an actor. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/ClearAnimations.md b/frontend/docs/scripting/functions/ClearAnimations.md index 0351b28e9c8a..4a3c347eed6e 100644 --- a/frontend/docs/scripting/functions/ClearAnimations.md +++ b/frontend/docs/scripting/functions/ClearAnimations.md @@ -20,7 +20,7 @@ This function always returns **true**, even when the player specified is not con ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/animclear", true)) @@ -32,7 +32,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/ClearBanList.md b/frontend/docs/scripting/functions/ClearBanList.md index 626ec29a2e7c..c64910afc5eb 100644 --- a/frontend/docs/scripting/functions/ClearBanList.md +++ b/frontend/docs/scripting/functions/ClearBanList.md @@ -2,7 +2,7 @@ title: ClearBanList sidebar_label: ClearBanList description: Clears the ban list. -tags: [] +tags: ["administration", "ban"] --- @@ -19,7 +19,7 @@ Clears the ban list. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/clearbanlist", true)) @@ -37,7 +37,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/ClearPlayerWorldBounds.md b/frontend/docs/scripting/functions/ClearPlayerWorldBounds.md index 04fa319db84f..3dbaf92e0ce4 100644 --- a/frontend/docs/scripting/functions/ClearPlayerWorldBounds.md +++ b/frontend/docs/scripting/functions/ClearPlayerWorldBounds.md @@ -23,7 +23,7 @@ Reset the player's world boundaries to default world boundaries. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0); @@ -37,7 +37,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/ConnectNPC.md b/frontend/docs/scripting/functions/ConnectNPC.md index 75ef727f5169..9db941e3cf8f 100644 --- a/frontend/docs/scripting/functions/ConnectNPC.md +++ b/frontend/docs/scripting/functions/ConnectNPC.md @@ -26,7 +26,7 @@ This function always return **1**. ## Examples -```c +```pawn public OnGameModeInit() { ConnectNPC("[BOT]Pilot", "pilot"); @@ -34,7 +34,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CountRunningTimers.md b/frontend/docs/scripting/functions/CountRunningTimers.md index 97bea16e7b8c..770e185399cb 100644 --- a/frontend/docs/scripting/functions/CountRunningTimers.md +++ b/frontend/docs/scripting/functions/CountRunningTimers.md @@ -17,7 +17,7 @@ Returns the amount of running timers. ## Examples -```c +```pawn printf("Running timers: %d", CountRunningTimers()); ``` diff --git a/frontend/docs/scripting/functions/Create3DTextLabel.md b/frontend/docs/scripting/functions/Create3DTextLabel.md index 6ac63355e66c..00fa584f668e 100644 --- a/frontend/docs/scripting/functions/Create3DTextLabel.md +++ b/frontend/docs/scripting/functions/Create3DTextLabel.md @@ -27,7 +27,7 @@ The ID of the newly created 3D Text Label, or `INVALID_3DTEXT_ID` if the 3D Text ## Examples -```c +```pawn public OnGameModeInit() { Create3DTextLabel("I'm at the coordinates:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); @@ -53,7 +53,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreateActor.md b/frontend/docs/scripting/functions/CreateActor.md index 555041018585..d3c5cdda00c1 100644 --- a/frontend/docs/scripting/functions/CreateActor.md +++ b/frontend/docs/scripting/functions/CreateActor.md @@ -27,7 +27,7 @@ INVALID_ACTOR_ID (65535) If the actor limit (1000) is reached. ## Examples -```c +```pawn new gActorCJ; public OnGameModeInit() @@ -43,7 +43,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreateExplosion.md b/frontend/docs/scripting/functions/CreateExplosion.md index da6d0a98a4d9..d927ef1ae7c3 100644 --- a/frontend/docs/scripting/functions/CreateExplosion.md +++ b/frontend/docs/scripting/functions/CreateExplosion.md @@ -2,7 +2,7 @@ title: CreateExplosion sidebar_label: CreateExplosion description: Create an explosion at the specified coordinates. -tags: [] +tags: ["explosion"] --- ## Description @@ -23,7 +23,7 @@ This function always returns **1**, even when the explosion type and/or radius v ## Examples -```c +```pawn public OnPlayerEnterCheckpoint(playerid) { // Get the player's position @@ -37,7 +37,7 @@ public OnPlayerEnterCheckpoint(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreateExplosionForPlayer.md b/frontend/docs/scripting/functions/CreateExplosionForPlayer.md index 8bbccb26df05..07c2bcefffbd 100644 --- a/frontend/docs/scripting/functions/CreateExplosionForPlayer.md +++ b/frontend/docs/scripting/functions/CreateExplosionForPlayer.md @@ -24,7 +24,7 @@ This function always returns **true**, even if the function failed to excute (pl ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/burnme", true) == 0) @@ -38,7 +38,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreateMenu.md b/frontend/docs/scripting/functions/CreateMenu.md index d036552eb572..00637bea2e0c 100644 --- a/frontend/docs/scripting/functions/CreateMenu.md +++ b/frontend/docs/scripting/functions/CreateMenu.md @@ -25,7 +25,7 @@ The ID of the new menu or **-1** on failure. ## Examples -```c +```pawn new Menu:exampleMenu; public OnGameModeInit() @@ -35,7 +35,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreateObject.md b/frontend/docs/scripting/functions/CreateObject.md index 88d5b83440f6..bce02ad34d19 100644 --- a/frontend/docs/scripting/functions/CreateObject.md +++ b/frontend/docs/scripting/functions/CreateObject.md @@ -26,7 +26,7 @@ The ID of the object that was created, or INVALID_OBJECT_ID if the object limit ## Examples -```c +```pawn public OnGameModeInit() { CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); // Object will render at its default distance. @@ -35,7 +35,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreatePickup.md b/frontend/docs/scripting/functions/CreatePickup.md index 3aafc924efe8..aa089a9e9dde 100644 --- a/frontend/docs/scripting/functions/CreatePickup.md +++ b/frontend/docs/scripting/functions/CreatePickup.md @@ -24,7 +24,7 @@ The ID of the created pickup, -1 on failure ([pickup max limit](../resources/lim ## Examples -```c +```pawn new pickup_Armour; // Create a variable to store the pickup ID in public OnGameModeInit() @@ -39,7 +39,7 @@ DestroyPickup(pickup_Armour); // Example of using the pickup ID pickup_Armour = 0; // pickup variable needs to be reset to avoid future conflicts ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreatePlayer3DTextLabel.md b/frontend/docs/scripting/functions/CreatePlayer3DTextLabel.md index 0e979aea5f80..4da0dcd064a4 100644 --- a/frontend/docs/scripting/functions/CreatePlayer3DTextLabel.md +++ b/frontend/docs/scripting/functions/CreatePlayer3DTextLabel.md @@ -29,7 +29,7 @@ The ID of the newly created **Player** 3D Text Label, or `INVALID_3DTEXT_ID` if ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/playerlabel", true)) @@ -51,7 +51,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreatePlayerGangZone.md b/frontend/docs/scripting/functions/CreatePlayerGangZone.md index 678120bb2ace..f4f3998dadc8 100644 --- a/frontend/docs/scripting/functions/CreatePlayerGangZone.md +++ b/frontend/docs/scripting/functions/CreatePlayerGangZone.md @@ -25,7 +25,7 @@ The ID of the created player gangzone, returns **-1** if not created ## Examples -```c +```pawn // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS]; @@ -50,7 +50,7 @@ public OnPlayerConnect(playerid) MinY ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/CreatePlayerObject.md b/frontend/docs/scripting/functions/CreatePlayerObject.md index 373a55450d43..e938b93ad15b 100644 --- a/frontend/docs/scripting/functions/CreatePlayerObject.md +++ b/frontend/docs/scripting/functions/CreatePlayerObject.md @@ -27,7 +27,7 @@ The ID of the object that was created, or INVALID_OBJECT_ID if the object limit ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/CreatePlayerPickup.md b/frontend/docs/scripting/functions/CreatePlayerPickup.md index 78d29c73f9b0..8b72c9c7cc98 100644 --- a/frontend/docs/scripting/functions/CreatePlayerPickup.md +++ b/frontend/docs/scripting/functions/CreatePlayerPickup.md @@ -27,7 +27,7 @@ The ID of the created player-pickup, **-1** on failure (pickup max limit). ## Examples -```c +```pawn new PlayerPickupArmour[MAX_PLAYERS]; // Create a variable to store the player-pickup ID in public OnPlayerConnect(playerid) @@ -38,7 +38,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreatePlayerTextDraw.md b/frontend/docs/scripting/functions/CreatePlayerTextDraw.md index 51773ae7a7cb..d727a89f1354 100644 --- a/frontend/docs/scripting/functions/CreatePlayerTextDraw.md +++ b/frontend/docs/scripting/functions/CreatePlayerTextDraw.md @@ -23,7 +23,7 @@ The ID of the created textdraw ## Examples -```c +```pawn // This variable is used to store the id of the textdraw // so that we can use it throught the script new PlayerText:welcomeText[MAX_PLAYERS]; @@ -39,7 +39,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/CreateVehicle.md b/frontend/docs/scripting/functions/CreateVehicle.md index e4f2261c3db2..cd72cda0d036 100644 --- a/frontend/docs/scripting/functions/CreateVehicle.md +++ b/frontend/docs/scripting/functions/CreateVehicle.md @@ -31,7 +31,7 @@ The vehicle ID of the vehicle created (1 to MAX_VEHICLES). ## Examples -```c +```pawn public OnGameModeInit() { // Add a Hydra (520) to the game with a respawn time of 60 seconds @@ -40,7 +40,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_Close_Modern.md b/frontend/docs/scripting/functions/DB_Close_Modern.md index cfcadd94c042..c4413d57790d 100644 --- a/frontend/docs/scripting/functions/DB_Close_Modern.md +++ b/frontend/docs/scripting/functions/DB_Close_Modern.md @@ -21,7 +21,7 @@ Closes a SQLite database connection that was opened with [DB_Open](DB_Open_Moder ## Examples -```c +```pawn static DB:gDBConnectionHandle; // ... @@ -65,7 +65,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_ExecuteQuery.md b/frontend/docs/scripting/functions/DB_ExecuteQuery.md index 60d190db3931..211dba5ba64c 100644 --- a/frontend/docs/scripting/functions/DB_ExecuteQuery.md +++ b/frontend/docs/scripting/functions/DB_ExecuteQuery.md @@ -21,7 +21,7 @@ The query result index (starting at 1) if successful, otherwise 0. ## Examples -```c +```pawn // entity_storage.inc EntityStorage_SpawnAll(DB:connectionHandle) @@ -40,7 +40,7 @@ EntityStorage_SpawnAll(DB:connectionHandle) } ``` -```c +```pawn // mode.pwn #include @@ -89,7 +89,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_FreeResultSet.md b/frontend/docs/scripting/functions/DB_FreeResultSet.md index a9bfda3b95b7..29c020ef83c1 100644 --- a/frontend/docs/scripting/functions/DB_FreeResultSet.md +++ b/frontend/docs/scripting/functions/DB_FreeResultSet.md @@ -19,7 +19,7 @@ Returns **true** if result set handle is valid, otherwise **false**. ## Examples -```c +```pawn // entity_storage.inc EntityStorage_SpawnAll(DB:connectionHandle) @@ -38,7 +38,7 @@ EntityStorage_SpawnAll(DB:connectionHandle) } ``` -```c +```pawn // mode.pwn #include diff --git a/frontend/docs/scripting/functions/DB_GetDatabaseConnectionCount.md b/frontend/docs/scripting/functions/DB_GetDatabaseConnectionCount.md index 34df86061154..11603c4c1f92 100644 --- a/frontend/docs/scripting/functions/DB_GetDatabaseConnectionCount.md +++ b/frontend/docs/scripting/functions/DB_GetDatabaseConnectionCount.md @@ -13,7 +13,7 @@ The function has no parameters. ## Examples -```c +```pawn printf("Database connection count: %d", DB_GetDatabaseConnectionCount()); ``` diff --git a/frontend/docs/scripting/functions/DB_GetDatabaseResultSetCount.md b/frontend/docs/scripting/functions/DB_GetDatabaseResultSetCount.md index b79d1e3d22cb..8d1e8d5c7556 100644 --- a/frontend/docs/scripting/functions/DB_GetDatabaseResultSetCount.md +++ b/frontend/docs/scripting/functions/DB_GetDatabaseResultSetCount.md @@ -13,7 +13,7 @@ The function has no parameters. ## Examples -```c +```pawn printf("Database result set count: %d", DB_GetDatabaseResultSetCount()); ``` diff --git a/frontend/docs/scripting/functions/DB_GetFieldCount.md b/frontend/docs/scripting/functions/DB_GetFieldCount.md index 9055972cde4e..585a9c2902a6 100644 --- a/frontend/docs/scripting/functions/DB_GetFieldCount.md +++ b/frontend/docs/scripting/functions/DB_GetFieldCount.md @@ -19,7 +19,7 @@ The number of fields in the result. ## Example -```c +```pawn // examples.inc // ... @@ -94,7 +94,7 @@ Float:Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -145,7 +145,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetFieldFloat.md b/frontend/docs/scripting/functions/DB_GetFieldFloat.md index d4236b5c1c01..bfd5fd55a166 100644 --- a/frontend/docs/scripting/functions/DB_GetFieldFloat.md +++ b/frontend/docs/scripting/functions/DB_GetFieldFloat.md @@ -20,7 +20,7 @@ Retrieved value as a floating point number. ## Example -```c +```pawn // examples.inc // ... @@ -95,7 +95,7 @@ Float:Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -146,7 +146,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetFieldFloatByName.md b/frontend/docs/scripting/functions/DB_GetFieldFloatByName.md index b46922a5d52d..055f71ef972a 100644 --- a/frontend/docs/scripting/functions/DB_GetFieldFloatByName.md +++ b/frontend/docs/scripting/functions/DB_GetFieldFloatByName.md @@ -20,7 +20,7 @@ Retrieved value as floating point number. ## Example -```c +```pawn // examples.inc // ... @@ -55,7 +55,7 @@ Float:Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -106,7 +106,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetFieldInt.md b/frontend/docs/scripting/functions/DB_GetFieldInt.md index 2a4ba511ee30..889dbdf3b333 100644 --- a/frontend/docs/scripting/functions/DB_GetFieldInt.md +++ b/frontend/docs/scripting/functions/DB_GetFieldInt.md @@ -20,7 +20,7 @@ Retrieved value as an integer. ## Example -```c +```pawn // examples.inc // ... @@ -95,7 +95,7 @@ Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -146,7 +146,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetFieldIntByName.md b/frontend/docs/scripting/functions/DB_GetFieldIntByName.md index 6e48ebbd3cea..8084406d2f65 100644 --- a/frontend/docs/scripting/functions/DB_GetFieldIntByName.md +++ b/frontend/docs/scripting/functions/DB_GetFieldIntByName.md @@ -20,7 +20,7 @@ Retrieved value as an integer. ## Example -```c +```pawn // examples.inc // ... @@ -55,7 +55,7 @@ Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -106,7 +106,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetFieldName.md b/frontend/docs/scripting/functions/DB_GetFieldName.md index f15625a5e766..2b128e987026 100644 --- a/frontend/docs/scripting/functions/DB_GetFieldName.md +++ b/frontend/docs/scripting/functions/DB_GetFieldName.md @@ -22,7 +22,7 @@ Returns **true** if result set handle is valid, otherwise **false**. ## Examples -```c +```pawn static DB:gDBConnectionHandle; public OnGameModeInit() @@ -83,7 +83,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetFieldString.md b/frontend/docs/scripting/functions/DB_GetFieldString.md index eefb3b5f2cda..664b0b865c8e 100644 --- a/frontend/docs/scripting/functions/DB_GetFieldString.md +++ b/frontend/docs/scripting/functions/DB_GetFieldString.md @@ -22,7 +22,7 @@ Returns **true** if result set handle is valid and the column is available, othe ## Example -```c +```pawn // examples.inc // ... @@ -94,7 +94,7 @@ Examples_ListNames(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -145,7 +145,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetFieldStringByName.md b/frontend/docs/scripting/functions/DB_GetFieldStringByName.md index eb317efdabbd..0d0b6e299c84 100644 --- a/frontend/docs/scripting/functions/DB_GetFieldStringByName.md +++ b/frontend/docs/scripting/functions/DB_GetFieldStringByName.md @@ -22,7 +22,7 @@ Returns **true** if result set handle is valid and the column is available, othe ## Examples -```c +```pawn // examples.inc // ... @@ -54,7 +54,7 @@ Examples_ListNames(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -105,7 +105,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetLegacyDBResult.md b/frontend/docs/scripting/functions/DB_GetLegacyDBResult.md index 2237b0a0f481..57d92b87098e 100644 --- a/frontend/docs/scripting/functions/DB_GetLegacyDBResult.md +++ b/frontend/docs/scripting/functions/DB_GetLegacyDBResult.md @@ -19,7 +19,7 @@ Returns the memory handle of the database result set handle. ## Examples -```c +```pawn static DB:gDBConnectionHandle; // ... @@ -69,7 +69,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetMemHandle.md b/frontend/docs/scripting/functions/DB_GetMemHandle.md index 96ed3197c63c..211f7dc3020f 100644 --- a/frontend/docs/scripting/functions/DB_GetMemHandle.md +++ b/frontend/docs/scripting/functions/DB_GetMemHandle.md @@ -19,7 +19,7 @@ Returns the memory handle of the database connection handle. ## Examples -```c +```pawn static DB:gDBConnectionHandle; // ... @@ -64,7 +64,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_GetRowCount.md b/frontend/docs/scripting/functions/DB_GetRowCount.md index 6330a4874dbb..63b275234238 100644 --- a/frontend/docs/scripting/functions/DB_GetRowCount.md +++ b/frontend/docs/scripting/functions/DB_GetRowCount.md @@ -19,7 +19,7 @@ The number of rows in the result. ## Examples -```c +```pawn // examples.inc // ... @@ -43,7 +43,7 @@ Examples_CountVehicles(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -94,7 +94,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_Open_Modern.md b/frontend/docs/scripting/functions/DB_Open_Modern.md index 17ad2da3b290..962418d422ae 100644 --- a/frontend/docs/scripting/functions/DB_Open_Modern.md +++ b/frontend/docs/scripting/functions/DB_Open_Modern.md @@ -20,7 +20,7 @@ Returns index (**starting at 1**) of the database connection. ## Examples -```c +```pawn static DB:gDBConnectionHandle; // ... @@ -64,7 +64,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DB_SelectNextRow.md b/frontend/docs/scripting/functions/DB_SelectNextRow.md index b815da12a73c..fa00d6d35024 100644 --- a/frontend/docs/scripting/functions/DB_SelectNextRow.md +++ b/frontend/docs/scripting/functions/DB_SelectNextRow.md @@ -19,7 +19,7 @@ Returns **true** if result set handle is valid and the last row is not reached y ## Examples -```c +```pawn // examples.inc // ... @@ -51,7 +51,7 @@ Examples_ListNames(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -102,7 +102,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/Delete3DTextLabel.md b/frontend/docs/scripting/functions/Delete3DTextLabel.md index ba66dffc2eb2..605cb73149b1 100644 --- a/frontend/docs/scripting/functions/Delete3DTextLabel.md +++ b/frontend/docs/scripting/functions/Delete3DTextLabel.md @@ -19,7 +19,7 @@ Delete a 3D text label (created with [Create3DTextLabel](Create3DTextLabel)). ## Examples -```c +```pawn new Text3D:gMyLabel; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/DeletePVar.md b/frontend/docs/scripting/functions/DeletePVar.md index 937f2d615532..00da1855ca20 100644 --- a/frontend/docs/scripting/functions/DeletePVar.md +++ b/frontend/docs/scripting/functions/DeletePVar.md @@ -22,7 +22,7 @@ Deletes a previously set player variable. ## Examples -```c +```pawn SetPVarInt(playerid, "SomeVarName", 69); // Later on, when the variable is no longer needed... @@ -30,7 +30,7 @@ SetPVarInt(playerid, "SomeVarName", 69); DeletePVar(playerid, "SomeVarName"); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/DeletePlayer3DTextLabel.md b/frontend/docs/scripting/functions/DeletePlayer3DTextLabel.md index c86fa3bf16c8..034a849a7ad4 100644 --- a/frontend/docs/scripting/functions/DeletePlayer3DTextLabel.md +++ b/frontend/docs/scripting/functions/DeletePlayer3DTextLabel.md @@ -22,7 +22,7 @@ Destroy a 3D text label that was created using [CreatePlayer3DTextLabel](CreateP ## Examples -```c +```pawn new PlayerText3D:playerTextId[MAX_PLAYERS]; public OnPlayerSpawn(playerid) diff --git a/frontend/docs/scripting/functions/DeleteSVar.md b/frontend/docs/scripting/functions/DeleteSVar.md index 12d88dde41b8..cda1ada562e0 100644 --- a/frontend/docs/scripting/functions/DeleteSVar.md +++ b/frontend/docs/scripting/functions/DeleteSVar.md @@ -21,7 +21,7 @@ Deletes a previously set server variable. ## Examples -```c +```pawn SetSVarInt("SomeVarName", 69); // Later on, when the variable is no longer needed... @@ -29,7 +29,7 @@ SetSVarInt("SomeVarName", 69); DeleteSVar("SomeVarName"); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/DestroyActor.md b/frontend/docs/scripting/functions/DestroyActor.md index a408798e6618..b2afa18b9628 100644 --- a/frontend/docs/scripting/functions/DestroyActor.md +++ b/frontend/docs/scripting/functions/DestroyActor.md @@ -23,7 +23,7 @@ Destroy an actor which was created with [CreateActor](CreateActor). ## Examples -```c +```pawn new MyActor; public OnFilterScriptInit() diff --git a/frontend/docs/scripting/functions/DestroyMenu.md b/frontend/docs/scripting/functions/DestroyMenu.md index ce31eede8cfc..5ccc82983283 100644 --- a/frontend/docs/scripting/functions/DestroyMenu.md +++ b/frontend/docs/scripting/functions/DestroyMenu.md @@ -19,7 +19,7 @@ Destroys the specified menu. ## Examples -```c +```pawn new Menu:exampleMenu; exampleMenu = CreateMenu("Your Menu", 2, 200.0, 100.0, 150.0, 150.0); diff --git a/frontend/docs/scripting/functions/DestroyObject.md b/frontend/docs/scripting/functions/DestroyObject.md index 94574d098c6c..c9b9b9c842b8 100644 --- a/frontend/docs/scripting/functions/DestroyObject.md +++ b/frontend/docs/scripting/functions/DestroyObject.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnObjectMoved(objectid) { DestroyObject(objectid); diff --git a/frontend/docs/scripting/functions/DestroyPickup.md b/frontend/docs/scripting/functions/DestroyPickup.md index dec2bc717f55..a855d24833a9 100644 --- a/frontend/docs/scripting/functions/DestroyPickup.md +++ b/frontend/docs/scripting/functions/DestroyPickup.md @@ -21,7 +21,7 @@ Destroys a pickup created with [CreatePickup](CreatePickup). ## Examples -```c +```pawn new g_PickupArmour; // Create a pickup for armor. diff --git a/frontend/docs/scripting/functions/DestroyPlayerObject.md b/frontend/docs/scripting/functions/DestroyPlayerObject.md index f4fdae6f0a8d..8b429ff9f689 100644 --- a/frontend/docs/scripting/functions/DestroyPlayerObject.md +++ b/frontend/docs/scripting/functions/DestroyPlayerObject.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerObjectMoved(playerid, objectid) { DestroyPlayerObject(playerid, objectid); diff --git a/frontend/docs/scripting/functions/DestroyPlayerPickup.md b/frontend/docs/scripting/functions/DestroyPlayerPickup.md index 2b6407c4e811..5c21cd7610e6 100644 --- a/frontend/docs/scripting/functions/DestroyPlayerPickup.md +++ b/frontend/docs/scripting/functions/DestroyPlayerPickup.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerPickupArmour[MAX_PLAYERS]; // Create a variable to store the player-pickup ID in public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/DestroyVehicle.md b/frontend/docs/scripting/functions/DestroyVehicle.md index 238779fb5d67..0291bfa79e21 100644 --- a/frontend/docs/scripting/functions/DestroyVehicle.md +++ b/frontend/docs/scripting/functions/DestroyVehicle.md @@ -21,7 +21,7 @@ Destroy a vehicle. It will disappear instantly. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/destroyveh", true) == 0) diff --git a/frontend/docs/scripting/functions/DetachTrailerFromVehicle.md b/frontend/docs/scripting/functions/DetachTrailerFromVehicle.md index 2a0c4654cf66..ea1abeddd35a 100644 --- a/frontend/docs/scripting/functions/DetachTrailerFromVehicle.md +++ b/frontend/docs/scripting/functions/DetachTrailerFromVehicle.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn DetachTrailerFromVehicle(vehicleid); ``` diff --git a/frontend/docs/scripting/functions/DisableInteriorEnterExits.md b/frontend/docs/scripting/functions/DisableInteriorEnterExits.md index ee92ac847054..6c44a5427068 100644 --- a/frontend/docs/scripting/functions/DisableInteriorEnterExits.md +++ b/frontend/docs/scripting/functions/DisableInteriorEnterExits.md @@ -15,7 +15,7 @@ This function always returns **true**. ## Examples -```c +```pawn public OnGameModeInit() { DisableInteriorEnterExits(); @@ -23,7 +23,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DisableMenu.md b/frontend/docs/scripting/functions/DisableMenu.md index 1bcf939afb88..261ee11cb85d 100644 --- a/frontend/docs/scripting/functions/DisableMenu.md +++ b/frontend/docs/scripting/functions/DisableMenu.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new WeaponMenu; public OnGameModeInit() @@ -43,7 +43,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DisableMenuRow.md b/frontend/docs/scripting/functions/DisableMenuRow.md index 8cb8ec9ec1db..ca1ab9e3e2b1 100644 --- a/frontend/docs/scripting/functions/DisableMenuRow.md +++ b/frontend/docs/scripting/functions/DisableMenuRow.md @@ -22,7 +22,7 @@ If an invalid row is specified, nothing will happen. ## Examples -```c +```pawn new Menu:WeaponMenu; public OnGameModeInit() @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DisableNameTagLOS.md b/frontend/docs/scripting/functions/DisableNameTagLOS.md index 01e4d11cfd83..bb4c99376e48 100644 --- a/frontend/docs/scripting/functions/DisableNameTagLOS.md +++ b/frontend/docs/scripting/functions/DisableNameTagLOS.md @@ -2,7 +2,7 @@ title: DisableNameTagLOS sidebar_label: DisableNameTagLOS description: Disables the nametag Line-Of-Sight checking so that players can see nametags through objects. -tags: [] +tags: ["player", "nametag"] --- ## Description @@ -15,7 +15,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { DisableNameTagLOS(); @@ -23,7 +23,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/DisablePlayerCheckpoint.md b/frontend/docs/scripting/functions/DisablePlayerCheckpoint.md index b8b892072c5e..03387820201a 100644 --- a/frontend/docs/scripting/functions/DisablePlayerCheckpoint.md +++ b/frontend/docs/scripting/functions/DisablePlayerCheckpoint.md @@ -21,7 +21,7 @@ Disables (hides/destroys) a player's set checkpoint. Players can only have a sin ## Examples -```c +```pawn public OnPlayerEnterCheckpoint(playerid) { DisablePlayerCheckpoint(playerid); diff --git a/frontend/docs/scripting/functions/DisablePlayerRaceCheckpoint.md b/frontend/docs/scripting/functions/DisablePlayerRaceCheckpoint.md index 6466cbf30ad0..ce8bb73bba77 100644 --- a/frontend/docs/scripting/functions/DisablePlayerRaceCheckpoint.md +++ b/frontend/docs/scripting/functions/DisablePlayerRaceCheckpoint.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerLeaveRaceCheckpoint(playerid) { DisablePlayerRaceCheckpoint(playerid); diff --git a/frontend/docs/scripting/functions/DisableRemoteVehicleCollisions.md b/frontend/docs/scripting/functions/DisableRemoteVehicleCollisions.md index 9aee94dae22f..c86e132ac3e6 100644 --- a/frontend/docs/scripting/functions/DisableRemoteVehicleCollisions.md +++ b/frontend/docs/scripting/functions/DisableRemoteVehicleCollisions.md @@ -24,7 +24,7 @@ Disables collisions between occupied vehicles for a player. ## Examples -```c +```pawn new bool:gPlayerVehicleCollision[MAX_PLAYERS]; public OnPlayerCommandText(playerid, cmdtext[]) diff --git a/frontend/docs/scripting/functions/EditAttachedObject.md b/frontend/docs/scripting/functions/EditAttachedObject.md index 90245b51522d..47dae62c429a 100644 --- a/frontend/docs/scripting/functions/EditAttachedObject.md +++ b/frontend/docs/scripting/functions/EditAttachedObject.md @@ -20,7 +20,7 @@ Enter edition mode for an attached object. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { SetPlayerAttachedObject(playerid, 0, 1337, 2); @@ -38,7 +38,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/EditObject.md b/frontend/docs/scripting/functions/EditObject.md index 59541c4aa9dd..d7c964d72095 100644 --- a/frontend/docs/scripting/functions/EditObject.md +++ b/frontend/docs/scripting/functions/EditObject.md @@ -2,7 +2,7 @@ title: EditObject sidebar_label: EditObject description: Allows a player to edit an object (position and rotation) using their mouse on a GUI (Graphical User Interface). -tags: [] +tags: ["player", "object"] --- ## Description @@ -22,7 +22,7 @@ Allows a player to edit an object (position and rotation) using their mouse on a ## Examples -```c +```pawn new object; public OnGameModeInit() { @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/EditPlayerClass.md b/frontend/docs/scripting/functions/EditPlayerClass.md index 654e12e9f102..24e3ad863344 100644 --- a/frontend/docs/scripting/functions/EditPlayerClass.md +++ b/frontend/docs/scripting/functions/EditPlayerClass.md @@ -29,7 +29,7 @@ Edit a class data. ## Examples -```c +```pawn // Edit class id 10 EditPlayerClass(10, TEAM_NONE, 299, -253.8291, 2602.9312, 62.8527, -90.0000, WEAPON_KNIFE, 1, WEAPON_MP5, 100, WEAPON_COLT45, 20); ``` diff --git a/frontend/docs/scripting/functions/EditPlayerObject.md b/frontend/docs/scripting/functions/EditPlayerObject.md index 300caa2f02e8..e75b7ae7ed33 100644 --- a/frontend/docs/scripting/functions/EditPlayerObject.md +++ b/frontend/docs/scripting/functions/EditPlayerObject.md @@ -22,7 +22,7 @@ Allows players to edit a player-object (position and rotation) with a GUI and th ## Examples -```c +```pawn new object[MAX_PLAYERS]; public OnPlayerSpawn(playerid) { @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/EnableAllAnimations.md b/frontend/docs/scripting/functions/EnableAllAnimations.md index 80f2dd081032..fe5bf45b6ed4 100644 --- a/frontend/docs/scripting/functions/EnableAllAnimations.md +++ b/frontend/docs/scripting/functions/EnableAllAnimations.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { EnableAllAnimations(true); @@ -29,7 +29,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/EnablePlayerCameraTarget.md b/frontend/docs/scripting/functions/EnablePlayerCameraTarget.md index d68526827751..5ed82621ac61 100644 --- a/frontend/docs/scripting/functions/EnablePlayerCameraTarget.md +++ b/frontend/docs/scripting/functions/EnablePlayerCameraTarget.md @@ -24,7 +24,7 @@ Toggle camera targeting functions for a player. Disabled by default to save band ## Examples -```c +```pawn public OnPlayerConnect(playerid) { EnablePlayerCameraTarget(playerid, true); diff --git a/frontend/docs/scripting/functions/EnableStuntBonusForAll.md b/frontend/docs/scripting/functions/EnableStuntBonusForAll.md index 3cfe288b54cb..698171ba22ef 100644 --- a/frontend/docs/scripting/functions/EnableStuntBonusForAll.md +++ b/frontend/docs/scripting/functions/EnableStuntBonusForAll.md @@ -2,7 +2,7 @@ title: EnableStuntBonusForAll sidebar_label: EnableStuntBonusForAll description: Enables or disables stunt bonuses for all players. -tags: [] +tags: ["player", "stunt bonus"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { EnableStuntBonusForAll(false); @@ -27,7 +27,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/EnableStuntBonusForPlayer.md b/frontend/docs/scripting/functions/EnableStuntBonusForPlayer.md index dfcd410afb05..c60930ea40a0 100644 --- a/frontend/docs/scripting/functions/EnableStuntBonusForPlayer.md +++ b/frontend/docs/scripting/functions/EnableStuntBonusForPlayer.md @@ -22,7 +22,7 @@ Toggle stunt bonuses for a player. Enabled by default. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { EnableStuntBonusForPlayer(playerid, false); // Disable stunt bonuses when the player connects to the server. diff --git a/frontend/docs/scripting/functions/EnableTirePopping.md b/frontend/docs/scripting/functions/EnableTirePopping.md index 241f852fceaf..aa8a18d7d228 100644 --- a/frontend/docs/scripting/functions/EnableTirePopping.md +++ b/frontend/docs/scripting/functions/EnableTirePopping.md @@ -2,7 +2,7 @@ title: EnableTirePopping sidebar_label: EnableTirePopping description: With this function you can enable or disable tire popping. -tags: [] +tags: ["vehicle"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { // This will disable tire popping on your gamemode. @@ -28,7 +28,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/EnableVehicleFriendlyFire.md b/frontend/docs/scripting/functions/EnableVehicleFriendlyFire.md index 3353afc93609..51aad6b9a1c3 100644 --- a/frontend/docs/scripting/functions/EnableVehicleFriendlyFire.md +++ b/frontend/docs/scripting/functions/EnableVehicleFriendlyFire.md @@ -15,7 +15,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { EnableVehicleFriendlyFire(); diff --git a/frontend/docs/scripting/functions/EnableZoneNames.md b/frontend/docs/scripting/functions/EnableZoneNames.md index ba030cae0917..845af1363ba8 100644 --- a/frontend/docs/scripting/functions/EnableZoneNames.md +++ b/frontend/docs/scripting/functions/EnableZoneNames.md @@ -2,7 +2,7 @@ title: EnableZoneNames sidebar_label: EnableZoneNames description: This function allows to turn on zone / area names such as the "Vinewood" or "Doherty" text at the bottom-right of the screen as they enter the area. -tags: [] +tags: ["zone"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { EnableZoneNames(true); @@ -27,7 +27,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/EndObjectEditing.md b/frontend/docs/scripting/functions/EndObjectEditing.md index 7906b87e7446..0df9d8857dd9 100644 --- a/frontend/docs/scripting/functions/EndObjectEditing.md +++ b/frontend/docs/scripting/functions/EndObjectEditing.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/stopedit", true)) diff --git a/frontend/docs/scripting/functions/ForceClassSelection.md b/frontend/docs/scripting/functions/ForceClassSelection.md index 21afe3b286b2..258607978d61 100644 --- a/frontend/docs/scripting/functions/ForceClassSelection.md +++ b/frontend/docs/scripting/functions/ForceClassSelection.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/class", true)) @@ -33,7 +33,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GameModeExit.md b/frontend/docs/scripting/functions/GameModeExit.md index d7b96542d49a..4b92208e8dcf 100644 --- a/frontend/docs/scripting/functions/GameModeExit.md +++ b/frontend/docs/scripting/functions/GameModeExit.md @@ -2,7 +2,7 @@ title: GameModeExit sidebar_label: GameModeExit description: Ends the current gamemode. -tags: [] +tags: ["gamemode"] --- ## Description @@ -15,7 +15,7 @@ This function does not return any specific values. ## Examples -```c +```pawn if (OneTeamHasWon) { GameModeExit(); diff --git a/frontend/docs/scripting/functions/GameTextForAll.md b/frontend/docs/scripting/functions/GameTextForAll.md index dd6cdecf8de8..7aeb762dffee 100644 --- a/frontend/docs/scripting/functions/GameTextForAll.md +++ b/frontend/docs/scripting/functions/GameTextForAll.md @@ -22,7 +22,7 @@ This function always returns **1**. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // This example shows a large, white text saying "[playerName] has @@ -42,7 +42,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GameTextForPlayer.md b/frontend/docs/scripting/functions/GameTextForPlayer.md index 4a715c313b14..a716c3af03ec 100644 --- a/frontend/docs/scripting/functions/GameTextForPlayer.md +++ b/frontend/docs/scripting/functions/GameTextForPlayer.md @@ -25,7 +25,7 @@ Shows 'game text' (on-screen text) for a certain length of time for a specific p ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { GameTextForPlayer(playerid, "Wasted", 5000, 2); @@ -41,7 +41,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GangZoneCreate.md b/frontend/docs/scripting/functions/GangZoneCreate.md index 2c5df7d9b1a1..eb38b24270b4 100644 --- a/frontend/docs/scripting/functions/GangZoneCreate.md +++ b/frontend/docs/scripting/functions/GangZoneCreate.md @@ -22,7 +22,7 @@ The ID of the created zone, returns **-1** if not created ## Examples -```c +```pawn new gangZone; public OnGameModeInit() @@ -45,7 +45,7 @@ public OnGameModeInit() MinY ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GangZoneDestroy.md b/frontend/docs/scripting/functions/GangZoneDestroy.md index 8eadaee21251..d3335c058d7a 100644 --- a/frontend/docs/scripting/functions/GangZoneDestroy.md +++ b/frontend/docs/scripting/functions/GangZoneDestroy.md @@ -21,7 +21,7 @@ Destroy a gangzone. ## Examples -```c +```pawn new gangZone; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneFlashForAll.md b/frontend/docs/scripting/functions/GangZoneFlashForAll.md index da4a1117c10a..af0a2bc0c856 100644 --- a/frontend/docs/scripting/functions/GangZoneFlashForAll.md +++ b/frontend/docs/scripting/functions/GangZoneFlashForAll.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new gGangZoneId; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneFlashForPlayer.md b/frontend/docs/scripting/functions/GangZoneFlashForPlayer.md index 52563ff61265..c5c80cf0325a 100644 --- a/frontend/docs/scripting/functions/GangZoneFlashForPlayer.md +++ b/frontend/docs/scripting/functions/GangZoneFlashForPlayer.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new gGangZoneId; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneGetPos.md b/frontend/docs/scripting/functions/GangZoneGetPos.md index 9f3a449105f0..781c8d6cdf49 100644 --- a/frontend/docs/scripting/functions/GangZoneGetPos.md +++ b/frontend/docs/scripting/functions/GangZoneGetPos.md @@ -25,7 +25,7 @@ This function always returns **true**. ## Examples -```c +```pawn new gangZone; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneHideForAll.md b/frontend/docs/scripting/functions/GangZoneHideForAll.md index 6b0926dc76e2..b60a482197c2 100644 --- a/frontend/docs/scripting/functions/GangZoneHideForAll.md +++ b/frontend/docs/scripting/functions/GangZoneHideForAll.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new gGangZoneId; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneHideForPlayer.md b/frontend/docs/scripting/functions/GangZoneHideForPlayer.md index 2bb72057571c..a4f5cc3a1fae 100644 --- a/frontend/docs/scripting/functions/GangZoneHideForPlayer.md +++ b/frontend/docs/scripting/functions/GangZoneHideForPlayer.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new gGangZoneId; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneShowForAll.md b/frontend/docs/scripting/functions/GangZoneShowForAll.md index 8331eda0e321..518ed4920ed2 100644 --- a/frontend/docs/scripting/functions/GangZoneShowForAll.md +++ b/frontend/docs/scripting/functions/GangZoneShowForAll.md @@ -22,7 +22,7 @@ Shows a gangzone with the desired color to all players. ## Examples -```c +```pawn new gGangZoneId; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneShowForPlayer.md b/frontend/docs/scripting/functions/GangZoneShowForPlayer.md index 27a4f0d3e578..d6b6e04b0f71 100644 --- a/frontend/docs/scripting/functions/GangZoneShowForPlayer.md +++ b/frontend/docs/scripting/functions/GangZoneShowForPlayer.md @@ -21,7 +21,7 @@ Show a gangzone for a player. Must be created with [GangZoneCreate](GangZoneCrea ## Examples -```c +```pawn new gGangZoneId; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneStopFlashForAll.md b/frontend/docs/scripting/functions/GangZoneStopFlashForAll.md index 47e60a916546..eb93cd8f9874 100644 --- a/frontend/docs/scripting/functions/GangZoneStopFlashForAll.md +++ b/frontend/docs/scripting/functions/GangZoneStopFlashForAll.md @@ -21,7 +21,7 @@ Stops a gangzone flashing for all players. ## Examples -```c +```pawn new gGangZoneId; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GangZoneStopFlashForPlayer.md b/frontend/docs/scripting/functions/GangZoneStopFlashForPlayer.md index 92aa867ebc62..a8140e65c3f6 100644 --- a/frontend/docs/scripting/functions/GangZoneStopFlashForPlayer.md +++ b/frontend/docs/scripting/functions/GangZoneStopFlashForPlayer.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new gGangZoneId; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/Get3DTextLabelAttachedData.md b/frontend/docs/scripting/functions/Get3DTextLabelAttachedData.md index 611927260a45..d0ec8aafa060 100644 --- a/frontend/docs/scripting/functions/Get3DTextLabelAttachedData.md +++ b/frontend/docs/scripting/functions/Get3DTextLabelAttachedData.md @@ -21,7 +21,7 @@ Gets the 3D text label attached data. An example for **parentPlayerid**: -```c +```pawn new Text3D:gMyLabel; new parentPlayerid; new parentVehicleid; @@ -34,7 +34,7 @@ Get3DTextLabelAttachedData(gMyLabel, parentPlayerid, parentVehicleid); An example for **parentVehicleid**: -```c +```pawn new Text3D:gVehicle3dText[MAX_VEHICLES]; new gVehicleId; diff --git a/frontend/docs/scripting/functions/Get3DTextLabelColor.md b/frontend/docs/scripting/functions/Get3DTextLabelColor.md index af0bed6ae05e..442c506afc40 100644 --- a/frontend/docs/scripting/functions/Get3DTextLabelColor.md +++ b/frontend/docs/scripting/functions/Get3DTextLabelColor.md @@ -25,7 +25,7 @@ Returns the 3D text label color. ## Examples -```c +```pawn new Text3D:gMyLabel; gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); diff --git a/frontend/docs/scripting/functions/Get3DTextLabelColour.md b/frontend/docs/scripting/functions/Get3DTextLabelColour.md index 0af427f4910a..e7ee66298a8b 100644 --- a/frontend/docs/scripting/functions/Get3DTextLabelColour.md +++ b/frontend/docs/scripting/functions/Get3DTextLabelColour.md @@ -21,7 +21,7 @@ Returns the 3D text label colour. ## Examples -```c +```pawn new Text3D:gMyLabel; gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); diff --git a/frontend/docs/scripting/functions/Get3DTextLabelDrawDistance.md b/frontend/docs/scripting/functions/Get3DTextLabelDrawDistance.md index a060fabd86f7..ec5805716c08 100644 --- a/frontend/docs/scripting/functions/Get3DTextLabelDrawDistance.md +++ b/frontend/docs/scripting/functions/Get3DTextLabelDrawDistance.md @@ -21,7 +21,7 @@ Returns the draw distance of the 3D text label as float. ## Examples -```c +```pawn new Text3D:gMyLabel; new Float:drawDistance; diff --git a/frontend/docs/scripting/functions/Get3DTextLabelLOS.md b/frontend/docs/scripting/functions/Get3DTextLabelLOS.md index 2e98250b4a13..c654a8964c1d 100644 --- a/frontend/docs/scripting/functions/Get3DTextLabelLOS.md +++ b/frontend/docs/scripting/functions/Get3DTextLabelLOS.md @@ -21,7 +21,7 @@ Returns the line-of-sight of the 3D text label as boolean (`false`/`true`). ## Examples -```c +```pawn new Text3D:gMyLabel; new bool:testLOS; diff --git a/frontend/docs/scripting/functions/Get3DTextLabelPos.md b/frontend/docs/scripting/functions/Get3DTextLabelPos.md index 46f1b86d5735..c8b1c5faad7e 100644 --- a/frontend/docs/scripting/functions/Get3DTextLabelPos.md +++ b/frontend/docs/scripting/functions/Get3DTextLabelPos.md @@ -20,7 +20,7 @@ Gets the 3D text label position. ## Examples -```c +```pawn new Text3D:gMyLabel; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/Get3DTextLabelText.md b/frontend/docs/scripting/functions/Get3DTextLabelText.md index e153bad7bb5d..7de1dd029e1c 100644 --- a/frontend/docs/scripting/functions/Get3DTextLabelText.md +++ b/frontend/docs/scripting/functions/Get3DTextLabelText.md @@ -19,7 +19,7 @@ Gets the 3D text label text. ## Examples -```c +```pawn new Text3D:gMyLabel; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/Get3DTextLabelVirtualWorld.md b/frontend/docs/scripting/functions/Get3DTextLabelVirtualWorld.md index 01c903d91bcb..639a7b3ed9de 100644 --- a/frontend/docs/scripting/functions/Get3DTextLabelVirtualWorld.md +++ b/frontend/docs/scripting/functions/Get3DTextLabelVirtualWorld.md @@ -21,7 +21,7 @@ Returns the virtual world id of the 3D text label. ## Examples -```c +```pawn new Text3D:gMyLabel; new worldid; diff --git a/frontend/docs/scripting/functions/GetActorAnimation.md b/frontend/docs/scripting/functions/GetActorAnimation.md index d7a71439105a..15837acc1be6 100644 --- a/frontend/docs/scripting/functions/GetActorAnimation.md +++ b/frontend/docs/scripting/functions/GetActorAnimation.md @@ -31,7 +31,7 @@ Returns **true** if the actor is valid, otherwise returns **false**. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetActorFacingAngle.md b/frontend/docs/scripting/functions/GetActorFacingAngle.md index 0f06b4c69df8..b702eaa412eb 100644 --- a/frontend/docs/scripting/functions/GetActorFacingAngle.md +++ b/frontend/docs/scripting/functions/GetActorFacingAngle.md @@ -26,7 +26,7 @@ The actor's facing angle is stored in the specified variable. ## Examples -```c +```pawn new Float:facingAngle; GetActorFacingAngle(actorid, facingAngle); ``` diff --git a/frontend/docs/scripting/functions/GetActorHealth.md b/frontend/docs/scripting/functions/GetActorHealth.md index ef57d5b687a6..b5b061431e75 100644 --- a/frontend/docs/scripting/functions/GetActorHealth.md +++ b/frontend/docs/scripting/functions/GetActorHealth.md @@ -22,11 +22,15 @@ Get the health of an actor. **false** - failure (i.e. actor is not created). -**NOTE:** The actor's health is stored in the specified variable, not in the return value. +:::note + +The actor's health is stored in the specified variable, not in the return value. + +::: ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetActorPoolSize.md b/frontend/docs/scripting/functions/GetActorPoolSize.md index c41b01f9f026..ef32c2a1119d 100644 --- a/frontend/docs/scripting/functions/GetActorPoolSize.md +++ b/frontend/docs/scripting/functions/GetActorPoolSize.md @@ -13,7 +13,7 @@ Gets the highest actorid created on the server. Note that in SA:MP this function ## Examples -```c +```pawn SetAllActorsHealth(Float:health) { for (new i = 0, j = GetActorPoolSize(); i <= j; i++) diff --git a/frontend/docs/scripting/functions/GetActorPos.md b/frontend/docs/scripting/functions/GetActorPos.md index 914057170f8a..190d1e7929dc 100644 --- a/frontend/docs/scripting/functions/GetActorPos.md +++ b/frontend/docs/scripting/functions/GetActorPos.md @@ -28,7 +28,7 @@ The actor's position is stored in the specified variables. ## Examples -```c +```pawn new Float:x, Float:y, Float:z; GetActorPos(actorid, x, y, z); ``` diff --git a/frontend/docs/scripting/functions/GetActorSkin.md b/frontend/docs/scripting/functions/GetActorSkin.md index f27091a53e34..b2ea9339810c 100644 --- a/frontend/docs/scripting/functions/GetActorSkin.md +++ b/frontend/docs/scripting/functions/GetActorSkin.md @@ -21,7 +21,7 @@ Returns the actor's current skin. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetActorSpawnInfo.md b/frontend/docs/scripting/functions/GetActorSpawnInfo.md index 31da23b4a029..583ac356390f 100644 --- a/frontend/docs/scripting/functions/GetActorSpawnInfo.md +++ b/frontend/docs/scripting/functions/GetActorSpawnInfo.md @@ -26,7 +26,7 @@ Returns **true** if the actor is valid, otherwise returns **false**. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetActorVirtualWorld.md b/frontend/docs/scripting/functions/GetActorVirtualWorld.md index 54484900bcda..8e5c2b640928 100644 --- a/frontend/docs/scripting/functions/GetActorVirtualWorld.md +++ b/frontend/docs/scripting/functions/GetActorVirtualWorld.md @@ -23,7 +23,7 @@ Also returns 0 if actor specified does not exist. ## Examples -```c +```pawn new MyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetAnimationName.md b/frontend/docs/scripting/functions/GetAnimationName.md index 1251459b36f6..ada9e7cb74ae 100644 --- a/frontend/docs/scripting/functions/GetAnimationName.md +++ b/frontend/docs/scripting/functions/GetAnimationName.md @@ -2,7 +2,7 @@ title: GetAnimationName sidebar_label: GetAnimationName description: Get the animation library/name for the index. -tags: [] +tags: ["animation"] --- ## Description @@ -23,7 +23,7 @@ Get the animation library/name for the index. ## Examples -```c +```pawn public OnPlayerUpdate(playerid) { if (GetPlayerAnimationIndex(playerid)) diff --git a/frontend/docs/scripting/functions/GetAvailableClasses.md b/frontend/docs/scripting/functions/GetAvailableClasses.md index bf5038334f09..e60f5c3b7595 100644 --- a/frontend/docs/scripting/functions/GetAvailableClasses.md +++ b/frontend/docs/scripting/functions/GetAvailableClasses.md @@ -13,7 +13,7 @@ Get the number of classes defined. ## Examples -```c +```pawn printf("Available classes: %d", GetAvailableClasses()); ``` diff --git a/frontend/docs/scripting/functions/GetConsoleVarAsBool.md b/frontend/docs/scripting/functions/GetConsoleVarAsBool.md index df5c2e727f30..51da56c2fee9 100644 --- a/frontend/docs/scripting/functions/GetConsoleVarAsBool.md +++ b/frontend/docs/scripting/functions/GetConsoleVarAsBool.md @@ -2,7 +2,7 @@ title: GetConsoleVarAsBool sidebar_label: GetConsoleVarAsBool description: Get the boolean value of a console variable. -tags: [] +tags: ["server", "console variable"] --- ## Description @@ -19,7 +19,7 @@ The value of the specified console variable. 0 if the specified console variable ## Examples -```c +```pawn public OnGameModeInit() { new queryEnabled = GetConsoleVarAsBool("enable_query"); @@ -31,7 +31,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/GetConsoleVarAsFloat.md b/frontend/docs/scripting/functions/GetConsoleVarAsFloat.md index 9a347a5b0620..61efec429a61 100644 --- a/frontend/docs/scripting/functions/GetConsoleVarAsFloat.md +++ b/frontend/docs/scripting/functions/GetConsoleVarAsFloat.md @@ -2,7 +2,7 @@ title: GetConsoleVarAsFloat sidebar_label: GetConsoleVarAsFloat description: Get the float value of a console variable. -tags: [] +tags: ["server", "console variable"] --- ## Description @@ -21,12 +21,12 @@ The value of the specified console variable. ## Examples -```c +```pawn new Float:radius = GetConsoleVarAsInt("game.nametag_draw_radius"); printf("Nametag Draw Radius: %i", radius); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/GetConsoleVarAsInt.md b/frontend/docs/scripting/functions/GetConsoleVarAsInt.md index ae72401e48d7..e1056e7d6f4f 100644 --- a/frontend/docs/scripting/functions/GetConsoleVarAsInt.md +++ b/frontend/docs/scripting/functions/GetConsoleVarAsInt.md @@ -2,7 +2,7 @@ title: GetConsoleVarAsInt sidebar_label: GetConsoleVarAsInt description: Get the integer value of a console variable. -tags: [] +tags: ["server", "console variable"] --- ## Description @@ -19,12 +19,12 @@ The value of the specified console variable. 0 if the specified console variable ## Examples -```c +```pawn new serverPort = GetConsoleVarAsInt("network.port"); printf("Server Port: %i", serverPort); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/GetConsoleVarAsString.md b/frontend/docs/scripting/functions/GetConsoleVarAsString.md index a59ada8ec66a..4c8ea442e9f1 100644 --- a/frontend/docs/scripting/functions/GetConsoleVarAsString.md +++ b/frontend/docs/scripting/functions/GetConsoleVarAsString.md @@ -2,7 +2,7 @@ title: GetConsoleVarAsString sidebar_label: GetConsoleVarAsString description: Get the string value of a console variable. -tags: [] +tags: ["server", "console variable"] --- ## Description @@ -23,7 +23,7 @@ The length of the returned string. ## Examples -```c +```pawn public OnGameModeInit() { new hostname[64]; @@ -32,7 +32,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetCustomModelPath.md b/frontend/docs/scripting/functions/GetCustomModelPath.md index 349a1ced5a27..46c36afb81e9 100644 --- a/frontend/docs/scripting/functions/GetCustomModelPath.md +++ b/frontend/docs/scripting/functions/GetCustomModelPath.md @@ -21,7 +21,7 @@ Get a custom model path. ## Examples -```c +```pawn new modelid = -2000, dffPath[64], diff --git a/frontend/docs/scripting/functions/GetDefaultPlayerColour.md b/frontend/docs/scripting/functions/GetDefaultPlayerColour.md index 9934de1f4c9a..a13b6c949868 100644 --- a/frontend/docs/scripting/functions/GetDefaultPlayerColour.md +++ b/frontend/docs/scripting/functions/GetDefaultPlayerColour.md @@ -21,7 +21,7 @@ The player's default color. ## Examples -```c +```pawn new colour = GetDefaultPlayerColour(playerid); ``` diff --git a/frontend/docs/scripting/functions/GetGameText.md b/frontend/docs/scripting/functions/GetGameText.md index c6b6a44434be..87fd80b88a50 100644 --- a/frontend/docs/scripting/functions/GetGameText.md +++ b/frontend/docs/scripting/functions/GetGameText.md @@ -28,7 +28,7 @@ false - The function failed to execute. This means the player specified does not ## Examples -```c +```pawn public OnPlayerConnect(playerid) { GameTextForPlayer(playerid, "Welcome to the server!", 5000, 3); diff --git a/frontend/docs/scripting/functions/GetGravity.md b/frontend/docs/scripting/functions/GetGravity.md index 41e831038944..8c21f3067bbc 100644 --- a/frontend/docs/scripting/functions/GetGravity.md +++ b/frontend/docs/scripting/functions/GetGravity.md @@ -2,7 +2,7 @@ title: GetGravity sidebar_label: GetGravity description: Get the currently global gravity. -tags: [] +tags: ["world", "gravity"] --- ## Description @@ -17,7 +17,7 @@ The current set gravity (as a float). **SA-MP server:** -```c +```pawn #include #if !defined GetGravity @@ -33,7 +33,7 @@ public OnGameModeInit() **open.mp server:** -```c +```pawn #include public OnGameModeInit() @@ -43,7 +43,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetMaxPlayers.md b/frontend/docs/scripting/functions/GetMaxPlayers.md index d94752a01e61..db4b2692f69c 100644 --- a/frontend/docs/scripting/functions/GetMaxPlayers.md +++ b/frontend/docs/scripting/functions/GetMaxPlayers.md @@ -11,13 +11,13 @@ Returns the maximum number of players that can join the server, as set by the se ## Examples -```c +```pawn new string[128]; format(string, sizeof(string), "There are %i slots on this server!", GetMaxPlayers()); SendClientMessage(playerid, 0xFFFFFFFF, string); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetMenuColumnHeader.md b/frontend/docs/scripting/functions/GetMenuColumnHeader.md index 62dac3b3667c..2886e2f45e5f 100644 --- a/frontend/docs/scripting/functions/GetMenuColumnHeader.md +++ b/frontend/docs/scripting/functions/GetMenuColumnHeader.md @@ -24,7 +24,7 @@ This function always returns **true**. ## Examples -```c +```pawn new text[32]; // Get the menu header text in the column 1 diff --git a/frontend/docs/scripting/functions/GetMenuColumnWidth.md b/frontend/docs/scripting/functions/GetMenuColumnWidth.md index da2757425ebc..d6988e8df933 100644 --- a/frontend/docs/scripting/functions/GetMenuColumnWidth.md +++ b/frontend/docs/scripting/functions/GetMenuColumnWidth.md @@ -23,7 +23,7 @@ This function always returns **true**. ## Examples -```c +```pawn new Float:column1Width, Float:column2Width; GetMenuColumnWidth(menuid, column1Width, column2Width); diff --git a/frontend/docs/scripting/functions/GetMenuColumns.md b/frontend/docs/scripting/functions/GetMenuColumns.md index 7a572ed3c34f..ee26b1fa5684 100644 --- a/frontend/docs/scripting/functions/GetMenuColumns.md +++ b/frontend/docs/scripting/functions/GetMenuColumns.md @@ -21,7 +21,7 @@ Returns the number of active columns. ## Examples -```c +```pawn new columns = GetMenuColumns(menuid); ``` diff --git a/frontend/docs/scripting/functions/GetMenuItem.md b/frontend/docs/scripting/functions/GetMenuItem.md index 89a6e3779142..bb51146cbd80 100644 --- a/frontend/docs/scripting/functions/GetMenuItem.md +++ b/frontend/docs/scripting/functions/GetMenuItem.md @@ -25,7 +25,7 @@ This function always returns true. ## Examples -```c +```pawn new text[32]; // Get the menu item text in the column 1 and row 2 diff --git a/frontend/docs/scripting/functions/GetMenuItems.md b/frontend/docs/scripting/functions/GetMenuItems.md index 93262831d088..8fd1cba647ea 100644 --- a/frontend/docs/scripting/functions/GetMenuItems.md +++ b/frontend/docs/scripting/functions/GetMenuItems.md @@ -22,7 +22,7 @@ Returns the number of rows. ## Examples -```c +```pawn // Get the menu number of rows in the column 1 new items = GetMenuItems(menuid, 1); ``` diff --git a/frontend/docs/scripting/functions/GetMenuPos.md b/frontend/docs/scripting/functions/GetMenuPos.md index 5e041e8ae2ab..63d49e3d04db 100644 --- a/frontend/docs/scripting/functions/GetMenuPos.md +++ b/frontend/docs/scripting/functions/GetMenuPos.md @@ -23,7 +23,7 @@ This function always returns true. ## Examples -```c +```pawn new Float:x, Float:y; GetMenuPos(menuid, x, y); ``` diff --git a/frontend/docs/scripting/functions/GetModeRestartTime.md b/frontend/docs/scripting/functions/GetModeRestartTime.md index a373e8a74b56..638cba58edec 100644 --- a/frontend/docs/scripting/functions/GetModeRestartTime.md +++ b/frontend/docs/scripting/functions/GetModeRestartTime.md @@ -2,7 +2,7 @@ title: GetModeRestartTime sidebar_label: GetModeRestartTime description: Gets the delay between loading main scripts, in seconds. -tags: [] +tags: ["gamemode", "server"] --- @@ -17,7 +17,7 @@ Returns the delay as a float value. ## Examples -```c +```pawn SetModeRestartTime(5.0); new Float:seconds = GetModeRestartTime(); diff --git a/frontend/docs/scripting/functions/GetMyFacingAngle.md b/frontend/docs/scripting/functions/GetMyFacingAngle.md index 12c8834126c3..191d1501665b 100644 --- a/frontend/docs/scripting/functions/GetMyFacingAngle.md +++ b/frontend/docs/scripting/functions/GetMyFacingAngle.md @@ -2,7 +2,7 @@ title: GetMyFacingAngle sidebar_label: GetMyFacingAngle description: Get the current facing angle of the NPC. -tags: [] +tags: ["npc", "angle"] --- :::warning @@ -25,7 +25,7 @@ The facing angle is stored in the specified variable. ## Examples -```c +```pawn new Float:Angle; GetMyFacingAngle(Angle); printf("I am currently facing %f!", Angle); diff --git a/frontend/docs/scripting/functions/GetMyPos.md b/frontend/docs/scripting/functions/GetMyPos.md index 15add970120c..74f71fe263e7 100644 --- a/frontend/docs/scripting/functions/GetMyPos.md +++ b/frontend/docs/scripting/functions/GetMyPos.md @@ -27,7 +27,7 @@ This function does not return any specific values. ## Example -```c +```pawn new Float:x, Float:y, Float:z; GetMyPos(x, y, z); printf("I am currently at %f, %f, %f!", x, y, z); diff --git a/frontend/docs/scripting/functions/GetNetworkStats.md b/frontend/docs/scripting/functions/GetNetworkStats.md index 055984744337..d1388e8150e8 100644 --- a/frontend/docs/scripting/functions/GetNetworkStats.md +++ b/frontend/docs/scripting/functions/GetNetworkStats.md @@ -2,7 +2,7 @@ title: GetNetworkStats sidebar_label: GetNetworkStats description: Gets the server's network stats and stores them in a string. -tags: [] +tags: ["network monitoring"] --- ## Description @@ -20,7 +20,7 @@ This function always returns **1**. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/netstats")) diff --git a/frontend/docs/scripting/functions/GetObjectAttachedData.md b/frontend/docs/scripting/functions/GetObjectAttachedData.md index 2331b6273d47..8772579c818a 100644 --- a/frontend/docs/scripting/functions/GetObjectAttachedData.md +++ b/frontend/docs/scripting/functions/GetObjectAttachedData.md @@ -26,7 +26,7 @@ Get the attachment data of an object. ## Examples -```c +```pawn new parentVehicle, parentObject, diff --git a/frontend/docs/scripting/functions/GetObjectAttachedOffset.md b/frontend/docs/scripting/functions/GetObjectAttachedOffset.md index fa5b359ffe1c..e9f0c9eebd4d 100644 --- a/frontend/docs/scripting/functions/GetObjectAttachedOffset.md +++ b/frontend/docs/scripting/functions/GetObjectAttachedOffset.md @@ -29,7 +29,7 @@ Get the attachment offset and rotation of an object. ## Examples -```c +```pawn new Float:offsetX, Float:offsetY, diff --git a/frontend/docs/scripting/functions/GetObjectDrawDistance.md b/frontend/docs/scripting/functions/GetObjectDrawDistance.md index 1056b1107a23..f3a2a6cf0969 100644 --- a/frontend/docs/scripting/functions/GetObjectDrawDistance.md +++ b/frontend/docs/scripting/functions/GetObjectDrawDistance.md @@ -21,7 +21,7 @@ Returns the draw distance as float. ## Examples -```c +```pawn new objectid = CreateObject(3335, 672.53485, -656.11023, 15.26560, 3.00000, 0.00000, 0.00000, 100.0); new Float:drawDistance = GetObjectDrawDistance(objectid); diff --git a/frontend/docs/scripting/functions/GetObjectMaterial.md b/frontend/docs/scripting/functions/GetObjectMaterial.md index 0aee3ccc832c..ef3559025248 100644 --- a/frontend/docs/scripting/functions/GetObjectMaterial.md +++ b/frontend/docs/scripting/functions/GetObjectMaterial.md @@ -30,7 +30,7 @@ Get the material data from an index of the object. ## Examples -```c +```pawn new objectid = CreateObject(19371, 978.71143, -925.25708, 42.63720, 0.00000, 0.00000, 2.00000); SetObjectMaterial(objectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); diff --git a/frontend/docs/scripting/functions/GetObjectMaterialText.md b/frontend/docs/scripting/functions/GetObjectMaterialText.md index c09cf855ba51..637498968a38 100644 --- a/frontend/docs/scripting/functions/GetObjectMaterialText.md +++ b/frontend/docs/scripting/functions/GetObjectMaterialText.md @@ -34,7 +34,7 @@ Get the material text data from an index of the object. ## Examples -```c +```pawn new objectid = CreateObject(19174, 986.42767, -983.14850, 40.95220, 0.00000, 0.00000, 186.00000); SetObjectMaterialText(objectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); diff --git a/frontend/docs/scripting/functions/GetObjectModel.md b/frontend/docs/scripting/functions/GetObjectModel.md index f0e2d0c85a67..ad2f4d98513a 100644 --- a/frontend/docs/scripting/functions/GetObjectModel.md +++ b/frontend/docs/scripting/functions/GetObjectModel.md @@ -23,7 +23,7 @@ The model ID of the object. ## Examples -```c +```pawn public OnGameModeInit() { new objectid = CreateObject(19609, 666.57239, 1750.79749, 4.95627, 0.00000, 0.00000, -156.00000); diff --git a/frontend/docs/scripting/functions/GetObjectMoveSpeed.md b/frontend/docs/scripting/functions/GetObjectMoveSpeed.md index d51c467c60d5..00f5b64a895b 100644 --- a/frontend/docs/scripting/functions/GetObjectMoveSpeed.md +++ b/frontend/docs/scripting/functions/GetObjectMoveSpeed.md @@ -21,7 +21,7 @@ Returns the move speed as float. ## Examples -```c +```pawn new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); MoveObject(objectid, 1003.3915, -643.3342, 114.5122, 0.8); diff --git a/frontend/docs/scripting/functions/GetObjectMovingTargetPos.md b/frontend/docs/scripting/functions/GetObjectMovingTargetPos.md index 8a7f22bcd069..181582e3db74 100644 --- a/frontend/docs/scripting/functions/GetObjectMovingTargetPos.md +++ b/frontend/docs/scripting/functions/GetObjectMovingTargetPos.md @@ -26,7 +26,7 @@ Get the move target position of an object. ## Examples -```c +```pawn new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); MoveObject(objectid, 1003.3915, -643.3342, 114.5122, 0.8); diff --git a/frontend/docs/scripting/functions/GetObjectMovingTargetRot.md b/frontend/docs/scripting/functions/GetObjectMovingTargetRot.md index b5768dac976e..3273434ec972 100644 --- a/frontend/docs/scripting/functions/GetObjectMovingTargetRot.md +++ b/frontend/docs/scripting/functions/GetObjectMovingTargetRot.md @@ -26,7 +26,7 @@ Get the move target rotation of an object. ## Examples -```c +```pawn new objectid = CreateObject(968, 1023.79541, -943.75879, 42.31450, 0.00000, 0.00000, 10.00000); MoveObject(objectid, 1023.79541, -943.75879, 42.31450, 0.8, 0.00000, -90.00000, 10.00000); diff --git a/frontend/docs/scripting/functions/GetObjectPos.md b/frontend/docs/scripting/functions/GetObjectPos.md index dc0a1037e961..6fb77c456ea2 100644 --- a/frontend/docs/scripting/functions/GetObjectPos.md +++ b/frontend/docs/scripting/functions/GetObjectPos.md @@ -24,7 +24,7 @@ Get the position of an object. ## Examples -```c +```pawn public OnGameModeInit() { new objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); diff --git a/frontend/docs/scripting/functions/GetObjectRot.md b/frontend/docs/scripting/functions/GetObjectRot.md index 99c3ea49c473..c6486daffa73 100644 --- a/frontend/docs/scripting/functions/GetObjectRot.md +++ b/frontend/docs/scripting/functions/GetObjectRot.md @@ -22,7 +22,7 @@ The object's rotation is stored in the referenced variables, not in the return v ## Examples -```c +```pawn public OnGameModeInit() { new objectid = CreateObject(652, 732.32690, 1940.21289, 4.27340, 357.00000, 0.00000, -76.00000); diff --git a/frontend/docs/scripting/functions/GetObjectSyncRotation.md b/frontend/docs/scripting/functions/GetObjectSyncRotation.md index f51f9901567c..0f91e12705d5 100644 --- a/frontend/docs/scripting/functions/GetObjectSyncRotation.md +++ b/frontend/docs/scripting/functions/GetObjectSyncRotation.md @@ -21,7 +21,7 @@ Returns the sync rotation of the object as boolean (`true`/`false`). ## Examples -```c +```pawn new objectid = CreateObject(...); new parentid = CreateObject(...); AttachObjectToObject(objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, false); diff --git a/frontend/docs/scripting/functions/GetObjectType.md b/frontend/docs/scripting/functions/GetObjectType.md index 9333f6229393..73bfe3f18bad 100644 --- a/frontend/docs/scripting/functions/GetObjectType.md +++ b/frontend/docs/scripting/functions/GetObjectType.md @@ -26,7 +26,7 @@ Get the type of an object. (global or player) ## Examples -```c +```pawn new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); new objectType = GetObjectType(playerid, objectid); @@ -35,7 +35,7 @@ new objectType = GetObjectType(playerid, objectid); Another example: -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 19174, 978.88757, -986.34918, 40.95220, 0.00000, 0.00000, 228.00000); new objectType = GetObjectType(playerid, playerobjectid); diff --git a/frontend/docs/scripting/functions/GetPVarFloat.md b/frontend/docs/scripting/functions/GetPVarFloat.md index 5f36718a77c2..39459e3230f0 100644 --- a/frontend/docs/scripting/functions/GetPVarFloat.md +++ b/frontend/docs/scripting/functions/GetPVarFloat.md @@ -20,7 +20,7 @@ The float from the specified player variable ## Examples -```c +```pawn LoadPlayerPos(playerid) { new Float:x, Float:y, Float:z; @@ -34,7 +34,7 @@ LoadPlayerPos(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPVarInt.md b/frontend/docs/scripting/functions/GetPVarInt.md index a651e0db37fe..a1d23f1a812b 100644 --- a/frontend/docs/scripting/functions/GetPVarInt.md +++ b/frontend/docs/scripting/functions/GetPVarInt.md @@ -22,7 +22,7 @@ It will still return **0** if the variable is not set, or the player does not ex ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { SetPVarInt(playerid, "Level", 20); @@ -37,7 +37,7 @@ public OnPlayerDisconnect(playerid, reason) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPVarString.md b/frontend/docs/scripting/functions/GetPVarString.md index 54a8b5fd1c0b..7f5605ed74e6 100644 --- a/frontend/docs/scripting/functions/GetPVarString.md +++ b/frontend/docs/scripting/functions/GetPVarString.md @@ -22,7 +22,7 @@ The length of the string. ## Examples -```c +```pawn public OnPlayerConnect(playerid, reason) { new playerName[MAX_PLAYER_NAME]; @@ -40,7 +40,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPVarType.md b/frontend/docs/scripting/functions/GetPVarType.md index 944c0e8243f6..d0fe5286f77b 100644 --- a/frontend/docs/scripting/functions/GetPVarType.md +++ b/frontend/docs/scripting/functions/GetPVarType.md @@ -22,7 +22,7 @@ Returns `PLAYER_VARTYPE_NONE` (0) if a player variable with the given name does ## Examples -```c +```pawn stock PrintPVar(playerid, varname[]) { switch (GetPVarType(playerid, varname)) diff --git a/frontend/docs/scripting/functions/GetPVarsUpperIndex.md b/frontend/docs/scripting/functions/GetPVarsUpperIndex.md index 7ca1edd76503..0ceebf643434 100644 --- a/frontend/docs/scripting/functions/GetPVarsUpperIndex.md +++ b/frontend/docs/scripting/functions/GetPVarsUpperIndex.md @@ -19,7 +19,7 @@ The highest set PVar ID. ## Examples -```c +```pawn // Store the upper index in the variable 'PVarUpperIndex' + 1 new PVarUpperIndex = GetPVarsUpperIndex(playerid) + 1; diff --git a/frontend/docs/scripting/functions/GetPickupModel.md b/frontend/docs/scripting/functions/GetPickupModel.md index cdedd6003972..46ccab146a98 100644 --- a/frontend/docs/scripting/functions/GetPickupModel.md +++ b/frontend/docs/scripting/functions/GetPickupModel.md @@ -21,7 +21,7 @@ Returns the model ID of the pickup. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetPickupPos.md b/frontend/docs/scripting/functions/GetPickupPos.md index 53dbd2d19416..4bc390f4ccc1 100644 --- a/frontend/docs/scripting/functions/GetPickupPos.md +++ b/frontend/docs/scripting/functions/GetPickupPos.md @@ -26,7 +26,7 @@ Gets the coordinates of a pickup. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetPickupType.md b/frontend/docs/scripting/functions/GetPickupType.md index 6e591a052ab1..66e7bbbd03c0 100644 --- a/frontend/docs/scripting/functions/GetPickupType.md +++ b/frontend/docs/scripting/functions/GetPickupType.md @@ -23,7 +23,7 @@ Returns the type of the pickup. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetPickupVirtualWorld.md b/frontend/docs/scripting/functions/GetPickupVirtualWorld.md index 19d20121c6c6..2bd58b00f87c 100644 --- a/frontend/docs/scripting/functions/GetPickupVirtualWorld.md +++ b/frontend/docs/scripting/functions/GetPickupVirtualWorld.md @@ -21,7 +21,7 @@ Returns the virtual world ID of the pickup. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelAttached.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelAttached.md index c1fc2ba951ae..bc7dc67d2f6e 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelAttached.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelAttached.md @@ -26,7 +26,7 @@ Gets the player's 3D text label attached data. An example for parentPlayerid: -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; new attachedplayer = 37; // Attach to player id 37 @@ -43,7 +43,7 @@ GetPlayer3DTextLabelAttached(playerid, playerTextId, parentPlayerid, parentVehic An example for parentVehicleid: -```c +```pawn new PlayerText3D:gVehicle3dText[MAX_VEHICLES]; new gVehicleId; @@ -57,7 +57,7 @@ GetPlayer3DTextLabelAttached(playerid, gVehicle3dText[gVehicleId], parentPlayeri // The `parentVehicleid` will be the value of 'gVehicleId' ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelAttachedData.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelAttachedData.md index d798fe3e06d7..deaeac09d69c 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelAttachedData.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelAttachedData.md @@ -22,7 +22,7 @@ Gets the player's 3D text label attached data. An example for **parentPlayerid**: -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; new attachedplayer = 37; // Attach to player id 37 @@ -39,7 +39,7 @@ GetPlayer3DTextLabelAttachedData(playerid, playerTextId, parentPlayerid, parentV An example for **parentVehicleid**: -```c +```pawn new PlayerText3D:gVehicle3dText[MAX_VEHICLES]; new gVehicleId; diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelColor.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelColor.md index b175edef66aa..f5f790c0d659 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelColor.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelColor.md @@ -26,7 +26,7 @@ Returns the player's 3D text label color. ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; new color; diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelColour.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelColour.md index f92b20d00e80..2392f4d33c2e 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelColour.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelColour.md @@ -22,7 +22,7 @@ Returns the player's 3D text label colour. ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:x, Float:y, Float:z; new colour; diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelDrawDist.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelDrawDist.md index 82d4f374e7b3..ca1c0884a00c 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelDrawDist.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelDrawDist.md @@ -26,7 +26,7 @@ Returns the draw distance of the player's 3D text label as float. ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; new Float:drawDistance; @@ -38,7 +38,7 @@ drawDistance = GetPlayer3DTextLabelDrawDist(playerid, playerTextId); // drawDistance = 40.0 ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelDrawDistance.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelDrawDistance.md index ee2e96eff28f..a0f0ad5f7ca0 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelDrawDistance.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelDrawDistance.md @@ -22,7 +22,7 @@ Returns the draw distance of the player's 3D text label as float. ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:x, Float:y, Float:z; new Float:drawDistance; diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelLOS.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelLOS.md index 5cd03d0ed392..c0d69428cebb 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelLOS.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelLOS.md @@ -22,7 +22,7 @@ Returns the line-of-sight of the player's 3D text label as boolean (false/true). ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; new bool:testLOS; diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelPos.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelPos.md index 02a5390f9c1d..4073f74b9201 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelPos.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelPos.md @@ -21,7 +21,7 @@ Gets the player's 3D text label position. ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:playerX, Float:playerY, Float:playerZ; diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelText.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelText.md index 497e6a3188fa..59aec288eae9 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelText.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelText.md @@ -20,7 +20,7 @@ Gets the player's 3D text label text. ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; new text[16]; diff --git a/frontend/docs/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md b/frontend/docs/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md index 1eee9424177c..9e0307123e2a 100644 --- a/frontend/docs/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md +++ b/frontend/docs/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md @@ -22,7 +22,7 @@ Returns the virtual world id of the player's 3D text label. ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; new worldid; @@ -33,7 +33,7 @@ playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", worldid = GetPlayer3DTextLabelVirtualWorld(playerid, playerTextId); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerAmmo.md b/frontend/docs/scripting/functions/GetPlayerAmmo.md index 8423c10c8740..91b59bbc7c90 100644 --- a/frontend/docs/scripting/functions/GetPlayerAmmo.md +++ b/frontend/docs/scripting/functions/GetPlayerAmmo.md @@ -19,7 +19,7 @@ The amount of ammo in the player's current weapon. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/myammo", true)) @@ -36,7 +36,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerAnimFlags.md b/frontend/docs/scripting/functions/GetPlayerAnimFlags.md index fad4344afdc4..3bc284f12fa2 100644 --- a/frontend/docs/scripting/functions/GetPlayerAnimFlags.md +++ b/frontend/docs/scripting/functions/GetPlayerAnimFlags.md @@ -21,7 +21,7 @@ Returns the player animation flags as integer. ## Examples -```c +```pawn new flags = GetPlayerAnimFlags(playerid); ``` diff --git a/frontend/docs/scripting/functions/GetPlayerAnimationFlags.md b/frontend/docs/scripting/functions/GetPlayerAnimationFlags.md index 93888f478794..df34a2241e73 100644 --- a/frontend/docs/scripting/functions/GetPlayerAnimationFlags.md +++ b/frontend/docs/scripting/functions/GetPlayerAnimationFlags.md @@ -23,7 +23,7 @@ Returns the player animation flags as an integer. In order to get each flag separately, bit masking is used. -```c +```pawn #define ANIM_FREEZE_FLAG 0b0000000000000100 #define ANIM_LOCK_X_FLAG 0b0010000000000 @@ -52,7 +52,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerAnimationIndex.md b/frontend/docs/scripting/functions/GetPlayerAnimationIndex.md index b9df30ed5ab9..ae1dadf29ab5 100644 --- a/frontend/docs/scripting/functions/GetPlayerAnimationIndex.md +++ b/frontend/docs/scripting/functions/GetPlayerAnimationIndex.md @@ -19,7 +19,7 @@ Returns the index of any running applied animations. ## Examples -```c +```pawn public OnPlayerUpdate(playerid) { if (GetPlayerAnimationIndex(playerid)) diff --git a/frontend/docs/scripting/functions/GetPlayerArmour.md b/frontend/docs/scripting/functions/GetPlayerArmour.md index cc14e1c17b7a..473b20bb9e4f 100644 --- a/frontend/docs/scripting/functions/GetPlayerArmour.md +++ b/frontend/docs/scripting/functions/GetPlayerArmour.md @@ -24,7 +24,7 @@ The player's armour is stored in the specified variable. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/myarmour", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerAttachedObject.md b/frontend/docs/scripting/functions/GetPlayerAttachedObject.md index 8e9548a59732..6ed7e0829186 100644 --- a/frontend/docs/scripting/functions/GetPlayerAttachedObject.md +++ b/frontend/docs/scripting/functions/GetPlayerAttachedObject.md @@ -35,7 +35,7 @@ Always returns true. ## Examples -```c +```pawn new modelid, bone, diff --git a/frontend/docs/scripting/functions/GetPlayerBuildingsRemoved.md b/frontend/docs/scripting/functions/GetPlayerBuildingsRemoved.md index 66b4e925d57b..c5dddcf52491 100644 --- a/frontend/docs/scripting/functions/GetPlayerBuildingsRemoved.md +++ b/frontend/docs/scripting/functions/GetPlayerBuildingsRemoved.md @@ -21,7 +21,7 @@ Returns the number of removed buildings. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { RemoveBuildingForPlayer(playerid, 700, 1192.1016, -1738.0000, 13.0391, 0.25); diff --git a/frontend/docs/scripting/functions/GetPlayerCameraAspectRatio.md b/frontend/docs/scripting/functions/GetPlayerCameraAspectRatio.md index 6d8f2fa5b30e..de6819530d81 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraAspectRatio.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraAspectRatio.md @@ -21,13 +21,13 @@ The aspect ratio can be one of three values: 4:3 (1.3333334, Float:0x3FAAAAAB) w ## Examples -```c +```pawn new string[128]; format(string, sizeof(string), "Your aspect ratio: %f", GetPlayerCameraAspectRatio(playerid)); SendClientMessage(playerid, -1, string); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerCameraFrontVector.md b/frontend/docs/scripting/functions/GetPlayerCameraFrontVector.md index 1426ba9e4bb4..256e91ce0db5 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraFrontVector.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraFrontVector.md @@ -22,7 +22,7 @@ The position is stored in the specified variables. ## Examples -```c +```pawn // A simple command to manipulate this vector using the // positions from GetPlayerCameraPos. This command will create // a hydra missile in the direction of where the player is looking. @@ -56,7 +56,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerCameraMode.md b/frontend/docs/scripting/functions/GetPlayerCameraMode.md index 9bb94abe32aa..9795d0975035 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraMode.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraMode.md @@ -19,7 +19,7 @@ The [camera mode](../resources/cameramodes) as an integer (or -1 if player is no ## Examples -```c +```pawn /* when the player types 'cameramode' in to the chat box, they'll see this. */ public OnPlayerText(playerid, text[]) { diff --git a/frontend/docs/scripting/functions/GetPlayerCameraPos.md b/frontend/docs/scripting/functions/GetPlayerCameraPos.md index 18a94078056e..a47875f17209 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraPos.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraPos.md @@ -22,7 +22,7 @@ The player's position is stored in the specified variables. ## Examples -```c +```pawn public OnPlayerDisconnect(playerid, reason) { new Float:x, Float:y, Float:z; @@ -33,7 +33,7 @@ public OnPlayerDisconnect(playerid, reason) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerCameraTargetActor.md b/frontend/docs/scripting/functions/GetPlayerCameraTargetActor.md index 835ecd250b11..f90787475d84 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraTargetActor.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraTargetActor.md @@ -23,7 +23,7 @@ The ID of the actor the player is looking at. Actors perform a 'hands up' animation when aimed at: -```c +```pawn new bool:ActorHandsup[MAX_ACTORS]; public OnPlayerConnect(playerid) @@ -61,7 +61,7 @@ public OnPlayerUpdate(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/GetPlayerCameraTargetObject.md b/frontend/docs/scripting/functions/GetPlayerCameraTargetObject.md index 30f5b21b31e5..190f4424c407 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraTargetObject.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraTargetObject.md @@ -21,7 +21,7 @@ The ID of the object playerid is looking at. If INVALID_OBJECT_ID (65535) is ret ## Examples -```c +```pawn new globalObjectID; public OnGameModeInit() @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayer.md b/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayer.md index 5c0fb7094345..7492438c7bca 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayer.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayer.md @@ -21,7 +21,7 @@ The ID of the player the playerid is looking at ## Examples -```c +```pawn new playerTarget = GetPlayerCameraTargetPlayer(playerid); if (IsPlayerAdmin(playerTarget)) @@ -30,7 +30,7 @@ if (IsPlayerAdmin(playerTarget)) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayerObject.md b/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayerObject.md index 1a6b07b092a5..c69bc1068116 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayerObject.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayerObject.md @@ -23,7 +23,7 @@ If `INVALID_OBJECT_ID` (65535) is returned, player isn't looking at any object. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -51,7 +51,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerCameraTargetVehicle.md b/frontend/docs/scripting/functions/GetPlayerCameraTargetVehicle.md index a74f52e64768..2df1e9301886 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraTargetVehicle.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraTargetVehicle.md @@ -21,7 +21,7 @@ The vehicle ID of the vehicle the player is looking at. `INVALID_VEHICLE_ID` if ## Examples -```c +```pawn new globalVehicleID; public OnGameModeInit() @@ -55,7 +55,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerCameraUpVector.md b/frontend/docs/scripting/functions/GetPlayerCameraUpVector.md index 634bdef17a01..3c12c2f69357 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraUpVector.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraUpVector.md @@ -20,7 +20,7 @@ This function returns the vector, that points to the upside of the camera's view The position is stored in the specified variables. -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerCameraZoom.md b/frontend/docs/scripting/functions/GetPlayerCameraZoom.md index d5a2635fb671..8790e96175c0 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraZoom.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraZoom.md @@ -19,13 +19,13 @@ The player's camera zoom level (camera, sniper etc.), a float. ## Examples -```c +```pawn new string[128]; format(string, sizeof(string), "Your camera zoom level: %f", GetPlayerCameraZoom(playerid)); SendClientMessage(playerid, -1, string); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerCheckpoint.md b/frontend/docs/scripting/functions/GetPlayerCheckpoint.md index 901b5260fdb8..cde79c2ad770 100644 --- a/frontend/docs/scripting/functions/GetPlayerCheckpoint.md +++ b/frontend/docs/scripting/functions/GetPlayerCheckpoint.md @@ -25,7 +25,7 @@ This function does not return any specific values. ## Examples -```c +```pawn SetPlayerCheckpoint(playerid, 408.9874, 2537.8059, 16.5455, 1.5); new Float:centreX, diff --git a/frontend/docs/scripting/functions/GetPlayerClass.md b/frontend/docs/scripting/functions/GetPlayerClass.md index 137e357d948e..e8d703f9d548 100644 --- a/frontend/docs/scripting/functions/GetPlayerClass.md +++ b/frontend/docs/scripting/functions/GetPlayerClass.md @@ -29,7 +29,7 @@ Get the class data. ## Examples -```c +```pawn new classid = 10, team, diff --git a/frontend/docs/scripting/functions/GetPlayerColor.md b/frontend/docs/scripting/functions/GetPlayerColor.md index a0d27ce67f87..65ab488b3d66 100644 --- a/frontend/docs/scripting/functions/GetPlayerColor.md +++ b/frontend/docs/scripting/functions/GetPlayerColor.md @@ -19,7 +19,7 @@ The player's color. 0 if no color set or player not connected. ## Examples -```c +```pawn SendClientMessage(playerid, GetPlayerColor(playerid), "This message is in your color :)"); new output[144]; @@ -28,7 +28,7 @@ SendClientMessage(playerid, -1, output); // will output the message in white, with ''color embedding'' in the player's color ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerCustomSkin.md b/frontend/docs/scripting/functions/GetPlayerCustomSkin.md index ca7305ec3bef..c997d11c924e 100644 --- a/frontend/docs/scripting/functions/GetPlayerCustomSkin.md +++ b/frontend/docs/scripting/functions/GetPlayerCustomSkin.md @@ -21,7 +21,7 @@ The custom skin id that was specified in [AddCharModel](AddCharModel) **newid**. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/customskin", true)) diff --git a/frontend/docs/scripting/functions/GetPlayerDialog.md b/frontend/docs/scripting/functions/GetPlayerDialog.md index f510cb580aed..4f0a795fe98b 100644 --- a/frontend/docs/scripting/functions/GetPlayerDialog.md +++ b/frontend/docs/scripting/functions/GetPlayerDialog.md @@ -27,7 +27,7 @@ Or **INVALID_DIALOG_ID** if the player is not connected or has no dialog open. ## Examples -```c +```pawn new dialogID = GetPlayerDialog(playerid); if (dialogID != INVALID_DIALOG_ID) { diff --git a/frontend/docs/scripting/functions/GetPlayerDialogData.md b/frontend/docs/scripting/functions/GetPlayerDialogData.md index cd8b57d98645..a24cb6f922b2 100644 --- a/frontend/docs/scripting/functions/GetPlayerDialogData.md +++ b/frontend/docs/scripting/functions/GetPlayerDialogData.md @@ -32,7 +32,7 @@ Get the data of the dialog currently show to the player. ## Examples -```c +```pawn enum { DIALOG_LOGIN diff --git a/frontend/docs/scripting/functions/GetPlayerDialogID.md b/frontend/docs/scripting/functions/GetPlayerDialogID.md index 233d2732c961..4d74af1b3cf1 100644 --- a/frontend/docs/scripting/functions/GetPlayerDialogID.md +++ b/frontend/docs/scripting/functions/GetPlayerDialogID.md @@ -23,7 +23,7 @@ Or **INVALID_DIALOG_ID** if the player is not connected or has no dialog open. ## Examples -```c +```pawn new dialogID = GetPlayerDialogID(playerid); if (dialogID != INVALID_DIALOG_ID) { diff --git a/frontend/docs/scripting/functions/GetPlayerDistanceFromPoint.md b/frontend/docs/scripting/functions/GetPlayerDistanceFromPoint.md index e4ebb433b371..c5c6ab9df42e 100644 --- a/frontend/docs/scripting/functions/GetPlayerDistanceFromPoint.md +++ b/frontend/docs/scripting/functions/GetPlayerDistanceFromPoint.md @@ -22,7 +22,7 @@ The distance between the player and the point as a **float**. ## Examples -```c +```pawn /* when the player types '/vend' into the chat box, they'll see this.*/ public OnPlayerCommandText(playerid, cmdtext[]) { diff --git a/frontend/docs/scripting/functions/GetPlayerDrunkLevel.md b/frontend/docs/scripting/functions/GetPlayerDrunkLevel.md index 58a1fd6817e4..7cfcec5b0c70 100644 --- a/frontend/docs/scripting/functions/GetPlayerDrunkLevel.md +++ b/frontend/docs/scripting/functions/GetPlayerDrunkLevel.md @@ -19,7 +19,7 @@ An integer with the level of drunkenness of the player. ## Examples -```c +```pawn public OnPlayerStateChange(playerid, oldstate, newstate) { if (newstate == PLAYER_STATE_DRIVER && GetPlayerDrunkLevel(playerid) > 1999) @@ -30,7 +30,7 @@ public OnPlayerStateChange(playerid, oldstate, newstate) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/GetPlayerFacingAngle.md b/frontend/docs/scripting/functions/GetPlayerFacingAngle.md index 6968bfb719da..37b756784adf 100644 --- a/frontend/docs/scripting/functions/GetPlayerFacingAngle.md +++ b/frontend/docs/scripting/functions/GetPlayerFacingAngle.md @@ -24,7 +24,7 @@ The player's angle is stored in the specified variable. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/angle", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerFightingStyle.md b/frontend/docs/scripting/functions/GetPlayerFightingStyle.md index 7fa481ab4896..b62e9975fb29 100644 --- a/frontend/docs/scripting/functions/GetPlayerFightingStyle.md +++ b/frontend/docs/scripting/functions/GetPlayerFightingStyle.md @@ -19,7 +19,7 @@ The ID of the [fighting style](../resources/fightingstyles) of the player. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/fightstyle", true)) diff --git a/frontend/docs/scripting/functions/GetPlayerGhostMode.md b/frontend/docs/scripting/functions/GetPlayerGhostMode.md index cda868203a47..5cbf90449069 100644 --- a/frontend/docs/scripting/functions/GetPlayerGhostMode.md +++ b/frontend/docs/scripting/functions/GetPlayerGhostMode.md @@ -23,7 +23,7 @@ Get player's ghost mode. ## Examples -```c +```pawn new string[64]; format(string, sizeof(string), "Your ghost mode is %s", GetPlayerGhostMode(playerid) == true ? "enable" : "disable"); SendClientMessage(playerid, -1, string); diff --git a/frontend/docs/scripting/functions/GetPlayerGravity.md b/frontend/docs/scripting/functions/GetPlayerGravity.md index 7cf58c9b8308..d09cfad95c46 100644 --- a/frontend/docs/scripting/functions/GetPlayerGravity.md +++ b/frontend/docs/scripting/functions/GetPlayerGravity.md @@ -21,7 +21,7 @@ The player's gravity as float. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/mygravity", true)) diff --git a/frontend/docs/scripting/functions/GetPlayerHealth.md b/frontend/docs/scripting/functions/GetPlayerHealth.md index 214799eced52..04023b11a65f 100644 --- a/frontend/docs/scripting/functions/GetPlayerHealth.md +++ b/frontend/docs/scripting/functions/GetPlayerHealth.md @@ -24,7 +24,7 @@ The player's health is stored in the specified variable. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/doctor", true) == 0) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerHydraReactorAngle.md b/frontend/docs/scripting/functions/GetPlayerHydraReactorAngle.md index 09b881e9c1b3..ae256b066b60 100644 --- a/frontend/docs/scripting/functions/GetPlayerHydraReactorAngle.md +++ b/frontend/docs/scripting/functions/GetPlayerHydraReactorAngle.md @@ -19,11 +19,11 @@ Gets the hydra reactor angle of the player's vehicle. ## Examples -```c +```pawn new reactorAngle = GetPlayerHydraReactorAngle(playerid); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerInterior.md b/frontend/docs/scripting/functions/GetPlayerInterior.md index 74d93b3f3389..c5ede75aefdd 100644 --- a/frontend/docs/scripting/functions/GetPlayerInterior.md +++ b/frontend/docs/scripting/functions/GetPlayerInterior.md @@ -19,7 +19,7 @@ The interior ID the player is currently in. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, text[]) { if (strcmp(cmdtext, "/int", true) == 0) @@ -33,7 +33,7 @@ public OnPlayerCommandText(playerid, text[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerIp.md b/frontend/docs/scripting/functions/GetPlayerIp.md index ebbbf5210529..ad1a541cd5dc 100644 --- a/frontend/docs/scripting/functions/GetPlayerIp.md +++ b/frontend/docs/scripting/functions/GetPlayerIp.md @@ -25,7 +25,7 @@ The player's IP address is stored in the specified array. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { new ipAddress[16]; @@ -38,7 +38,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerKeys.md b/frontend/docs/scripting/functions/GetPlayerKeys.md index d2ded10c833b..764c03c812d8 100644 --- a/frontend/docs/scripting/functions/GetPlayerKeys.md +++ b/frontend/docs/scripting/functions/GetPlayerKeys.md @@ -24,7 +24,7 @@ The keys are stored in the specified variables. The following example shows how you can regularly check the up/down/left/right values using [OnPlayerUpdate](../callbacks/OnPlayerUpdate). -```c +```pawn public OnPlayerUpdate(playerid) { new @@ -54,7 +54,7 @@ public OnPlayerUpdate(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerLandingGearState.md b/frontend/docs/scripting/functions/GetPlayerLandingGearState.md index d9624f6f750f..eaae888d465e 100644 --- a/frontend/docs/scripting/functions/GetPlayerLandingGearState.md +++ b/frontend/docs/scripting/functions/GetPlayerLandingGearState.md @@ -19,7 +19,7 @@ Gets the [landing gear state](../resources/landinggearstate) of the current play ## Examples -```c +```pawn new LANDING_GEAR_STATE:landingGearState = GetPlayerLandingGearState(playerid); ``` diff --git a/frontend/docs/scripting/functions/GetPlayerLastShotVectors.md b/frontend/docs/scripting/functions/GetPlayerLastShotVectors.md index 5bf32304b391..fb4f7e47bf62 100644 --- a/frontend/docs/scripting/functions/GetPlayerLastShotVectors.md +++ b/frontend/docs/scripting/functions/GetPlayerLastShotVectors.md @@ -29,7 +29,7 @@ The position of the last bullet is stored in the specified variables. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/lastshot", true) == 0) @@ -48,7 +48,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerLastSyncedTrailerID.md b/frontend/docs/scripting/functions/GetPlayerLastSyncedTrailerID.md index 3054140787a9..c389c3dee746 100644 --- a/frontend/docs/scripting/functions/GetPlayerLastSyncedTrailerID.md +++ b/frontend/docs/scripting/functions/GetPlayerLastSyncedTrailerID.md @@ -29,7 +29,7 @@ Returns the last synced trailer ID. ## Examples -```c +```pawn new trailerid = GetPlayerLastSyncedTrailerID(playerid); ``` diff --git a/frontend/docs/scripting/functions/GetPlayerLastSyncedVehicleID.md b/frontend/docs/scripting/functions/GetPlayerLastSyncedVehicleID.md index 7ec62141f079..b77b2f320707 100644 --- a/frontend/docs/scripting/functions/GetPlayerLastSyncedVehicleID.md +++ b/frontend/docs/scripting/functions/GetPlayerLastSyncedVehicleID.md @@ -29,7 +29,7 @@ Returns the last synced vehicle ID. ## Examples -```c +```pawn new vehicleid = GetPlayerLastSyncedVehicleID(playerid); ``` diff --git a/frontend/docs/scripting/functions/GetPlayerMarkerForPlayer.md b/frontend/docs/scripting/functions/GetPlayerMarkerForPlayer.md index 0e4e34aee1dd..f5057d3875c7 100644 --- a/frontend/docs/scripting/functions/GetPlayerMarkerForPlayer.md +++ b/frontend/docs/scripting/functions/GetPlayerMarkerForPlayer.md @@ -22,7 +22,7 @@ The target player's **nametag** and **radar blip** colour. ## Examples -```c +```pawn // Make player 42 see player 1 as a red marker SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF); diff --git a/frontend/docs/scripting/functions/GetPlayerMenu.md b/frontend/docs/scripting/functions/GetPlayerMenu.md index 409875d9606b..d5f8ad0ccab9 100644 --- a/frontend/docs/scripting/functions/GetPlayerMenu.md +++ b/frontend/docs/scripting/functions/GetPlayerMenu.md @@ -21,11 +21,11 @@ Value returned is tagged with **Menu:** ## Examples -```c +```pawn new Menu:currentMenu = GetPlayerMenu(playerid); // Store the player's current menu in 'CurrentMenu' ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerMoney.md b/frontend/docs/scripting/functions/GetPlayerMoney.md index ff2a56d0f932..bfac2c3a954a 100644 --- a/frontend/docs/scripting/functions/GetPlayerMoney.md +++ b/frontend/docs/scripting/functions/GetPlayerMoney.md @@ -19,7 +19,7 @@ The amount of money the player has. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { new string[32]; diff --git a/frontend/docs/scripting/functions/GetPlayerName.md b/frontend/docs/scripting/functions/GetPlayerName.md index 2bdc7c931531..c65fdc014332 100644 --- a/frontend/docs/scripting/functions/GetPlayerName.md +++ b/frontend/docs/scripting/functions/GetPlayerName.md @@ -23,7 +23,7 @@ Returns the length of the player's name. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { // Get the name of the player that connected and display a join message to other players @@ -39,7 +39,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerNetworkStats.md b/frontend/docs/scripting/functions/GetPlayerNetworkStats.md index 36b0fd36ec7f..0d2f5990b798 100644 --- a/frontend/docs/scripting/functions/GetPlayerNetworkStats.md +++ b/frontend/docs/scripting/functions/GetPlayerNetworkStats.md @@ -21,7 +21,7 @@ This function always returns **1**. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/mynetstats")) @@ -34,7 +34,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerObjectAttachedData.md b/frontend/docs/scripting/functions/GetPlayerObjectAttachedData.md index b6d6c056c23e..a118e4d8b3f8 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectAttachedData.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectAttachedData.md @@ -27,7 +27,7 @@ Get the attachment data of a player-object. ## Examples -```c +```pawn new parentVehicle, parentObject, diff --git a/frontend/docs/scripting/functions/GetPlayerObjectAttachedOffset.md b/frontend/docs/scripting/functions/GetPlayerObjectAttachedOffset.md index 649f6089e29d..f19305139a32 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectAttachedOffset.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectAttachedOffset.md @@ -30,7 +30,7 @@ Get the attachment offset and rotation of a player-object. ## Examples -```c +```pawn new Float:offsetX, Float:offsetY, diff --git a/frontend/docs/scripting/functions/GetPlayerObjectDrawDistance.md b/frontend/docs/scripting/functions/GetPlayerObjectDrawDistance.md index 5d0ee5f939b1..038418b1a1d1 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectDrawDistance.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectDrawDistance.md @@ -22,7 +22,7 @@ Returns the draw distance as float. ## Examples -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 3335, 672.53485, -656.11023, 15.26560, 3.00000, 0.00000, 0.00000, 100.0); new Float:drawDistance = GetPlayerObjectDrawDistance(playerid, playerobjectid); diff --git a/frontend/docs/scripting/functions/GetPlayerObjectMaterial.md b/frontend/docs/scripting/functions/GetPlayerObjectMaterial.md index d413ef85af23..b004732c3114 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectMaterial.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectMaterial.md @@ -31,7 +31,7 @@ Get the material data from an index of the player-object. ## Examples -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 19371, 978.71143, -925.25708, 42.63720, 0.00000, 0.00000, 2.00000); SetPlayerObjectMaterial(playerid, playerobjectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); diff --git a/frontend/docs/scripting/functions/GetPlayerObjectMaterialText.md b/frontend/docs/scripting/functions/GetPlayerObjectMaterialText.md index ce2773b7b6c0..030e22341f35 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectMaterialText.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectMaterialText.md @@ -35,7 +35,7 @@ Get the material text data from an index of the player-object. ## Examples -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 19174, 986.42767, -983.14850, 40.95220, 0.00000, 0.00000, 186.00000); SetPlayerObjectMaterialText(playerid, playerobjectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); diff --git a/frontend/docs/scripting/functions/GetPlayerObjectModel.md b/frontend/docs/scripting/functions/GetPlayerObjectModel.md index d78e5181fa28..c7e92e22ec29 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectModel.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectModel.md @@ -24,7 +24,7 @@ If the player or object don't exist, it will return **-1** or **0** if the playe ## Examples -```c +```pawn public OnPlayerConnect(playerid) { new objectid = CreatePlayerObject(playerid, 19609, 666.57239, 1750.79749, 4.95627, 0.00000, 0.00000, -156.00000); diff --git a/frontend/docs/scripting/functions/GetPlayerObjectMoveSpeed.md b/frontend/docs/scripting/functions/GetPlayerObjectMoveSpeed.md index 8c30e9f9ba71..fcc438ab4ba3 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectMoveSpeed.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectMoveSpeed.md @@ -22,7 +22,7 @@ Returns the move speed as float. ## Examples -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); MovePlayerObject(playerid, playerobjectid, 1003.3915, -643.3342, 114.5122, 0.8); diff --git a/frontend/docs/scripting/functions/GetPlayerObjectMovingTargetPos.md b/frontend/docs/scripting/functions/GetPlayerObjectMovingTargetPos.md index c163b9878e0d..51ba27947ece 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectMovingTargetPos.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectMovingTargetPos.md @@ -27,7 +27,7 @@ Get the move target position of a player-object. ## Examples -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); MovePlayerObject(playerid, playerobjectid, 1003.3915, -643.3342, 114.5122, 0.8); diff --git a/frontend/docs/scripting/functions/GetPlayerObjectMovingTargetRot.md b/frontend/docs/scripting/functions/GetPlayerObjectMovingTargetRot.md index c9a957530739..2f2f26e0565c 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectMovingTargetRot.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectMovingTargetRot.md @@ -27,7 +27,7 @@ Get the move target rotation of a player-object. ## Examples -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 968, 1023.79541, -943.75879, 42.31450, 0.00000, 0.00000, 10.00000); MovePlayerObject(playerid, playerobjectid, 1023.79541, -943.75879, 42.31450, 0.8, 0.00000, -90.00000, 10.00000); diff --git a/frontend/docs/scripting/functions/GetPlayerObjectPos.md b/frontend/docs/scripting/functions/GetPlayerObjectPos.md index e743b4972731..e9d5caaaafd5 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectPos.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectPos.md @@ -27,7 +27,7 @@ The object's position is stored in the specified variables. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/GetPlayerObjectRot.md b/frontend/docs/scripting/functions/GetPlayerObjectRot.md index 8567c6551dbe..5e443812e5c2 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectRot.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectRot.md @@ -23,7 +23,7 @@ The object's rotation is stored in the specified variables. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/GetPlayerObjectSyncRotation.md b/frontend/docs/scripting/functions/GetPlayerObjectSyncRotation.md index a0fb5d035b03..5b0d975f2ba6 100644 --- a/frontend/docs/scripting/functions/GetPlayerObjectSyncRotation.md +++ b/frontend/docs/scripting/functions/GetPlayerObjectSyncRotation.md @@ -22,7 +22,7 @@ Returns the sync rotation of the player-object as boolean (`true`/`false`). ## Examples -```c +```pawn new objectid = CreatePlayerObject(...); new parentid = CreatePlayerObject(...); AttachPlayerObjectToObject(playerid, objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true); diff --git a/frontend/docs/scripting/functions/GetPlayerPickupModel.md b/frontend/docs/scripting/functions/GetPlayerPickupModel.md index 97e50bf7fdf4..c0d2a1fa5cd3 100644 --- a/frontend/docs/scripting/functions/GetPlayerPickupModel.md +++ b/frontend/docs/scripting/functions/GetPlayerPickupModel.md @@ -22,7 +22,7 @@ Returns the model ID of the player-pickup. ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/GetPlayerPickupPos.md b/frontend/docs/scripting/functions/GetPlayerPickupPos.md index 952e1a25320a..a76a0f6b36fc 100644 --- a/frontend/docs/scripting/functions/GetPlayerPickupPos.md +++ b/frontend/docs/scripting/functions/GetPlayerPickupPos.md @@ -25,7 +25,7 @@ This function does not return a specific value. ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/GetPlayerPickupType.md b/frontend/docs/scripting/functions/GetPlayerPickupType.md index 6a287575795b..5545c393dded 100644 --- a/frontend/docs/scripting/functions/GetPlayerPickupType.md +++ b/frontend/docs/scripting/functions/GetPlayerPickupType.md @@ -24,7 +24,7 @@ Returns the type of the player-pickup. ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/GetPlayerPickupVirtualWorld.md b/frontend/docs/scripting/functions/GetPlayerPickupVirtualWorld.md index 1ef3b3c86d5e..1f0c81eb4c9d 100644 --- a/frontend/docs/scripting/functions/GetPlayerPickupVirtualWorld.md +++ b/frontend/docs/scripting/functions/GetPlayerPickupVirtualWorld.md @@ -22,7 +22,7 @@ Returns the virtual world ID of the player-pickup. ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/GetPlayerPing.md b/frontend/docs/scripting/functions/GetPlayerPing.md index 7565ecff1309..0755d375bd09 100644 --- a/frontend/docs/scripting/functions/GetPlayerPing.md +++ b/frontend/docs/scripting/functions/GetPlayerPing.md @@ -19,7 +19,7 @@ The current ping of the player (expressed in milliseconds). ## Examples -```c +```pawn new string[24]; format(string, sizeof(string), "Your ping: %d", GetPlayerPing(playerid)); SendClientMessage(playerid, -1, string); @@ -29,7 +29,7 @@ SendClientMessage(playerid, -1, string); **Example to kick high ping players:** -```c +```pawn // Declare an array of all possible timer identifiers for timers for kicking players with // generally high ping with default value of 0 new gPlayerPingTimer[MAX_PLAYERS] = {0, ...}; @@ -68,7 +68,7 @@ public Ping_Timer(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerPoolSize.md b/frontend/docs/scripting/functions/GetPlayerPoolSize.md index 6e7aa0571ff8..fcb40d7b503c 100644 --- a/frontend/docs/scripting/functions/GetPlayerPoolSize.md +++ b/frontend/docs/scripting/functions/GetPlayerPoolSize.md @@ -13,7 +13,7 @@ Gets the highest playerid currently in use on the server. Note that in SA:MP thi ## Examples -```c +```pawn FreezeAll() { // note that we assign the return value to a new variable (j) to avoid calling the function with each iteration diff --git a/frontend/docs/scripting/functions/GetPlayerPos.md b/frontend/docs/scripting/functions/GetPlayerPos.md index cbd26de21ddb..4f99e2d9c856 100644 --- a/frontend/docs/scripting/functions/GetPlayerPos.md +++ b/frontend/docs/scripting/functions/GetPlayerPos.md @@ -24,7 +24,7 @@ Get the position of a player, represented by X, Y and Z coordinates. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Declare 3 float variables to store the X, Y and Z coordinates in @@ -39,7 +39,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerRaceCheckpoint.md b/frontend/docs/scripting/functions/GetPlayerRaceCheckpoint.md index b1fb06574ead..223757855758 100644 --- a/frontend/docs/scripting/functions/GetPlayerRaceCheckpoint.md +++ b/frontend/docs/scripting/functions/GetPlayerRaceCheckpoint.md @@ -28,7 +28,7 @@ This function does not return any specific values. ## Examples -```c +```pawn SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_NORMAL, 373.1631, 2502.4644, 16.4774, 269.8644, 2503.4963, 16.4774, 2.0); new Float:centreX, diff --git a/frontend/docs/scripting/functions/GetPlayerRawIp.md b/frontend/docs/scripting/functions/GetPlayerRawIp.md index db26133ec6f3..ffdb68cb4e71 100644 --- a/frontend/docs/scripting/functions/GetPlayerRawIp.md +++ b/frontend/docs/scripting/functions/GetPlayerRawIp.md @@ -21,7 +21,7 @@ Returns the player's Raw IP address as integer. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { new rawIp = GetPlayerRawIp(playerid); @@ -30,7 +30,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerRotationQuat.md b/frontend/docs/scripting/functions/GetPlayerRotationQuat.md index 479dab38dc42..56f1256d0ab1 100644 --- a/frontend/docs/scripting/functions/GetPlayerRotationQuat.md +++ b/frontend/docs/scripting/functions/GetPlayerRotationQuat.md @@ -29,7 +29,7 @@ The player's rotation is stored in the specified variables. ## Examples -```c +```pawn new Float:w, Float:x, @@ -39,7 +39,7 @@ new GetPlayerRotationQuat(playerid, w, x, y, z); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerScore.md b/frontend/docs/scripting/functions/GetPlayerScore.md index 15cba7d58264..2c44a4bfafee 100644 --- a/frontend/docs/scripting/functions/GetPlayerScore.md +++ b/frontend/docs/scripting/functions/GetPlayerScore.md @@ -19,7 +19,7 @@ The player's score. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, text[]) { if (!strcmp(cmdtext, "/score", true)) diff --git a/frontend/docs/scripting/functions/GetPlayerSirenState.md b/frontend/docs/scripting/functions/GetPlayerSirenState.md index 6bfcc61cf7c0..a1c8c14a0d13 100644 --- a/frontend/docs/scripting/functions/GetPlayerSirenState.md +++ b/frontend/docs/scripting/functions/GetPlayerSirenState.md @@ -23,7 +23,7 @@ Returns the vehicle siren state. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/siren", true)) diff --git a/frontend/docs/scripting/functions/GetPlayerSkillLevel.md b/frontend/docs/scripting/functions/GetPlayerSkillLevel.md index 40e5612139f8..f469195bf367 100644 --- a/frontend/docs/scripting/functions/GetPlayerSkillLevel.md +++ b/frontend/docs/scripting/functions/GetPlayerSkillLevel.md @@ -24,7 +24,7 @@ Otherwise, it returns the skill level of the weapon type. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/skill", true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerSkin.md b/frontend/docs/scripting/functions/GetPlayerSkin.md index 73c6fdcd155a..492dd35304ac 100644 --- a/frontend/docs/scripting/functions/GetPlayerSkin.md +++ b/frontend/docs/scripting/functions/GetPlayerSkin.md @@ -19,7 +19,7 @@ The [skin id](../resources/skins). **0** if invalid. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/myskin", true)) @@ -35,7 +35,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerSpecialAction.md b/frontend/docs/scripting/functions/GetPlayerSpecialAction.md index a91dde09621e..a08ef4c8b6b4 100644 --- a/frontend/docs/scripting/functions/GetPlayerSpecialAction.md +++ b/frontend/docs/scripting/functions/GetPlayerSpecialAction.md @@ -19,7 +19,7 @@ The special action of the player (see: [Special Actions](../resources/specialact ## Examples -```c +```pawn public OnPlayerUpdate(playerid) { // Ban players if they have a jetpack diff --git a/frontend/docs/scripting/functions/GetPlayerSpectateID.md b/frontend/docs/scripting/functions/GetPlayerSpectateID.md index 551983f9ed91..5a832abb5135 100644 --- a/frontend/docs/scripting/functions/GetPlayerSpectateID.md +++ b/frontend/docs/scripting/functions/GetPlayerSpectateID.md @@ -21,7 +21,7 @@ Returns the ID of the player or vehicle. ## Examples -```c +```pawn new spectateType = GetPlayerSpectateType(playerid); if (spectateType == 1) @@ -34,7 +34,7 @@ else if (spectateType == 2) } ``` -## Notes +## Good to know :::info diff --git a/frontend/docs/scripting/functions/GetPlayerSpectateType.md b/frontend/docs/scripting/functions/GetPlayerSpectateType.md index c33a5182fcfe..5c7ed8bd76f5 100644 --- a/frontend/docs/scripting/functions/GetPlayerSpectateType.md +++ b/frontend/docs/scripting/functions/GetPlayerSpectateType.md @@ -21,7 +21,7 @@ Returns the player's [spectate type](../resources/spectatetypes). ## Examples -```c +```pawn new spectateType = GetPlayerSpectateType(playerid); if (spectateType == 1) diff --git a/frontend/docs/scripting/functions/GetPlayerState.md b/frontend/docs/scripting/functions/GetPlayerState.md index 724e893f16b6..27c438c07246 100644 --- a/frontend/docs/scripting/functions/GetPlayerState.md +++ b/frontend/docs/scripting/functions/GetPlayerState.md @@ -19,7 +19,7 @@ The player's current **state** as an integer (see: [Player States](../resources/ ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { new PLAYER_STATE:playerState = GetPlayerState(killerid); // Get the killer's state diff --git a/frontend/docs/scripting/functions/GetPlayerSurfingObjectID.md b/frontend/docs/scripting/functions/GetPlayerSurfingObjectID.md index a3e038ccd5cc..bfdd26c5e7ec 100644 --- a/frontend/docs/scripting/functions/GetPlayerSurfingObjectID.md +++ b/frontend/docs/scripting/functions/GetPlayerSurfingObjectID.md @@ -19,7 +19,7 @@ The ID of the **moving** object the player is surfing. If the player isn't surfi ## Examples -```c +```pawn /* when the player types 'objectsurfing' in to the chat box, they'll see this.*/ public OnPlayerText(playerid, text[]) { diff --git a/frontend/docs/scripting/functions/GetPlayerSurfingOffsets.md b/frontend/docs/scripting/functions/GetPlayerSurfingOffsets.md index 960cb421fdd4..85419142c3e6 100644 --- a/frontend/docs/scripting/functions/GetPlayerSurfingOffsets.md +++ b/frontend/docs/scripting/functions/GetPlayerSurfingOffsets.md @@ -24,7 +24,7 @@ This function does not return any specific value. ## Examples -```c +```pawn new surfingVehicleId = GetPlayerSurfingVehicleID(playerid); if (surfingVehicleId != INVALID_VEHICLE_ID) { diff --git a/frontend/docs/scripting/functions/GetPlayerSurfingPlayerObjectID.md b/frontend/docs/scripting/functions/GetPlayerSurfingPlayerObjectID.md index bc974cfd7202..f14c62b14ff1 100644 --- a/frontend/docs/scripting/functions/GetPlayerSurfingPlayerObjectID.md +++ b/frontend/docs/scripting/functions/GetPlayerSurfingPlayerObjectID.md @@ -21,7 +21,7 @@ The ID of the moving object the player is surfing. If the player isn't surfing a ## Examples -```c +```pawn /* when the player types 'objectsurfing' in to the chat box, they'll see this.*/ public OnPlayerText(playerid, text[]) { diff --git a/frontend/docs/scripting/functions/GetPlayerSurfingVehicleID.md b/frontend/docs/scripting/functions/GetPlayerSurfingVehicleID.md index 3920f10e91a1..7bcdfcb934d2 100644 --- a/frontend/docs/scripting/functions/GetPlayerSurfingVehicleID.md +++ b/frontend/docs/scripting/functions/GetPlayerSurfingVehicleID.md @@ -21,7 +21,7 @@ If the player specified is not connected, `INVALID_VEHICLE_ID` also. ## Examples -```c +```pawn new surfingVehicleId = GetPlayerSurfingVehicleID(playerid); if (surfingVehicleId == INVALID_VEHICLE_ID) { diff --git a/frontend/docs/scripting/functions/GetPlayerTargetActor.md b/frontend/docs/scripting/functions/GetPlayerTargetActor.md index 93ac654be0a7..a3ce47c99d02 100644 --- a/frontend/docs/scripting/functions/GetPlayerTargetActor.md +++ b/frontend/docs/scripting/functions/GetPlayerTargetActor.md @@ -21,7 +21,7 @@ The ID of the targeted actor, or `INVALID_ACTOR_ID` if none. ## Examples -```c +```pawn public OnPlayerUpdate(playerid) { new @@ -34,7 +34,7 @@ public OnPlayerUpdate(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerTargetPlayer.md b/frontend/docs/scripting/functions/GetPlayerTargetPlayer.md index eca42b48e835..ea8c152def9a 100644 --- a/frontend/docs/scripting/functions/GetPlayerTargetPlayer.md +++ b/frontend/docs/scripting/functions/GetPlayerTargetPlayer.md @@ -19,7 +19,7 @@ The ID of the target player, or `INVALID_PLAYER_ID` if none. ## Examples -```c +```pawn public OnPlayerUpdate(playerid) { // Store the ID @@ -31,7 +31,7 @@ public OnPlayerUpdate(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetPlayerTeam.md b/frontend/docs/scripting/functions/GetPlayerTeam.md index c360829e7265..cf0d39f0993f 100644 --- a/frontend/docs/scripting/functions/GetPlayerTeam.md +++ b/frontend/docs/scripting/functions/GetPlayerTeam.md @@ -23,7 +23,7 @@ Get the ID of the team the player is on. ## Examples -```c +```pawn enum { TEAM_ONE = 1, diff --git a/frontend/docs/scripting/functions/GetPlayerTime.md b/frontend/docs/scripting/functions/GetPlayerTime.md index 4c6f1afdccae..45358a4667f9 100644 --- a/frontend/docs/scripting/functions/GetPlayerTime.md +++ b/frontend/docs/scripting/functions/GetPlayerTime.md @@ -25,7 +25,7 @@ The current game time is stored in the specified variables. ## Examples -```c +```pawn new hour, minutes; GetPlayerTime(playerid, hour, minutes); if (hour == 13 && minutes == 37) diff --git a/frontend/docs/scripting/functions/GetPlayerTrainSpeed.md b/frontend/docs/scripting/functions/GetPlayerTrainSpeed.md index b118d63a8bb3..2415cf286d35 100644 --- a/frontend/docs/scripting/functions/GetPlayerTrainSpeed.md +++ b/frontend/docs/scripting/functions/GetPlayerTrainSpeed.md @@ -19,7 +19,7 @@ Gets the speed of the player's train. ## Examples -```c +```pawn new Float:speed = GetPlayerTrainSpeed(playerid); SendClientMessage(playerid, 0xFFFF00FF, "The speed of your train: %f", speed); ``` diff --git a/frontend/docs/scripting/functions/GetPlayerVehicleID.md b/frontend/docs/scripting/functions/GetPlayerVehicleID.md index 713b77d9bbcf..a22f707415f0 100644 --- a/frontend/docs/scripting/functions/GetPlayerVehicleID.md +++ b/frontend/docs/scripting/functions/GetPlayerVehicleID.md @@ -9,7 +9,11 @@ tags: ["player", "vehicle"] This function gets the ID of the vehicle the player is currently in. -**Note:** **NOT** the model id of the vehicle. See [GetVehicleModel](GetVehicleModel) for that. +:::note + +**NOT** the model id of the vehicle. See [GetVehicleModel](GetVehicleModel) for that. + +::: | Name | Description | | -------- | ------------------------------------------------------------------ | @@ -21,7 +25,7 @@ ID of the vehicle or **0** if not in a vehicle ## Examples -```c +```pawn // Add 10x Nitro if the player is in a car. Might be called on a command. new vehicleId = GetPlayerVehicleID(playerid); if (vehicleId != 0) diff --git a/frontend/docs/scripting/functions/GetPlayerVehicleSeat.md b/frontend/docs/scripting/functions/GetPlayerVehicleSeat.md index 2a9a13786cc6..4631c4e16a33 100644 --- a/frontend/docs/scripting/functions/GetPlayerVehicleSeat.md +++ b/frontend/docs/scripting/functions/GetPlayerVehicleSeat.md @@ -21,7 +21,7 @@ The ID of the seat the player is in. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/myseat", true) == 0) diff --git a/frontend/docs/scripting/functions/GetPlayerVelocity.md b/frontend/docs/scripting/functions/GetPlayerVelocity.md index fd7346fb0666..2f058934948a 100644 --- a/frontend/docs/scripting/functions/GetPlayerVelocity.md +++ b/frontend/docs/scripting/functions/GetPlayerVelocity.md @@ -22,7 +22,7 @@ The function itself doesn't return a specific value. The X, Y and Z velocities a ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/velocity", true)) diff --git a/frontend/docs/scripting/functions/GetPlayerVersion.md b/frontend/docs/scripting/functions/GetPlayerVersion.md index 702d46c17619..acfa78482799 100644 --- a/frontend/docs/scripting/functions/GetPlayerVersion.md +++ b/frontend/docs/scripting/functions/GetPlayerVersion.md @@ -25,7 +25,7 @@ The client version is stored in the specified array. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { new version[24]; @@ -39,7 +39,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerVirtualWorld.md b/frontend/docs/scripting/functions/GetPlayerVirtualWorld.md index c3fc796799c7..80f378975596 100644 --- a/frontend/docs/scripting/functions/GetPlayerVirtualWorld.md +++ b/frontend/docs/scripting/functions/GetPlayerVirtualWorld.md @@ -19,7 +19,7 @@ The ID of the virtual world the player is currently in. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/world", true)) @@ -33,7 +33,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerWantedLevel.md b/frontend/docs/scripting/functions/GetPlayerWantedLevel.md index 52a19c9e08c4..9c2dec205aeb 100644 --- a/frontend/docs/scripting/functions/GetPlayerWantedLevel.md +++ b/frontend/docs/scripting/functions/GetPlayerWantedLevel.md @@ -19,7 +19,7 @@ The player's wanted level. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/getmywantedlevel", true) == 0) diff --git a/frontend/docs/scripting/functions/GetPlayerWeapon.md b/frontend/docs/scripting/functions/GetPlayerWeapon.md index e1a5b89b8768..85260d91f8b2 100644 --- a/frontend/docs/scripting/functions/GetPlayerWeapon.md +++ b/frontend/docs/scripting/functions/GetPlayerWeapon.md @@ -19,7 +19,7 @@ The ID of the player's current [weapon](../resources/weaponids). Returns **-1** ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Check if the killerid is not an invalid player (which means is connected). @@ -36,7 +36,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerWeaponData.md b/frontend/docs/scripting/functions/GetPlayerWeaponData.md index e9d273d9f0eb..9a291c3fa53d 100644 --- a/frontend/docs/scripting/functions/GetPlayerWeaponData.md +++ b/frontend/docs/scripting/functions/GetPlayerWeaponData.md @@ -24,7 +24,7 @@ Get the weapon and ammo in a specific player's weapon slot (e.g. the weapon in t ## Examples -```c +```pawn // Common use: get all weapons and store info in an array containing 13 slots // The first value is the weapon ID, and second is the ammo @@ -38,7 +38,7 @@ for (new i = 0; i <= 12; i++) Another example: -```c +```pawn new weaponid, ammo; @@ -47,7 +47,7 @@ new GetPlayerWeaponData(playerid, WEAPON_SLOT_PISTOL, weaponid, ammo); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetPlayerWeaponState.md b/frontend/docs/scripting/functions/GetPlayerWeaponState.md index eb9354968377..4e0b03f834ea 100644 --- a/frontend/docs/scripting/functions/GetPlayerWeaponState.md +++ b/frontend/docs/scripting/functions/GetPlayerWeaponState.md @@ -21,7 +21,7 @@ The [state of the player's weapon](../resources/weaponstates). ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/wstate", true)) diff --git a/frontend/docs/scripting/functions/GetPlayerWeather.md b/frontend/docs/scripting/functions/GetPlayerWeather.md index c7dbfe767c08..1af1ce8ee0c0 100644 --- a/frontend/docs/scripting/functions/GetPlayerWeather.md +++ b/frontend/docs/scripting/functions/GetPlayerWeather.md @@ -21,7 +21,7 @@ Returns the player's weather. ## Examples -```c +```pawn SetPlayerWeather(playerid, 8); printf("Player weather: %d", GetPlayerWeather(playerid)); diff --git a/frontend/docs/scripting/functions/GetPlayerWorldBounds.md b/frontend/docs/scripting/functions/GetPlayerWorldBounds.md index df5d8a969894..01096308f748 100644 --- a/frontend/docs/scripting/functions/GetPlayerWorldBounds.md +++ b/frontend/docs/scripting/functions/GetPlayerWorldBounds.md @@ -25,7 +25,7 @@ This function does not return a specific value. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { SetPlayerWorldBounds(playerid, -1212.0, -1420.0, 2628.5, 2430.5); diff --git a/frontend/docs/scripting/functions/GetPlayerZAim.md b/frontend/docs/scripting/functions/GetPlayerZAim.md index 66584b9e38a4..d36c0dc52470 100644 --- a/frontend/docs/scripting/functions/GetPlayerZAim.md +++ b/frontend/docs/scripting/functions/GetPlayerZAim.md @@ -21,7 +21,7 @@ Returns the player's Z Aim as a float value. ## Examples -```c +```pawn new Float:zAim = GetPlayerZAim(playerid); SendClientMessage(playerid, -1, "Z Aim = %f", zAim); diff --git a/frontend/docs/scripting/functions/GetPlayers.md b/frontend/docs/scripting/functions/GetPlayers.md index 3b750b9de933..3970bf3a8f9b 100644 --- a/frontend/docs/scripting/functions/GetPlayers.md +++ b/frontend/docs/scripting/functions/GetPlayers.md @@ -24,7 +24,7 @@ The function returns the number of players stored in the array. Suppose there are 5 players on the server: -```c +```pawn new players[MAX_PLAYERS]; new length; diff --git a/frontend/docs/scripting/functions/GetRandomVehicleColourPair.md b/frontend/docs/scripting/functions/GetRandomVehicleColourPair.md index 1bd28b3d3f50..e2f9741a990a 100644 --- a/frontend/docs/scripting/functions/GetRandomVehicleColourPair.md +++ b/frontend/docs/scripting/functions/GetRandomVehicleColourPair.md @@ -23,7 +23,7 @@ Get random colour indexes that are valid for the given vehicle model. ## Examples -```c +```pawn new colour1, colour2; diff --git a/frontend/docs/scripting/functions/GetRunningTimers.md b/frontend/docs/scripting/functions/GetRunningTimers.md index a5ae7e53c445..b7531385f029 100644 --- a/frontend/docs/scripting/functions/GetRunningTimers.md +++ b/frontend/docs/scripting/functions/GetRunningTimers.md @@ -2,7 +2,7 @@ title: GetRunningTimers sidebar_label: GetRunningTimers description: Get the running timers. -tags: [] +tags: ["timer"] --- :::warning @@ -21,7 +21,7 @@ Returns the amount of running timers. ## Examples -```c +```pawn printf("Running timers: %d", GetRunningTimers()); ``` diff --git a/frontend/docs/scripting/functions/GetSVarFloat.md b/frontend/docs/scripting/functions/GetSVarFloat.md index 22688883da7c..eb24ee480422 100644 --- a/frontend/docs/scripting/functions/GetSVarFloat.md +++ b/frontend/docs/scripting/functions/GetSVarFloat.md @@ -23,7 +23,7 @@ It will still return **0.0** if the variable is not set. ## Examples -```c +```pawn // set "Version" SetSVarFloat("Version", 0.37); diff --git a/frontend/docs/scripting/functions/GetSVarInt.md b/frontend/docs/scripting/functions/GetSVarInt.md index 47dabdc75fae..62a1e4ae3c18 100644 --- a/frontend/docs/scripting/functions/GetSVarInt.md +++ b/frontend/docs/scripting/functions/GetSVarInt.md @@ -23,7 +23,7 @@ It will still return **0** if the variable is not set. ## Examples -```c +```pawn // set "Version" SetSVarInt("Version", 37); diff --git a/frontend/docs/scripting/functions/GetSVarString.md b/frontend/docs/scripting/functions/GetSVarString.md index 100402f34b49..8a73fc1422b3 100644 --- a/frontend/docs/scripting/functions/GetSVarString.md +++ b/frontend/docs/scripting/functions/GetSVarString.md @@ -23,7 +23,7 @@ The length of the string. ## Examples -```c +```pawn // set "Version" SetSVarString("Version", "0.3.7"); diff --git a/frontend/docs/scripting/functions/GetSVarType.md b/frontend/docs/scripting/functions/GetSVarType.md index c7ad2f90c8bf..ae71c67dee22 100644 --- a/frontend/docs/scripting/functions/GetSVarType.md +++ b/frontend/docs/scripting/functions/GetSVarType.md @@ -21,7 +21,7 @@ Returns `SERVER_VARTYPE_NONE` (0) if a server variable with the given name does ## Examples -```c +```pawn stock PrintSVar(varname[]) { switch (GetSVarType(varname)) diff --git a/frontend/docs/scripting/functions/GetSVarsUpperIndex.md b/frontend/docs/scripting/functions/GetSVarsUpperIndex.md index 956dbe8b8dd7..2acfb863a156 100644 --- a/frontend/docs/scripting/functions/GetSVarsUpperIndex.md +++ b/frontend/docs/scripting/functions/GetSVarsUpperIndex.md @@ -15,7 +15,7 @@ The highest set SVar ID. ## Examples -```c +```pawn // Store the upper index in the variable 'SVarUpperIndex' + 1 new sVarUpperIndex = GetSVarsUpperIndex() + 1; diff --git a/frontend/docs/scripting/functions/GetServerRuleFlags.md b/frontend/docs/scripting/functions/GetServerRuleFlags.md index 3683aebb93c3..202c5220f947 100644 --- a/frontend/docs/scripting/functions/GetServerRuleFlags.md +++ b/frontend/docs/scripting/functions/GetServerRuleFlags.md @@ -23,7 +23,7 @@ Returns the server rule flags. ## Examples -```c +```pawn public OnGameModeInit() { AddServerRule("discord", "discord.gg/samp"); diff --git a/frontend/docs/scripting/functions/GetServerTickRate.md b/frontend/docs/scripting/functions/GetServerTickRate.md index 2102dbcd9b58..bf072966b27d 100644 --- a/frontend/docs/scripting/functions/GetServerTickRate.md +++ b/frontend/docs/scripting/functions/GetServerTickRate.md @@ -2,7 +2,7 @@ title: GetServerTickRate sidebar_label: GetServerTickRate description: Gets the tick rate (like FPS) of the server. -tags: [] +tags: ["server", "network monitoring"] --- ## Description @@ -15,7 +15,7 @@ The server tick rate (per second). Returns 0 when the server is just started. ## Examples -```c +```pawn printf("The current server tick rate is: %i", GetServerTickRate()); ``` diff --git a/frontend/docs/scripting/functions/GetServerVarAsBool.md b/frontend/docs/scripting/functions/GetServerVarAsBool.md index 04cf3bbed67b..1497ac2dfe6b 100644 --- a/frontend/docs/scripting/functions/GetServerVarAsBool.md +++ b/frontend/docs/scripting/functions/GetServerVarAsBool.md @@ -2,7 +2,7 @@ title: GetServerVarAsBool sidebar_label: GetServerVarAsBool description: Get the boolean value of a server variable. -tags: [] +tags: ["server", "console variable"] --- :::warning @@ -25,7 +25,7 @@ The value of the specified server variable. 0 if the specified server variable i ## Examples -```c +```pawn public OnGameModeInit() { new queryEnabled = GetServerVarAsBool("query"); @@ -37,7 +37,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/GetServerVarAsInt.md b/frontend/docs/scripting/functions/GetServerVarAsInt.md index 405e4635c010..b45a69620955 100644 --- a/frontend/docs/scripting/functions/GetServerVarAsInt.md +++ b/frontend/docs/scripting/functions/GetServerVarAsInt.md @@ -2,7 +2,7 @@ title: GetServerVarAsInt sidebar_label: GetServerVarAsInt description: Get the integer value of a server variable. -tags: [] +tags: ["server", "console variable"] --- :::warning @@ -25,12 +25,12 @@ The value of the specified server variable. 0 if the specified server variable i ## Examples -```c +```pawn new serverPort = GetServerVarAsInt("port"); printf("Server Port: %i", serverPort); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/GetServerVarAsString.md b/frontend/docs/scripting/functions/GetServerVarAsString.md index a354508e4276..833faa072f3d 100644 --- a/frontend/docs/scripting/functions/GetServerVarAsString.md +++ b/frontend/docs/scripting/functions/GetServerVarAsString.md @@ -2,7 +2,7 @@ title: GetServerVarAsString sidebar_label: GetServerVarAsString description: Get the string value of a server variable. -tags: [] +tags: ["server", "console variable"] --- :::warning @@ -27,7 +27,7 @@ The length of the returned string. 0 if the specified server variable is not a s ## Examples -```c +```pawn public OnGameModeInit() { new hostname[64]; @@ -36,7 +36,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetSpawnInfo.md b/frontend/docs/scripting/functions/GetSpawnInfo.md index eba4a170b19f..a5f921252ece 100644 --- a/frontend/docs/scripting/functions/GetSpawnInfo.md +++ b/frontend/docs/scripting/functions/GetSpawnInfo.md @@ -35,7 +35,7 @@ Return the current spawn data for a player, where they will spawn next. ## Examples -```c +```pawn public OnPlayerRequestClass(playerid, classid) { SetSpawnInfo(playerid, NO_TEAM, 293, 1139.4786, -1761.3989, 13.5844, 0.0000, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); diff --git a/frontend/docs/scripting/functions/GetTickCount.md b/frontend/docs/scripting/functions/GetTickCount.md index 4f1e1b826c1f..3c05071164e1 100644 --- a/frontend/docs/scripting/functions/GetTickCount.md +++ b/frontend/docs/scripting/functions/GetTickCount.md @@ -13,7 +13,7 @@ Returns a value which increases every millisecond, it should be used to compare Only allow a player to call a command once every ten seconds (10000 milliseconds): -```c +```pawn static gLastCommandUse[MAX_PLAYERS]; public OnPlayerCommandText(playerid, cmdtext[]) @@ -36,13 +36,13 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning The difference in values that `GetTickCount` can handle is limited to just under 25 days (2147483647 milliseconds). As long as the events being compared are less than that amount apart this function works perfectly with one small caveat. Due to integer overflow, the following code may not work: -```c +```pawn new start = GetTickCount(); // Long code. new end = GetTickCount(); @@ -54,7 +54,7 @@ if (start + 2000 > end) If `start` is very high this code will wrap around and may cause the check to pass erroneously. However, solving this is very simple: -```c +```pawn new start = GetTickCount(); // Long code. new end = GetTickCount(); diff --git a/frontend/docs/scripting/functions/GetTimerInterval.md b/frontend/docs/scripting/functions/GetTimerInterval.md index 55dac8f65d09..6a0621bb2758 100644 --- a/frontend/docs/scripting/functions/GetTimerInterval.md +++ b/frontend/docs/scripting/functions/GetTimerInterval.md @@ -23,7 +23,7 @@ Returns the interval of the timer in milliseconds. ## Examples -```c +```pawn new g_Timer; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetTimerRemaining.md b/frontend/docs/scripting/functions/GetTimerRemaining.md index 35e8c4cd67c5..8cf967443e37 100644 --- a/frontend/docs/scripting/functions/GetTimerRemaining.md +++ b/frontend/docs/scripting/functions/GetTimerRemaining.md @@ -23,7 +23,7 @@ Returns the remaining interval of the timer in milliseconds. ## Examples -```c +```pawn new g_Timer; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetVehicleCab.md b/frontend/docs/scripting/functions/GetVehicleCab.md index b5470b5553a1..5133e02b0b4f 100644 --- a/frontend/docs/scripting/functions/GetVehicleCab.md +++ b/frontend/docs/scripting/functions/GetVehicleCab.md @@ -21,7 +21,7 @@ The vehicle ID of the cab or **0** if no cab is attached. ## Examples -```c +```pawn new cabId = GetVehicleCab(vehicleid); ``` diff --git a/frontend/docs/scripting/functions/GetVehicleColours.md b/frontend/docs/scripting/functions/GetVehicleColours.md index 0d92ebf20a78..c3e535c4e145 100644 --- a/frontend/docs/scripting/functions/GetVehicleColours.md +++ b/frontend/docs/scripting/functions/GetVehicleColours.md @@ -21,7 +21,7 @@ Gets the vehicle colours. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); diff --git a/frontend/docs/scripting/functions/GetVehicleComponentInSlot.md b/frontend/docs/scripting/functions/GetVehicleComponentInSlot.md index 45aff066dd8f..22cdbe181e03 100644 --- a/frontend/docs/scripting/functions/GetVehicleComponentInSlot.md +++ b/frontend/docs/scripting/functions/GetVehicleComponentInSlot.md @@ -22,7 +22,7 @@ Returns **0** if no component in specified vehicle's specified slot, or if vehic ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/myspoiler", cmdtext, true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetVehicleComponentType.md b/frontend/docs/scripting/functions/GetVehicleComponentType.md index 2eec38cab951..b7fdcdb9c9d7 100644 --- a/frontend/docs/scripting/functions/GetVehicleComponentType.md +++ b/frontend/docs/scripting/functions/GetVehicleComponentType.md @@ -19,7 +19,7 @@ The [component slot](../resources/componentslots) ID of the specified component ## Examples -```c +```pawn public OnVehicleMod(playerid, vehicleid, componentid) { new diff --git a/frontend/docs/scripting/functions/GetVehicleDamageStatus.md b/frontend/docs/scripting/functions/GetVehicleDamageStatus.md index 7ea959d17d53..37593c9b0eb4 100644 --- a/frontend/docs/scripting/functions/GetVehicleDamageStatus.md +++ b/frontend/docs/scripting/functions/GetVehicleDamageStatus.md @@ -31,7 +31,7 @@ Retrieve the damage statuses of a vehicle. ## Examples -```c +```pawn new VEHICLE_PANEL_STATUS:panels, VEHICLE_DOOR_STATUS:doors, diff --git a/frontend/docs/scripting/functions/GetVehicleDistanceFromPoint.md b/frontend/docs/scripting/functions/GetVehicleDistanceFromPoint.md index 74b197f96dbd..1e7b7707853f 100644 --- a/frontend/docs/scripting/functions/GetVehicleDistanceFromPoint.md +++ b/frontend/docs/scripting/functions/GetVehicleDistanceFromPoint.md @@ -22,7 +22,7 @@ A float containing the distance from the point specified in the coordinates. ## Examples -```c +```pawn /* when the player types 'vendingmachine' in to the chat box, they'll see this.*/ public OnPlayerText(playerid, text[]) { diff --git a/frontend/docs/scripting/functions/GetVehicleDriver.md b/frontend/docs/scripting/functions/GetVehicleDriver.md index 2a6ae4daf0bf..4a8696c54b0f 100644 --- a/frontend/docs/scripting/functions/GetVehicleDriver.md +++ b/frontend/docs/scripting/functions/GetVehicleDriver.md @@ -25,7 +25,7 @@ Returns the driver ID (player ID). ## Examples -```c +```pawn public OnPlayerExitVehicle(playerid, vehicleid) { new driverid = GetVehicleDriver(vehicleid); diff --git a/frontend/docs/scripting/functions/GetVehicleHealth.md b/frontend/docs/scripting/functions/GetVehicleHealth.md index 6029ae9f47f0..64e333bb5179 100644 --- a/frontend/docs/scripting/functions/GetVehicleHealth.md +++ b/frontend/docs/scripting/functions/GetVehicleHealth.md @@ -24,7 +24,7 @@ The vehicle's health is stored in the referenced variable, not in the return val ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/repair", true) == 0) @@ -48,7 +48,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetVehicleHydraReactorAngle.md b/frontend/docs/scripting/functions/GetVehicleHydraReactorAngle.md index 99e213bc67f1..55290dfbd9f9 100644 --- a/frontend/docs/scripting/functions/GetVehicleHydraReactorAngle.md +++ b/frontend/docs/scripting/functions/GetVehicleHydraReactorAngle.md @@ -19,11 +19,11 @@ Gets the hydra reactor angle of the vehicle. ## Examples -```c +```pawn new reactorAngle = GetVehicleHydraReactorAngle(vehicleid); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetVehicleInterior.md b/frontend/docs/scripting/functions/GetVehicleInterior.md index 6f2a5c8d6f33..bbc5c423c5bf 100644 --- a/frontend/docs/scripting/functions/GetVehicleInterior.md +++ b/frontend/docs/scripting/functions/GetVehicleInterior.md @@ -23,7 +23,7 @@ Returns vehicle interior id. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); diff --git a/frontend/docs/scripting/functions/GetVehicleLandingGearState.md b/frontend/docs/scripting/functions/GetVehicleLandingGearState.md index 4d4cf188bc90..9afbcfc99a00 100644 --- a/frontend/docs/scripting/functions/GetVehicleLandingGearState.md +++ b/frontend/docs/scripting/functions/GetVehicleLandingGearState.md @@ -19,7 +19,7 @@ Gets the current vehicle [landing gear state](../resources/landinggearstate) fro ## Examples -```c +```pawn new LANDING_GEAR_STATE:landingGearState = GetVehicleLandingGearState(vehicleid); ``` diff --git a/frontend/docs/scripting/functions/GetVehicleLastDriver.md b/frontend/docs/scripting/functions/GetVehicleLastDriver.md index 1928790980a4..764edaa30376 100644 --- a/frontend/docs/scripting/functions/GetVehicleLastDriver.md +++ b/frontend/docs/scripting/functions/GetVehicleLastDriver.md @@ -25,7 +25,7 @@ Returns the last driver ID (player ID). ## Examples -```c +```pawn new g_Vehicle; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/GetVehicleMatrix.md b/frontend/docs/scripting/functions/GetVehicleMatrix.md index 30f7854ac22e..06798aa65c6a 100644 --- a/frontend/docs/scripting/functions/GetVehicleMatrix.md +++ b/frontend/docs/scripting/functions/GetVehicleMatrix.md @@ -36,7 +36,7 @@ The vehicle's rotation is stored in the specified variables. ## Examples -```c +```pawn new Float:rightX, Float:rightY, diff --git a/frontend/docs/scripting/functions/GetVehicleModel.md b/frontend/docs/scripting/functions/GetVehicleModel.md index 884710d14bfd..fc0a999bc484 100644 --- a/frontend/docs/scripting/functions/GetVehicleModel.md +++ b/frontend/docs/scripting/functions/GetVehicleModel.md @@ -19,7 +19,7 @@ The [vehicle's model ID](../resources/vehicleid), or **0** if the vehicle doesn' ## Examples -```c +```pawn public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if (GetVehicleModel(vehicleid) == 411) // 411 is the Infernus model diff --git a/frontend/docs/scripting/functions/GetVehicleModelCount.md b/frontend/docs/scripting/functions/GetVehicleModelCount.md index 063c7c157fe0..b8eace101ddb 100644 --- a/frontend/docs/scripting/functions/GetVehicleModelCount.md +++ b/frontend/docs/scripting/functions/GetVehicleModelCount.md @@ -19,7 +19,7 @@ Gets the model count of a vehicle model. ## Examples -```c +```pawn public OnGameModeInit() { CreateVehicle(560, 2112.7607, -1308.3751, 23.6797, 90.0000, -1, -1, 100); diff --git a/frontend/docs/scripting/functions/GetVehicleModelInfo.md b/frontend/docs/scripting/functions/GetVehicleModelInfo.md index a18d8b8264dd..94e3f4de57c6 100644 --- a/frontend/docs/scripting/functions/GetVehicleModelInfo.md +++ b/frontend/docs/scripting/functions/GetVehicleModelInfo.md @@ -23,7 +23,7 @@ The vehicle info is stored in the specified variables. ## Examples -```c +```pawn new Float: x, Float: y, Float: z; //Get the size of vehicle model 411 (Infernus) diff --git a/frontend/docs/scripting/functions/GetVehicleModelsUsed.md b/frontend/docs/scripting/functions/GetVehicleModelsUsed.md index 3923b70340b3..b9807257c140 100644 --- a/frontend/docs/scripting/functions/GetVehicleModelsUsed.md +++ b/frontend/docs/scripting/functions/GetVehicleModelsUsed.md @@ -13,7 +13,7 @@ Get the number of used vehicle models on the server. ## Examples -```c +```pawn public OnGameModeInit() { printf("Used vehicle models: %d", GetVehicleModelsUsed()); diff --git a/frontend/docs/scripting/functions/GetVehicleNumberPlate.md b/frontend/docs/scripting/functions/GetVehicleNumberPlate.md index b2bc51200faf..1dbe7e630354 100644 --- a/frontend/docs/scripting/functions/GetVehicleNumberPlate.md +++ b/frontend/docs/scripting/functions/GetVehicleNumberPlate.md @@ -21,7 +21,7 @@ Get the number plate of a vehicle. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); diff --git a/frontend/docs/scripting/functions/GetVehicleOccupiedTick.md b/frontend/docs/scripting/functions/GetVehicleOccupiedTick.md index 3fa51aed9a7f..26446953b054 100644 --- a/frontend/docs/scripting/functions/GetVehicleOccupiedTick.md +++ b/frontend/docs/scripting/functions/GetVehicleOccupiedTick.md @@ -23,7 +23,7 @@ Returns occupied tick in milliseconds. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); diff --git a/frontend/docs/scripting/functions/GetVehiclePaintjob.md b/frontend/docs/scripting/functions/GetVehiclePaintjob.md index 2d1b26940192..d56604389bfa 100644 --- a/frontend/docs/scripting/functions/GetVehiclePaintjob.md +++ b/frontend/docs/scripting/functions/GetVehiclePaintjob.md @@ -23,7 +23,7 @@ Returns the [paintjob id](../resources/paintjobs). ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); diff --git a/frontend/docs/scripting/functions/GetVehicleParamsCarDoors.md b/frontend/docs/scripting/functions/GetVehicleParamsCarDoors.md index 429ea3399a12..768168367e72 100644 --- a/frontend/docs/scripting/functions/GetVehicleParamsCarDoors.md +++ b/frontend/docs/scripting/functions/GetVehicleParamsCarDoors.md @@ -23,7 +23,7 @@ Allows you to retrieve the current state of a vehicle's doors The vehicle's doors state is stored in the specified variables. -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetVehicleParamsCarWindows.md b/frontend/docs/scripting/functions/GetVehicleParamsCarWindows.md index c4c5214e3cf3..6a41d9e68fd3 100644 --- a/frontend/docs/scripting/functions/GetVehicleParamsCarWindows.md +++ b/frontend/docs/scripting/functions/GetVehicleParamsCarWindows.md @@ -23,7 +23,7 @@ Allows you to retrieve the current state of a vehicle's windows The vehicle's windows state is stored in the specified variables. -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetVehicleParamsEx.md b/frontend/docs/scripting/functions/GetVehicleParamsEx.md index 6d2c8d64f302..13b68ecce026 100644 --- a/frontend/docs/scripting/functions/GetVehicleParamsEx.md +++ b/frontend/docs/scripting/functions/GetVehicleParamsEx.md @@ -30,14 +30,14 @@ The vehicle's parameters are stored in the referenced variables, not in the retu ## Examples -```c +```pawn new engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); //This would cause all the variable above, to become the status of its subject. ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetVehicleParamsSirenState.md b/frontend/docs/scripting/functions/GetVehicleParamsSirenState.md index 3cb1dc9f9902..a2ecef37481a 100644 --- a/frontend/docs/scripting/functions/GetVehicleParamsSirenState.md +++ b/frontend/docs/scripting/functions/GetVehicleParamsSirenState.md @@ -25,7 +25,7 @@ Returns a vehicle's siren state (on/off). ## Examples -```c +```pawn new siren = GetVehicleParamsSirenState(vehicleid); @@ -43,7 +43,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetVehiclePoolSize.md b/frontend/docs/scripting/functions/GetVehiclePoolSize.md index 9a6f93f46c6b..dec69c24cdbe 100644 --- a/frontend/docs/scripting/functions/GetVehiclePoolSize.md +++ b/frontend/docs/scripting/functions/GetVehiclePoolSize.md @@ -13,7 +13,7 @@ Gets the highest vehicleid currently in use on the server. Note that in SA:MP th ## Examples -```c +```pawn RepairAllVehicles() { // vehicleids start at 1 diff --git a/frontend/docs/scripting/functions/GetVehiclePos.md b/frontend/docs/scripting/functions/GetVehiclePos.md index a86b68caa145..8d10646aa888 100644 --- a/frontend/docs/scripting/functions/GetVehiclePos.md +++ b/frontend/docs/scripting/functions/GetVehiclePos.md @@ -24,7 +24,7 @@ Gets the position of a vehicle. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/vehpos", true) == 0) diff --git a/frontend/docs/scripting/functions/GetVehicleRespawnDelay.md b/frontend/docs/scripting/functions/GetVehicleRespawnDelay.md index baa1dfa1f946..a44c1cc52df1 100644 --- a/frontend/docs/scripting/functions/GetVehicleRespawnDelay.md +++ b/frontend/docs/scripting/functions/GetVehicleRespawnDelay.md @@ -19,7 +19,7 @@ Get the respawn delay of a vehicle. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); diff --git a/frontend/docs/scripting/functions/GetVehicleRespawnTick.md b/frontend/docs/scripting/functions/GetVehicleRespawnTick.md index 8f4bc10a0a23..2f17a9894b45 100644 --- a/frontend/docs/scripting/functions/GetVehicleRespawnTick.md +++ b/frontend/docs/scripting/functions/GetVehicleRespawnTick.md @@ -23,7 +23,7 @@ Returns respawn tick in milliseconds. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); diff --git a/frontend/docs/scripting/functions/GetVehicleRotation.md b/frontend/docs/scripting/functions/GetVehicleRotation.md index b5ee2d3b7f63..7b9f6a0deb28 100644 --- a/frontend/docs/scripting/functions/GetVehicleRotation.md +++ b/frontend/docs/scripting/functions/GetVehicleRotation.md @@ -28,7 +28,7 @@ The vehicle's rotation is stored in the specified variables. ## Examples -```c +```pawn new Float:x, Float:y, @@ -37,7 +37,7 @@ new GetVehicleRotation(vehicleid, x, y, z); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetVehicleRotationQuat.md b/frontend/docs/scripting/functions/GetVehicleRotationQuat.md index 5a9477d946ea..cff0dd1caeec 100644 --- a/frontend/docs/scripting/functions/GetVehicleRotationQuat.md +++ b/frontend/docs/scripting/functions/GetVehicleRotationQuat.md @@ -27,7 +27,7 @@ The vehicle's rotation is stored in the specified variables. ## Examples -```c +```pawn new Float:w, Float:x, @@ -37,7 +37,7 @@ new GetVehicleRotationQuat(vehicleid, w, x, y, z); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/GetVehicleSeats.md b/frontend/docs/scripting/functions/GetVehicleSeats.md index 67ed261b9fce..cc2ae6eba728 100644 --- a/frontend/docs/scripting/functions/GetVehicleSeats.md +++ b/frontend/docs/scripting/functions/GetVehicleSeats.md @@ -23,7 +23,7 @@ Returns the number of seats. ## Examples -```c +```pawn new vehicleid = GetPlayerVehicleID(playerid); new modelid = GetVehicleModel(vehicleid); new seats = GetVehicleSeats(modelid); diff --git a/frontend/docs/scripting/functions/GetVehicleSirenState.md b/frontend/docs/scripting/functions/GetVehicleSirenState.md index 8b5d789a5f65..fae5d2706dbd 100644 --- a/frontend/docs/scripting/functions/GetVehicleSirenState.md +++ b/frontend/docs/scripting/functions/GetVehicleSirenState.md @@ -23,7 +23,7 @@ Returns the vehicle siren state. ## Examples -```c +```pawn public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new bool:sirenState = GetVehicleSirenState(vehicleid); diff --git a/frontend/docs/scripting/functions/GetVehicleSpawnInfo.md b/frontend/docs/scripting/functions/GetVehicleSpawnInfo.md index e67f69fde47b..3b0f6f203a4a 100644 --- a/frontend/docs/scripting/functions/GetVehicleSpawnInfo.md +++ b/frontend/docs/scripting/functions/GetVehicleSpawnInfo.md @@ -25,7 +25,7 @@ Gets the vehicle spawn location and colours. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); diff --git a/frontend/docs/scripting/functions/GetVehicleTower.md b/frontend/docs/scripting/functions/GetVehicleTower.md index fa1551abc5f0..eecd09d4b72f 100644 --- a/frontend/docs/scripting/functions/GetVehicleTower.md +++ b/frontend/docs/scripting/functions/GetVehicleTower.md @@ -25,7 +25,7 @@ The vehicle ID of the cab or **0** if no cab is attached. ## Examples -```c +```pawn new cabId = GetVehicleTower(vehicleid); ``` diff --git a/frontend/docs/scripting/functions/GetVehicleTrailer.md b/frontend/docs/scripting/functions/GetVehicleTrailer.md index 5024456e667b..fb2f6128e6f0 100644 --- a/frontend/docs/scripting/functions/GetVehicleTrailer.md +++ b/frontend/docs/scripting/functions/GetVehicleTrailer.md @@ -19,13 +19,13 @@ The vehicle ID of the trailer or 0 if no trailer is attached. ## Examples -```c +```pawn new trailerId = GetVehicleTrailer(vehicleid); DetachTrailerFromVehicle(trailerId); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/GetVehicleTrainSpeed.md b/frontend/docs/scripting/functions/GetVehicleTrainSpeed.md index fcc913c9e6ab..8772117c7920 100644 --- a/frontend/docs/scripting/functions/GetVehicleTrainSpeed.md +++ b/frontend/docs/scripting/functions/GetVehicleTrainSpeed.md @@ -19,7 +19,7 @@ Gets the speed of the train. ## Examples -```c +```pawn new vehicleid = GetPlayerVehicleID(playerid); new Float:speed = GetVehicleTrainSpeed(vehicleid); diff --git a/frontend/docs/scripting/functions/GetVehicleVelocity.md b/frontend/docs/scripting/functions/GetVehicleVelocity.md index a235aab7cef6..63f7b1df4939 100644 --- a/frontend/docs/scripting/functions/GetVehicleVelocity.md +++ b/frontend/docs/scripting/functions/GetVehicleVelocity.md @@ -26,7 +26,7 @@ The vehicle's velocity is stored in the specified variables. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/GetMyCarVelocity", cmdtext)) @@ -50,7 +50,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/GetVehicleVirtualWorld.md b/frontend/docs/scripting/functions/GetVehicleVirtualWorld.md index 742210b83561..32b575ad7767 100644 --- a/frontend/docs/scripting/functions/GetVehicleVirtualWorld.md +++ b/frontend/docs/scripting/functions/GetVehicleVirtualWorld.md @@ -19,7 +19,7 @@ The virtual world that the vehicle is in. ## Examples -```c +```pawn new vehicleWorld = GetVehicleVirtualWorld(vehicleid); SetPlayerVirtualWorld(playerid, vehicleWorld); diff --git a/frontend/docs/scripting/functions/GetVehicleZAngle.md b/frontend/docs/scripting/functions/GetVehicleZAngle.md index d1130314c205..2c42d8b052e9 100644 --- a/frontend/docs/scripting/functions/GetVehicleZAngle.md +++ b/frontend/docs/scripting/functions/GetVehicleZAngle.md @@ -24,7 +24,7 @@ The vehicle's rotation is stored in the specified variable. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/vehrot", true) == 0) diff --git a/frontend/docs/scripting/functions/GetVehicles.md b/frontend/docs/scripting/functions/GetVehicles.md index bc89df925223..1f8d8958507f 100644 --- a/frontend/docs/scripting/functions/GetVehicles.md +++ b/frontend/docs/scripting/functions/GetVehicles.md @@ -22,7 +22,7 @@ The function returns the number of vehicles stored in the array. ## Examples -```c +```pawn new vehicles[MAX_VEHICLES]; GetVehicles(vehicles, sizeof(vehicles)); diff --git a/frontend/docs/scripting/functions/GetWeaponName.md b/frontend/docs/scripting/functions/GetWeaponName.md index 1b0ca1009771..bcaee27baaf2 100644 --- a/frontend/docs/scripting/functions/GetWeaponName.md +++ b/frontend/docs/scripting/functions/GetWeaponName.md @@ -2,7 +2,7 @@ title: GetWeaponName sidebar_label: GetWeaponName description: Get the name of a weapon. -tags: [] +tags: ["weapon"] --- ## Description @@ -25,7 +25,7 @@ The weapon's name is stored in the specified array. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Variable declarations, with killerName having the default value of "World". diff --git a/frontend/docs/scripting/functions/GetWeaponSlot.md b/frontend/docs/scripting/functions/GetWeaponSlot.md index cfde6180eed5..ad90621679dc 100644 --- a/frontend/docs/scripting/functions/GetWeaponSlot.md +++ b/frontend/docs/scripting/functions/GetWeaponSlot.md @@ -21,7 +21,7 @@ The number of the [weapon slot](../resources/weaponslots) (0 - 12) ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/weaponslot", true) == 0) diff --git a/frontend/docs/scripting/functions/GetWeather.md b/frontend/docs/scripting/functions/GetWeather.md index b8f66893bc9e..48a015aaa3dd 100644 --- a/frontend/docs/scripting/functions/GetWeather.md +++ b/frontend/docs/scripting/functions/GetWeather.md @@ -2,7 +2,7 @@ title: GetWeather sidebar_label: GetWeather description: Get the current world weather. -tags: [] +tags: ["world", "weather"] --- @@ -13,7 +13,7 @@ Get the current world weather. ## Examples -```c +```pawn SetWeather(19); printf("Current world weather: %d", GetWeather()); diff --git a/frontend/docs/scripting/functions/GetWorldTime.md b/frontend/docs/scripting/functions/GetWorldTime.md index be1341551e3f..d6d9fc384b45 100644 --- a/frontend/docs/scripting/functions/GetWorldTime.md +++ b/frontend/docs/scripting/functions/GetWorldTime.md @@ -13,7 +13,7 @@ Get the current world time. ## Examples -```c +```pawn SetWorldTime(12); printf("Current world time: %d", GetWorldTime()); diff --git a/frontend/docs/scripting/functions/GivePlayerMoney.md b/frontend/docs/scripting/functions/GivePlayerMoney.md index cc2d95d94efa..689c8a995fbc 100644 --- a/frontend/docs/scripting/functions/GivePlayerMoney.md +++ b/frontend/docs/scripting/functions/GivePlayerMoney.md @@ -22,7 +22,7 @@ Give money to or take money from a player. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { if (killerid != INVALID_PLAYER_ID) diff --git a/frontend/docs/scripting/functions/GivePlayerWeapon.md b/frontend/docs/scripting/functions/GivePlayerWeapon.md index 5c3d27dd2e45..f2a51f6ea88e 100644 --- a/frontend/docs/scripting/functions/GivePlayerWeapon.md +++ b/frontend/docs/scripting/functions/GivePlayerWeapon.md @@ -23,7 +23,7 @@ Give a player a weapon with a specified amount of ammo. ## Examples -```c +```pawn GivePlayerWeapon(playerid, WEAPON_SAWEDOFF, 64); // Give playerid a sawn-off shotgun with 64 ammo ``` diff --git a/frontend/docs/scripting/functions/HTTP.md b/frontend/docs/scripting/functions/HTTP.md index ec94f27d4fba..1c4c44d5aaac 100644 --- a/frontend/docs/scripting/functions/HTTP.md +++ b/frontend/docs/scripting/functions/HTTP.md @@ -23,14 +23,14 @@ Sends a threaded HTTP request. ## Definitions -```c +```pawn // HTTP request types #define HTTP_GET (HTTP_METHOD:1) // Sends a regular HTTP request. #define HTTP_POST (HTTP_METHOD:2) // Sends a HTTP request with POST data. #define HTTP_HEAD (HTTP_METHOD:3) // Sends a regular HTTP request, but ignores any response data - returning only the response code. ``` -```c +```pawn // HTTP error response codes // These codes compliment ordinary HTTP response codes returned in 'response_code' #define HTTP_ERROR_BAD_HOST (HTTP_ERROR:1) @@ -43,7 +43,7 @@ Sends a threaded HTTP request. ## Examples -```c +```pawn forward MyHttpResponse(index, response_code, data[]); public OnPlayerCommandText(playerid, cmdtext[]) @@ -76,7 +76,7 @@ public MyHttpResponse(index, response_code, data[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/HasGameText.md b/frontend/docs/scripting/functions/HasGameText.md index 4344d8ac1d40..a477229d5318 100644 --- a/frontend/docs/scripting/functions/HasGameText.md +++ b/frontend/docs/scripting/functions/HasGameText.md @@ -22,7 +22,7 @@ This function returns **true** if the player has gametext, or **false** if it is ## Examples -```c +```pawn public OnPlayerConnect(playerid) { GameTextForPlayer(playerid, "Welcome to the server!", 5000, 3); diff --git a/frontend/docs/scripting/functions/HasObjectCameraCollision.md b/frontend/docs/scripting/functions/HasObjectCameraCollision.md index 0bb2ca075c73..edf3ec28fac1 100644 --- a/frontend/docs/scripting/functions/HasObjectCameraCollision.md +++ b/frontend/docs/scripting/functions/HasObjectCameraCollision.md @@ -23,7 +23,7 @@ Checks if an object has camera collision enabled. ([SetObjectNoCameraCollision]( ## Examples -```c +```pawn if (HasObjectCameraCollision(objectid)) { printf("Object %d camera collision: enable", objectid); diff --git a/frontend/docs/scripting/functions/HasPlayerObjectCameraCollision.md b/frontend/docs/scripting/functions/HasPlayerObjectCameraCollision.md index 30c12748cc51..ca0da9dc8775 100644 --- a/frontend/docs/scripting/functions/HasPlayerObjectCameraCollision.md +++ b/frontend/docs/scripting/functions/HasPlayerObjectCameraCollision.md @@ -24,7 +24,7 @@ Checks if a player-object has camera collision enabled. ([SetPlayerObjectNoCamer ## Examples -```c +```pawn if (HasPlayerObjectCameraCollision(playerid, playerobjectid)) { printf("Player: %d Object: %d Camera collision: enable", playerid, playerobjectid); diff --git a/frontend/docs/scripting/functions/HasVehicleBeenOccupied.md b/frontend/docs/scripting/functions/HasVehicleBeenOccupied.md index 72a48e1f0fc6..d010e733f36f 100644 --- a/frontend/docs/scripting/functions/HasVehicleBeenOccupied.md +++ b/frontend/docs/scripting/functions/HasVehicleBeenOccupied.md @@ -25,7 +25,7 @@ Check if a vehicle is occupied. ## Examples -```c +```pawn if (HasVehicleBeenOccupied(vehicleid)) { // Vehicle is occupied diff --git a/frontend/docs/scripting/functions/HideGameTextForAll.md b/frontend/docs/scripting/functions/HideGameTextForAll.md index 9218f452a27e..976cfd501484 100644 --- a/frontend/docs/scripting/functions/HideGameTextForAll.md +++ b/frontend/docs/scripting/functions/HideGameTextForAll.md @@ -21,7 +21,7 @@ This function does not return any specific value. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/hidegametext3", true)) diff --git a/frontend/docs/scripting/functions/HideGameTextForPlayer.md b/frontend/docs/scripting/functions/HideGameTextForPlayer.md index 072f614c3e82..ea7143f0fbe0 100644 --- a/frontend/docs/scripting/functions/HideGameTextForPlayer.md +++ b/frontend/docs/scripting/functions/HideGameTextForPlayer.md @@ -22,7 +22,7 @@ This function does not return any specific value. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { HideGameTextForPlayer(playerid, 3); diff --git a/frontend/docs/scripting/functions/HideMenuForPlayer.md b/frontend/docs/scripting/functions/HideMenuForPlayer.md index 305c2cbb9a1e..36b7db177c0b 100644 --- a/frontend/docs/scripting/functions/HideMenuForPlayer.md +++ b/frontend/docs/scripting/functions/HideMenuForPlayer.md @@ -22,7 +22,7 @@ Hides a menu for a player. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/menuhide", true) == 0) @@ -35,7 +35,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning @@ -49,7 +49,7 @@ This function has always taken a menu ID parameter, but in SA:MP this ID was not Old code may have looked like: -```c +```pawn gShopMenu = CreateMenu("text", 2, 100.0, 30.0, 7.0); HideMenuForPlayer(gShopMenu, playerid); @@ -57,7 +57,7 @@ HideMenuForPlayer(gShopMenu, playerid); That would always close the player's current menu, regardless of which one they were actually looking at. Now you will need to remember which one they are looking at, or just get it: -```c +```pawn gShopMenu = CreateMenu("text", 2, 100.0, 30.0, 7.0); HideMenuForPlayer(GetPlayerMenu(playerid), playerid); diff --git a/frontend/docs/scripting/functions/HideObjectForPlayer.md b/frontend/docs/scripting/functions/HideObjectForPlayer.md index 71a6e56c7433..7338ec2cdf8d 100644 --- a/frontend/docs/scripting/functions/HideObjectForPlayer.md +++ b/frontend/docs/scripting/functions/HideObjectForPlayer.md @@ -26,7 +26,7 @@ Hide an object for a player. ## Examples -```c +```pawn new gObject; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/HidePickupForPlayer.md b/frontend/docs/scripting/functions/HidePickupForPlayer.md index 6aa7eae1790e..b0cc5aa418f1 100644 --- a/frontend/docs/scripting/functions/HidePickupForPlayer.md +++ b/frontend/docs/scripting/functions/HidePickupForPlayer.md @@ -22,7 +22,7 @@ This function always returns **true**. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/HidePlayerDialog.md b/frontend/docs/scripting/functions/HidePlayerDialog.md index 62406d331728..9ea13919fb83 100644 --- a/frontend/docs/scripting/functions/HidePlayerDialog.md +++ b/frontend/docs/scripting/functions/HidePlayerDialog.md @@ -23,7 +23,7 @@ Hides any dialog the player may currently be able to see. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { if (IsAccountRegistered(playerid)) // Imaginary function to check if the player name is registered diff --git a/frontend/docs/scripting/functions/HideVehicle.md b/frontend/docs/scripting/functions/HideVehicle.md index bdce74e178ca..e549d1cd42e5 100644 --- a/frontend/docs/scripting/functions/HideVehicle.md +++ b/frontend/docs/scripting/functions/HideVehicle.md @@ -25,7 +25,7 @@ Hides a vehicle from the game. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(536, 2496.5034, 5.6658, 27.2247, 180.0000, -1, -1, 60); diff --git a/frontend/docs/scripting/functions/InterpolateCameraLookAt.md b/frontend/docs/scripting/functions/InterpolateCameraLookAt.md index 1814fe791090..1b93764d2b9d 100644 --- a/frontend/docs/scripting/functions/InterpolateCameraLookAt.md +++ b/frontend/docs/scripting/functions/InterpolateCameraLookAt.md @@ -27,7 +27,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/rotateme", true)) @@ -43,7 +43,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/InterpolateCameraPos.md b/frontend/docs/scripting/functions/InterpolateCameraPos.md index 01abae8e8c3f..a5824f1d90ee 100644 --- a/frontend/docs/scripting/functions/InterpolateCameraPos.md +++ b/frontend/docs/scripting/functions/InterpolateCameraPos.md @@ -27,7 +27,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/moveme", true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/Is3DTextLabelStreamedIn.md b/frontend/docs/scripting/functions/Is3DTextLabelStreamedIn.md index f7be7212e82d..7c8ace705359 100644 --- a/frontend/docs/scripting/functions/Is3DTextLabelStreamedIn.md +++ b/frontend/docs/scripting/functions/Is3DTextLabelStreamedIn.md @@ -22,7 +22,7 @@ This function returns **true** if the 3D text label is streamed in for the playe ## Examples -```c +```pawn new Text3D:gMyLabel; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsActorInvulnerable.md b/frontend/docs/scripting/functions/IsActorInvulnerable.md index 58f21ab7a64c..6a68b1799b70 100644 --- a/frontend/docs/scripting/functions/IsActorInvulnerable.md +++ b/frontend/docs/scripting/functions/IsActorInvulnerable.md @@ -23,7 +23,7 @@ Check if an actor is invulnerable. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsActorStreamedIn.md b/frontend/docs/scripting/functions/IsActorStreamedIn.md index 8f5320716bb1..b4330d13f41d 100644 --- a/frontend/docs/scripting/functions/IsActorStreamedIn.md +++ b/frontend/docs/scripting/functions/IsActorStreamedIn.md @@ -22,7 +22,7 @@ This function returns **1** if the actor is streamed in for the player, or **0** ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsAdminTeleportAllowed.md b/frontend/docs/scripting/functions/IsAdminTeleportAllowed.md index 7105fe48e4f6..60534cc70262 100644 --- a/frontend/docs/scripting/functions/IsAdminTeleportAllowed.md +++ b/frontend/docs/scripting/functions/IsAdminTeleportAllowed.md @@ -2,7 +2,7 @@ title: IsAdminTeleportAllowed sidebar_label: IsAdminTeleportAllowed description: Checks if the RCON admins allowed to teleport by right-clicking on the map. -tags: [] +tags: ["rcon", "administration"] --- @@ -19,7 +19,7 @@ false: Not allowed. ## Examples -```c +```pawn if (IsAdminTeleportAllowed()) { // Do something diff --git a/frontend/docs/scripting/functions/IsBanned.md b/frontend/docs/scripting/functions/IsBanned.md index ca7ce1efaae0..fa31dc53215e 100644 --- a/frontend/docs/scripting/functions/IsBanned.md +++ b/frontend/docs/scripting/functions/IsBanned.md @@ -21,14 +21,14 @@ Returns **true** if the IP address is banned, otherwise **false**. ## Examples -```c +```pawn if (IsBanned("255.255.255.255")) { // Do something } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/IsNickNameCharacterAllowed.md b/frontend/docs/scripting/functions/IsNickNameCharacterAllowed.md index 01098e49b6fb..29b95958eb75 100644 --- a/frontend/docs/scripting/functions/IsNickNameCharacterAllowed.md +++ b/frontend/docs/scripting/functions/IsNickNameCharacterAllowed.md @@ -2,7 +2,7 @@ title: IsNickNameCharacterAllowed sidebar_label: IsNickNameCharacterAllowed description: Checks if a character is allowed in nickname. -tags: [] +tags: ["player", "name"] --- @@ -21,7 +21,7 @@ This function returns **true** if the character is allowed, or **false** if it i ## Examples -```c +```pawn public OnGameModeInit() { AllowNickNameCharacter('*', true); // Allow char * diff --git a/frontend/docs/scripting/functions/IsObjectHiddenForPlayer.md b/frontend/docs/scripting/functions/IsObjectHiddenForPlayer.md index d9f45feec7f2..b292f7d97e35 100644 --- a/frontend/docs/scripting/functions/IsObjectHiddenForPlayer.md +++ b/frontend/docs/scripting/functions/IsObjectHiddenForPlayer.md @@ -26,7 +26,7 @@ Checks if an object is hidden for a player. ## Examples -```c +```pawn new gObject; public OnGameModeInit() @@ -51,7 +51,7 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/IsObjectMaterialSlotUsed.md b/frontend/docs/scripting/functions/IsObjectMaterialSlotUsed.md index bb27f27bee2a..7f4d5d6130bd 100644 --- a/frontend/docs/scripting/functions/IsObjectMaterialSlotUsed.md +++ b/frontend/docs/scripting/functions/IsObjectMaterialSlotUsed.md @@ -28,7 +28,7 @@ The function returns the type of material slot usage. ## Examples -```c +```pawn new objectid = CreateObject(19371, 978.71143, -925.25708, 42.63720, 0.00000, 0.00000, 2.00000); SetObjectMaterial(objectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); @@ -38,7 +38,7 @@ new type = IsObjectMaterialSlotUsed(objectid, 0); Another example: -```c +```pawn new objectid = CreateObject(19174, 986.42767, -983.14850, 40.95220, 0.00000, 0.00000, 186.00000); SetObjectMaterialText(objectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); diff --git a/frontend/docs/scripting/functions/IsObjectMoving.md b/frontend/docs/scripting/functions/IsObjectMoving.md index 8473b1ba33ce..fea3a56f7296 100644 --- a/frontend/docs/scripting/functions/IsObjectMoving.md +++ b/frontend/docs/scripting/functions/IsObjectMoving.md @@ -19,7 +19,7 @@ Checks if the given objectid is moving. ## Examples -```c +```pawn new gAirportGate; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsPickupHiddenForPlayer.md b/frontend/docs/scripting/functions/IsPickupHiddenForPlayer.md index 19cdb55c882f..8216e191c853 100644 --- a/frontend/docs/scripting/functions/IsPickupHiddenForPlayer.md +++ b/frontend/docs/scripting/functions/IsPickupHiddenForPlayer.md @@ -22,7 +22,7 @@ This function returns **true** if the pickup is hidden for the player, or **fals ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsPickupStreamedIn.md b/frontend/docs/scripting/functions/IsPickupStreamedIn.md index 1412b337d374..1f8616d39b57 100644 --- a/frontend/docs/scripting/functions/IsPickupStreamedIn.md +++ b/frontend/docs/scripting/functions/IsPickupStreamedIn.md @@ -22,7 +22,7 @@ This function returns **true** if the pickup is streamed in for the player, or * ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsPlayerAdmin.md b/frontend/docs/scripting/functions/IsPlayerAdmin.md index 946da6dd3277..7bf083f0c551 100644 --- a/frontend/docs/scripting/functions/IsPlayerAdmin.md +++ b/frontend/docs/scripting/functions/IsPlayerAdmin.md @@ -21,7 +21,7 @@ Check if a player is logged in as an RCON admin. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { if (IsPlayerAdmin(playerid)) diff --git a/frontend/docs/scripting/functions/IsPlayerAttachedObjectSlotUsed.md b/frontend/docs/scripting/functions/IsPlayerAttachedObjectSlotUsed.md index e734c98db3ac..d67565639c52 100644 --- a/frontend/docs/scripting/functions/IsPlayerAttachedObjectSlotUsed.md +++ b/frontend/docs/scripting/functions/IsPlayerAttachedObjectSlotUsed.md @@ -22,7 +22,7 @@ Check if a player has an object attached in the specified index (slot). ## Examples -```c +```pawn stock CountAttachedObjects(playerid) { new count; diff --git a/frontend/docs/scripting/functions/IsPlayerCameraTargetEnabled.md b/frontend/docs/scripting/functions/IsPlayerCameraTargetEnabled.md index 549d24936c98..1d9f8a13a552 100644 --- a/frontend/docs/scripting/functions/IsPlayerCameraTargetEnabled.md +++ b/frontend/docs/scripting/functions/IsPlayerCameraTargetEnabled.md @@ -23,7 +23,7 @@ Check if the player camera target is enabled. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { if (IsPlayerCameraTargetEnabled(playerid)) diff --git a/frontend/docs/scripting/functions/IsPlayerCheckpointActive.md b/frontend/docs/scripting/functions/IsPlayerCheckpointActive.md index 1e24c9446173..e53f7d47ea26 100644 --- a/frontend/docs/scripting/functions/IsPlayerCheckpointActive.md +++ b/frontend/docs/scripting/functions/IsPlayerCheckpointActive.md @@ -21,7 +21,7 @@ Returns **false** if there is no checkpoint currently shown, otherwise returns * ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { if (IsPlayerCheckpointActive(playerid)) diff --git a/frontend/docs/scripting/functions/IsPlayerConnected.md b/frontend/docs/scripting/functions/IsPlayerConnected.md index 1110bc54c9ab..90abc887d802 100644 --- a/frontend/docs/scripting/functions/IsPlayerConnected.md +++ b/frontend/docs/scripting/functions/IsPlayerConnected.md @@ -21,7 +21,7 @@ Checks if a player is connected (if an ID is taken by a connected player). ## Examples -```c +```pawn KillPlayer(playerid) { if (!IsPlayerConnected(playerid)) @@ -35,7 +35,7 @@ KillPlayer(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/IsPlayerControllable.md b/frontend/docs/scripting/functions/IsPlayerControllable.md index 1d46bfc54161..e60ccf6f4533 100644 --- a/frontend/docs/scripting/functions/IsPlayerControllable.md +++ b/frontend/docs/scripting/functions/IsPlayerControllable.md @@ -23,7 +23,7 @@ Check if the player is controllable. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { // Unfreeze the player if it is freezed diff --git a/frontend/docs/scripting/functions/IsPlayerCuffed.md b/frontend/docs/scripting/functions/IsPlayerCuffed.md index 37803184d0c3..7a346c125377 100644 --- a/frontend/docs/scripting/functions/IsPlayerCuffed.md +++ b/frontend/docs/scripting/functions/IsPlayerCuffed.md @@ -21,7 +21,7 @@ Returns true if the player is cuffed, otherwise false. ## Examples -```c +```pawn SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED); if (IsPlayerCuffed(playerid)) diff --git a/frontend/docs/scripting/functions/IsPlayerGangZoneFlashing.md b/frontend/docs/scripting/functions/IsPlayerGangZoneFlashing.md index c9ce03867587..2b60e3fe8e96 100644 --- a/frontend/docs/scripting/functions/IsPlayerGangZoneFlashing.md +++ b/frontend/docs/scripting/functions/IsPlayerGangZoneFlashing.md @@ -24,7 +24,7 @@ Check if the player gangzone is flashing. ## Examples -```c +```pawn new gGangZoneID[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsPlayerGangZoneVisible.md b/frontend/docs/scripting/functions/IsPlayerGangZoneVisible.md index 98c4f7bb2f11..bd156040c4f6 100644 --- a/frontend/docs/scripting/functions/IsPlayerGangZoneVisible.md +++ b/frontend/docs/scripting/functions/IsPlayerGangZoneVisible.md @@ -24,7 +24,7 @@ Check if the player gangzone is visible. ## Examples -```c +```pawn new gGangZoneID[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsPlayerInAnyVehicle.md b/frontend/docs/scripting/functions/IsPlayerInAnyVehicle.md index 208ea53ed427..964dc190314d 100644 --- a/frontend/docs/scripting/functions/IsPlayerInAnyVehicle.md +++ b/frontend/docs/scripting/functions/IsPlayerInAnyVehicle.md @@ -21,7 +21,7 @@ Check if a player is inside any vehicle (as a driver or passenger). ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/invehicle", true) == 0) diff --git a/frontend/docs/scripting/functions/IsPlayerInCheckpoint.md b/frontend/docs/scripting/functions/IsPlayerInCheckpoint.md index 88e8f4b8585d..27d31d0ba51b 100644 --- a/frontend/docs/scripting/functions/IsPlayerInCheckpoint.md +++ b/frontend/docs/scripting/functions/IsPlayerInCheckpoint.md @@ -19,7 +19,7 @@ Check if the player is currently inside a checkpoint, this could be used for pro ## Examples -```c +```pawn if (IsPlayerInCheckpoint(playerid)) { SetPlayerHealth(playerid, 100.0); diff --git a/frontend/docs/scripting/functions/IsPlayerInDriveByMode.md b/frontend/docs/scripting/functions/IsPlayerInDriveByMode.md index 2abd7e4cf664..19172533e4c4 100644 --- a/frontend/docs/scripting/functions/IsPlayerInDriveByMode.md +++ b/frontend/docs/scripting/functions/IsPlayerInDriveByMode.md @@ -21,7 +21,7 @@ Returns true if the player is in driveby mode, otherwise false. ## Examples -```c +```pawn if (IsPlayerInDriveByMode(playerid)) { // do something diff --git a/frontend/docs/scripting/functions/IsPlayerInGangZone.md b/frontend/docs/scripting/functions/IsPlayerInGangZone.md index 1bb915f8a130..cbb336d00957 100644 --- a/frontend/docs/scripting/functions/IsPlayerInGangZone.md +++ b/frontend/docs/scripting/functions/IsPlayerInGangZone.md @@ -22,7 +22,7 @@ Check if the player in gangzone. **false** - The player is not in gangzone. -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/IsPlayerInModShop.md b/frontend/docs/scripting/functions/IsPlayerInModShop.md index 7700611ec421..aeb16adaac94 100644 --- a/frontend/docs/scripting/functions/IsPlayerInModShop.md +++ b/frontend/docs/scripting/functions/IsPlayerInModShop.md @@ -25,7 +25,7 @@ Check if the player is in the mod shop. ## Examples -```c +```pawn if (IsPlayerInModShop(playerid)) { SendClientMessage(playerid, 0xFFFF00FF, "You are in the mod shop."); diff --git a/frontend/docs/scripting/functions/IsPlayerInPlayerGangZone.md b/frontend/docs/scripting/functions/IsPlayerInPlayerGangZone.md index 8916c4584ad6..fbfffd110d10 100644 --- a/frontend/docs/scripting/functions/IsPlayerInPlayerGangZone.md +++ b/frontend/docs/scripting/functions/IsPlayerInPlayerGangZone.md @@ -24,7 +24,7 @@ Check if the player in player gangzone. ## Examples -```c +```pawn new gGangZoneID[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsPlayerInRaceCheckpoint.md b/frontend/docs/scripting/functions/IsPlayerInRaceCheckpoint.md index 00535deac82f..ce7b032c23fa 100644 --- a/frontend/docs/scripting/functions/IsPlayerInRaceCheckpoint.md +++ b/frontend/docs/scripting/functions/IsPlayerInRaceCheckpoint.md @@ -21,7 +21,7 @@ Check if the player is inside their current set race checkpoint ([SetPlayerRaceC ## Examples -```c +```pawn if (IsPlayerInRaceCheckpoint(playerid)) { SetPlayerHealth(playerid, 100.0); diff --git a/frontend/docs/scripting/functions/IsPlayerInRangeOfPoint.md b/frontend/docs/scripting/functions/IsPlayerInRangeOfPoint.md index 473d56df5124..46799ee54f89 100644 --- a/frontend/docs/scripting/functions/IsPlayerInRangeOfPoint.md +++ b/frontend/docs/scripting/functions/IsPlayerInRangeOfPoint.md @@ -25,7 +25,7 @@ Checks if a player is in range of a point. This native function is faster than t ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/stadium", true)) diff --git a/frontend/docs/scripting/functions/IsPlayerInVehicle.md b/frontend/docs/scripting/functions/IsPlayerInVehicle.md index 566bc26e3c84..23e6e2cb0b7d 100644 --- a/frontend/docs/scripting/functions/IsPlayerInVehicle.md +++ b/frontend/docs/scripting/functions/IsPlayerInVehicle.md @@ -22,7 +22,7 @@ Checks if a player is in a specific vehicle. ## Examples -```c +```pawn new gSpecialCar; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsPlayerNPC.md b/frontend/docs/scripting/functions/IsPlayerNPC.md index 58dc7ee8fd30..01e346997986 100644 --- a/frontend/docs/scripting/functions/IsPlayerNPC.md +++ b/frontend/docs/scripting/functions/IsPlayerNPC.md @@ -21,7 +21,7 @@ Check if a player is an actual player or an NPC. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { if (IsPlayerNPC(playerid)) diff --git a/frontend/docs/scripting/functions/IsPlayerObjectMaterialSlotUsed.md b/frontend/docs/scripting/functions/IsPlayerObjectMaterialSlotUsed.md index 9301ef232dc6..1fadd637a826 100644 --- a/frontend/docs/scripting/functions/IsPlayerObjectMaterialSlotUsed.md +++ b/frontend/docs/scripting/functions/IsPlayerObjectMaterialSlotUsed.md @@ -29,7 +29,7 @@ The function returns the type of material slot usage. ## Examples -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 19371, 978.71143, -925.25708, 42.63720, 0.00000, 0.00000, 2.00000); SetPlayerObjectMaterial(playerid, playerobjectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); @@ -39,7 +39,7 @@ new type = IsPlayerObjectMaterialSlotUsed(playerid, playerobjectid, 0); Another example: -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 19174, 986.42767, -983.14850, 40.95220, 0.00000, 0.00000, 186.00000); SetPlayerObjectMaterialText(playerid, playerobjectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); diff --git a/frontend/docs/scripting/functions/IsPlayerObjectMoving.md b/frontend/docs/scripting/functions/IsPlayerObjectMoving.md index f0a920c2691f..479e0653fe9c 100644 --- a/frontend/docs/scripting/functions/IsPlayerObjectMoving.md +++ b/frontend/docs/scripting/functions/IsPlayerObjectMoving.md @@ -20,7 +20,7 @@ Checks if the given player objectid is moving. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsPlayerPickupStreamedIn.md b/frontend/docs/scripting/functions/IsPlayerPickupStreamedIn.md index 906a2edbc81b..cddf76698d86 100644 --- a/frontend/docs/scripting/functions/IsPlayerPickupStreamedIn.md +++ b/frontend/docs/scripting/functions/IsPlayerPickupStreamedIn.md @@ -22,7 +22,7 @@ This function returns **true** if the player-pickup is streamed in for the playe ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; // Create a variable to store the player-pickup ID in public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsPlayerRaceCheckpointActive.md b/frontend/docs/scripting/functions/IsPlayerRaceCheckpointActive.md index 1685b736fa2c..f8bac83cc80a 100644 --- a/frontend/docs/scripting/functions/IsPlayerRaceCheckpointActive.md +++ b/frontend/docs/scripting/functions/IsPlayerRaceCheckpointActive.md @@ -21,7 +21,7 @@ Returns **false** if there is no race checkpoint currently shown, otherwise retu ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { if (IsPlayerRaceCheckpointActive(playerid)) diff --git a/frontend/docs/scripting/functions/IsPlayerSpawned.md b/frontend/docs/scripting/functions/IsPlayerSpawned.md index 229d4a2e1376..0859e15bf22a 100644 --- a/frontend/docs/scripting/functions/IsPlayerSpawned.md +++ b/frontend/docs/scripting/functions/IsPlayerSpawned.md @@ -23,7 +23,7 @@ Checks if a player is spawned. ## Examples -```c +```pawn public OnPlayerText(playerid, text[]) { if (!IsPlayerSpawned(playerid)) diff --git a/frontend/docs/scripting/functions/IsPlayerStreamedIn.md b/frontend/docs/scripting/functions/IsPlayerStreamedIn.md index 10ffa7e1bdfd..7ca9a643ef31 100644 --- a/frontend/docs/scripting/functions/IsPlayerStreamedIn.md +++ b/frontend/docs/scripting/functions/IsPlayerStreamedIn.md @@ -22,14 +22,14 @@ Checks if a player is streamed in another player's client. ## Examples -```c +```pawn if (IsPlayerStreamedIn(playerid, 0)) { SendClientMessage(playerid, -1, "ID 0 can see you."); } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/IsPlayerTeleportAllowed.md b/frontend/docs/scripting/functions/IsPlayerTeleportAllowed.md index 511ed7605258..cb71b53a3e0b 100644 --- a/frontend/docs/scripting/functions/IsPlayerTeleportAllowed.md +++ b/frontend/docs/scripting/functions/IsPlayerTeleportAllowed.md @@ -23,7 +23,7 @@ Can this player teleport by right-clicking on the map? ## Examples -```c +```pawn public OnPlayerConnect(playerid) { AllowPlayerTeleport(playerid, true); diff --git a/frontend/docs/scripting/functions/IsPlayerTextDrawVisible.md b/frontend/docs/scripting/functions/IsPlayerTextDrawVisible.md index 1b590e5e85be..f36bf55ab9e0 100644 --- a/frontend/docs/scripting/functions/IsPlayerTextDrawVisible.md +++ b/frontend/docs/scripting/functions/IsPlayerTextDrawVisible.md @@ -24,7 +24,7 @@ Checks if a player-textdraw is shown for the player. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsPlayerUsingOfficialClient.md b/frontend/docs/scripting/functions/IsPlayerUsingOfficialClient.md index 5927cbb96540..6cdd9ed8d4c4 100644 --- a/frontend/docs/scripting/functions/IsPlayerUsingOfficialClient.md +++ b/frontend/docs/scripting/functions/IsPlayerUsingOfficialClient.md @@ -21,7 +21,7 @@ Returns 1 if the player is using the official client, otherwise 0. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { if (IsPlayerUsingOfficialClient(playerid) == 0) diff --git a/frontend/docs/scripting/functions/IsPlayerUsingOmp.md b/frontend/docs/scripting/functions/IsPlayerUsingOmp.md index 6813d01592ef..3c14b0c19539 100644 --- a/frontend/docs/scripting/functions/IsPlayerUsingOmp.md +++ b/frontend/docs/scripting/functions/IsPlayerUsingOmp.md @@ -21,7 +21,7 @@ Returns 1 if the player is using the open.mp launcher, otherwise 0. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { // Player is using the open.mp launcher diff --git a/frontend/docs/scripting/functions/IsPlayerWidescreenToggled.md b/frontend/docs/scripting/functions/IsPlayerWidescreenToggled.md index 2bcc04f58d9c..d7bcbc59248b 100644 --- a/frontend/docs/scripting/functions/IsPlayerWidescreenToggled.md +++ b/frontend/docs/scripting/functions/IsPlayerWidescreenToggled.md @@ -23,7 +23,7 @@ Checks if a player widescreen is on or off. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/widescreencheck", true)) diff --git a/frontend/docs/scripting/functions/IsRepeatingTimer.md b/frontend/docs/scripting/functions/IsRepeatingTimer.md index 3ad363360b08..b8765b6f2714 100644 --- a/frontend/docs/scripting/functions/IsRepeatingTimer.md +++ b/frontend/docs/scripting/functions/IsRepeatingTimer.md @@ -25,7 +25,7 @@ Checks if a timer is set to repeat. ## Examples -```c +```pawn new g_Timer; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsTextDrawVisibleForPlayer.md b/frontend/docs/scripting/functions/IsTextDrawVisibleForPlayer.md index d10e148347c8..8857debbe6ff 100644 --- a/frontend/docs/scripting/functions/IsTextDrawVisibleForPlayer.md +++ b/frontend/docs/scripting/functions/IsTextDrawVisibleForPlayer.md @@ -24,7 +24,7 @@ Checks if a textdraw is shown for a player. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsTrailerAttachedToVehicle.md b/frontend/docs/scripting/functions/IsTrailerAttachedToVehicle.md index 53a5ce017082..e8df1ae9ca03 100644 --- a/frontend/docs/scripting/functions/IsTrailerAttachedToVehicle.md +++ b/frontend/docs/scripting/functions/IsTrailerAttachedToVehicle.md @@ -21,7 +21,7 @@ Checks if a vehicle has a trailer attached to it. Use [GetVehicleTrailer](GetVeh ## Examples -```c +```pawn if (IsTrailerAttachedToVehicle(vehicleid)) { printf("Vehicle %i has a trailer!", vehicleid); diff --git a/frontend/docs/scripting/functions/IsValid3DTextLabel.md b/frontend/docs/scripting/functions/IsValid3DTextLabel.md index bfd937b5479c..bad169126807 100644 --- a/frontend/docs/scripting/functions/IsValid3DTextLabel.md +++ b/frontend/docs/scripting/functions/IsValid3DTextLabel.md @@ -21,7 +21,7 @@ This function returns **true** if the 3D text label is valid, or **false** if it ## Examples -```c +```pawn new Text3D:gMyLabel; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsValidActor.md b/frontend/docs/scripting/functions/IsValidActor.md index 82e2effb8174..9a5ac36ee072 100644 --- a/frontend/docs/scripting/functions/IsValidActor.md +++ b/frontend/docs/scripting/functions/IsValidActor.md @@ -23,7 +23,7 @@ Checks if an actor ID is valid. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsValidAnimationLibrary.md b/frontend/docs/scripting/functions/IsValidAnimationLibrary.md index 2cd3cfd2d87f..3ac176e3857a 100644 --- a/frontend/docs/scripting/functions/IsValidAnimationLibrary.md +++ b/frontend/docs/scripting/functions/IsValidAnimationLibrary.md @@ -21,7 +21,7 @@ Returns true if the animation library is valid, otherwise false. ## Examples -```c +```pawn if (IsValidAnimationLibrary("PED")) { // Animation library is valid diff --git a/frontend/docs/scripting/functions/IsValidNickName.md b/frontend/docs/scripting/functions/IsValidNickName.md index 2f509134a25d..0420074ae763 100644 --- a/frontend/docs/scripting/functions/IsValidNickName.md +++ b/frontend/docs/scripting/functions/IsValidNickName.md @@ -2,7 +2,7 @@ title: IsValidNickName sidebar_label: IsValidNickName description: Checks if a nick name is valid. -tags: [] +tags: ["player", "name", "validation"] --- @@ -21,7 +21,7 @@ Returns true if the nick name is valid, otherwise false. ## Examples -```c +```pawn if (IsValidNickName("Barnaby_Keene")) { // Do something @@ -32,7 +32,7 @@ else } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/IsValidObject.md b/frontend/docs/scripting/functions/IsValidObject.md index be9824771832..9f9f2462e169 100644 --- a/frontend/docs/scripting/functions/IsValidObject.md +++ b/frontend/docs/scripting/functions/IsValidObject.md @@ -21,7 +21,7 @@ Checks if an object with the ID provided exists. ## Examples -```c +```pawn new objectid; public OnGameModeInit() @@ -40,7 +40,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/IsValidPickup.md b/frontend/docs/scripting/functions/IsValidPickup.md index 207a5e08855e..87b4ae866712 100644 --- a/frontend/docs/scripting/functions/IsValidPickup.md +++ b/frontend/docs/scripting/functions/IsValidPickup.md @@ -21,7 +21,7 @@ This function returns **true** if the pickup is valid, or **false** if it is not ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsValidPlayer3DTextLabel.md b/frontend/docs/scripting/functions/IsValidPlayer3DTextLabel.md index 61f4f1977267..d7e682fb0d23 100644 --- a/frontend/docs/scripting/functions/IsValidPlayer3DTextLabel.md +++ b/frontend/docs/scripting/functions/IsValidPlayer3DTextLabel.md @@ -22,7 +22,7 @@ This function returns **true** if the player's 3D text label is valid, or **fals ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; diff --git a/frontend/docs/scripting/functions/IsValidPlayerGangZone.md b/frontend/docs/scripting/functions/IsValidPlayerGangZone.md index f21575a1b3d3..d054bd3b976a 100644 --- a/frontend/docs/scripting/functions/IsValidPlayerGangZone.md +++ b/frontend/docs/scripting/functions/IsValidPlayerGangZone.md @@ -24,7 +24,7 @@ Check if the player gangzone valid. ## Examples -```c +```pawn // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; diff --git a/frontend/docs/scripting/functions/IsValidPlayerObject.md b/frontend/docs/scripting/functions/IsValidPlayerObject.md index 34cffc6030f6..5e35fa2fa6dd 100644 --- a/frontend/docs/scripting/functions/IsValidPlayerObject.md +++ b/frontend/docs/scripting/functions/IsValidPlayerObject.md @@ -20,7 +20,7 @@ Checks if the given object ID is valid for the given player. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsValidPlayerPickup.md b/frontend/docs/scripting/functions/IsValidPlayerPickup.md index ad29eca21f90..06ef8d60a781 100644 --- a/frontend/docs/scripting/functions/IsValidPlayerPickup.md +++ b/frontend/docs/scripting/functions/IsValidPlayerPickup.md @@ -22,7 +22,7 @@ This function returns **true** if the player-pickup is valid, or **false** if it ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; // Create a variable to store the player-pickup ID in public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsValidPlayerTextDraw.md b/frontend/docs/scripting/functions/IsValidPlayerTextDraw.md index ec50cc0480c0..61fe16409ebe 100644 --- a/frontend/docs/scripting/functions/IsValidPlayerTextDraw.md +++ b/frontend/docs/scripting/functions/IsValidPlayerTextDraw.md @@ -24,7 +24,7 @@ Returns **true** if the player-textdraw is valid, otherwise **false**. ## Example Usage -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/IsValidServerRule.md b/frontend/docs/scripting/functions/IsValidServerRule.md index 0b9df9962a38..9795055c4dd6 100644 --- a/frontend/docs/scripting/functions/IsValidServerRule.md +++ b/frontend/docs/scripting/functions/IsValidServerRule.md @@ -21,7 +21,7 @@ Returns true if the server rule is valid, otherwise false. ## Examples -```c +```pawn if (IsValidServerRule("version")) { // Server rule is valid diff --git a/frontend/docs/scripting/functions/IsValidTextDraw.md b/frontend/docs/scripting/functions/IsValidTextDraw.md index c59bd48f6eae..8a184c826ba5 100644 --- a/frontend/docs/scripting/functions/IsValidTextDraw.md +++ b/frontend/docs/scripting/functions/IsValidTextDraw.md @@ -23,7 +23,7 @@ Returns **true** if the textdraw is valid, otherwise **false**. ## Example Usage -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsValidTimer.md b/frontend/docs/scripting/functions/IsValidTimer.md index 5d82b4441e51..6691ec35d57d 100644 --- a/frontend/docs/scripting/functions/IsValidTimer.md +++ b/frontend/docs/scripting/functions/IsValidTimer.md @@ -25,7 +25,7 @@ Checks if a timer is valid. ## Examples -```c +```pawn new g_Timer; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/IsValidVehicle.md b/frontend/docs/scripting/functions/IsValidVehicle.md index c56b504743cf..0a6f4aa8fd14 100644 --- a/frontend/docs/scripting/functions/IsValidVehicle.md +++ b/frontend/docs/scripting/functions/IsValidVehicle.md @@ -27,7 +27,7 @@ Check if a vehicle is created. ## Example Usage -```c +```pawn #if !defined IsValidVehicle native IsValidVehicle(vehicleid); #endif diff --git a/frontend/docs/scripting/functions/IsVehicleDead.md b/frontend/docs/scripting/functions/IsVehicleDead.md index 1104a626d1f7..6324b6924912 100644 --- a/frontend/docs/scripting/functions/IsVehicleDead.md +++ b/frontend/docs/scripting/functions/IsVehicleDead.md @@ -25,7 +25,7 @@ Check if a vehicle is dead. ## Examples -```c +```pawn if (IsVehicleDead(vehicleid)) { // Vehicle is dead diff --git a/frontend/docs/scripting/functions/IsVehicleHidden.md b/frontend/docs/scripting/functions/IsVehicleHidden.md index 70035a67b8ba..9738525c79fe 100644 --- a/frontend/docs/scripting/functions/IsVehicleHidden.md +++ b/frontend/docs/scripting/functions/IsVehicleHidden.md @@ -31,7 +31,7 @@ Checks if a vehicle is hidden. ## Examples -```c +```pawn if (IsVehicleHidden(vehicleid)) { // Vehicle is hidden diff --git a/frontend/docs/scripting/functions/IsVehicleOccupied.md b/frontend/docs/scripting/functions/IsVehicleOccupied.md index 19c41a7db5fd..21ed4797b627 100644 --- a/frontend/docs/scripting/functions/IsVehicleOccupied.md +++ b/frontend/docs/scripting/functions/IsVehicleOccupied.md @@ -25,7 +25,7 @@ Check if a vehicle is occupied. ## Examples -```c +```pawn if (IsVehicleOccupied(vehicleid)) { // Vehicle is occupied diff --git a/frontend/docs/scripting/functions/IsVehicleSirenEnabled.md b/frontend/docs/scripting/functions/IsVehicleSirenEnabled.md index 438186f68357..f7664cf89148 100644 --- a/frontend/docs/scripting/functions/IsVehicleSirenEnabled.md +++ b/frontend/docs/scripting/functions/IsVehicleSirenEnabled.md @@ -25,7 +25,7 @@ Checks if a vehicle siren is on or off. ## Examples -```c +```pawn if (IsVehicleSirenEnabled(vehicleid)) { // Vehicle siren is on diff --git a/frontend/docs/scripting/functions/IsVehicleStreamedIn.md b/frontend/docs/scripting/functions/IsVehicleStreamedIn.md index fd932ea53b31..43d238868fba 100644 --- a/frontend/docs/scripting/functions/IsVehicleStreamedIn.md +++ b/frontend/docs/scripting/functions/IsVehicleStreamedIn.md @@ -22,7 +22,7 @@ Checks if a vehicle is streamed in for a player. Only nearby vehicles are stream ## Examples -```c +```pawn new streamedVehicleCount; for (new i = 1; i < MAX_VEHICLES; i++) diff --git a/frontend/docs/scripting/functions/Kick.md b/frontend/docs/scripting/functions/Kick.md index 66c82b7bf2d2..f2f999177c8b 100644 --- a/frontend/docs/scripting/functions/Kick.md +++ b/frontend/docs/scripting/functions/Kick.md @@ -17,7 +17,7 @@ Kicks a player from the server. They will have to quit the game and re-connect i This function always returns **1**, even if the function failed to execute (player specified doesn't exist). -## Notes +## Good to know :::warning @@ -27,7 +27,7 @@ Any action taken directly before Kick (such as sending a message with [SendClien ## Examples -```c +```pawn // In order to display a message (eg. reason) for the player before the connection is closed // you have to use a timer to create a delay. This delay only needs to be a few milliseconds long, // but this example uses a full second just to be on the safe side. diff --git a/frontend/docs/scripting/functions/KillTimer.md b/frontend/docs/scripting/functions/KillTimer.md index ffa7b555cd4d..d675fbef0e52 100644 --- a/frontend/docs/scripting/functions/KillTimer.md +++ b/frontend/docs/scripting/functions/KillTimer.md @@ -19,7 +19,7 @@ This function always returns **0**. ## Examples -```c +```pawn new gConnectTimer[MAX_PLAYERS] = {0, ...}; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/LimitGlobalChatRadius.md b/frontend/docs/scripting/functions/LimitGlobalChatRadius.md index cd6a30e483bc..c93ed08108be 100644 --- a/frontend/docs/scripting/functions/LimitGlobalChatRadius.md +++ b/frontend/docs/scripting/functions/LimitGlobalChatRadius.md @@ -2,7 +2,7 @@ title: LimitGlobalChatRadius sidebar_label: LimitGlobalChatRadius description: Set a radius limitation for the chat. -tags: [] +tags: ["chat"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { LimitGlobalChatRadius(200.0); diff --git a/frontend/docs/scripting/functions/LimitPlayerMarkerRadius.md b/frontend/docs/scripting/functions/LimitPlayerMarkerRadius.md index 2370ac62c530..2083138091bb 100644 --- a/frontend/docs/scripting/functions/LimitPlayerMarkerRadius.md +++ b/frontend/docs/scripting/functions/LimitPlayerMarkerRadius.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { LimitPlayerMarkerRadius(100.0); diff --git a/frontend/docs/scripting/functions/LinkVehicleToInterior.md b/frontend/docs/scripting/functions/LinkVehicleToInterior.md index ff42465950d0..f9b24d874eaa 100644 --- a/frontend/docs/scripting/functions/LinkVehicleToInterior.md +++ b/frontend/docs/scripting/functions/LinkVehicleToInterior.md @@ -22,7 +22,7 @@ Links a vehicle to an interior. Vehicles can only be seen by players in the same ## Examples -```c +```pawn public OnGameModeInit() { new vehicleId = AddStaticVehicle(559, 2543.7505, -21.8345, 27.1899, 52.6054, -1, -1); diff --git a/frontend/docs/scripting/functions/ManualVehicleEngineAndLights.md b/frontend/docs/scripting/functions/ManualVehicleEngineAndLights.md index 2f76706ce7db..72e3f9256e85 100644 --- a/frontend/docs/scripting/functions/ManualVehicleEngineAndLights.md +++ b/frontend/docs/scripting/functions/ManualVehicleEngineAndLights.md @@ -15,7 +15,7 @@ This function always returns **true**. It cannot fail to execute. ## Examples -```c +```pawn public OnGameModeInit() { ManualVehicleEngineAndLights(); @@ -23,7 +23,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/MoveObject.md b/frontend/docs/scripting/functions/MoveObject.md index 666d9a72c7d6..69f7a5441488 100644 --- a/frontend/docs/scripting/functions/MoveObject.md +++ b/frontend/docs/scripting/functions/MoveObject.md @@ -26,7 +26,7 @@ The time it will take for the object to move in milliseconds. ## Examples -```c +```pawn new gAirportGate; // Somewhere at the top of your script public OnGameModeInit() @@ -51,7 +51,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/MovePlayerObject.md b/frontend/docs/scripting/functions/MovePlayerObject.md index a8cdb5c4ccc8..77bdd53b208f 100644 --- a/frontend/docs/scripting/functions/MovePlayerObject.md +++ b/frontend/docs/scripting/functions/MovePlayerObject.md @@ -27,7 +27,7 @@ The time it will take for the object to move in milliseconds. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -39,7 +39,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_AddPointToPath.md b/frontend/docs/scripting/functions/NPC_AddPointToPath.md index e20d6f23a266..6965793bdd5c 100644 --- a/frontend/docs/scripting/functions/NPC_AddPointToPath.md +++ b/frontend/docs/scripting/functions/NPC_AddPointToPath.md @@ -25,7 +25,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/addpatrolpos", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) ``` -## Notes +## Good to know - Points are added sequentially to form the path route - The `stopRange` parameter defines how close the NPC needs to get before moving to the next point diff --git a/frontend/docs/scripting/functions/NPC_AimAt.md b/frontend/docs/scripting/functions/NPC_AimAt.md index 2878a15a4f84..0328da21b095 100644 --- a/frontend/docs/scripting/functions/NPC_AimAt.md +++ b/frontend/docs/scripting/functions/NPC_AimAt.md @@ -31,7 +31,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/aim", true)) @@ -65,7 +65,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC will continuously aim at the specified position until `NPC_StopAim` is called - If `shoot` is `true`, the NPC will fire at the target position with the specified delay diff --git a/frontend/docs/scripting/functions/NPC_AimAtPlayer.md b/frontend/docs/scripting/functions/NPC_AimAtPlayer.md index a0e79c6169d8..6b3882c49117 100644 --- a/frontend/docs/scripting/functions/NPC_AimAtPlayer.md +++ b/frontend/docs/scripting/functions/NPC_AimAtPlayer.md @@ -32,7 +32,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/hostile", true)) @@ -60,7 +60,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC will continuously track the player's movement while aiming - If the target player disconnects or becomes invalid, the NPC will stop aiming/shooting diff --git a/frontend/docs/scripting/functions/NPC_ApplyAnimation.md b/frontend/docs/scripting/functions/NPC_ApplyAnimation.md index 2a2b354106c4..a9e02202ab7c 100644 --- a/frontend/docs/scripting/functions/NPC_ApplyAnimation.md +++ b/frontend/docs/scripting/functions/NPC_ApplyAnimation.md @@ -29,7 +29,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/applydance", true)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Use `time` parameter to set animation duration - Lock parameters prevent movement on specific axes during animation diff --git a/frontend/docs/scripting/functions/NPC_ChangeNode.md b/frontend/docs/scripting/functions/NPC_ChangeNode.md index fe081447e537..27cafc3b9bdd 100644 --- a/frontend/docs/scripting/functions/NPC_ChangeNode.md +++ b/frontend/docs/scripting/functions/NPC_ChangeNode.md @@ -23,7 +23,7 @@ Returns the new point ID in the node. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcchangenode ", true, 15)) @@ -57,7 +57,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC must be currently playing a node before changing - The target node must be opened with `NPC_OpenNode` first diff --git a/frontend/docs/scripting/functions/NPC_ClearAnimations.md b/frontend/docs/scripting/functions/NPC_ClearAnimations.md index c8a263ea9b58..56cdbe40a780 100644 --- a/frontend/docs/scripting/functions/NPC_ClearAnimations.md +++ b/frontend/docs/scripting/functions/NPC_ClearAnimations.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/applydance", true)) @@ -50,7 +50,7 @@ public ClearNPCAnimations(playerid, npcid) ``` -## Notes +## Good to know - This function stops all currently playing animations including looping ones - The NPC will return to its default idle stance diff --git a/frontend/docs/scripting/functions/NPC_ClearPath.md b/frontend/docs/scripting/functions/NPC_ClearPath.md index baf075c23c45..e008c8e6561c 100644 --- a/frontend/docs/scripting/functions/NPC_ClearPath.md +++ b/frontend/docs/scripting/functions/NPC_ClearPath.md @@ -21,7 +21,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/clearpatrol", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This function removes all waypoints from the specified path - The path itself remains valid and can be reused diff --git a/frontend/docs/scripting/functions/NPC_CloseNode.md b/frontend/docs/scripting/functions/NPC_CloseNode.md index f4ff7ddd1d8c..54a28fae036d 100644 --- a/frontend/docs/scripting/functions/NPC_CloseNode.md +++ b/frontend/docs/scripting/functions/NPC_CloseNode.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checknodetype ", true, 15)) @@ -40,7 +40,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Closing a node prevents new NPCs from using it - NPCs currently using the node will continue until they finish diff --git a/frontend/docs/scripting/functions/NPC_Create.md b/frontend/docs/scripting/functions/NPC_Create.md index 9ba828758e3f..7194e7beb428 100644 --- a/frontend/docs/scripting/functions/NPC_Create.md +++ b/frontend/docs/scripting/functions/NPC_Create.md @@ -21,7 +21,7 @@ Returns the ID of the created NPC, or `INVALID_NPC_ID` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/createnpc", true)) @@ -53,7 +53,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_CreatePath.md b/frontend/docs/scripting/functions/NPC_CreatePath.md index c7c509be1025..53dad64781e0 100644 --- a/frontend/docs/scripting/functions/NPC_CreatePath.md +++ b/frontend/docs/scripting/functions/NPC_CreatePath.md @@ -17,7 +17,7 @@ Returns the ID of the created path. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/createpatrol", true)) @@ -38,7 +38,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The path is always created empty, use `NPC_AddPointToPath` to add waypoints - Multiple NPCs can use the same path simultaneously diff --git a/frontend/docs/scripting/functions/NPC_Destroy.md b/frontend/docs/scripting/functions/NPC_Destroy.md index dea581833e89..7913687fbccb 100644 --- a/frontend/docs/scripting/functions/NPC_Destroy.md +++ b/frontend/docs/scripting/functions/NPC_Destroy.md @@ -21,7 +21,7 @@ Returns `true` if the NPC was destroyed successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/destroynpc", true)) @@ -50,7 +50,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_DestroyAllPath.md b/frontend/docs/scripting/functions/NPC_DestroyAllPath.md index bb8ba47d6d53..5cfa42fa6ebd 100644 --- a/frontend/docs/scripting/functions/NPC_DestroyAllPath.md +++ b/frontend/docs/scripting/functions/NPC_DestroyAllPath.md @@ -17,7 +17,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnGameModeExit() { // Get number of paths before clearing @@ -38,7 +38,7 @@ public OnGameModeExit() ``` -## Notes +## Good to know - This function destroys ALL paths on the server and NPCs currently following paths will stop moving - All path IDs become invalid after this function is called diff --git a/frontend/docs/scripting/functions/NPC_DestroyPath.md b/frontend/docs/scripting/functions/NPC_DestroyPath.md index 2170c8085a6a..c6904cd566ce 100644 --- a/frontend/docs/scripting/functions/NPC_DestroyPath.md +++ b/frontend/docs/scripting/functions/NPC_DestroyPath.md @@ -21,7 +21,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/deletepatrol", true)) @@ -56,7 +56,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The path ID becomes invalid after destruction - NPCs currently following this path will stop moving since all points in the path are removed diff --git a/frontend/docs/scripting/functions/NPC_EnableInfiniteAmmo.md b/frontend/docs/scripting/functions/NPC_EnableInfiniteAmmo.md index cdb4d5a01f5a..b3627fca6f16 100644 --- a/frontend/docs/scripting/functions/NPC_EnableInfiniteAmmo.md +++ b/frontend/docs/scripting/functions/NPC_EnableInfiniteAmmo.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/toggleinfiniteammo", true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - When enabled, the NPC will never run out of ammunition - This affects all weapons the NPC uses diff --git a/frontend/docs/scripting/functions/NPC_EnableReloading.md b/frontend/docs/scripting/functions/NPC_EnableReloading.md index e33f20cd7be2..18889879b399 100644 --- a/frontend/docs/scripting/functions/NPC_EnableReloading.md +++ b/frontend/docs/scripting/functions/NPC_EnableReloading.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/togglereload", true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - When enabled, the NPC will automatically reload when its clip is empty - When disabled, the NPC will not reload and will eventually run out of ammo in clip diff --git a/frontend/docs/scripting/functions/NPC_EnterVehicle.md b/frontend/docs/scripting/functions/NPC_EnterVehicle.md index 4920c9c93242..8033f14e8e21 100644 --- a/frontend/docs/scripting/functions/NPC_EnterVehicle.md +++ b/frontend/docs/scripting/functions/NPC_EnterVehicle.md @@ -24,7 +24,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcenterbike ", true, 14)) @@ -62,7 +62,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) | 3 | Back-right passenger | | 4+ | Passenger seats (coach etc.) | -## Notes +## Good to know - The NPC will try to reach the vehicle door, using the specified movement type, before entering - If the seat is occupied, the NPC may not be able to enter diff --git a/frontend/docs/scripting/functions/NPC_ExitVehicle.md b/frontend/docs/scripting/functions/NPC_ExitVehicle.md index 607f6578e27d..a1af3192fa59 100644 --- a/frontend/docs/scripting/functions/NPC_ExitVehicle.md +++ b/frontend/docs/scripting/functions/NPC_ExitVehicle.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcexitbike", true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC must be in a vehicle for this function to work, otherwise this function has no effect - The NPC will perform the exit animation and after exiting, the NPC will be on foot near the vehicle diff --git a/frontend/docs/scripting/functions/NPC_GetAll.md b/frontend/docs/scripting/functions/NPC_GetAll.md index b55bf1a393e1..525169f3e25b 100644 --- a/frontend/docs/scripting/functions/NPC_GetAll.md +++ b/frontend/docs/scripting/functions/NPC_GetAll.md @@ -22,7 +22,7 @@ Returns the number of NPCs found. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/countnpcs", true)) @@ -38,7 +38,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_GetAmmo.md b/frontend/docs/scripting/functions/NPC_GetAmmo.md index 2cc2245e322a..7ac980703a85 100644 --- a/frontend/docs/scripting/functions/NPC_GetAmmo.md +++ b/frontend/docs/scripting/functions/NPC_GetAmmo.md @@ -21,7 +21,7 @@ Returns the amount of ammunition the NPC has for its current weapon. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkammo", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the total ammunition count - If the NPC has no weapon, this returns 0 diff --git a/frontend/docs/scripting/functions/NPC_GetAmmoInClip.md b/frontend/docs/scripting/functions/NPC_GetAmmoInClip.md index 7b604d770472..0ba858958317 100644 --- a/frontend/docs/scripting/functions/NPC_GetAmmoInClip.md +++ b/frontend/docs/scripting/functions/NPC_GetAmmoInClip.md @@ -21,7 +21,7 @@ Returns the amount of ammunition in the NPC's current weapon clip. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkclip", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the amount of ammunition currently loaded in the weapon's magazine (clip), unlike [NPC_GetAmmo](NPC_GetAmmo), which returns the total ammo the NPC holds. - Clip size varies depending on the weapon type. diff --git a/frontend/docs/scripting/functions/NPC_GetAnimation.md b/frontend/docs/scripting/functions/NPC_GetAnimation.md index 9d3debd25434..6591ab60d54f 100644 --- a/frontend/docs/scripting/functions/NPC_GetAnimation.md +++ b/frontend/docs/scripting/functions/NPC_GetAnimation.md @@ -28,7 +28,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/getanim", true)) @@ -53,7 +53,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This won't return data if used with [NPC_SetAnimation](NPC_SetAnimation) - All parameters except npcid are passed by reference and will be modified diff --git a/frontend/docs/scripting/functions/NPC_GetArmour.md b/frontend/docs/scripting/functions/NPC_GetArmour.md index 1e322daaa662..450100366270 100644 --- a/frontend/docs/scripting/functions/NPC_GetArmour.md +++ b/frontend/docs/scripting/functions/NPC_GetArmour.md @@ -21,7 +21,7 @@ Returns the NPC's armour as a float value (0.0 to 100.0). ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkarmour", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Armour values range from 0.0 to 100.0 - NPCs start with 0.0 armour by default, use [NPC_SetArmour](NPC_SetArmour) to define a higher value diff --git a/frontend/docs/scripting/functions/NPC_GetCurrentPathPointIndex.md b/frontend/docs/scripting/functions/NPC_GetCurrentPathPointIndex.md index e608644782e3..815ea6532321 100644 --- a/frontend/docs/scripting/functions/NPC_GetCurrentPathPointIndex.md +++ b/frontend/docs/scripting/functions/NPC_GetCurrentPathPointIndex.md @@ -21,7 +21,7 @@ Returns the current path point index the NPC is moving towards. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { // The commands to create paths and to create points on paths @@ -84,7 +84,7 @@ public CheckPathProgress(playerid) ``` -## Notes +## Good to know - Returns -1 if the NPC is not following a path - This indicates the point the NPC is currently moving towards diff --git a/frontend/docs/scripting/functions/NPC_GetCustomSkin.md b/frontend/docs/scripting/functions/NPC_GetCustomSkin.md index dd42ff8f1798..a8f828cf3dc1 100644 --- a/frontend/docs/scripting/functions/NPC_GetCustomSkin.md +++ b/frontend/docs/scripting/functions/NPC_GetCustomSkin.md @@ -21,7 +21,7 @@ Returns the custom skin ID of the NPC, or -1 if the NPC has no custom skin or is ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkcustomskin", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_GetEnteringVehicle.md b/frontend/docs/scripting/functions/NPC_GetEnteringVehicle.md index b2abe1992c33..200959d72ba2 100644 --- a/frontend/docs/scripting/functions/NPC_GetEnteringVehicle.md +++ b/frontend/docs/scripting/functions/NPC_GetEnteringVehicle.md @@ -21,7 +21,7 @@ Returns the vehicle ID the NPC is entering, or INVALID_VEHICLE_ID if not enterin ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkenterveh", true)) @@ -82,7 +82,7 @@ public CheckNPCEnteringVehicle(playerid) } ``` -## Notes +## Good to know - Returns INVALID_VEHICLE_ID if the NPC is not currently entering a vehicle - This is different from the vehicle the NPC is already in diff --git a/frontend/docs/scripting/functions/NPC_GetEnteringVehicleID.md b/frontend/docs/scripting/functions/NPC_GetEnteringVehicleID.md index 34e3b1e23f9c..c377f5e08ebf 100644 --- a/frontend/docs/scripting/functions/NPC_GetEnteringVehicleID.md +++ b/frontend/docs/scripting/functions/NPC_GetEnteringVehicleID.md @@ -21,7 +21,7 @@ Returns the vehicle ID the NPC is entering, or INVALID_VEHICLE_ID if not enterin ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkenterveh", true)) @@ -82,7 +82,7 @@ public CheckNPCEnteringVehicle(playerid) } ``` -## Notes +## Good to know - This function is similar to NPC_GetEnteringVehicle - Returns INVALID_VEHICLE_ID if the NPC is not in the process of entering a vehicle diff --git a/frontend/docs/scripting/functions/NPC_GetEnteringVehicleSeat.md b/frontend/docs/scripting/functions/NPC_GetEnteringVehicleSeat.md index 44ed5b973147..058f6c4ad801 100644 --- a/frontend/docs/scripting/functions/NPC_GetEnteringVehicleSeat.md +++ b/frontend/docs/scripting/functions/NPC_GetEnteringVehicleSeat.md @@ -21,7 +21,7 @@ Returns the seat number the NPC is entering, or -1 if not entering. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkenterveh", true)) @@ -92,7 +92,7 @@ public CheckNPCEnteringVehicle(playerid) | 3 | Back-right passenger | | 4+ | Passenger seats (coach etc.) | -## Notes +## Good to know - Returns -1 if the NPC is not entering any vehicle - This information is only valid while the NPC is in the entering process diff --git a/frontend/docs/scripting/functions/NPC_GetFacingAngle.md b/frontend/docs/scripting/functions/NPC_GetFacingAngle.md index 8c34c6acfa0a..2529de3a313d 100644 --- a/frontend/docs/scripting/functions/NPC_GetFacingAngle.md +++ b/frontend/docs/scripting/functions/NPC_GetFacingAngle.md @@ -22,7 +22,7 @@ Returns `true` if the facing angle was retrieved successfully, `false` otherwise ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkfacingangle", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_GetFightingStyle.md b/frontend/docs/scripting/functions/NPC_GetFightingStyle.md index 6bade42b0d28..41f75b073e36 100644 --- a/frontend/docs/scripting/functions/NPC_GetFightingStyle.md +++ b/frontend/docs/scripting/functions/NPC_GetFightingStyle.md @@ -21,7 +21,7 @@ Returns the fighting style ID of the NPC. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkfightingstyle", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Fighting styles affect melee combat animations and damage - Each style has different punch and kick animations diff --git a/frontend/docs/scripting/functions/NPC_GetHealth.md b/frontend/docs/scripting/functions/NPC_GetHealth.md index 3b7a5789641e..3f1ddff4b884 100644 --- a/frontend/docs/scripting/functions/NPC_GetHealth.md +++ b/frontend/docs/scripting/functions/NPC_GetHealth.md @@ -21,7 +21,7 @@ Returns the NPC's health as a float value. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkhealth", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Health values typically range from 0.0 to 100.0 - An NPC with 0.0 health is considered dead diff --git a/frontend/docs/scripting/functions/NPC_GetInterior.md b/frontend/docs/scripting/functions/NPC_GetInterior.md index f75226bbf8e0..767258a57ed5 100644 --- a/frontend/docs/scripting/functions/NPC_GetInterior.md +++ b/frontend/docs/scripting/functions/NPC_GetInterior.md @@ -21,7 +21,7 @@ Returns the interior ID the NPC is currently in. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkinterior", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Interior 0 is the main world (outside) diff --git a/frontend/docs/scripting/functions/NPC_GetKeys.md b/frontend/docs/scripting/functions/NPC_GetKeys.md index 200ba7a2b5e9..4e1af630a07a 100644 --- a/frontend/docs/scripting/functions/NPC_GetKeys.md +++ b/frontend/docs/scripting/functions/NPC_GetKeys.md @@ -24,7 +24,7 @@ Returns `true` if the keys were retrieved successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkkeys", true)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - All parameters except npcid are passed by reference and will be modified - Key states are stored as bit flags diff --git a/frontend/docs/scripting/functions/NPC_GetNodeInfo.md b/frontend/docs/scripting/functions/NPC_GetNodeInfo.md index b78fcc521d94..8f0f56014baf 100644 --- a/frontend/docs/scripting/functions/NPC_GetNodeInfo.md +++ b/frontend/docs/scripting/functions/NPC_GetNodeInfo.md @@ -24,7 +24,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checknodeinfo ", true, 15)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The node must be opened with `NPC_OpenNode` before getting info - Vehicle nodes are for vehicle navigation paths diff --git a/frontend/docs/scripting/functions/NPC_GetNodePointCount.md b/frontend/docs/scripting/functions/NPC_GetNodePointCount.md index 4b013e97064b..cdc339c07d2a 100644 --- a/frontend/docs/scripting/functions/NPC_GetNodePointCount.md +++ b/frontend/docs/scripting/functions/NPC_GetNodePointCount.md @@ -21,7 +21,7 @@ Returns the number of points in the node, or 0 if the node is invalid. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checknodepointcount ", true, 21)) @@ -40,7 +40,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns 0 if the node is invalid or not opened - The point count represents navigation waypoints within the node diff --git a/frontend/docs/scripting/functions/NPC_GetNodePointPosition.md b/frontend/docs/scripting/functions/NPC_GetNodePointPosition.md index 5856f72345fa..6bcc85433bcb 100644 --- a/frontend/docs/scripting/functions/NPC_GetNodePointPosition.md +++ b/frontend/docs/scripting/functions/NPC_GetNodePointPosition.md @@ -24,7 +24,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checknodepointpos ", true, 19)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The node must be opened with `NPC_OpenNode` first - A point must be set with `NPC_SetNodePoint` before getting its position diff --git a/frontend/docs/scripting/functions/NPC_GetNodeType.md b/frontend/docs/scripting/functions/NPC_GetNodeType.md index a9e9645bc13b..3c7023d4bec1 100644 --- a/frontend/docs/scripting/functions/NPC_GetNodeType.md +++ b/frontend/docs/scripting/functions/NPC_GetNodeType.md @@ -21,7 +21,7 @@ Returns the node type ID, or -1 if the node is invalid. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checknodetype ", true, 15)) @@ -40,7 +40,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns -1 if the node is invalid or not opened - Different node types are designed for different movement types diff --git a/frontend/docs/scripting/functions/NPC_GetPathCount.md b/frontend/docs/scripting/functions/NPC_GetPathCount.md index 812a076b1693..7b866c99ed76 100644 --- a/frontend/docs/scripting/functions/NPC_GetPathCount.md +++ b/frontend/docs/scripting/functions/NPC_GetPathCount.md @@ -17,7 +17,7 @@ Returns the number of paths that exist on the server. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkpathcount", true)) @@ -31,7 +31,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This counts all paths, whether they have points or not - Empty paths (no waypoints) are still counted diff --git a/frontend/docs/scripting/functions/NPC_GetPathPoint.md b/frontend/docs/scripting/functions/NPC_GetPathPoint.md index 7a4e0dc4e11e..bee729b7a177 100644 --- a/frontend/docs/scripting/functions/NPC_GetPathPoint.md +++ b/frontend/docs/scripting/functions/NPC_GetPathPoint.md @@ -26,7 +26,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkpathpoint", true)) @@ -55,7 +55,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - All coordinate and stopRange parameters are passed by reference - Point indices start from 0 diff --git a/frontend/docs/scripting/functions/NPC_GetPathPointCount.md b/frontend/docs/scripting/functions/NPC_GetPathPointCount.md index 3a6c65e48b95..70bd55a29e50 100644 --- a/frontend/docs/scripting/functions/NPC_GetPathPointCount.md +++ b/frontend/docs/scripting/functions/NPC_GetPathPointCount.md @@ -21,7 +21,7 @@ Returns the number of points in the path, or 0 if the path is invalid. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkpathpointcount", true)) @@ -39,7 +39,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns 0 if the path is invalid or empty diff --git a/frontend/docs/scripting/functions/NPC_GetPlayerAimingAt.md b/frontend/docs/scripting/functions/NPC_GetPlayerAimingAt.md index 425e75d90e0b..915d24feeb46 100644 --- a/frontend/docs/scripting/functions/NPC_GetPlayerAimingAt.md +++ b/frontend/docs/scripting/functions/NPC_GetPlayerAimingAt.md @@ -21,7 +21,7 @@ Returns the ID of the player being aimed at, or `INVALID_PLAYER_ID` if not aimin ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkwhonpcaiming", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the player ID if the NPC is aiming using [NPC_AimAtPlayer](NPC_AimAtPlayer) - Returns `INVALID_PLAYER_ID` if the NPC is not aiming at any player diff --git a/frontend/docs/scripting/functions/NPC_GetPlayerMovingTo.md b/frontend/docs/scripting/functions/NPC_GetPlayerMovingTo.md index 9181cf59fb4f..5acc1c34682d 100644 --- a/frontend/docs/scripting/functions/NPC_GetPlayerMovingTo.md +++ b/frontend/docs/scripting/functions/NPC_GetPlayerMovingTo.md @@ -21,7 +21,7 @@ Returns the ID of the player being moved toward, or `INVALID_PLAYER_ID` if not m ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkwhonpcmoving", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the player ID if the NPC is moving using [NPC_MoveToPlayer](NPC_MoveToPlayer) - Returns `INVALID_PLAYER_ID` if the NPC is not moving toward any player diff --git a/frontend/docs/scripting/functions/NPC_GetPos.md b/frontend/docs/scripting/functions/NPC_GetPos.md index 4470e876281d..d433f956e236 100644 --- a/frontend/docs/scripting/functions/NPC_GetPos.md +++ b/frontend/docs/scripting/functions/NPC_GetPos.md @@ -24,7 +24,7 @@ Returns `true` if the position was retrieved successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkpos", true)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_GetPosMovingTo.md b/frontend/docs/scripting/functions/NPC_GetPosMovingTo.md index 6cc7de1b011a..680ffb6cd032 100644 --- a/frontend/docs/scripting/functions/NPC_GetPosMovingTo.md +++ b/frontend/docs/scripting/functions/NPC_GetPosMovingTo.md @@ -24,7 +24,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkposmovingto", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_GetRecordCount.md b/frontend/docs/scripting/functions/NPC_GetRecordCount.md index 31f5ac025ebe..822257e21d49 100644 --- a/frontend/docs/scripting/functions/NPC_GetRecordCount.md +++ b/frontend/docs/scripting/functions/NPC_GetRecordCount.md @@ -17,7 +17,7 @@ Returns the number of recording files currently loaded. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkrecordcount", true)) @@ -30,7 +30,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the total number of valid recordings in memory - Only successfully loaded recordings are counted diff --git a/frontend/docs/scripting/functions/NPC_GetRot.md b/frontend/docs/scripting/functions/NPC_GetRot.md index ca7b0b108577..5d0db452880e 100644 --- a/frontend/docs/scripting/functions/NPC_GetRot.md +++ b/frontend/docs/scripting/functions/NPC_GetRot.md @@ -24,7 +24,7 @@ Returns `true` if the rotation was retrieved successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkrot", true)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_GetSkin.md b/frontend/docs/scripting/functions/NPC_GetSkin.md index 458ee061b12b..9791493d5151 100644 --- a/frontend/docs/scripting/functions/NPC_GetSkin.md +++ b/frontend/docs/scripting/functions/NPC_GetSkin.md @@ -21,7 +21,7 @@ Returns the skin/model ID of the NPC, or -1 if invalid. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkskin", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the current skin/model the NPC is using - Use [NPC_SetSkin](NPC_SetSkin) to change the NPC's skin diff --git a/frontend/docs/scripting/functions/NPC_GetSpecialAction.md b/frontend/docs/scripting/functions/NPC_GetSpecialAction.md index 3ec820ac9ce3..441df63cea46 100644 --- a/frontend/docs/scripting/functions/NPC_GetSpecialAction.md +++ b/frontend/docs/scripting/functions/NPC_GetSpecialAction.md @@ -21,7 +21,7 @@ Returns the special action ID, or `SPECIAL_ACTION_NONE` if no special action is ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkspecialaction", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the current special action constant - Use this to check what action the NPC is currently performing diff --git a/frontend/docs/scripting/functions/NPC_GetSurfingObject.md b/frontend/docs/scripting/functions/NPC_GetSurfingObject.md index e83cfc80cacb..e426d05b345d 100644 --- a/frontend/docs/scripting/functions/NPC_GetSurfingObject.md +++ b/frontend/docs/scripting/functions/NPC_GetSurfingObject.md @@ -21,7 +21,7 @@ Returns the object ID, or `INVALID_OBJECT_ID` if not surfing on an object. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checksurfingobject", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns INVALID_OBJECT_ID if the NPC is not surfing on any object diff --git a/frontend/docs/scripting/functions/NPC_GetSurfingOffsets.md b/frontend/docs/scripting/functions/NPC_GetSurfingOffsets.md index 8ac636608975..8f507e75388a 100644 --- a/frontend/docs/scripting/functions/NPC_GetSurfingOffsets.md +++ b/frontend/docs/scripting/functions/NPC_GetSurfingOffsets.md @@ -24,7 +24,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checksurfingoffset", true)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The surfing offset represents the relative position of the NPC compared to the object/vehicle it's surfing on - All offset values are returned as floating-point numbers diff --git a/frontend/docs/scripting/functions/NPC_GetSurfingPlayerObject.md b/frontend/docs/scripting/functions/NPC_GetSurfingPlayerObject.md index 1c47c424954a..1bf69e16b39c 100644 --- a/frontend/docs/scripting/functions/NPC_GetSurfingPlayerObject.md +++ b/frontend/docs/scripting/functions/NPC_GetSurfingPlayerObject.md @@ -21,7 +21,7 @@ Returns the player object ID, or `INVALID_OBJECT_ID` if not surfing on a player ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checksurfingplayerobject", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns INVALID_OBJECT_ID if the NPC is not surfing on any player object - This function only checks for player-specific objects, not global objects diff --git a/frontend/docs/scripting/functions/NPC_GetSurfingVehicle.md b/frontend/docs/scripting/functions/NPC_GetSurfingVehicle.md index 04337e356cbc..05c320e8edbf 100644 --- a/frontend/docs/scripting/functions/NPC_GetSurfingVehicle.md +++ b/frontend/docs/scripting/functions/NPC_GetSurfingVehicle.md @@ -21,7 +21,7 @@ Returns the vehicle ID, or `INVALID_VEHICLE_ID` if not surfing on a vehicle. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checksurfingvehicle", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns `INVALID_VEHICLE_ID` if the NPC is not surfing on any vehicle - Surfing allows NPCs to move along with vehicles while maintaining their relative position diff --git a/frontend/docs/scripting/functions/NPC_GetVehicle.md b/frontend/docs/scripting/functions/NPC_GetVehicle.md index ca7282791f3b..f837d3f2b138 100644 --- a/frontend/docs/scripting/functions/NPC_GetVehicle.md +++ b/frontend/docs/scripting/functions/NPC_GetVehicle.md @@ -21,7 +21,7 @@ Returns the vehicle ID the NPC is in, or INVALID_VEHICLE_ID if not in any vehicl ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvehicle", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns INVALID_VEHICLE_ID if the NPC is not in any vehicle diff --git a/frontend/docs/scripting/functions/NPC_GetVehicleGearState.md b/frontend/docs/scripting/functions/NPC_GetVehicleGearState.md index d0d0862efd6c..a36f77532d85 100644 --- a/frontend/docs/scripting/functions/NPC_GetVehicleGearState.md +++ b/frontend/docs/scripting/functions/NPC_GetVehicleGearState.md @@ -21,7 +21,7 @@ Returns the landing gear state of the NPC's aircraft (LANDING_GEAR_STATE_DOWN or ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvehiclegearstate", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works when the NPC is piloting an aircraft - Returns the current landing gear state set by NPC_SetVehicleGearState diff --git a/frontend/docs/scripting/functions/NPC_GetVehicleHealth.md b/frontend/docs/scripting/functions/NPC_GetVehicleHealth.md index 42b10eb793aa..dbb073b34c0c 100644 --- a/frontend/docs/scripting/functions/NPC_GetVehicleHealth.md +++ b/frontend/docs/scripting/functions/NPC_GetVehicleHealth.md @@ -21,7 +21,7 @@ Returns the vehicle health as a float value, or 0.0 if the NPC is not in a vehic ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvehiclehealth", true)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) ``` -## Notes +## Good to know - Returns 0.0 if the NPC is not in a vehicle - Vehicle health typically ranges from 0.0 to 1000.0 diff --git a/frontend/docs/scripting/functions/NPC_GetVehicleHydraThrusters.md b/frontend/docs/scripting/functions/NPC_GetVehicleHydraThrusters.md index c36a83cd23d9..5b4078c761d2 100644 --- a/frontend/docs/scripting/functions/NPC_GetVehicleHydraThrusters.md +++ b/frontend/docs/scripting/functions/NPC_GetVehicleHydraThrusters.md @@ -21,7 +21,7 @@ Returns the thruster direction (0 = forward, 1 = vertical), or -1 if not in a Hy ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvehiclehydra", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works with Hydra vehicles (model 520) - Returns -1 if the NPC is not in a Hydra or not in a vehicle diff --git a/frontend/docs/scripting/functions/NPC_GetVehicleID.md b/frontend/docs/scripting/functions/NPC_GetVehicleID.md index e688b40ee295..042eebe66c7b 100644 --- a/frontend/docs/scripting/functions/NPC_GetVehicleID.md +++ b/frontend/docs/scripting/functions/NPC_GetVehicleID.md @@ -21,7 +21,7 @@ Returns the vehicle ID the NPC is in, or INVALID_VEHICLE_ID if not in any vehicl ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvehicleid", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns INVALID_VEHICLE_ID if the NPC is not in any vehicle diff --git a/frontend/docs/scripting/functions/NPC_GetVehicleSeat.md b/frontend/docs/scripting/functions/NPC_GetVehicleSeat.md index 62f7247610e2..81f49ac25394 100644 --- a/frontend/docs/scripting/functions/NPC_GetVehicleSeat.md +++ b/frontend/docs/scripting/functions/NPC_GetVehicleSeat.md @@ -21,7 +21,7 @@ Returns the seat ID, or -1 if not in a vehicle. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvehicleseat", true)) @@ -55,7 +55,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) | 3 | Back-right passenger | | 4+ | Passenger seats (coach etc.) | -## Notes +## Good to know - Returns -1 if the NPC is not in any vehicle - Seat 0 is always the driver seat diff --git a/frontend/docs/scripting/functions/NPC_GetVehicleTrainSpeed.md b/frontend/docs/scripting/functions/NPC_GetVehicleTrainSpeed.md index ded7514e0f8a..cd1defb0b670 100644 --- a/frontend/docs/scripting/functions/NPC_GetVehicleTrainSpeed.md +++ b/frontend/docs/scripting/functions/NPC_GetVehicleTrainSpeed.md @@ -21,7 +21,7 @@ Returns the train speed as a float, or 0.0 if not in a train. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvehicletrainspeed", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works when the NPC is driving a train vehicle - Returns 0.0 if the NPC is not in a train or not the driver diff --git a/frontend/docs/scripting/functions/NPC_GetVelocity.md b/frontend/docs/scripting/functions/NPC_GetVelocity.md index adfb90cf97c8..67fc3626c29e 100644 --- a/frontend/docs/scripting/functions/NPC_GetVelocity.md +++ b/frontend/docs/scripting/functions/NPC_GetVelocity.md @@ -24,7 +24,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvelocity", true)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_GetVirtualWorld.md b/frontend/docs/scripting/functions/NPC_GetVirtualWorld.md index ad95ca826751..d0a207804496 100644 --- a/frontend/docs/scripting/functions/NPC_GetVirtualWorld.md +++ b/frontend/docs/scripting/functions/NPC_GetVirtualWorld.md @@ -21,7 +21,7 @@ Returns the virtual world ID, or 0 on error. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvirtualworld", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_GetWeapon.md b/frontend/docs/scripting/functions/NPC_GetWeapon.md index 6e735e2f476c..3722a04f4d9d 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeapon.md +++ b/frontend/docs/scripting/functions/NPC_GetWeapon.md @@ -21,7 +21,7 @@ Returns the weapon ID that the NPC is currently holding. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweapon", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns 0 if the NPC has no weapon (fists) - Weapon IDs are the same as player weapon IDs diff --git a/frontend/docs/scripting/functions/NPC_GetWeaponAccuracy.md b/frontend/docs/scripting/functions/NPC_GetWeaponAccuracy.md index de462f8bfe22..1ef4293f003e 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeaponAccuracy.md +++ b/frontend/docs/scripting/functions/NPC_GetWeaponAccuracy.md @@ -22,7 +22,7 @@ Returns the accuracy value (0.0 to 1.0), or -1.0 on error. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweaponaccuracy", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Accuracy is a value between 0.0 (0% accurate) and 1.0 (100% accurate) - Returns -1.0 if the NPC ID is invalid or weapon doesn't exist diff --git a/frontend/docs/scripting/functions/NPC_GetWeaponActualClipSize.md b/frontend/docs/scripting/functions/NPC_GetWeaponActualClipSize.md index 9113f840d76b..92662cfe4647 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeaponActualClipSize.md +++ b/frontend/docs/scripting/functions/NPC_GetWeaponActualClipSize.md @@ -22,7 +22,7 @@ Returns the default clip size, or -1 on error. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweaponactualclipsize", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the original game clip size for the weapon - This is different from custom clip sizes set with `NPC_SetWeaponClipSize` diff --git a/frontend/docs/scripting/functions/NPC_GetWeaponActualReloadTime.md b/frontend/docs/scripting/functions/NPC_GetWeaponActualReloadTime.md index 7baac5c84bfb..d6e568a73067 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeaponActualReloadTime.md +++ b/frontend/docs/scripting/functions/NPC_GetWeaponActualReloadTime.md @@ -22,7 +22,7 @@ Returns the default reload time in milliseconds, or -1 on error. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweaponactualreloadtime", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the original game reload time for the weapon - This is different from custom reload times set with `NPC_SetWeaponReloadTime` diff --git a/frontend/docs/scripting/functions/NPC_GetWeaponClipSize.md b/frontend/docs/scripting/functions/NPC_GetWeaponClipSize.md index c12dd6f61069..7606a1d2b482 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeaponClipSize.md +++ b/frontend/docs/scripting/functions/NPC_GetWeaponClipSize.md @@ -22,7 +22,7 @@ Returns the weapon's clip size, or -1 on error. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweaponclipsize", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the current custom clip size setting - Different weapons have different default clip sizes diff --git a/frontend/docs/scripting/functions/NPC_GetWeaponReloadTime.md b/frontend/docs/scripting/functions/NPC_GetWeaponReloadTime.md index d82cd3f673be..f9a4ab6989b9 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeaponReloadTime.md +++ b/frontend/docs/scripting/functions/NPC_GetWeaponReloadTime.md @@ -22,7 +22,7 @@ Returns the reload time in milliseconds for the specified weapon. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweaponreloadtime", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the current custom reload time setting - Use NPC_GetWeaponActualReloadTime to get the default game reload time diff --git a/frontend/docs/scripting/functions/NPC_GetWeaponShootTime.md b/frontend/docs/scripting/functions/NPC_GetWeaponShootTime.md index cc3dd55a6e89..2badb80acfd4 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeaponShootTime.md +++ b/frontend/docs/scripting/functions/NPC_GetWeaponShootTime.md @@ -22,7 +22,7 @@ Returns the shoot time in milliseconds for the specified weapon. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweaponshoottime", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Shoot time affects the delay between shots - Lower values mean faster firing rate diff --git a/frontend/docs/scripting/functions/NPC_GetWeaponSkillLevel.md b/frontend/docs/scripting/functions/NPC_GetWeaponSkillLevel.md index b03db342a621..0e6161c709e7 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeaponSkillLevel.md +++ b/frontend/docs/scripting/functions/NPC_GetWeaponSkillLevel.md @@ -22,7 +22,7 @@ Returns the weapon skill level (0-999), or `UNKNOWN_WEAPONSKILL` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweaponskill", true)) @@ -53,7 +53,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Weapon skill affects accuracy and shooting behavior - Skill level ranges from 0 (poor) to 999 (hitman) diff --git a/frontend/docs/scripting/functions/NPC_GetWeaponState.md b/frontend/docs/scripting/functions/NPC_GetWeaponState.md index 223cb64e91ed..f869d333057f 100644 --- a/frontend/docs/scripting/functions/NPC_GetWeaponState.md +++ b/frontend/docs/scripting/functions/NPC_GetWeaponState.md @@ -21,7 +21,7 @@ Returns the weapon state ID. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkweaponstate", true)) @@ -51,7 +51,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Weapon states include reloading, shooting, out of ammo, etc. - Use this to check the current status of the NPC's weapon diff --git a/frontend/docs/scripting/functions/NPC_HasPathPointInRange.md b/frontend/docs/scripting/functions/NPC_HasPathPointInRange.md index 4f6110f62c10..652b845e14b1 100644 --- a/frontend/docs/scripting/functions/NPC_HasPathPointInRange.md +++ b/frontend/docs/scripting/functions/NPC_HasPathPointInRange.md @@ -25,7 +25,7 @@ Returns `true` if the path has at least one point within the specified range, `f ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkpathpointinrange ", true, 23)) @@ -50,7 +50,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This function is useful for checking if an NPC path intersects with a specific area or location before starting path movement - The function checks the 3D distance between the given position and each path point diff --git a/frontend/docs/scripting/functions/NPC_IsAiming.md b/frontend/docs/scripting/functions/NPC_IsAiming.md index 08b85de7a947..c7e48d1c666c 100644 --- a/frontend/docs/scripting/functions/NPC_IsAiming.md +++ b/frontend/docs/scripting/functions/NPC_IsAiming.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is aiming, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkaiming", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns true when the NPC is actively aiming at a target - Use this to check if an NPC is in combat mode diff --git a/frontend/docs/scripting/functions/NPC_IsAimingAtPlayer.md b/frontend/docs/scripting/functions/NPC_IsAimingAtPlayer.md index f6b2a8c8506d..9347d5492873 100644 --- a/frontend/docs/scripting/functions/NPC_IsAimingAtPlayer.md +++ b/frontend/docs/scripting/functions/NPC_IsAimingAtPlayer.md @@ -22,7 +22,7 @@ Returns `true` if the NPC is aiming at the specified player, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns true only when the NPC is specifically targeting the given player - Use this to check if a player is being targeted by an NPC diff --git a/frontend/docs/scripting/functions/NPC_IsAnyStreamedIn.md b/frontend/docs/scripting/functions/NPC_IsAnyStreamedIn.md index d3641cdccab8..513358ef2cd9 100644 --- a/frontend/docs/scripting/functions/NPC_IsAnyStreamedIn.md +++ b/frontend/docs/scripting/functions/NPC_IsAnyStreamedIn.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is streamed in for at least one player, `false` otherw ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkanystreamedin", true)) @@ -35,7 +35,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - An NPC is streamed in when it's within a player's streaming range diff --git a/frontend/docs/scripting/functions/NPC_IsDead.md b/frontend/docs/scripting/functions/NPC_IsDead.md index 06921b9e03b3..f8ed9ad5966d 100644 --- a/frontend/docs/scripting/functions/NPC_IsDead.md +++ b/frontend/docs/scripting/functions/NPC_IsDead.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is dead, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkdead", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_IsEnteringVehicle.md b/frontend/docs/scripting/functions/NPC_IsEnteringVehicle.md index 934cba200bfc..767230bf016c 100644 --- a/frontend/docs/scripting/functions/NPC_IsEnteringVehicle.md +++ b/frontend/docs/scripting/functions/NPC_IsEnteringVehicle.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is entering a vehicle, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkenteringvehicle", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns true only during the entering animation/process - Once the NPC is fully inside, this returns false diff --git a/frontend/docs/scripting/functions/NPC_IsInfiniteAmmoEnabled.md b/frontend/docs/scripting/functions/NPC_IsInfiniteAmmoEnabled.md index 17bdb0bfe1c9..fafd194cf06a 100644 --- a/frontend/docs/scripting/functions/NPC_IsInfiniteAmmoEnabled.md +++ b/frontend/docs/scripting/functions/NPC_IsInfiniteAmmoEnabled.md @@ -21,7 +21,7 @@ Returns `true` if infinite ammo is enabled, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkinfiniteammo", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Infinite ammo prevents the NPC from running out of ammunition - The ammo count may still display as decreasing but weapon functionality remains diff --git a/frontend/docs/scripting/functions/NPC_IsInvulnerable.md b/frontend/docs/scripting/functions/NPC_IsInvulnerable.md index 1f4e9d25e7de..3aa0e643ecfd 100644 --- a/frontend/docs/scripting/functions/NPC_IsInvulnerable.md +++ b/frontend/docs/scripting/functions/NPC_IsInvulnerable.md @@ -21,7 +21,7 @@ Returns true if the NPC is invulnerable, false otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkinvulnerable", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns the invulnerability status set by `NPC_SetInvulnerable` - NPCs are vulnerable by default when created diff --git a/frontend/docs/scripting/functions/NPC_IsMeleeAttacking.md b/frontend/docs/scripting/functions/NPC_IsMeleeAttacking.md index 425ca1fa7c0e..3b9a46c688f4 100644 --- a/frontend/docs/scripting/functions/NPC_IsMeleeAttacking.md +++ b/frontend/docs/scripting/functions/NPC_IsMeleeAttacking.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is performing a melee attack, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkmeleeattacking", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns true during the melee attack animation - Melee attacks are started with NPC_MeleeAttack diff --git a/frontend/docs/scripting/functions/NPC_IsMoving.md b/frontend/docs/scripting/functions/NPC_IsMoving.md index 4542760a1bad..a62adeaf9788 100644 --- a/frontend/docs/scripting/functions/NPC_IsMoving.md +++ b/frontend/docs/scripting/functions/NPC_IsMoving.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is moving, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkmoving", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns true when the NPC is walking, running, or driving to a destination - Returns false when the NPC reaches its destination or is stopped diff --git a/frontend/docs/scripting/functions/NPC_IsMovingToPlayer.md b/frontend/docs/scripting/functions/NPC_IsMovingToPlayer.md index 847615c00a26..cb27ff03883f 100644 --- a/frontend/docs/scripting/functions/NPC_IsMovingToPlayer.md +++ b/frontend/docs/scripting/functions/NPC_IsMovingToPlayer.md @@ -22,7 +22,7 @@ Returns `true` if the NPC is moving toward the specified player, `false` otherwi ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkmovingtowardme", true)) @@ -43,7 +43,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This function checks if the NPC was commanded to move toward a specific player using [NPC_MoveToPlayer](NPC_MoveToPlayer) - Returns false if the NPC is not moving or is moving toward a different target diff --git a/frontend/docs/scripting/functions/NPC_IsNodeOpen.md b/frontend/docs/scripting/functions/NPC_IsNodeOpen.md index 2f3f3b6d0ccb..53029d0e58d2 100644 --- a/frontend/docs/scripting/functions/NPC_IsNodeOpen.md +++ b/frontend/docs/scripting/functions/NPC_IsNodeOpen.md @@ -21,7 +21,7 @@ Returns `true` if the node is open, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checknodeopen ", true, 15)) @@ -37,7 +37,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Nodes must be opened with NPC_OpenNode before use - Only open nodes can be played by NPCs diff --git a/frontend/docs/scripting/functions/NPC_IsPlaybackPaused.md b/frontend/docs/scripting/functions/NPC_IsPlaybackPaused.md index a0ff47db309a..fd699676061f 100644 --- a/frontend/docs/scripting/functions/NPC_IsPlaybackPaused.md +++ b/frontend/docs/scripting/functions/NPC_IsPlaybackPaused.md @@ -21,7 +21,7 @@ Returns `true` if the playback is paused, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkplaybackpaused", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only returns true if the NPC is playing a recording and it's paused - NPCs not playing recordings will always return false diff --git a/frontend/docs/scripting/functions/NPC_IsPlayingNode.md b/frontend/docs/scripting/functions/NPC_IsPlayingNode.md index 41153f21ab06..a2d1c0951f35 100644 --- a/frontend/docs/scripting/functions/NPC_IsPlayingNode.md +++ b/frontend/docs/scripting/functions/NPC_IsPlayingNode.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is playing a node, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkplayingnode", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns `false` if the NPC is not valid diff --git a/frontend/docs/scripting/functions/NPC_IsPlayingNodePaused.md b/frontend/docs/scripting/functions/NPC_IsPlayingNodePaused.md index 8bc182eb7b0b..ef110cf11080 100644 --- a/frontend/docs/scripting/functions/NPC_IsPlayingNodePaused.md +++ b/frontend/docs/scripting/functions/NPC_IsPlayingNodePaused.md @@ -21,7 +21,7 @@ Returns `true` if the NPC's node playing is paused, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checknodepaused", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns `false` if the NPC is not playing a node diff --git a/frontend/docs/scripting/functions/NPC_IsPlayingPlayback.md b/frontend/docs/scripting/functions/NPC_IsPlayingPlayback.md index b09c3634807e..86a744cc1b9c 100644 --- a/frontend/docs/scripting/functions/NPC_IsPlayingPlayback.md +++ b/frontend/docs/scripting/functions/NPC_IsPlayingPlayback.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is playing a playback, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkplayingplayback", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns true when the NPC is actively playing a recording diff --git a/frontend/docs/scripting/functions/NPC_IsReloadEnabled.md b/frontend/docs/scripting/functions/NPC_IsReloadEnabled.md index 13a6e11a76d5..1527ea1f3252 100644 --- a/frontend/docs/scripting/functions/NPC_IsReloadEnabled.md +++ b/frontend/docs/scripting/functions/NPC_IsReloadEnabled.md @@ -21,7 +21,7 @@ Returns `true` if auto-reload is enabled, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkreloadenabled", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Auto-reload makes NPCs automatically reload when their clip is empty - NPCs without auto-reload will stop shooting when their clip runs out diff --git a/frontend/docs/scripting/functions/NPC_IsReloading.md b/frontend/docs/scripting/functions/NPC_IsReloading.md index df92a5aeb2d8..22bad410cdd9 100644 --- a/frontend/docs/scripting/functions/NPC_IsReloading.md +++ b/frontend/docs/scripting/functions/NPC_IsReloading.md @@ -2,7 +2,7 @@ title: NPC_IsReloading sidebar_label: NPC_IsReloading description: Checks if an NPC is currently reloading their weapon. -tags: ["npc", "weapon", "reloading"] +tags: ["npc", "weapon", "reload"] --- @@ -21,7 +21,7 @@ Returns `true` if the NPC is reloading, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkreloading", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns true only during the actual reload animation - Reloading is automatic when ammo in clip runs out diff --git a/frontend/docs/scripting/functions/NPC_IsShooting.md b/frontend/docs/scripting/functions/NPC_IsShooting.md index 9f6f7a6cf4db..7ed86328abf7 100644 --- a/frontend/docs/scripting/functions/NPC_IsShooting.md +++ b/frontend/docs/scripting/functions/NPC_IsShooting.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is shooting, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkshooting", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns true only during the actual shooting action - NPCs must have a weapon and ammo to shoot diff --git a/frontend/docs/scripting/functions/NPC_IsSpawned.md b/frontend/docs/scripting/functions/NPC_IsSpawned.md index 928300a5b9a8..832c9a7fc5f4 100644 --- a/frontend/docs/scripting/functions/NPC_IsSpawned.md +++ b/frontend/docs/scripting/functions/NPC_IsSpawned.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is spawned, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkspawned", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This is different from [NPC_IsValid](NPC_IsValid), which checks if the NPC exists diff --git a/frontend/docs/scripting/functions/NPC_IsStreamedIn.md b/frontend/docs/scripting/functions/NPC_IsStreamedIn.md index d86146ea7cf4..4a66f5c5d288 100644 --- a/frontend/docs/scripting/functions/NPC_IsStreamedIn.md +++ b/frontend/docs/scripting/functions/NPC_IsStreamedIn.md @@ -22,7 +22,7 @@ Returns `true` if the NPC is streamed in for the player, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkstreamedin", true)) @@ -43,7 +43,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - NPCs are only streamed in when within the player's streaming distance - Streaming depends on distance and interior/virtual world matching diff --git a/frontend/docs/scripting/functions/NPC_IsValid.md b/frontend/docs/scripting/functions/NPC_IsValid.md index 2539a3ac8277..515160d09d2e 100644 --- a/frontend/docs/scripting/functions/NPC_IsValid.md +++ b/frontend/docs/scripting/functions/NPC_IsValid.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is valid, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvalid", true)) @@ -39,7 +39,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/NPC_IsValidPath.md b/frontend/docs/scripting/functions/NPC_IsValidPath.md index c3bb63c376d6..a68bea70f10b 100644 --- a/frontend/docs/scripting/functions/NPC_IsValidPath.md +++ b/frontend/docs/scripting/functions/NPC_IsValidPath.md @@ -21,7 +21,7 @@ Returns `true` if the path is valid, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvalidpath ", true, 16)) @@ -37,7 +37,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Always check if a path is valid before using it with NPCs - Invalid paths may have been destroyed or never created properly diff --git a/frontend/docs/scripting/functions/NPC_IsValidRecord.md b/frontend/docs/scripting/functions/NPC_IsValidRecord.md index aa9ce1f23dc6..4d3c471b6293 100644 --- a/frontend/docs/scripting/functions/NPC_IsValidRecord.md +++ b/frontend/docs/scripting/functions/NPC_IsValidRecord.md @@ -21,7 +21,7 @@ Returns `true` if the recording is valid and loaded, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checkvalidrecord ", true, 18)) @@ -37,7 +37,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Recording must be loaded with NPC_LoadRecord before it becomes valid - Invalid recordings cannot be used for playback diff --git a/frontend/docs/scripting/functions/NPC_IsVehicleSirenUsed.md b/frontend/docs/scripting/functions/NPC_IsVehicleSirenUsed.md index 7b64e56a9e56..0f0446e4aad4 100644 --- a/frontend/docs/scripting/functions/NPC_IsVehicleSirenUsed.md +++ b/frontend/docs/scripting/functions/NPC_IsVehicleSirenUsed.md @@ -21,7 +21,7 @@ Returns `true` if the NPC is using the vehicle siren, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/checksirenused", true)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Returns `false` if the NPC is not in a vehicle - Only works for vehicles that have sirens (police cars, ambulances, fire trucks) diff --git a/frontend/docs/scripting/functions/NPC_Kill.md b/frontend/docs/scripting/functions/NPC_Kill.md index b9350f3b9cb9..08a9faf70bde 100644 --- a/frontend/docs/scripting/functions/NPC_Kill.md +++ b/frontend/docs/scripting/functions/NPC_Kill.md @@ -23,7 +23,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npckill", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Use `INVALID_PLAYER_ID` for killerid if there is no killer - The reason parameter uses weapon IDs (WEAPON enum) diff --git a/frontend/docs/scripting/functions/NPC_LoadRecord.md b/frontend/docs/scripting/functions/NPC_LoadRecord.md index d64cb5b79cbf..dde6303dd372 100644 --- a/frontend/docs/scripting/functions/NPC_LoadRecord.md +++ b/frontend/docs/scripting/functions/NPC_LoadRecord.md @@ -21,7 +21,7 @@ Returns the ID of the loaded recording, or `INVALID_RECORD_ID` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcloadrecord ", true, 15)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Load recordings before using them with NPC_StartPlayback diff --git a/frontend/docs/scripting/functions/NPC_MeleeAttack.md b/frontend/docs/scripting/functions/NPC_MeleeAttack.md index 6cb56e096142..f71797597a27 100644 --- a/frontend/docs/scripting/functions/NPC_MeleeAttack.md +++ b/frontend/docs/scripting/functions/NPC_MeleeAttack.md @@ -23,7 +23,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcmeleeattack", true, 15)) @@ -62,7 +62,7 @@ public ComboStep3(playerid) } ``` -## Notes +## Good to know - The NPC must have a melee weapon or use fists for the attack - Duration affects how long the attack animation plays diff --git a/frontend/docs/scripting/functions/NPC_Move.md b/frontend/docs/scripting/functions/NPC_Move.md index cbe0c33533c6..cdfbb59c1e29 100644 --- a/frontend/docs/scripting/functions/NPC_Move.md +++ b/frontend/docs/scripting/functions/NPC_Move.md @@ -27,7 +27,7 @@ Returns `true` if the movement was started successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcmove", true)) @@ -51,7 +51,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_MoveByPath.md b/frontend/docs/scripting/functions/NPC_MoveByPath.md index 697cfda66114..8c7e986f3b8c 100644 --- a/frontend/docs/scripting/functions/NPC_MoveByPath.md +++ b/frontend/docs/scripting/functions/NPC_MoveByPath.md @@ -25,7 +25,7 @@ Returns `true` if the NPC started following the path, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/startpatrol", true)) @@ -54,7 +54,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Path must be created with `NPC_CreatePath` and contain at least one point before calling this function - Use `NPC_AddPointToPath` to build the route and `NPC_ClearPath` if you need to reset it diff --git a/frontend/docs/scripting/functions/NPC_MoveToPlayer.md b/frontend/docs/scripting/functions/NPC_MoveToPlayer.md index ec8ae44f0a02..053599ead865 100644 --- a/frontend/docs/scripting/functions/NPC_MoveToPlayer.md +++ b/frontend/docs/scripting/functions/NPC_MoveToPlayer.md @@ -27,7 +27,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcmovetoplayer", true)) @@ -48,7 +48,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_OpenNode.md b/frontend/docs/scripting/functions/NPC_OpenNode.md index d004b212fb8f..f6824182230d 100644 --- a/frontend/docs/scripting/functions/NPC_OpenNode.md +++ b/frontend/docs/scripting/functions/NPC_OpenNode.md @@ -21,7 +21,7 @@ Returns `true` if the node was opened successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcopennode ", true, 13)) @@ -40,7 +40,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Node IDs range from 0 to 63 - Nodes must be opened before NPCs can use them for navigation diff --git a/frontend/docs/scripting/functions/NPC_PausePlayback.md b/frontend/docs/scripting/functions/NPC_PausePlayback.md index bd78fc643481..5802dc69fc81 100644 --- a/frontend/docs/scripting/functions/NPC_PausePlayback.md +++ b/frontend/docs/scripting/functions/NPC_PausePlayback.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/pauseplayback ", true, 15)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works when NPC is actively playing a recording - Paused playback can be resumed by calling with pause = false diff --git a/frontend/docs/scripting/functions/NPC_PausePlayingNode.md b/frontend/docs/scripting/functions/NPC_PausePlayingNode.md index d697e8c87095..82493d58bbba 100644 --- a/frontend/docs/scripting/functions/NPC_PausePlayingNode.md +++ b/frontend/docs/scripting/functions/NPC_PausePlayingNode.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcpausenode", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works when NPC is actively playing a node - Paused node navigation can be resumed with NPC_ResumePlayingNode diff --git a/frontend/docs/scripting/functions/NPC_PlayNode.md b/frontend/docs/scripting/functions/NPC_PlayNode.md index 8c303655c2da..2c4b58db3251 100644 --- a/frontend/docs/scripting/functions/NPC_PlayNode.md +++ b/frontend/docs/scripting/functions/NPC_PlayNode.md @@ -26,7 +26,7 @@ Returns `true` if the NPC started playing the node, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcplaynode ", true, 13)) @@ -52,7 +52,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Nodes are predefined navigation points from the game's node files (IDs 0-63) - The node must be opened with `NPC_OpenNode` before it can be used diff --git a/frontend/docs/scripting/functions/NPC_PutInVehicle.md b/frontend/docs/scripting/functions/NPC_PutInVehicle.md index 4afb8a6336b3..1ce11b14eb3f 100644 --- a/frontend/docs/scripting/functions/NPC_PutInVehicle.md +++ b/frontend/docs/scripting/functions/NPC_PutInVehicle.md @@ -23,7 +23,7 @@ Returns `true` if the NPC was put in the vehicle successfully, `false` otherwise ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcputinvehicle", true)) @@ -58,7 +58,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) | 3 | Back-right passenger | | 4+ | Passenger seats (coach etc.) | -## Notes +## Good to know - NPC will instantly appear in the vehicle without enter animation - Use NPC_GetVehicleID to check which vehicle an NPC is in diff --git a/frontend/docs/scripting/functions/NPC_RemoveFromVehicle.md b/frontend/docs/scripting/functions/NPC_RemoveFromVehicle.md index 3132461a1206..a8aeede85257 100644 --- a/frontend/docs/scripting/functions/NPC_RemoveFromVehicle.md +++ b/frontend/docs/scripting/functions/NPC_RemoveFromVehicle.md @@ -21,7 +21,7 @@ Returns `true` if the NPC was removed from the vehicle, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcremovefromvehicle", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - NPC will instantly appear outside the vehicle without exit animation - Use NPC_ExitVehicle for animated exit diff --git a/frontend/docs/scripting/functions/NPC_RemovePointFromPath.md b/frontend/docs/scripting/functions/NPC_RemovePointFromPath.md index f20bbde1a473..61c129524f50 100644 --- a/frontend/docs/scripting/functions/NPC_RemovePointFromPath.md +++ b/frontend/docs/scripting/functions/NPC_RemovePointFromPath.md @@ -22,7 +22,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strncmp(cmdtext, "/removepatrolpoint ", 19, true)) @@ -56,7 +56,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Point indices start at 0 - Removing a point will shift all subsequent points down by one index diff --git a/frontend/docs/scripting/functions/NPC_ResetAnimation.md b/frontend/docs/scripting/functions/NPC_ResetAnimation.md index 9c2e296d13e9..a250ffef08b7 100644 --- a/frontend/docs/scripting/functions/NPC_ResetAnimation.md +++ b/frontend/docs/scripting/functions/NPC_ResetAnimation.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/resetanim", true)) @@ -39,7 +39,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Stops all current animations and returns NPC to idle state - Equivalent to calling NPC_ClearAnimations diff --git a/frontend/docs/scripting/functions/NPC_ResetSurfingData.md b/frontend/docs/scripting/functions/NPC_ResetSurfingData.md index 4a8e03ac5528..caebf9ab586c 100644 --- a/frontend/docs/scripting/functions/NPC_ResetSurfingData.md +++ b/frontend/docs/scripting/functions/NPC_ResetSurfingData.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/resetsurfing", true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This function clears all surfing-related data for an NPC, including the surfing object/vehicle and offset - The NPC will no longer be attached to any surface after calling this function diff --git a/frontend/docs/scripting/functions/NPC_Respawn.md b/frontend/docs/scripting/functions/NPC_Respawn.md index 13c6dec61920..19504161cfe5 100644 --- a/frontend/docs/scripting/functions/NPC_Respawn.md +++ b/frontend/docs/scripting/functions/NPC_Respawn.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/respawnnpc", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_ResumePlayingNode.md b/frontend/docs/scripting/functions/NPC_ResumePlayingNode.md index 9abf721783ba..9dfbde416e7e 100644 --- a/frontend/docs/scripting/functions/NPC_ResumePlayingNode.md +++ b/frontend/docs/scripting/functions/NPC_ResumePlayingNode.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcresumenode", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works if the NPC's node navigation was previously paused - The NPC will continue from where it was paused diff --git a/frontend/docs/scripting/functions/NPC_SetAmmo.md b/frontend/docs/scripting/functions/NPC_SetAmmo.md index 5b41f22aa254..1dabaecbee81 100644 --- a/frontend/docs/scripting/functions/NPC_SetAmmo.md +++ b/frontend/docs/scripting/functions/NPC_SetAmmo.md @@ -2,7 +2,7 @@ title: NPC_SetAmmo sidebar_label: NPC_SetAmmo description: Sets the ammunition count for an NPC's current weapon. -tags: ["npc", "weapon", "ammo", "ammunition"] +tags: ["npc", "weapon", "ammo"] --- @@ -22,7 +22,7 @@ Returns `true` if the ammo was set successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setammo ", true, 9)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Setting ammo to 0 makes the weapon unusable - Different weapons have different maximum ammo capacities diff --git a/frontend/docs/scripting/functions/NPC_SetAmmoInClip.md b/frontend/docs/scripting/functions/NPC_SetAmmoInClip.md index 08fdb1140d0c..70c608395ee3 100644 --- a/frontend/docs/scripting/functions/NPC_SetAmmoInClip.md +++ b/frontend/docs/scripting/functions/NPC_SetAmmoInClip.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setammoclip ", true, 13)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Amount cannot exceed the weapon's maximum clip size - Setting to 0 will require the NPC to reload before shooting diff --git a/frontend/docs/scripting/functions/NPC_SetAngleToPlayer.md b/frontend/docs/scripting/functions/NPC_SetAngleToPlayer.md index 3a5c1bf9651f..7ad79107aad8 100644 --- a/frontend/docs/scripting/functions/NPC_SetAngleToPlayer.md +++ b/frontend/docs/scripting/functions/NPC_SetAngleToPlayer.md @@ -22,7 +22,7 @@ Returns `true` if the NPC was rotated successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/lookatme", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_SetAngleToPos.md b/frontend/docs/scripting/functions/NPC_SetAngleToPos.md index 3b72156f283a..a39ffced65af 100644 --- a/frontend/docs/scripting/functions/NPC_SetAngleToPos.md +++ b/frontend/docs/scripting/functions/NPC_SetAngleToPos.md @@ -24,7 +24,7 @@ Returns `true` if the NPC was rotated successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/lookatpos", true)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_SetAnimation.md b/frontend/docs/scripting/functions/NPC_SetAnimation.md index 9f06a3d7bc4f..4245bd1c965d 100644 --- a/frontend/docs/scripting/functions/NPC_SetAnimation.md +++ b/frontend/docs/scripting/functions/NPC_SetAnimation.md @@ -28,7 +28,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setdance", true)) @@ -56,7 +56,7 @@ public ClearNPCAnimations(playerid, npcid) } ``` -## Notes +## Good to know - Animation IDs correspond to GTA San Andreas animation indices - Use `NPC_ApplyAnimation` for animations by library and name diff --git a/frontend/docs/scripting/functions/NPC_SetArmour.md b/frontend/docs/scripting/functions/NPC_SetArmour.md index f5d9a9e2642c..d4b27325cff4 100644 --- a/frontend/docs/scripting/functions/NPC_SetArmour.md +++ b/frontend/docs/scripting/functions/NPC_SetArmour.md @@ -22,7 +22,7 @@ Returns `true` if the armour was set successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setarmour ", true, 11)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Armour value ranges from 0.0 (no armour) to 100.0 (full armour) - Armour absorbs damage before health is affected diff --git a/frontend/docs/scripting/functions/NPC_SetFacingAngle.md b/frontend/docs/scripting/functions/NPC_SetFacingAngle.md index 46c80be2ce37..0787d6e244e6 100644 --- a/frontend/docs/scripting/functions/NPC_SetFacingAngle.md +++ b/frontend/docs/scripting/functions/NPC_SetFacingAngle.md @@ -22,7 +22,7 @@ Returns `true` if the facing angle was set successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setfacingangle ", true, 16)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_SetFightingStyle.md b/frontend/docs/scripting/functions/NPC_SetFightingStyle.md index 750c6fa54360..a7f58d4b0cf7 100644 --- a/frontend/docs/scripting/functions/NPC_SetFightingStyle.md +++ b/frontend/docs/scripting/functions/NPC_SetFightingStyle.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setfightingstyle ", true, 18)) @@ -48,7 +48,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Fighting styles affect melee attack animations and damage - Use NPC_GetFightingStyle to check current style diff --git a/frontend/docs/scripting/functions/NPC_SetHealth.md b/frontend/docs/scripting/functions/NPC_SetHealth.md index 42af8754fda0..0cf3cd04d425 100644 --- a/frontend/docs/scripting/functions/NPC_SetHealth.md +++ b/frontend/docs/scripting/functions/NPC_SetHealth.md @@ -22,7 +22,7 @@ Returns `true` if the health was set successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/sethealth ", true, 11)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Health values typically range from 0.0 to 100.0, but can be set higher - Setting health to 0.0 will kill the NPC diff --git a/frontend/docs/scripting/functions/NPC_SetInterior.md b/frontend/docs/scripting/functions/NPC_SetInterior.md index f92f66ad3f8d..10962b8d22cb 100644 --- a/frontend/docs/scripting/functions/NPC_SetInterior.md +++ b/frontend/docs/scripting/functions/NPC_SetInterior.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setinterior ", true, 13)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Interior 0 is the main world (outside) - Make sure to set appropriate coordinates for each interior diff --git a/frontend/docs/scripting/functions/NPC_SetInvulnerable.md b/frontend/docs/scripting/functions/NPC_SetInvulnerable.md index 046e2825e416..e321a6181879 100644 --- a/frontend/docs/scripting/functions/NPC_SetInvulnerable.md +++ b/frontend/docs/scripting/functions/NPC_SetInvulnerable.md @@ -22,7 +22,7 @@ Returns `true` if the invulnerability was set successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/toggleinvulnerable", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) ``` -## Notes +## Good to know - Invulnerable NPCs will not take any damage from weapons, explosions, or other damage sources - This setting persists until changed or the NPC is destroyed diff --git a/frontend/docs/scripting/functions/NPC_SetKeys.md b/frontend/docs/scripting/functions/NPC_SetKeys.md index b89d572d607a..02ce7483d09c 100644 --- a/frontend/docs/scripting/functions/NPC_SetKeys.md +++ b/frontend/docs/scripting/functions/NPC_SetKeys.md @@ -24,7 +24,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setkeys ", true, 9)) @@ -72,7 +72,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Keys affect NPC behavior in vehicles and on foot - Use NPC_GetKeys to check current key states diff --git a/frontend/docs/scripting/functions/NPC_SetNodePoint.md b/frontend/docs/scripting/functions/NPC_SetNodePoint.md index 9e8735a354c7..235ccaef3cc6 100644 --- a/frontend/docs/scripting/functions/NPC_SetNodePoint.md +++ b/frontend/docs/scripting/functions/NPC_SetNodePoint.md @@ -22,7 +22,7 @@ Returns `true` if the point was set successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcsetnodepoint ", true, 17)) @@ -50,7 +50,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Node must be opened before setting points - Point indices typically start from 0 diff --git a/frontend/docs/scripting/functions/NPC_SetPos.md b/frontend/docs/scripting/functions/NPC_SetPos.md index 74c2297e34f4..8eb5a0683a6c 100644 --- a/frontend/docs/scripting/functions/NPC_SetPos.md +++ b/frontend/docs/scripting/functions/NPC_SetPos.md @@ -24,7 +24,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setposhere", true)) @@ -48,7 +48,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_SetRot.md b/frontend/docs/scripting/functions/NPC_SetRot.md index ec8ac43260df..19d6705ba648 100644 --- a/frontend/docs/scripting/functions/NPC_SetRot.md +++ b/frontend/docs/scripting/functions/NPC_SetRot.md @@ -24,7 +24,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setrandomrot", true)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_SetSkin.md b/frontend/docs/scripting/functions/NPC_SetSkin.md index 159c9158c4c3..709c840544d5 100644 --- a/frontend/docs/scripting/functions/NPC_SetSkin.md +++ b/frontend/docs/scripting/functions/NPC_SetSkin.md @@ -22,7 +22,7 @@ Returns `true` if the skin was set successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setskin ", true, 9)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Invalid skin IDs may cause visual glitches diff --git a/frontend/docs/scripting/functions/NPC_SetSpecialAction.md b/frontend/docs/scripting/functions/NPC_SetSpecialAction.md index c2714d52293a..287a4a582c67 100644 --- a/frontend/docs/scripting/functions/NPC_SetSpecialAction.md +++ b/frontend/docs/scripting/functions/NPC_SetSpecialAction.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setspecialaction ", true, 18)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Use SPECIAL_ACTION_NONE to clear the current action - Some actions may conflict with movement or other activities diff --git a/frontend/docs/scripting/functions/NPC_SetSurfingObject.md b/frontend/docs/scripting/functions/NPC_SetSurfingObject.md index 8210ee3d7345..d234d96669d1 100644 --- a/frontend/docs/scripting/functions/NPC_SetSurfingObject.md +++ b/frontend/docs/scripting/functions/NPC_SetSurfingObject.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setsurfingobject ", true, 18)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC will move along with the object if it moves - The object must exist for surfing to work properly diff --git a/frontend/docs/scripting/functions/NPC_SetSurfingOffsets.md b/frontend/docs/scripting/functions/NPC_SetSurfingOffsets.md index 863f9fdf8e37..e23caf98649c 100644 --- a/frontend/docs/scripting/functions/NPC_SetSurfingOffsets.md +++ b/frontend/docs/scripting/functions/NPC_SetSurfingOffsets.md @@ -24,7 +24,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setsurfingoffset ", true, 18)) @@ -68,7 +68,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The surfing offset determines the relative position of the NPC compared to the object/vehicle it's surfing on - Positive Z values move the NPC upward, negative values downward diff --git a/frontend/docs/scripting/functions/NPC_SetSurfingPlayerObject.md b/frontend/docs/scripting/functions/NPC_SetSurfingPlayerObject.md index 9d16ab16c905..dfaf732fb43a 100644 --- a/frontend/docs/scripting/functions/NPC_SetSurfingPlayerObject.md +++ b/frontend/docs/scripting/functions/NPC_SetSurfingPlayerObject.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setsurfingplayerobject ", true, 24)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC will move along with the player object if it moves - Player objects are client-side objects created specifically for individual players diff --git a/frontend/docs/scripting/functions/NPC_SetSurfingVehicle.md b/frontend/docs/scripting/functions/NPC_SetSurfingVehicle.md index 4c0b76a451d6..82d1150f9a29 100644 --- a/frontend/docs/scripting/functions/NPC_SetSurfingVehicle.md +++ b/frontend/docs/scripting/functions/NPC_SetSurfingVehicle.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setsurfingvehicle ", true, 19)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This function allows NPCs to "surf" on vehicles, meaning they will move along with the vehicle while maintaining their position relative to it - The NPC will follow the vehicle's movement, rotation, and position changes diff --git a/frontend/docs/scripting/functions/NPC_SetVehicleGearState.md b/frontend/docs/scripting/functions/NPC_SetVehicleGearState.md index 9d8b111aa28a..cec1fa530e1a 100644 --- a/frontend/docs/scripting/functions/NPC_SetVehicleGearState.md +++ b/frontend/docs/scripting/functions/NPC_SetVehicleGearState.md @@ -22,7 +22,7 @@ This function does not return any specific value. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setvehiclegearstate ", true, 21)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works when NPC is piloting an aircraft - Uses the same constants as [Vehicle Landing Gear States](../resources/landinggearstate): LANDING_GEAR_STATE_DOWN and LANDING_GEAR_STATE_UP diff --git a/frontend/docs/scripting/functions/NPC_SetVehicleHealth.md b/frontend/docs/scripting/functions/NPC_SetVehicleHealth.md index 844e530d5b87..3a6fd17cbbc7 100644 --- a/frontend/docs/scripting/functions/NPC_SetVehicleHealth.md +++ b/frontend/docs/scripting/functions/NPC_SetVehicleHealth.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setvehiclehealth ", true, 18)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works when NPC is in a vehicle - Health ranges from 0.0 (destroyed) to 1000.0 (perfect condition) diff --git a/frontend/docs/scripting/functions/NPC_SetVehicleHydraThrusters.md b/frontend/docs/scripting/functions/NPC_SetVehicleHydraThrusters.md index f5001199ec13..54583c90e6d6 100644 --- a/frontend/docs/scripting/functions/NPC_SetVehicleHydraThrusters.md +++ b/frontend/docs/scripting/functions/NPC_SetVehicleHydraThrusters.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/sethydrathrusters ", true, 19)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works with Hydra aircraft (vehicle ID 520) - Direction 0 = forward thrusters (jet mode) diff --git a/frontend/docs/scripting/functions/NPC_SetVehicleTrainSpeed.md b/frontend/docs/scripting/functions/NPC_SetVehicleTrainSpeed.md index f8b1a555d70b..d829de97aaed 100644 --- a/frontend/docs/scripting/functions/NPC_SetVehicleTrainSpeed.md +++ b/frontend/docs/scripting/functions/NPC_SetVehicleTrainSpeed.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/settrainspeed ", true, 15)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works with train vehicles (models 537, 538) - Use NPC_GetVehicleTrainSpeed to check current speed diff --git a/frontend/docs/scripting/functions/NPC_SetVelocity.md b/frontend/docs/scripting/functions/NPC_SetVelocity.md index 07cbce85a733..89f53fcfa2ed 100644 --- a/frontend/docs/scripting/functions/NPC_SetVelocity.md +++ b/frontend/docs/scripting/functions/NPC_SetVelocity.md @@ -24,7 +24,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setvelocity ", true, 13)) @@ -68,7 +68,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Velocity values determine the speed and direction of movement - Positive Z values move the NPC upward, negative values move downward diff --git a/frontend/docs/scripting/functions/NPC_SetVirtualWorld.md b/frontend/docs/scripting/functions/NPC_SetVirtualWorld.md index 0197047c8bc0..feb17cfced6e 100644 --- a/frontend/docs/scripting/functions/NPC_SetVirtualWorld.md +++ b/frontend/docs/scripting/functions/NPC_SetVirtualWorld.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setvirtualworld ", true, 16)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_SetWeapon.md b/frontend/docs/scripting/functions/NPC_SetWeapon.md index e477d4a68297..a864498bbd3a 100644 --- a/frontend/docs/scripting/functions/NPC_SetWeapon.md +++ b/frontend/docs/scripting/functions/NPC_SetWeapon.md @@ -22,7 +22,7 @@ Returns `true` if the weapon was set successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setweapon ", true, 11)) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Setting a weapon will equip the NPC with that weapon - Use NPC_SetAmmo to provide ammunition for the weapon diff --git a/frontend/docs/scripting/functions/NPC_SetWeaponAccuracy.md b/frontend/docs/scripting/functions/NPC_SetWeaponAccuracy.md index 3e1a32762c1b..9410ea6698b6 100644 --- a/frontend/docs/scripting/functions/NPC_SetWeaponAccuracy.md +++ b/frontend/docs/scripting/functions/NPC_SetWeaponAccuracy.md @@ -23,7 +23,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setweaponaccuracy ", true, 19)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Accuracy value ranges from 0.0 (never hits) to 1.0 (always hits) - Default accuracy varies by weapon type diff --git a/frontend/docs/scripting/functions/NPC_SetWeaponClipSize.md b/frontend/docs/scripting/functions/NPC_SetWeaponClipSize.md index b0252c0b4d2b..1ec275f03276 100644 --- a/frontend/docs/scripting/functions/NPC_SetWeaponClipSize.md +++ b/frontend/docs/scripting/functions/NPC_SetWeaponClipSize.md @@ -23,7 +23,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setweaponclipsize ", true, 19)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC must have a weapon for this function to work - Clip size affects how much ammo the NPC can fire before needing to reload diff --git a/frontend/docs/scripting/functions/NPC_SetWeaponReloadTime.md b/frontend/docs/scripting/functions/NPC_SetWeaponReloadTime.md index 17b1ccff2ab1..c6a74169b3a3 100644 --- a/frontend/docs/scripting/functions/NPC_SetWeaponReloadTime.md +++ b/frontend/docs/scripting/functions/NPC_SetWeaponReloadTime.md @@ -23,7 +23,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setweaponreloadtime ", true, 21)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Reload time is measured in milliseconds - Use NPC_GetWeaponReloadTime to check current reload time diff --git a/frontend/docs/scripting/functions/NPC_SetWeaponShootTime.md b/frontend/docs/scripting/functions/NPC_SetWeaponShootTime.md index 9f14806733a5..49996158b480 100644 --- a/frontend/docs/scripting/functions/NPC_SetWeaponShootTime.md +++ b/frontend/docs/scripting/functions/NPC_SetWeaponShootTime.md @@ -23,7 +23,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setweaponshoottime ", true, 20)) @@ -46,7 +46,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Shoot time is measured in milliseconds between shots - Use NPC_GetWeaponShootTime to check current shoot time diff --git a/frontend/docs/scripting/functions/NPC_SetWeaponSkillLevel.md b/frontend/docs/scripting/functions/NPC_SetWeaponSkillLevel.md index adcc6babd0a1..4ba4fe7004a8 100644 --- a/frontend/docs/scripting/functions/NPC_SetWeaponSkillLevel.md +++ b/frontend/docs/scripting/functions/NPC_SetWeaponSkillLevel.md @@ -23,7 +23,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setweaponskill ", true, 16)) @@ -54,7 +54,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Weapon skill affects accuracy and shooting behavior - Skill level ranges from 0 (poor) to 999 (hitman) diff --git a/frontend/docs/scripting/functions/NPC_SetWeaponState.md b/frontend/docs/scripting/functions/NPC_SetWeaponState.md index a378874578bb..f0ed5192393a 100644 --- a/frontend/docs/scripting/functions/NPC_SetWeaponState.md +++ b/frontend/docs/scripting/functions/NPC_SetWeaponState.md @@ -22,7 +22,7 @@ Returns `true` on success, `false` on failure. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/setweaponstate ", true, 16)) @@ -53,7 +53,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Weapon state controls the current action of the NPC's weapon - Use [NPC_GetWeaponState](NPC_GetWeaponState) to retrieve the current state diff --git a/frontend/docs/scripting/functions/NPC_Shoot.md b/frontend/docs/scripting/functions/NPC_Shoot.md index 5b3e93dc987a..1aacf4136056 100644 --- a/frontend/docs/scripting/functions/NPC_Shoot.md +++ b/frontend/docs/scripting/functions/NPC_Shoot.md @@ -2,7 +2,7 @@ title: NPC_Shoot sidebar_label: NPC_Shoot description: Makes an NPC fire a weapon shot. -tags: ["npc", "weapon", "shoot", "combat"] +tags: ["npc", "weapon", "shooting", "combat"] --- @@ -32,7 +32,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcshoot", true)) @@ -57,7 +57,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC must have a weapon set with `NPC_SetWeapon` before shooting - Use `isHit = false` for warning shots or suppression fire diff --git a/frontend/docs/scripting/functions/NPC_Spawn.md b/frontend/docs/scripting/functions/NPC_Spawn.md index 036dd76b9835..9fdf4a4c0bf6 100644 --- a/frontend/docs/scripting/functions/NPC_Spawn.md +++ b/frontend/docs/scripting/functions/NPC_Spawn.md @@ -21,7 +21,7 @@ Returns `true` if the NPC was spawned successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/createnpc", true)) @@ -53,7 +53,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NPC_StartPlayback.md b/frontend/docs/scripting/functions/NPC_StartPlayback.md index c7418d3ec9de..51fe0cd5e8fb 100644 --- a/frontend/docs/scripting/functions/NPC_StartPlayback.md +++ b/frontend/docs/scripting/functions/NPC_StartPlayback.md @@ -29,7 +29,7 @@ Returns `true` if the playback was started successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/startplayback ", true, 15)) @@ -64,7 +64,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The recording file must exist in the `npcmodes\recordings` directory - If autoUnload is true, the recording is unloaded when playback ends diff --git a/frontend/docs/scripting/functions/NPC_StartPlaybackEx.md b/frontend/docs/scripting/functions/NPC_StartPlaybackEx.md index efd735c1c6c0..bd2560b85123 100644 --- a/frontend/docs/scripting/functions/NPC_StartPlaybackEx.md +++ b/frontend/docs/scripting/functions/NPC_StartPlaybackEx.md @@ -29,7 +29,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/startplaybackex ", true, 17)) @@ -59,7 +59,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Recording must be pre-loaded with `NPC_LoadRecord` - Auto-unload saves memory when playback completes diff --git a/frontend/docs/scripting/functions/NPC_StopAim.md b/frontend/docs/scripting/functions/NPC_StopAim.md index a8ab90265252..70a1c67cc1b0 100644 --- a/frontend/docs/scripting/functions/NPC_StopAim.md +++ b/frontend/docs/scripting/functions/NPC_StopAim.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/friendly", true)) @@ -38,7 +38,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This stops both aiming and shooting if the NPC was doing both - The NPC will return to its normal stance after stopping aim diff --git a/frontend/docs/scripting/functions/NPC_StopMeleeAttack.md b/frontend/docs/scripting/functions/NPC_StopMeleeAttack.md index ba306870514d..9445b07c3413 100644 --- a/frontend/docs/scripting/functions/NPC_StopMeleeAttack.md +++ b/frontend/docs/scripting/functions/NPC_StopMeleeAttack.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcstopmelee", true)) @@ -43,7 +43,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) ``` -## Notes +## Good to know - This immediately stops any ongoing melee attack animation - The NPC will return to its normal stance diff --git a/frontend/docs/scripting/functions/NPC_StopMove.md b/frontend/docs/scripting/functions/NPC_StopMove.md index 51e390469e10..ed0dfe786f53 100644 --- a/frontend/docs/scripting/functions/NPC_StopMove.md +++ b/frontend/docs/scripting/functions/NPC_StopMove.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcstopmove", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This stops the NPC at their current position. - If the NPC is not moving, this function has no effect. diff --git a/frontend/docs/scripting/functions/NPC_StopPlayback.md b/frontend/docs/scripting/functions/NPC_StopPlayback.md index 159f5c5bad40..26c7f0d6279c 100644 --- a/frontend/docs/scripting/functions/NPC_StopPlayback.md +++ b/frontend/docs/scripting/functions/NPC_StopPlayback.md @@ -21,7 +21,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/stopplayback", true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC will stop at their current position when playback ends - If the NPC is not playing a recording, this function has no effect diff --git a/frontend/docs/scripting/functions/NPC_StopPlayingNode.md b/frontend/docs/scripting/functions/NPC_StopPlayingNode.md index f82d701eb084..6ba0525d784c 100644 --- a/frontend/docs/scripting/functions/NPC_StopPlayingNode.md +++ b/frontend/docs/scripting/functions/NPC_StopPlayingNode.md @@ -21,7 +21,7 @@ Returns `true` if the NPC was stopped successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcstopnode", true)) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC will stop at their current position in the node - If the NPC is not playing a node, this function returns `false` diff --git a/frontend/docs/scripting/functions/NPC_UnloadAllRecords.md b/frontend/docs/scripting/functions/NPC_UnloadAllRecords.md index fe5a40c3d57a..ee67d5832187 100644 --- a/frontend/docs/scripting/functions/NPC_UnloadAllRecords.md +++ b/frontend/docs/scripting/functions/NPC_UnloadAllRecords.md @@ -17,7 +17,7 @@ Returns `true` if all records were unloaded successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcunloadallrecords", true)) @@ -34,7 +34,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - This frees up memory used by loaded recordings - All record IDs become invalid after this function diff --git a/frontend/docs/scripting/functions/NPC_UnloadRecord.md b/frontend/docs/scripting/functions/NPC_UnloadRecord.md index 1844a6bf5dc5..3bbe2f54f5a0 100644 --- a/frontend/docs/scripting/functions/NPC_UnloadRecord.md +++ b/frontend/docs/scripting/functions/NPC_UnloadRecord.md @@ -21,7 +21,7 @@ Returns `true` if the record was unloaded successfully, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcunloadrecord ", true, 17)) @@ -40,7 +40,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Frees memory used by the specific recording - The record ID becomes invalid after unloading diff --git a/frontend/docs/scripting/functions/NPC_UpdateNodePoint.md b/frontend/docs/scripting/functions/NPC_UpdateNodePoint.md index dfa03344a9d1..1b937ed72240 100644 --- a/frontend/docs/scripting/functions/NPC_UpdateNodePoint.md +++ b/frontend/docs/scripting/functions/NPC_UpdateNodePoint.md @@ -22,7 +22,7 @@ Returns `true` if the update was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcupdatenodepoint ", true, 20)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - The NPC must be currently playing a node - Point ID must exist in the current node diff --git a/frontend/docs/scripting/functions/NPC_UseVehicleSiren.md b/frontend/docs/scripting/functions/NPC_UseVehicleSiren.md index 85a77040c6b5..bef95fca456c 100644 --- a/frontend/docs/scripting/functions/NPC_UseVehicleSiren.md +++ b/frontend/docs/scripting/functions/NPC_UseVehicleSiren.md @@ -22,7 +22,7 @@ Returns `true` if the operation was successful, `false` otherwise. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/npcusesiren ", true, 13)) @@ -49,7 +49,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know - Only works when the NPC is in a vehicle as driver - The vehicle must support sirens (emergency vehicles) diff --git a/frontend/docs/scripting/functions/NetStats_BytesReceived.md b/frontend/docs/scripting/functions/NetStats_BytesReceived.md index 5738e825f42b..c35eb548ee5b 100644 --- a/frontend/docs/scripting/functions/NetStats_BytesReceived.md +++ b/frontend/docs/scripting/functions/NetStats_BytesReceived.md @@ -21,7 +21,7 @@ This function returns the number of bytes the server has received from the playe ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/bytesreceived")) diff --git a/frontend/docs/scripting/functions/NetStats_BytesSent.md b/frontend/docs/scripting/functions/NetStats_BytesSent.md index f6b670564da1..aea9dedcda89 100644 --- a/frontend/docs/scripting/functions/NetStats_BytesSent.md +++ b/frontend/docs/scripting/functions/NetStats_BytesSent.md @@ -21,7 +21,7 @@ This function returns the number of bytes the server has sent to the player. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/bytes_sent")) diff --git a/frontend/docs/scripting/functions/NetStats_ConnectionStatus.md b/frontend/docs/scripting/functions/NetStats_ConnectionStatus.md index 640e2a05a282..023d311221dc 100644 --- a/frontend/docs/scripting/functions/NetStats_ConnectionStatus.md +++ b/frontend/docs/scripting/functions/NetStats_ConnectionStatus.md @@ -19,7 +19,7 @@ The player's [connection status](../resources/connectionstatus), as an integer v ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/connectionstatus")) diff --git a/frontend/docs/scripting/functions/NetStats_GetConnectedTime.md b/frontend/docs/scripting/functions/NetStats_GetConnectedTime.md index 70e9e39507c9..9d7f1963081c 100644 --- a/frontend/docs/scripting/functions/NetStats_GetConnectedTime.md +++ b/frontend/docs/scripting/functions/NetStats_GetConnectedTime.md @@ -21,7 +21,7 @@ This function returns the amount of time (in milliseconds) that a player has bee ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/connectedtime")) @@ -34,7 +34,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/NetStats_GetIpPort.md b/frontend/docs/scripting/functions/NetStats_GetIpPort.md index 845b73cd4f6d..79d6246fe5e8 100644 --- a/frontend/docs/scripting/functions/NetStats_GetIpPort.md +++ b/frontend/docs/scripting/functions/NetStats_GetIpPort.md @@ -21,7 +21,7 @@ The player's IP and port is stored in the specified array. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/ipandport")) diff --git a/frontend/docs/scripting/functions/NetStats_MessagesReceived.md b/frontend/docs/scripting/functions/NetStats_MessagesReceived.md index 628be5166043..955b56a2c6cb 100644 --- a/frontend/docs/scripting/functions/NetStats_MessagesReceived.md +++ b/frontend/docs/scripting/functions/NetStats_MessagesReceived.md @@ -21,7 +21,7 @@ This function returns the number of messages the server has received from the pl ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/msgs")) diff --git a/frontend/docs/scripting/functions/NetStats_MessagesRecvPerSecond.md b/frontend/docs/scripting/functions/NetStats_MessagesRecvPerSecond.md index a60d6ed425e4..82f3fa922928 100644 --- a/frontend/docs/scripting/functions/NetStats_MessagesRecvPerSecond.md +++ b/frontend/docs/scripting/functions/NetStats_MessagesRecvPerSecond.md @@ -19,7 +19,7 @@ the number of messages the player has received in the last second. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/msgpersec")) diff --git a/frontend/docs/scripting/functions/NetStats_MessagesSent.md b/frontend/docs/scripting/functions/NetStats_MessagesSent.md index 16afec6e91bb..b06758dd11a5 100644 --- a/frontend/docs/scripting/functions/NetStats_MessagesSent.md +++ b/frontend/docs/scripting/functions/NetStats_MessagesSent.md @@ -19,7 +19,7 @@ The number of messages the server has sent to the player. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/msgsent")) diff --git a/frontend/docs/scripting/functions/NetStats_PacketLossPercent.md b/frontend/docs/scripting/functions/NetStats_PacketLossPercent.md index 325e951cebe6..e577d183f3c4 100644 --- a/frontend/docs/scripting/functions/NetStats_PacketLossPercent.md +++ b/frontend/docs/scripting/functions/NetStats_PacketLossPercent.md @@ -19,7 +19,7 @@ The percentage packet loss as a float. **0** if player not connected. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/packetloss")) @@ -32,13 +32,13 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note This function has been found to be currently unreliable the output is not as expected when compared to the client. Therefore this function should not be used as a packet loss kicker. A more accurate packetloss function: -```c +```pawn stock GetPlayerPacketLoss(playerid, &Float:packetLoss) { /* Returns the packetloss percentage of the given playerid - Made by Fusez */ diff --git a/frontend/docs/scripting/functions/PauseRecordingPlayback.md b/frontend/docs/scripting/functions/PauseRecordingPlayback.md index 3499e1bc370b..d2030033381e 100644 --- a/frontend/docs/scripting/functions/PauseRecordingPlayback.md +++ b/frontend/docs/scripting/functions/PauseRecordingPlayback.md @@ -2,7 +2,7 @@ title: PauseRecordingPlayback sidebar_label: PauseRecordingPlayback description: This will pause playing back the recording. -tags: [] +tags: ["npc", "recording", "playback"] --- :::warning diff --git a/frontend/docs/scripting/functions/PlayAudioStreamForPlayer.md b/frontend/docs/scripting/functions/PlayAudioStreamForPlayer.md index 8353094e2651..150f705ea110 100644 --- a/frontend/docs/scripting/functions/PlayAudioStreamForPlayer.md +++ b/frontend/docs/scripting/functions/PlayAudioStreamForPlayer.md @@ -27,7 +27,7 @@ Play an 'audio stream' for a player. Normal audio files also work (e.g. MP3). ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/radio", cmdtext, true) == 0) diff --git a/frontend/docs/scripting/functions/PlayCrimeReportForPlayer.md b/frontend/docs/scripting/functions/PlayCrimeReportForPlayer.md index 552e4359cdbc..8f0338126371 100644 --- a/frontend/docs/scripting/functions/PlayCrimeReportForPlayer.md +++ b/frontend/docs/scripting/functions/PlayCrimeReportForPlayer.md @@ -23,7 +23,7 @@ This function plays a crime report for a player - just like in single-player whe ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/suspect")) diff --git a/frontend/docs/scripting/functions/PlayerGangZoneDestroy.md b/frontend/docs/scripting/functions/PlayerGangZoneDestroy.md index e237b968be2d..956f6437deea 100644 --- a/frontend/docs/scripting/functions/PlayerGangZoneDestroy.md +++ b/frontend/docs/scripting/functions/PlayerGangZoneDestroy.md @@ -24,7 +24,7 @@ Destroy player gangzone. ## Examples -```c +```pawn // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; diff --git a/frontend/docs/scripting/functions/PlayerGangZoneFlash.md b/frontend/docs/scripting/functions/PlayerGangZoneFlash.md index 6015bbe171f9..450d5504054f 100644 --- a/frontend/docs/scripting/functions/PlayerGangZoneFlash.md +++ b/frontend/docs/scripting/functions/PlayerGangZoneFlash.md @@ -25,7 +25,7 @@ Start player gangzone flash. ## Examples -```c +```pawn // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; diff --git a/frontend/docs/scripting/functions/PlayerGangZoneGetColour.md b/frontend/docs/scripting/functions/PlayerGangZoneGetColour.md index a5d60dcd15a6..15c91d00bfad 100644 --- a/frontend/docs/scripting/functions/PlayerGangZoneGetColour.md +++ b/frontend/docs/scripting/functions/PlayerGangZoneGetColour.md @@ -24,7 +24,7 @@ Color of player gangzone. ## Examples -```c +```pawn new gGangZoneID[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerGangZoneGetFlashColour.md b/frontend/docs/scripting/functions/PlayerGangZoneGetFlashColour.md index 8655aa8cf241..b9cede2eb3d6 100644 --- a/frontend/docs/scripting/functions/PlayerGangZoneGetFlashColour.md +++ b/frontend/docs/scripting/functions/PlayerGangZoneGetFlashColour.md @@ -24,7 +24,7 @@ Flashing color of player gangzone. ## Examples -```c +```pawn new gGangZoneID[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerGangZoneGetPos.md b/frontend/docs/scripting/functions/PlayerGangZoneGetPos.md index 6710b132ba03..493d939a49aa 100644 --- a/frontend/docs/scripting/functions/PlayerGangZoneGetPos.md +++ b/frontend/docs/scripting/functions/PlayerGangZoneGetPos.md @@ -26,7 +26,7 @@ This function always returns **true**. ## Examples -```c +```pawn new gGangZoneID[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerGangZoneHide.md b/frontend/docs/scripting/functions/PlayerGangZoneHide.md index 2e0b3d958fff..a604448a137c 100644 --- a/frontend/docs/scripting/functions/PlayerGangZoneHide.md +++ b/frontend/docs/scripting/functions/PlayerGangZoneHide.md @@ -24,7 +24,7 @@ Hide player gangzone. ## Examples -```c +```pawn // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; diff --git a/frontend/docs/scripting/functions/PlayerGangZoneShow.md b/frontend/docs/scripting/functions/PlayerGangZoneShow.md index 55bba3f55100..419cb9ff1865 100644 --- a/frontend/docs/scripting/functions/PlayerGangZoneShow.md +++ b/frontend/docs/scripting/functions/PlayerGangZoneShow.md @@ -25,7 +25,7 @@ Show player gangzone in a color. ## Examples -```c +```pawn // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; diff --git a/frontend/docs/scripting/functions/PlayerGangZoneStopFlash.md b/frontend/docs/scripting/functions/PlayerGangZoneStopFlash.md index 6b123b6b1215..7ae46968ee88 100644 --- a/frontend/docs/scripting/functions/PlayerGangZoneStopFlash.md +++ b/frontend/docs/scripting/functions/PlayerGangZoneStopFlash.md @@ -24,7 +24,7 @@ Stop player gangzone flash. ## Examples -```c +```pawn // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; diff --git a/frontend/docs/scripting/functions/PlayerHasClockEnabled.md b/frontend/docs/scripting/functions/PlayerHasClockEnabled.md index 4a358ccb9d54..6eb9d89b8d7b 100644 --- a/frontend/docs/scripting/functions/PlayerHasClockEnabled.md +++ b/frontend/docs/scripting/functions/PlayerHasClockEnabled.md @@ -21,7 +21,7 @@ Checks whether the player has their in-game clock enabled. ([TogglePlayerClock]( ## Examples -```c +```pawn public OnPlayerConnect(playerid) { TogglePlayerClock(playerid, true); // Show the clock @@ -34,7 +34,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/PlayerPlaySound.md b/frontend/docs/scripting/functions/PlayerPlaySound.md index 7cc5888557ac..abe98b158e23 100644 --- a/frontend/docs/scripting/functions/PlayerPlaySound.md +++ b/frontend/docs/scripting/functions/PlayerPlaySound.md @@ -27,12 +27,12 @@ For a library that lists all sounds, check out [this](https://github.com/WoutPro ## Examples -```c +```pawn // player punching sound (fits for commands such as /slap well). The sound will be quiet, as the source is actually 10 meters above the player. PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/PlayerSpectatePlayer.md b/frontend/docs/scripting/functions/PlayerSpectatePlayer.md index f574dce1b79a..b6a818dfa537 100644 --- a/frontend/docs/scripting/functions/PlayerSpectatePlayer.md +++ b/frontend/docs/scripting/functions/PlayerSpectatePlayer.md @@ -23,7 +23,7 @@ Makes a player spectate (watch) another player. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { TogglePlayerSpectating(playerid, 1); @@ -32,7 +32,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/PlayerSpectateVehicle.md b/frontend/docs/scripting/functions/PlayerSpectateVehicle.md index 801d8b69913c..8598563a0cc5 100644 --- a/frontend/docs/scripting/functions/PlayerSpectateVehicle.md +++ b/frontend/docs/scripting/functions/PlayerSpectateVehicle.md @@ -23,12 +23,12 @@ Sets a player to spectate another vehicle. Their camera will be attached to the ## Examples -```c +```pawn TogglePlayerSpectating(playerid, 1); PlayerSpectateVehicle(playerid, vehicleid); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/PlayerTextDrawAlignment.md b/frontend/docs/scripting/functions/PlayerTextDrawAlignment.md index 6cfd16c78b94..d13313318837 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawAlignment.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawAlignment.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn /* TEXT_DRAW_ALIGN_LEFT TEXT_DRAW_ALIGN_CENTER @@ -38,7 +38,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/PlayerTextDrawBackgroundColor.md b/frontend/docs/scripting/functions/PlayerTextDrawBackgroundColor.md index ca20b67e265e..9983c44e1079 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawBackgroundColor.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawBackgroundColor.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:gMyTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -33,7 +33,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/PlayerTextDrawBackgroundColour.md b/frontend/docs/scripting/functions/PlayerTextDrawBackgroundColour.md index d3eaba5ed6c0..a416cb986659 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawBackgroundColour.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawBackgroundColour.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:gMyTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -35,7 +35,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/PlayerTextDrawBoxColor.md b/frontend/docs/scripting/functions/PlayerTextDrawBoxColor.md index c92a237b81d2..79226c90eee0 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawBoxColor.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawBoxColor.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawBoxColour.md b/frontend/docs/scripting/functions/PlayerTextDrawBoxColour.md index 48ddba47afc0..fe99bfded3cc 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawBoxColour.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawBoxColour.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawColor.md b/frontend/docs/scripting/functions/PlayerTextDrawColor.md index ae76c035e1d8..1523d1524f73 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawColor.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawColor.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -34,7 +34,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/PlayerTextDrawColour.md b/frontend/docs/scripting/functions/PlayerTextDrawColour.md index dc6aae34cf0e..afd6e58a0e19 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawColour.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawColour.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -36,7 +36,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/PlayerTextDrawDestroy.md b/frontend/docs/scripting/functions/PlayerTextDrawDestroy.md index 7c8cd11bc3f0..89dc6e2fe559 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawDestroy.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawDestroy.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawFont.md b/frontend/docs/scripting/functions/PlayerTextDrawFont.md index 760a3481d0b4..c53ebd0e839f 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawFont.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawFont.md @@ -27,7 +27,7 @@ This function does not return any specific values. ## Examples -```c +```pawn /* TEXT_DRAW_FONT_0 TEXT_DRAW_FONT_1 diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetAlignment.md b/frontend/docs/scripting/functions/PlayerTextDrawGetAlignment.md index 25575eb74a57..7a41ae277312 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetAlignment.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetAlignment.md @@ -22,7 +22,7 @@ Returns the player-textdraw text alignment. ## Examples -```c +```pawn new PlayerText:gMyTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetBackgroundCol.md b/frontend/docs/scripting/functions/PlayerTextDrawGetBackgroundCol.md index 2be11785a26e..7800995f9a6b 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetBackgroundCol.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetBackgroundCol.md @@ -22,7 +22,7 @@ Returns the background color of the player-textdraw. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetBackgroundColour.md b/frontend/docs/scripting/functions/PlayerTextDrawGetBackgroundColour.md index a7c6972b0020..0671cac715ee 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetBackgroundColour.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetBackgroundColour.md @@ -22,7 +22,7 @@ Returns the background colour of the player-textdraw. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetBoxColor.md b/frontend/docs/scripting/functions/PlayerTextDrawGetBoxColor.md index cd1b309a1290..c749c7a64707 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetBoxColor.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetBoxColor.md @@ -22,7 +22,7 @@ Returns the box color of the player-textdraw. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetBoxColour.md b/frontend/docs/scripting/functions/PlayerTextDrawGetBoxColour.md index 48fd78374b59..71580b79eeb3 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetBoxColour.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetBoxColour.md @@ -22,7 +22,7 @@ Returns the box colour of the player-textdraw. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetColor.md b/frontend/docs/scripting/functions/PlayerTextDrawGetColor.md index 250200f66856..215b4e694abd 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetColor.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetColor.md @@ -22,7 +22,7 @@ Returns the text color of the player-textdraw. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetColour.md b/frontend/docs/scripting/functions/PlayerTextDrawGetColour.md index bd8afdcf7ab7..8899a3012520 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetColour.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetColour.md @@ -22,7 +22,7 @@ Returns the text colour of the player-textdraw. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetFont.md b/frontend/docs/scripting/functions/PlayerTextDrawGetFont.md index f81752f130de..e676ab687700 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetFont.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetFont.md @@ -22,7 +22,7 @@ Returns the player-textdraw font. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetLetterSize.md b/frontend/docs/scripting/functions/PlayerTextDrawGetLetterSize.md index 2a10c8ab59fd..bcdc1c5e759b 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetLetterSize.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetLetterSize.md @@ -24,7 +24,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetOutline.md b/frontend/docs/scripting/functions/PlayerTextDrawGetOutline.md index 8bf4cf828b44..8134a62f82cd 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetOutline.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetOutline.md @@ -22,7 +22,7 @@ Returns the player-textdraw outline size. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetPos.md b/frontend/docs/scripting/functions/PlayerTextDrawGetPos.md index 382f914271da..9d4e7c01a462 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetPos.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetPos.md @@ -20,7 +20,7 @@ Gets the position (in-screen x & y) of a player-textdraw. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewModel.md b/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewModel.md index 278c0b87ce70..985208eceec7 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewModel.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewModel.md @@ -22,7 +22,7 @@ Returns the 3D player-textdraw preview model. ## Examples -```c +```pawn new PlayerText:gTextDraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewRot.md b/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewRot.md index 5c5702ab15b8..95619ac945ce 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewRot.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewRot.md @@ -22,7 +22,7 @@ Gets the rotation and zoom of a 3D model preview player-textdraw. ## Examples -```c +```pawn new PlayerText:gMyTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewVehCol.md b/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewVehCol.md index 5f690fc09b3d..5067f0e3e021 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewVehCol.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewVehCol.md @@ -20,7 +20,7 @@ Gets the preview vehicle colors of a 3D preview player-textdraw. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md b/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md index 64fce11023df..906c42d3bb95 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md @@ -20,7 +20,7 @@ Gets the preview vehicle colors of a 3D preview player-textdraw. ## Examples -```c +```pawn new PlayerText:pTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetShadow.md b/frontend/docs/scripting/functions/PlayerTextDrawGetShadow.md index 757beb5257b8..20ca0bae862e 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetShadow.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetShadow.md @@ -22,7 +22,7 @@ Returns the player-textdraw shadow size. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetString.md b/frontend/docs/scripting/functions/PlayerTextDrawGetString.md index 8a9eb92f04ba..1e269e42e5d8 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetString.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetString.md @@ -24,7 +24,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawGetTextSize.md b/frontend/docs/scripting/functions/PlayerTextDrawGetTextSize.md index 8dc555885ad9..db740ab3d88b 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawGetTextSize.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawGetTextSize.md @@ -24,7 +24,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawHide.md b/frontend/docs/scripting/functions/PlayerTextDrawHide.md index 3d53ebfaef42..72a5cfb92e73 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawHide.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawHide.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawIsBox.md b/frontend/docs/scripting/functions/PlayerTextDrawIsBox.md index 4719d1097eb6..4ee789d6aa3e 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawIsBox.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawIsBox.md @@ -24,7 +24,7 @@ Returns **true** if the player-textdraw is box, otherwise **false**. ## Example Usage -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawIsProportional.md b/frontend/docs/scripting/functions/PlayerTextDrawIsProportional.md index 2fd5bc5f8378..851a73d71476 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawIsProportional.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawIsProportional.md @@ -24,7 +24,7 @@ Returns **true** if the player-textdraw is proportional, otherwise **false**. ## Example Usage -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawIsSelectable.md b/frontend/docs/scripting/functions/PlayerTextDrawIsSelectable.md index 13ce8e073455..6ffdb8e09fb3 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawIsSelectable.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawIsSelectable.md @@ -24,7 +24,7 @@ Returns **true** if the player-textdraw is selectable, otherwise **false**. ## Example Usage -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawLetterSize.md b/frontend/docs/scripting/functions/PlayerTextDrawLetterSize.md index 544f5b125e25..bc0d0ebdb8b8 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawLetterSize.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawLetterSize.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -35,7 +35,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetOutline.md b/frontend/docs/scripting/functions/PlayerTextDrawSetOutline.md index 5d290bb1a36e..00776970b594 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetOutline.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetOutline.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetPos.md b/frontend/docs/scripting/functions/PlayerTextDrawSetPos.md index 30738e031d89..6a691928233c 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetPos.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetPos.md @@ -20,7 +20,7 @@ Sets the position (in-screen x & y) of a player-textdraw. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewModel.md b/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewModel.md index 03acf6285eea..794c320a6dab 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewModel.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewModel.md @@ -23,7 +23,7 @@ Sets a player textdraw 3D preview sprite of a specified model ID. ## Examples -```c +```pawn new PlayerText:gTextDraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -43,7 +43,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewRot.md b/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewRot.md index 91b32aad75d3..26df5c9525e4 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewRot.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewRot.md @@ -24,7 +24,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:gMyTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -42,7 +42,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewVehCol.md b/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewVehCol.md index 78cc636465ea..d23e95709c59 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewVehCol.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewVehCol.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:gTextDraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -41,7 +41,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md b/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md index 485b4a9fc70c..8056b4b38b77 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md @@ -24,7 +24,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:gTextDraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -43,7 +43,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetProportional.md b/frontend/docs/scripting/functions/PlayerTextDrawSetProportional.md index 7b3ee8f4bd03..eea1948a9689 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetProportional.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetProportional.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetSelectable.md b/frontend/docs/scripting/functions/PlayerTextDrawSetSelectable.md index aba444fb0e54..250d08ca07e5 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetSelectable.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetSelectable.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -41,7 +41,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetShadow.md b/frontend/docs/scripting/functions/PlayerTextDrawSetShadow.md index 6c1da02651c9..e954e98bae63 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetShadow.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetShadow.md @@ -23,7 +23,7 @@ Adds a shadow to the bottom-right side of the text in a player-textdraw. The sha ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -36,7 +36,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/PlayerTextDrawSetString.md b/frontend/docs/scripting/functions/PlayerTextDrawSetString.md index 704c59abfff7..a03fdf811f5b 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawSetString.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawSetString.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:pVehicleHealthTD[MAX_PLAYERS]; new pVehicleHealthTimer[MAX_PLAYERS]; @@ -67,7 +67,7 @@ NOTE: This example is purely for demonstration purposes, it is not guaranteed to */ ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/PlayerTextDrawShow.md b/frontend/docs/scripting/functions/PlayerTextDrawShow.md index b0de9d697574..cc9ccbb5ebbe 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawShow.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawShow.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -32,7 +32,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/PlayerTextDrawTextSize.md b/frontend/docs/scripting/functions/PlayerTextDrawTextSize.md index 98d26296f657..31ad64d21188 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawTextSize.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawTextSize.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -35,7 +35,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/PlayerTextDrawUseBox.md b/frontend/docs/scripting/functions/PlayerTextDrawUseBox.md index 337457aa05e0..afd369004455 100644 --- a/frontend/docs/scripting/functions/PlayerTextDrawUseBox.md +++ b/frontend/docs/scripting/functions/PlayerTextDrawUseBox.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new PlayerText:gMyTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/PutPlayerInVehicle.md b/frontend/docs/scripting/functions/PutPlayerInVehicle.md index 7b7630ffadb6..91f93aa7ad38 100644 --- a/frontend/docs/scripting/functions/PutPlayerInVehicle.md +++ b/frontend/docs/scripting/functions/PutPlayerInVehicle.md @@ -23,7 +23,7 @@ Puts a player in a vehicle. ## Examples -```c +```pawn public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger) { PutPlayerInVehicle(playerid, vehicleid, 0); @@ -40,7 +40,7 @@ public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger) | 3 | Back-right passenger | | 4+ | Passenger seats (coach etc.) | -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/RedirectDownload.md b/frontend/docs/scripting/functions/RedirectDownload.md index 95062715b3b3..439eed30a1a5 100644 --- a/frontend/docs/scripting/functions/RedirectDownload.md +++ b/frontend/docs/scripting/functions/RedirectDownload.md @@ -26,7 +26,7 @@ Redirect a player custom [AddCharModel](AddCharModel) or [AddSimpleModel](AddSim ## Example Usage from dl_redirect filterscript -```c +```pawn new baseurl[] = "https://assets.open.mp"; public OnPlayerRequestDownload(playerid, type, crc) diff --git a/frontend/docs/scripting/functions/RemoveBuildingForPlayer.md b/frontend/docs/scripting/functions/RemoveBuildingForPlayer.md index 06c20122f559..1cf9aea82ef5 100644 --- a/frontend/docs/scripting/functions/RemoveBuildingForPlayer.md +++ b/frontend/docs/scripting/functions/RemoveBuildingForPlayer.md @@ -24,7 +24,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { // When the player connects, objects with model 615 will be removed within a @@ -34,7 +34,7 @@ public OnPlayerConnect(playerid) } ``` -```c +```pawn public OnPlayerConnect(playerid) { // When the player connects, all map objects will be removed. @@ -43,7 +43,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/RemovePlayerAttachedObject.md b/frontend/docs/scripting/functions/RemovePlayerAttachedObject.md index 1c1007bcd361..968c0d7be193 100644 --- a/frontend/docs/scripting/functions/RemovePlayerAttachedObject.md +++ b/frontend/docs/scripting/functions/RemovePlayerAttachedObject.md @@ -20,7 +20,7 @@ Remove an attached object from a player. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strmp(cmdtext, "/remove", true)) // Remove Attached Objects diff --git a/frontend/docs/scripting/functions/RemovePlayerFromVehicle.md b/frontend/docs/scripting/functions/RemovePlayerFromVehicle.md index af1c118670ea..08452cc25679 100644 --- a/frontend/docs/scripting/functions/RemovePlayerFromVehicle.md +++ b/frontend/docs/scripting/functions/RemovePlayerFromVehicle.md @@ -22,7 +22,7 @@ Removes/ejects a player from their vehicle. ## Examples -```c +```pawn // Example - Players can only drive vehicles if they have 10 score. public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { @@ -34,7 +34,7 @@ public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstat } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/RemovePlayerMapIcon.md b/frontend/docs/scripting/functions/RemovePlayerMapIcon.md index 5dbac207a17a..9aaae2cd02f1 100644 --- a/frontend/docs/scripting/functions/RemovePlayerMapIcon.md +++ b/frontend/docs/scripting/functions/RemovePlayerMapIcon.md @@ -22,7 +22,7 @@ Removes a map icon that was set earlier for a player using [SetPlayerMapIcon](Se ## Examples -```c +```pawn SetPlayerMapIcon(playerid, 12, 2204.9468, 1986.2877, 16.7380, 52, 0); // Later on diff --git a/frontend/docs/scripting/functions/RemovePlayerWeapon.md b/frontend/docs/scripting/functions/RemovePlayerWeapon.md index 40d64aae6df3..ce717d24b69f 100644 --- a/frontend/docs/scripting/functions/RemovePlayerWeapon.md +++ b/frontend/docs/scripting/functions/RemovePlayerWeapon.md @@ -24,7 +24,7 @@ Remove a specified weapon from a player. ## Examples -```c +```pawn RemovePlayerWeapon(playerid, WEAPON_DEAGLE); // Remove the Desert-Eagle from the player ``` diff --git a/frontend/docs/scripting/functions/RemoveServerRule.md b/frontend/docs/scripting/functions/RemoveServerRule.md index ed56f55a2327..bcb6cb42eb5b 100644 --- a/frontend/docs/scripting/functions/RemoveServerRule.md +++ b/frontend/docs/scripting/functions/RemoveServerRule.md @@ -21,7 +21,7 @@ Returns true if the function executed successfully, otherwise false. ## Examples -```c +```pawn RemoveServerRule("rule"); ``` diff --git a/frontend/docs/scripting/functions/RemoveVehicleComponent.md b/frontend/docs/scripting/functions/RemoveVehicleComponent.md index a715903ad755..db10966f0ca8 100644 --- a/frontend/docs/scripting/functions/RemoveVehicleComponent.md +++ b/frontend/docs/scripting/functions/RemoveVehicleComponent.md @@ -22,7 +22,7 @@ Remove a component from a vehicle. ## Examples -```c +```pawn // Remove Nitro from player vehicle new vehicleid = GetPlayerVehicleID(playerid); RemoveVehicleComponent(vehicleid, 1010); diff --git a/frontend/docs/scripting/functions/RepairVehicle.md b/frontend/docs/scripting/functions/RepairVehicle.md index 411afe07d9e7..3957cc050874 100644 --- a/frontend/docs/scripting/functions/RepairVehicle.md +++ b/frontend/docs/scripting/functions/RepairVehicle.md @@ -21,7 +21,7 @@ Fully repairs a vehicle, including visual damage (bumps, dents, scratches, poppe ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/repair", cmdtext)) diff --git a/frontend/docs/scripting/functions/ResetPlayerMoney.md b/frontend/docs/scripting/functions/ResetPlayerMoney.md index ed4c3b8b75f9..ad0c8424c661 100644 --- a/frontend/docs/scripting/functions/ResetPlayerMoney.md +++ b/frontend/docs/scripting/functions/ResetPlayerMoney.md @@ -21,7 +21,7 @@ Reset a player's money to $0. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { SendClientMessage(playerid, 0xFFFFFFAA, "You died and lost all of your cash!"); diff --git a/frontend/docs/scripting/functions/ResetPlayerWeapons.md b/frontend/docs/scripting/functions/ResetPlayerWeapons.md index 846c6da40c9e..7ab01e42a093 100644 --- a/frontend/docs/scripting/functions/ResetPlayerWeapons.md +++ b/frontend/docs/scripting/functions/ResetPlayerWeapons.md @@ -21,7 +21,7 @@ Removes all weapons from a player. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Remove the killer's weapons @@ -30,7 +30,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/ResumeRecordingPlayback.md b/frontend/docs/scripting/functions/ResumeRecordingPlayback.md index 3939ebf5c061..ccd0ce41c01e 100644 --- a/frontend/docs/scripting/functions/ResumeRecordingPlayback.md +++ b/frontend/docs/scripting/functions/ResumeRecordingPlayback.md @@ -2,7 +2,7 @@ title: ResumeRecordingPlayback sidebar_label: ResumeRecordingPlayback description: This will resume the paused recording. -tags: [] +tags: ["npc", "recording", "playback"] --- :::warning diff --git a/frontend/docs/scripting/functions/SHA256_PassHash.md b/frontend/docs/scripting/functions/SHA256_PassHash.md index 026e146cd36a..f7a11b74d16d 100644 --- a/frontend/docs/scripting/functions/SHA256_PassHash.md +++ b/frontend/docs/scripting/functions/SHA256_PassHash.md @@ -30,7 +30,7 @@ The hash is stored in the specified array. ## Examples -```c +```pawn public OnGameModeInit() { new MyHash[64 + 1]; // + 1 to account for the required null terminator @@ -40,7 +40,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SelectObject.md b/frontend/docs/scripting/functions/SelectObject.md index e8e7d0fd35f0..9d4b06351518 100644 --- a/frontend/docs/scripting/functions/SelectObject.md +++ b/frontend/docs/scripting/functions/SelectObject.md @@ -2,7 +2,7 @@ title: SelectObject sidebar_label: SelectObject description: Display the cursor and allow the player to select an object. -tags: [] +tags: ["player", "object"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/select", true)) diff --git a/frontend/docs/scripting/functions/SelectTextDraw.md b/frontend/docs/scripting/functions/SelectTextDraw.md index 373ce8762ae8..03c65679c96c 100644 --- a/frontend/docs/scripting/functions/SelectTextDraw.md +++ b/frontend/docs/scripting/functions/SelectTextDraw.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/tdselect", true)) @@ -33,7 +33,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SendChat.md b/frontend/docs/scripting/functions/SendChat.md index 8fddc54cfa78..56f78063a2cb 100644 --- a/frontend/docs/scripting/functions/SendChat.md +++ b/frontend/docs/scripting/functions/SendChat.md @@ -2,7 +2,7 @@ title: SendChat sidebar_label: SendChat description: This will send a player text by the bot, just like using SendPlayerMessageToAll, but this function is to be used inside the NPC scripts. -tags: [] +tags: ["npc", "chat"] --- :::warning @@ -21,7 +21,7 @@ This will send a player text by the bot, just like using [SendPlayerMessageToAll ## Examples -```c +```pawn public OnPlayerDeath(playerid) { new string[80], name[MAX_PLAYER_NAME]; diff --git a/frontend/docs/scripting/functions/SendClientCheck.md b/frontend/docs/scripting/functions/SendClientCheck.md index a4cf6c8498b3..2bd36d7c3157 100644 --- a/frontend/docs/scripting/functions/SendClientCheck.md +++ b/frontend/docs/scripting/functions/SendClientCheck.md @@ -2,7 +2,7 @@ title: SendClientCheck sidebar_label: SendClientCheck description: Perform a memory check on the client. -tags: [] +tags: ["player", "anti-cheat"] --- ## Description @@ -25,7 +25,7 @@ Perform a memory check on the client. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { SendClientCheck(playerid, 0x48, 0, 0, 2); @@ -42,7 +42,7 @@ public OnClientCheckResponse(playerid, actionid, memaddr, retndata) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SendClientMessage.md b/frontend/docs/scripting/functions/SendClientMessage.md index efe059605070..e4629a6b7cb1 100644 --- a/frontend/docs/scripting/functions/SendClientMessage.md +++ b/frontend/docs/scripting/functions/SendClientMessage.md @@ -2,7 +2,7 @@ title: SendClientMessage sidebar_label: SendClientMessage description: This function sends a message to a specific player with a chosen color in the chat. -tags: [] +tags: ["player", "chat"] --- ## Description @@ -24,7 +24,7 @@ This function sends a message to a specific player with a chosen color in the ch ## Examples -```c +```pawn #define COLOR_RED 0xFF0000FF public OnPlayerConnect(playerid) @@ -48,7 +48,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/SendClientMessageToAll.md b/frontend/docs/scripting/functions/SendClientMessageToAll.md index ce87d57d3250..bcb5c6b39253 100644 --- a/frontend/docs/scripting/functions/SendClientMessageToAll.md +++ b/frontend/docs/scripting/functions/SendClientMessageToAll.md @@ -2,7 +2,7 @@ title: SendClientMessageToAll sidebar_label: SendClientMessageToAll description: Displays a message in chat to all players. -tags: [] +tags: ["player", "chat"] --- ## Description @@ -21,7 +21,7 @@ This function always returns **true (1)**. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/helloworld", true) == 0) @@ -47,7 +47,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SendClientMessageToAllf.md b/frontend/docs/scripting/functions/SendClientMessageToAllf.md index 5de3c5cd7e0b..fe007fc44d73 100644 --- a/frontend/docs/scripting/functions/SendClientMessageToAllf.md +++ b/frontend/docs/scripting/functions/SendClientMessageToAllf.md @@ -2,7 +2,7 @@ title: SendClientMessageToAllf sidebar_label: SendClientMessageToAllf description: Displays a formatted message in chat to all players. -tags: [] +tags: ["player", "chat"] --- @@ -31,7 +31,7 @@ This function always returns true (1). ## Examples -```c +```pawn #define HELLO_WORLD "Hello World" public OnPlayerCommandText(playerid, cmdtext[]) diff --git a/frontend/docs/scripting/functions/SendClientMessagef.md b/frontend/docs/scripting/functions/SendClientMessagef.md index 8c79ad161b73..22779de0e46b 100644 --- a/frontend/docs/scripting/functions/SendClientMessagef.md +++ b/frontend/docs/scripting/functions/SendClientMessagef.md @@ -2,7 +2,7 @@ title: SendClientMessagef sidebar_label: SendClientMessagef description: This function sends a formatted message to a specific player with a chosen color in the chat. -tags: [] +tags: ["player", "chat"] --- @@ -48,7 +48,7 @@ This function sends a formatted message to a specific player with a chosen color ## Examples -```c +```pawn #define COLOR_RED 0xFF0000FF public OnPlayerConnect(playerid) @@ -59,7 +59,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/SendCommand.md b/frontend/docs/scripting/functions/SendCommand.md index a0e1130ee487..9d8f156a1e94 100644 --- a/frontend/docs/scripting/functions/SendCommand.md +++ b/frontend/docs/scripting/functions/SendCommand.md @@ -2,7 +2,7 @@ title: SendCommand sidebar_label: SendCommand description: This will force the NPC to write a desired command, and this way, getting the effects it would produce. -tags: [] +tags: ["npc", "chat"] --- :::warning @@ -23,7 +23,7 @@ This will force the NPC to write a desired command, and this way, getting the ef ## Examples -```c +```pawn public OnPlayerText(playerid, text[]) { if (strfind(text, "stupid bot") != -1) diff --git a/frontend/docs/scripting/functions/SendDeathMessage.md b/frontend/docs/scripting/functions/SendDeathMessage.md index 1d51e6c9951e..37988fc585bd 100644 --- a/frontend/docs/scripting/functions/SendDeathMessage.md +++ b/frontend/docs/scripting/functions/SendDeathMessage.md @@ -2,7 +2,7 @@ title: SendDeathMessage sidebar_label: SendDeathMessage description: Adds a death to the 'killfeed' on the right-hand side of the screen for all players. -tags: [] +tags: ["player", "death"] --- ## Description @@ -29,7 +29,7 @@ If `weapon` is invalid, a generic skull-and-crossbones icon is shown. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { SendDeathMessage(killerid, playerid, reason); @@ -37,7 +37,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/SendDeathMessageToPlayer.md b/frontend/docs/scripting/functions/SendDeathMessageToPlayer.md index 59408ea52cbf..e1c71a3f73be 100644 --- a/frontend/docs/scripting/functions/SendDeathMessageToPlayer.md +++ b/frontend/docs/scripting/functions/SendDeathMessageToPlayer.md @@ -26,7 +26,7 @@ The 5 most recent kills are shown on the right side of players' screens. Pressin ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Sends a death message to "playerid" shows that "killerid" killed "playerid" for "reason" diff --git a/frontend/docs/scripting/functions/SendPlayerMessageToAll.md b/frontend/docs/scripting/functions/SendPlayerMessageToAll.md index 1e7e4f520f91..22beeb68942e 100644 --- a/frontend/docs/scripting/functions/SendPlayerMessageToAll.md +++ b/frontend/docs/scripting/functions/SendPlayerMessageToAll.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerText(playerid, text[]) { // format a message to contain the player's id in front of it @@ -35,7 +35,7 @@ public OnPlayerText(playerid, text[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SendPlayerMessageToPlayer.md b/frontend/docs/scripting/functions/SendPlayerMessageToPlayer.md index fbd2b70cdf76..5a0940fee3d2 100644 --- a/frontend/docs/scripting/functions/SendPlayerMessageToPlayer.md +++ b/frontend/docs/scripting/functions/SendPlayerMessageToPlayer.md @@ -24,7 +24,7 @@ Sends a message in the name of a player to another player on the server. The mes ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/hello", true)) @@ -37,7 +37,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SendRconCommand.md b/frontend/docs/scripting/functions/SendRconCommand.md index 48e582ff6d48..8ee38a2edfd8 100644 --- a/frontend/docs/scripting/functions/SendRconCommand.md +++ b/frontend/docs/scripting/functions/SendRconCommand.md @@ -20,7 +20,7 @@ This function always returns **1**. ## Examples -```c +```pawn SendRconCommand("gmx"); // This is a scripted version of typing "/rcon gmx" in-game. // GMX restarts the game mode. @@ -35,7 +35,7 @@ SendRconCommand(szCmd); SendRconCommand("game.map %s", szMapName); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/Set3DTextLabelDrawDistance.md b/frontend/docs/scripting/functions/Set3DTextLabelDrawDistance.md index 7da11833a9c1..f6edb506f159 100644 --- a/frontend/docs/scripting/functions/Set3DTextLabelDrawDistance.md +++ b/frontend/docs/scripting/functions/Set3DTextLabelDrawDistance.md @@ -22,7 +22,7 @@ This function always returns true. ## Examples -```c +```pawn new Text3D:gMyLabel; gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 0, false); diff --git a/frontend/docs/scripting/functions/Set3DTextLabelLOS.md b/frontend/docs/scripting/functions/Set3DTextLabelLOS.md index 3c534d25fb99..75bf3b7c8fd2 100644 --- a/frontend/docs/scripting/functions/Set3DTextLabelLOS.md +++ b/frontend/docs/scripting/functions/Set3DTextLabelLOS.md @@ -18,7 +18,7 @@ Sets the 3D text label line-of-sight. ## Examples -```c +```pawn new Text3D:gMyLabel; gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, true); diff --git a/frontend/docs/scripting/functions/Set3DTextLabelVirtualWorld.md b/frontend/docs/scripting/functions/Set3DTextLabelVirtualWorld.md index e9af0e45e5cb..2628fb5b0d8e 100644 --- a/frontend/docs/scripting/functions/Set3DTextLabelVirtualWorld.md +++ b/frontend/docs/scripting/functions/Set3DTextLabelVirtualWorld.md @@ -18,7 +18,7 @@ Sets the 3D text label virtual world id. ## Examples -```c +```pawn new Text3D:gMyLabel; gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 20, false); diff --git a/frontend/docs/scripting/functions/SetActorFacingAngle.md b/frontend/docs/scripting/functions/SetActorFacingAngle.md index 14ada59b8fb3..e13718669d93 100644 --- a/frontend/docs/scripting/functions/SetActorFacingAngle.md +++ b/frontend/docs/scripting/functions/SetActorFacingAngle.md @@ -24,7 +24,7 @@ Set the facing angle of an actor. ## Examples -```c +```pawn new MyActor; public OnGameModeInit() @@ -37,7 +37,7 @@ public OnGameModeInit() SetActorFacingAngle(MyActor, 180.0); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetActorHealth.md b/frontend/docs/scripting/functions/SetActorHealth.md index 8a448672bcea..3b2058341013 100644 --- a/frontend/docs/scripting/functions/SetActorHealth.md +++ b/frontend/docs/scripting/functions/SetActorHealth.md @@ -24,7 +24,7 @@ Set the health of an actor. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetActorInvulnerable.md b/frontend/docs/scripting/functions/SetActorInvulnerable.md index a1d269555e65..ccad0e55a56b 100644 --- a/frontend/docs/scripting/functions/SetActorInvulnerable.md +++ b/frontend/docs/scripting/functions/SetActorInvulnerable.md @@ -24,7 +24,7 @@ Toggle an actor's invulnerability. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() @@ -35,7 +35,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetActorPos.md b/frontend/docs/scripting/functions/SetActorPos.md index 5ea5050b426c..2a56a6e1271c 100644 --- a/frontend/docs/scripting/functions/SetActorPos.md +++ b/frontend/docs/scripting/functions/SetActorPos.md @@ -26,7 +26,7 @@ Set the position of an actor. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() @@ -39,7 +39,7 @@ public OnGameModeInit() SetActorPos(gMyActor, 2062.2332, -1908.1423, 13.5485); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetActorSkin.md b/frontend/docs/scripting/functions/SetActorSkin.md index f0ccbd9a2f70..506a2c9738fc 100644 --- a/frontend/docs/scripting/functions/SetActorSkin.md +++ b/frontend/docs/scripting/functions/SetActorSkin.md @@ -24,7 +24,7 @@ Set the skin of the actor. ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetActorVirtualWorld.md b/frontend/docs/scripting/functions/SetActorVirtualWorld.md index 8b2e95c435d2..8a4214d47ef9 100644 --- a/frontend/docs/scripting/functions/SetActorVirtualWorld.md +++ b/frontend/docs/scripting/functions/SetActorVirtualWorld.md @@ -24,7 +24,7 @@ Set the virtual world of an actor. Only players in the same world will see the a ## Examples -```c +```pawn new gMyActor; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetCameraBehindPlayer.md b/frontend/docs/scripting/functions/SetCameraBehindPlayer.md index c373e92f3c05..f9307e2cf51e 100644 --- a/frontend/docs/scripting/functions/SetCameraBehindPlayer.md +++ b/frontend/docs/scripting/functions/SetCameraBehindPlayer.md @@ -21,7 +21,7 @@ Restore the camera to a place behind the player, after using a function like Set ## Examples -```c +```pawn SetCameraBehindPlayer(playerid); ``` diff --git a/frontend/docs/scripting/functions/SetDeathDropAmount.md b/frontend/docs/scripting/functions/SetDeathDropAmount.md index fe63e72b7e00..3394b5f9ee2b 100644 --- a/frontend/docs/scripting/functions/SetDeathDropAmount.md +++ b/frontend/docs/scripting/functions/SetDeathDropAmount.md @@ -2,7 +2,7 @@ title: SetDeathDropAmount sidebar_label: SetDeathDropAmount description: Sets death drops money. -tags: [] +tags: ["player", "death", "money"] --- :::warning @@ -25,7 +25,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { SetDeathDropAmount(5000); @@ -33,7 +33,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetGameModeText.md b/frontend/docs/scripting/functions/SetGameModeText.md index 3ec0d7b75cd8..04426313018d 100644 --- a/frontend/docs/scripting/functions/SetGameModeText.md +++ b/frontend/docs/scripting/functions/SetGameModeText.md @@ -2,7 +2,7 @@ title: SetGameModeText sidebar_label: SetGameModeText description: Set the name of the game mode, which appears in the server browser. -tags: [] +tags: ["gamemode", "server"] --- ## Description @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { SetGameModeText("Team Deathmatch"); @@ -30,7 +30,7 @@ public OnGameModeInit()
-```c +```pawn #define GAME_MODE_VERSION "1.5.0" public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetGravity.md b/frontend/docs/scripting/functions/SetGravity.md index fd891700671b..81336e69477e 100644 --- a/frontend/docs/scripting/functions/SetGravity.md +++ b/frontend/docs/scripting/functions/SetGravity.md @@ -2,7 +2,7 @@ title: SetGravity sidebar_label: SetGravity description: Set the gravity for all players. -tags: [] +tags: ["world", "gravity"] --- ## Description @@ -19,7 +19,7 @@ This function always returns **1**, even when it fails to execute if the gravity ## Examples -```c +```pawn public OnGameModeInit() { // Set moon-like gravity @@ -29,7 +29,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetMenuColumnHeader.md b/frontend/docs/scripting/functions/SetMenuColumnHeader.md index e05f61bf5d74..ba861f90ebd5 100644 --- a/frontend/docs/scripting/functions/SetMenuColumnHeader.md +++ b/frontend/docs/scripting/functions/SetMenuColumnHeader.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Menu:gTestMenu; // There are two rows in this menu @@ -35,7 +35,7 @@ AddMenuItem(gTestMenu, 0, "Row1 Item1"); AddMenuItem(gTestMenu, 1, "Row2 Item1"); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetModeRestartTime.md b/frontend/docs/scripting/functions/SetModeRestartTime.md index 2a941e1ae5cb..9ff5067f775f 100644 --- a/frontend/docs/scripting/functions/SetModeRestartTime.md +++ b/frontend/docs/scripting/functions/SetModeRestartTime.md @@ -2,7 +2,7 @@ title: SetModeRestartTime sidebar_label: SetModeRestartTime description: Sets the delay between loading main scripts, in seconds. -tags: [] +tags: ["gamemode", "server"] --- @@ -25,7 +25,7 @@ Sets the delay between loading main scripts, in seconds. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/restart", true)) @@ -43,7 +43,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetMyFacingAngle.md b/frontend/docs/scripting/functions/SetMyFacingAngle.md index b6815f9ec2c1..1dcb068122b7 100644 --- a/frontend/docs/scripting/functions/SetMyFacingAngle.md +++ b/frontend/docs/scripting/functions/SetMyFacingAngle.md @@ -2,7 +2,7 @@ title: SetMyFacingAngle sidebar_label: SetMyFacingAngle description: Set the NPC's facing angle. -tags: [] +tags: ["npc", "angle"] --- :::warning @@ -21,11 +21,11 @@ Set the NPC's facing angle. ## Examples -```c +```pawn SetMyFacingAngle(0); //NPC faces north ``` -```c +```pawn north (0) | (90) west- -east (270) diff --git a/frontend/docs/scripting/functions/SetMyPos.md b/frontend/docs/scripting/functions/SetMyPos.md index 4b556c855751..1de710ca110a 100644 --- a/frontend/docs/scripting/functions/SetMyPos.md +++ b/frontend/docs/scripting/functions/SetMyPos.md @@ -27,7 +27,7 @@ This function does not return any specific values. ## Example -```c +```pawn SetMyPos(0.0, 0.0, 3.0); ``` diff --git a/frontend/docs/scripting/functions/SetNameTagDrawDistance.md b/frontend/docs/scripting/functions/SetNameTagDrawDistance.md index 78626a895b4b..c4bb01bfa96c 100644 --- a/frontend/docs/scripting/functions/SetNameTagDrawDistance.md +++ b/frontend/docs/scripting/functions/SetNameTagDrawDistance.md @@ -2,7 +2,7 @@ title: SetNameTagDrawDistance sidebar_label: SetNameTagDrawDistance description: Set the maximum distance to display the names of players. -tags: [] +tags: ["player", "nametag"] --- ## Description @@ -19,11 +19,11 @@ This function does not return any specific values. ## Examples -```c +```pawn SetNameTagDrawDistance(20.0); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetObjectMaterial.md b/frontend/docs/scripting/functions/SetObjectMaterial.md index 1bf0c83dcde7..013c8f11c601 100644 --- a/frontend/docs/scripting/functions/SetObjectMaterial.md +++ b/frontend/docs/scripting/functions/SetObjectMaterial.md @@ -26,7 +26,7 @@ Replace the texture of an object with the texture from another model in the game ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/mycommand", true)) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetObjectMaterialText.md b/frontend/docs/scripting/functions/SetObjectMaterialText.md index 00c1d34d2c66..69574ecb8766 100644 --- a/frontend/docs/scripting/functions/SetObjectMaterialText.md +++ b/frontend/docs/scripting/functions/SetObjectMaterialText.md @@ -31,7 +31,7 @@ Replace the texture of an object with text. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/text", cmdtext, true) == 0) @@ -45,7 +45,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/SetObjectMoveSpeed.md b/frontend/docs/scripting/functions/SetObjectMoveSpeed.md index 2724be45d55b..3099a80fa11f 100644 --- a/frontend/docs/scripting/functions/SetObjectMoveSpeed.md +++ b/frontend/docs/scripting/functions/SetObjectMoveSpeed.md @@ -24,7 +24,7 @@ Set the move speed of an object. ## Examples -```c +```pawn new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); MoveObject(objectid, 1003.3915, -643.3342, 114.5122, 0.8); diff --git a/frontend/docs/scripting/functions/SetObjectNoCameraCol.md b/frontend/docs/scripting/functions/SetObjectNoCameraCol.md index 70fdc02e7288..41af01f6c48b 100644 --- a/frontend/docs/scripting/functions/SetObjectNoCameraCol.md +++ b/frontend/docs/scripting/functions/SetObjectNoCameraCol.md @@ -23,7 +23,7 @@ Disable collisions between players' cameras and the specified object. ## Examples -```c +```pawn public OnObjectMoved(objectid) { new Float:objX, Float:objY, Float:objZ; @@ -36,7 +36,7 @@ public OnObjectMoved(objectid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetObjectNoCameraCollision.md b/frontend/docs/scripting/functions/SetObjectNoCameraCollision.md index 4753d8b4542b..e671c355fbb5 100644 --- a/frontend/docs/scripting/functions/SetObjectNoCameraCollision.md +++ b/frontend/docs/scripting/functions/SetObjectNoCameraCollision.md @@ -23,7 +23,7 @@ Disable collisions between players' cameras and the specified object. ## Examples -```c +```pawn public OnObjectMoved(objectid) { new Float:objX, Float:objY, Float:objZ; @@ -36,7 +36,7 @@ public OnObjectMoved(objectid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetObjectPos.md b/frontend/docs/scripting/functions/SetObjectPos.md index d36424c70bb5..f6444a8fdc47 100644 --- a/frontend/docs/scripting/functions/SetObjectPos.md +++ b/frontend/docs/scripting/functions/SetObjectPos.md @@ -22,7 +22,7 @@ This function always returns **true**, even if the object specified does not exi ## Examples -```c +```pawn SetObjectPos(objectid, 2001.195679, 1547.113892, 14.283400); ``` diff --git a/frontend/docs/scripting/functions/SetObjectRot.md b/frontend/docs/scripting/functions/SetObjectRot.md index a89216be5f72..1f42e29ba1a1 100644 --- a/frontend/docs/scripting/functions/SetObjectRot.md +++ b/frontend/docs/scripting/functions/SetObjectRot.md @@ -22,7 +22,7 @@ This function always returns **1**, even if the object doesn't exist. ## Examples -```c +```pawn public OnGameModeInit() { new objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); diff --git a/frontend/docs/scripting/functions/SetObjectsDefaultCameraCol.md b/frontend/docs/scripting/functions/SetObjectsDefaultCameraCol.md index e04358f70f3f..8cd02ec6e203 100644 --- a/frontend/docs/scripting/functions/SetObjectsDefaultCameraCol.md +++ b/frontend/docs/scripting/functions/SetObjectsDefaultCameraCol.md @@ -23,7 +23,7 @@ This function only affects the camera collision of objects created AFTER its use ## Examples -```c +```pawn public OnGameModeInit() { // Disable camera collision @@ -54,7 +54,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetObjectsDefaultCameraCollision.md b/frontend/docs/scripting/functions/SetObjectsDefaultCameraCollision.md index 5af1736200cf..df8d34566a92 100644 --- a/frontend/docs/scripting/functions/SetObjectsDefaultCameraCollision.md +++ b/frontend/docs/scripting/functions/SetObjectsDefaultCameraCollision.md @@ -23,7 +23,7 @@ This function only affects the camera collision of objects created AFTER its use ## Examples -```c +```pawn public OnGameModeInit() { // Disable camera collision @@ -54,7 +54,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPVarFloat.md b/frontend/docs/scripting/functions/SetPVarFloat.md index 1235a68264ad..5c6d01f1aab9 100644 --- a/frontend/docs/scripting/functions/SetPVarFloat.md +++ b/frontend/docs/scripting/functions/SetPVarFloat.md @@ -23,7 +23,7 @@ Set a float player variable's value. ## Examples -```c +```pawn SavePlayerPos(playerid) { new Float:x, Float:y, Float:z; @@ -36,7 +36,7 @@ SavePlayerPos(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPVarInt.md b/frontend/docs/scripting/functions/SetPVarInt.md index de432328dcc5..c151b16a7f7a 100644 --- a/frontend/docs/scripting/functions/SetPVarInt.md +++ b/frontend/docs/scripting/functions/SetPVarInt.md @@ -23,7 +23,7 @@ Set an integer player variable. ## Examples -```c +```pawn // set GetPlayerMoney the value of player variable named "Money" SetPVarInt(playerid, "Money", GetPlayerMoney(playerid)); @@ -31,7 +31,7 @@ SetPVarInt(playerid, "Money", GetPlayerMoney(playerid)); printf("money: %d", GetPVarInt(playerid, "Money")); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPVarString.md b/frontend/docs/scripting/functions/SetPVarString.md index 1c1f1d1ab999..b24cdc80670a 100644 --- a/frontend/docs/scripting/functions/SetPVarString.md +++ b/frontend/docs/scripting/functions/SetPVarString.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { new @@ -41,7 +41,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPickupForPlayer.md b/frontend/docs/scripting/functions/SetPickupForPlayer.md index df73a589b37d..c537bba92080 100644 --- a/frontend/docs/scripting/functions/SetPickupForPlayer.md +++ b/frontend/docs/scripting/functions/SetPickupForPlayer.md @@ -33,7 +33,7 @@ This function always returns **true**. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetPickupModel.md b/frontend/docs/scripting/functions/SetPickupModel.md index 8f9b7f7cfea3..6ba776c3ed5c 100644 --- a/frontend/docs/scripting/functions/SetPickupModel.md +++ b/frontend/docs/scripting/functions/SetPickupModel.md @@ -23,7 +23,7 @@ This function always returns **true**. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetPickupPos.md b/frontend/docs/scripting/functions/SetPickupPos.md index 4e12f1f3f28e..4514ba7e193a 100644 --- a/frontend/docs/scripting/functions/SetPickupPos.md +++ b/frontend/docs/scripting/functions/SetPickupPos.md @@ -25,7 +25,7 @@ This function always returns **true**. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetPickupType.md b/frontend/docs/scripting/functions/SetPickupType.md index 884b452e0f6c..1bb73c7940dc 100644 --- a/frontend/docs/scripting/functions/SetPickupType.md +++ b/frontend/docs/scripting/functions/SetPickupType.md @@ -23,7 +23,7 @@ This function always returns **true**. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetPickupVirtualWorld.md b/frontend/docs/scripting/functions/SetPickupVirtualWorld.md index ffe95148c432..38354d51b5ab 100644 --- a/frontend/docs/scripting/functions/SetPickupVirtualWorld.md +++ b/frontend/docs/scripting/functions/SetPickupVirtualWorld.md @@ -22,7 +22,7 @@ This function always returns **true**. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md b/frontend/docs/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md index c0c315bee7ab..01822ddb7c57 100644 --- a/frontend/docs/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md +++ b/frontend/docs/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md @@ -19,7 +19,7 @@ Sets the player's 3D text label virtual world id. ## Examples -```c +```pawn new PlayerText3D:playerTextId; new Float:X, Float:Y, Float:Z; @@ -29,7 +29,7 @@ playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", SetPlayer3DTextLabelVirtualWorld(playerid, playerTextId, 60); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerAdmin.md b/frontend/docs/scripting/functions/SetPlayerAdmin.md index 752a6e4a6d8d..2a60d111a7cc 100644 --- a/frontend/docs/scripting/functions/SetPlayerAdmin.md +++ b/frontend/docs/scripting/functions/SetPlayerAdmin.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/admin", true)) diff --git a/frontend/docs/scripting/functions/SetPlayerAmmo.md b/frontend/docs/scripting/functions/SetPlayerAmmo.md index c479ce4154a8..3e66f422f1f7 100644 --- a/frontend/docs/scripting/functions/SetPlayerAmmo.md +++ b/frontend/docs/scripting/functions/SetPlayerAmmo.md @@ -23,11 +23,11 @@ Set the ammo of a player's weapon. ## Examples -```c +```pawn SetPlayerAmmo(playerid, WEAPON_SHOTGUN, 100); // Set ammo of Shotgun to 100 bullets ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerArmedWeapon.md b/frontend/docs/scripting/functions/SetPlayerArmedWeapon.md index a935e64cfb54..8691f22f6de6 100644 --- a/frontend/docs/scripting/functions/SetPlayerArmedWeapon.md +++ b/frontend/docs/scripting/functions/SetPlayerArmedWeapon.md @@ -22,7 +22,7 @@ Sets which weapon (that a player already has) the player is holding. ## Examples -```c +```pawn public OnPlayerUpdate(playerid) { SetPlayerArmedWeapon(playerid, WEAPON_FIST); // disables weapons @@ -30,7 +30,7 @@ public OnPlayerUpdate(playerid) } ``` -```c +```pawn // SMG driveby by [03]Garsino public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { @@ -47,7 +47,7 @@ public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstat } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerArmour.md b/frontend/docs/scripting/functions/SetPlayerArmour.md index 0c8a4ab34d6e..f12b0aa991e5 100644 --- a/frontend/docs/scripting/functions/SetPlayerArmour.md +++ b/frontend/docs/scripting/functions/SetPlayerArmour.md @@ -22,7 +22,7 @@ Set a player's armor level. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { // Give players full armour (100%) when they spawn. @@ -31,7 +31,7 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerAttachedObject.md b/frontend/docs/scripting/functions/SetPlayerAttachedObject.md index 80013f09e519..626cdb24a366 100644 --- a/frontend/docs/scripting/functions/SetPlayerAttachedObject.md +++ b/frontend/docs/scripting/functions/SetPlayerAttachedObject.md @@ -33,7 +33,7 @@ Attach an object to a specific bone on a player. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { SetPlayerAttachedObject(playerid, 3, 1609, 2); // Attach a turtle to the playerid's head, in slot 3 @@ -45,7 +45,7 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerCameraLookAt.md b/frontend/docs/scripting/functions/SetPlayerCameraLookAt.md index a111d9b1bdfd..7a73a2c64a30 100644 --- a/frontend/docs/scripting/functions/SetPlayerCameraLookAt.md +++ b/frontend/docs/scripting/functions/SetPlayerCameraLookAt.md @@ -25,12 +25,12 @@ Set the direction a player's camera looks at. Generally meant to be used in comb ## Examples -```c +```pawn SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0); SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerCameraPos.md b/frontend/docs/scripting/functions/SetPlayerCameraPos.md index c22f339c7765..a7005c6fcf17 100644 --- a/frontend/docs/scripting/functions/SetPlayerCameraPos.md +++ b/frontend/docs/scripting/functions/SetPlayerCameraPos.md @@ -24,11 +24,11 @@ Sets the camera to a specific position for a player. ## Examples -```c +```pawn SetPlayerCameraPos(playerid, 652.23, 457.21, 10.84); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/SetPlayerChatBubble.md b/frontend/docs/scripting/functions/SetPlayerChatBubble.md index 5b0ae2ac753e..432abff1e4bf 100644 --- a/frontend/docs/scripting/functions/SetPlayerChatBubble.md +++ b/frontend/docs/scripting/functions/SetPlayerChatBubble.md @@ -24,7 +24,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerText(playerid, text[]) { SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000); @@ -32,7 +32,7 @@ public OnPlayerText(playerid, text[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerCheckpoint.md b/frontend/docs/scripting/functions/SetPlayerCheckpoint.md index 2451a044709f..77426657d5b0 100644 --- a/frontend/docs/scripting/functions/SetPlayerCheckpoint.md +++ b/frontend/docs/scripting/functions/SetPlayerCheckpoint.md @@ -25,7 +25,7 @@ Sets a checkpoint (red cylinder) for a player. Also shows a red blip on the rada ## Examples -```c +```pawn // In this example the player's checkpoint will be set when they spawn. // On entering the checkpoint they will receive $1000 and the checkpoint will be disabled. @@ -50,7 +50,7 @@ public OnPlayerEnterCheckpoint(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerColor.md b/frontend/docs/scripting/functions/SetPlayerColor.md index 064ee67db8ed..e99fb9db5116 100644 --- a/frontend/docs/scripting/functions/SetPlayerColor.md +++ b/frontend/docs/scripting/functions/SetPlayerColor.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn // Red, using hexadecimal notation: SetPlayerColor(playerid, 0xFF0000FF); @@ -28,7 +28,7 @@ SetPlayerColor(playerid, 0xFF0000FF); SetPlayerColor(playerid, 4278190335); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerDrunkLevel.md b/frontend/docs/scripting/functions/SetPlayerDrunkLevel.md index 02a73c923302..20ab1dfb68ce 100644 --- a/frontend/docs/scripting/functions/SetPlayerDrunkLevel.md +++ b/frontend/docs/scripting/functions/SetPlayerDrunkLevel.md @@ -22,7 +22,7 @@ Sets the drunk level of a player which makes the player's camera sway and vehicl ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/drunk", true) == 0) @@ -35,7 +35,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerFacingAngle.md b/frontend/docs/scripting/functions/SetPlayerFacingAngle.md index 8d8aa206e143..cf6519b6ed7b 100644 --- a/frontend/docs/scripting/functions/SetPlayerFacingAngle.md +++ b/frontend/docs/scripting/functions/SetPlayerFacingAngle.md @@ -22,7 +22,7 @@ Set a player's facing angle (Z rotation). ## Examples -```c +```pawn SetPlayerFacingAngle(playerid, 0.0); //Player faces north ``` @@ -34,7 +34,7 @@ SetPlayerFacingAngle(playerid, 0.0); //Player faces north south (180) ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerFightingStyle.md b/frontend/docs/scripting/functions/SetPlayerFightingStyle.md index 7c34f399145e..aa90e068ec85 100644 --- a/frontend/docs/scripting/functions/SetPlayerFightingStyle.md +++ b/frontend/docs/scripting/functions/SetPlayerFightingStyle.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/boxing", true) == 0) @@ -33,7 +33,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerGravity.md b/frontend/docs/scripting/functions/SetPlayerGravity.md index c37cf454f663..1415b5cfb348 100644 --- a/frontend/docs/scripting/functions/SetPlayerGravity.md +++ b/frontend/docs/scripting/functions/SetPlayerGravity.md @@ -24,7 +24,7 @@ Set a player's gravity. ## Examples -```c +```pawn public OnPlayerConnect(playerid) { // Set moon-like gravity @@ -34,7 +34,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerHealth.md b/frontend/docs/scripting/functions/SetPlayerHealth.md index ac1879c7541f..969551807480 100644 --- a/frontend/docs/scripting/functions/SetPlayerHealth.md +++ b/frontend/docs/scripting/functions/SetPlayerHealth.md @@ -22,7 +22,7 @@ Set the health of a player. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/heal", cmdtext, true)) @@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerHoldingObject.md b/frontend/docs/scripting/functions/SetPlayerHoldingObject.md index 14ff0802a598..ee98979e892a 100644 --- a/frontend/docs/scripting/functions/SetPlayerHoldingObject.md +++ b/frontend/docs/scripting/functions/SetPlayerHoldingObject.md @@ -27,7 +27,7 @@ Attaches an object to a bone. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { SetPlayerHoldingObject(playerid, 1609, 2); //Attach a turtle to the playerid's head! @@ -35,7 +35,7 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerInterior.md b/frontend/docs/scripting/functions/SetPlayerInterior.md index 3b4605d87790..60b868450021 100644 --- a/frontend/docs/scripting/functions/SetPlayerInterior.md +++ b/frontend/docs/scripting/functions/SetPlayerInterior.md @@ -22,7 +22,7 @@ Set a player's interior. A list of currently known interiors and their positions ## Examples -```c +```pawn // Set player to default interior (outside) SetPlayerInterior(playerid, 0); ``` diff --git a/frontend/docs/scripting/functions/SetPlayerMapIcon.md b/frontend/docs/scripting/functions/SetPlayerMapIcon.md index 5037357ce749..5bcf3af41db8 100644 --- a/frontend/docs/scripting/functions/SetPlayerMapIcon.md +++ b/frontend/docs/scripting/functions/SetPlayerMapIcon.md @@ -28,7 +28,7 @@ Place an icon/marker on a player's map. Can be used to mark locations such as ba ## Examples -```c +```pawn public OnPlayerConnect(playerid) { // This example demonstrates how to create a dollar-icon on top of a 24/7 located @@ -37,7 +37,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerMarkerForPlayer.md b/frontend/docs/scripting/functions/SetPlayerMarkerForPlayer.md index 056b52f36a44..95cb6c84df0f 100644 --- a/frontend/docs/scripting/functions/SetPlayerMarkerForPlayer.md +++ b/frontend/docs/scripting/functions/SetPlayerMarkerForPlayer.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn // Make player 42 see player 1 as a red marker SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF); diff --git a/frontend/docs/scripting/functions/SetPlayerName.md b/frontend/docs/scripting/functions/SetPlayerName.md index eada9b838ab9..0c3a689ad15d 100644 --- a/frontend/docs/scripting/functions/SetPlayerName.md +++ b/frontend/docs/scripting/functions/SetPlayerName.md @@ -24,7 +24,7 @@ Sets the name of a player. ## Examples -```c +```pawn // Command simply sets the player's name to to "Superman" if possible, with no error checking or messages. if (strcmp(cmdtext, "/superman", true) == 0) { @@ -55,7 +55,7 @@ if (strcmp(cmdtext, "/superman", true) == 0) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerObjectMaterial.md b/frontend/docs/scripting/functions/SetPlayerObjectMaterial.md index b371e0b2e2b6..10aaedaec66b 100644 --- a/frontend/docs/scripting/functions/SetPlayerObjectMaterial.md +++ b/frontend/docs/scripting/functions/SetPlayerObjectMaterial.md @@ -25,7 +25,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/objmat", true)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerObjectMaterialText.md b/frontend/docs/scripting/functions/SetPlayerObjectMaterialText.md index 2d42a1fb2c63..ca89076757aa 100644 --- a/frontend/docs/scripting/functions/SetPlayerObjectMaterialText.md +++ b/frontend/docs/scripting/functions/SetPlayerObjectMaterialText.md @@ -30,7 +30,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/text", cmdtext, true) == 0) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/SetPlayerObjectMoveSpeed.md b/frontend/docs/scripting/functions/SetPlayerObjectMoveSpeed.md index 63309a926be0..78aa4489ac24 100644 --- a/frontend/docs/scripting/functions/SetPlayerObjectMoveSpeed.md +++ b/frontend/docs/scripting/functions/SetPlayerObjectMoveSpeed.md @@ -25,7 +25,7 @@ Set the move speed of a player-object. ## Examples -```c +```pawn new playerobjectid = CreatePlayerObject(playerid, 985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); MovePlayerObject(playerid, playerobjectid, 1003.3915, -643.3342, 114.5122, 0.8); diff --git a/frontend/docs/scripting/functions/SetPlayerObjectNoCameraCol.md b/frontend/docs/scripting/functions/SetPlayerObjectNoCameraCol.md index 9fe5cb15e05d..38ddb47a4e22 100644 --- a/frontend/docs/scripting/functions/SetPlayerObjectNoCameraCol.md +++ b/frontend/docs/scripting/functions/SetPlayerObjectNoCameraCol.md @@ -24,7 +24,7 @@ Toggles a player object camera collision. ## Examples -```c +```pawn public OnPlayerObjectMoved(playerid, objectid) { new Float:objX, Float:objY, Float:objZ; @@ -37,7 +37,7 @@ public OnPlayerObjectMoved(playerid, objectid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerObjectNoCameraCollision.md b/frontend/docs/scripting/functions/SetPlayerObjectNoCameraCollision.md index edcf22010c0b..e64cc4938c47 100644 --- a/frontend/docs/scripting/functions/SetPlayerObjectNoCameraCollision.md +++ b/frontend/docs/scripting/functions/SetPlayerObjectNoCameraCollision.md @@ -24,7 +24,7 @@ Toggles a player object camera collision. ## Examples -```c +```pawn public OnPlayerObjectMoved(playerid, objectid) { new Float:objX, Float:objY, Float:objZ; @@ -37,7 +37,7 @@ public OnPlayerObjectMoved(playerid, objectid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerObjectPos.md b/frontend/docs/scripting/functions/SetPlayerObjectPos.md index 17487a033ce8..13694e43bc02 100644 --- a/frontend/docs/scripting/functions/SetPlayerObjectPos.md +++ b/frontend/docs/scripting/functions/SetPlayerObjectPos.md @@ -25,7 +25,7 @@ Sets the position of a player-object to the specified coordinates. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/SetPlayerObjectRot.md b/frontend/docs/scripting/functions/SetPlayerObjectRot.md index 20ecf59e07d8..d52b3ce1e007 100644 --- a/frontend/docs/scripting/functions/SetPlayerObjectRot.md +++ b/frontend/docs/scripting/functions/SetPlayerObjectRot.md @@ -25,7 +25,7 @@ Set the rotation of an object on the X, Y and Z axis. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) @@ -37,7 +37,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/SetPlayerPickupModel.md b/frontend/docs/scripting/functions/SetPlayerPickupModel.md index e1f05f21a7eb..6984e86baf51 100644 --- a/frontend/docs/scripting/functions/SetPlayerPickupModel.md +++ b/frontend/docs/scripting/functions/SetPlayerPickupModel.md @@ -24,7 +24,7 @@ This function always returns **true**. ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/SetPlayerPickupPos.md b/frontend/docs/scripting/functions/SetPlayerPickupPos.md index 90ec1a89f44c..1903d94e867b 100644 --- a/frontend/docs/scripting/functions/SetPlayerPickupPos.md +++ b/frontend/docs/scripting/functions/SetPlayerPickupPos.md @@ -26,7 +26,7 @@ This function always returns **true**. ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/SetPlayerPickupType.md b/frontend/docs/scripting/functions/SetPlayerPickupType.md index 46a2f18e34b7..a541e4f3e0e2 100644 --- a/frontend/docs/scripting/functions/SetPlayerPickupType.md +++ b/frontend/docs/scripting/functions/SetPlayerPickupType.md @@ -24,7 +24,7 @@ This function always returns **true**. ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/SetPlayerPickupVirtualWorld.md b/frontend/docs/scripting/functions/SetPlayerPickupVirtualWorld.md index 298868208a85..f7c9c5640e46 100644 --- a/frontend/docs/scripting/functions/SetPlayerPickupVirtualWorld.md +++ b/frontend/docs/scripting/functions/SetPlayerPickupVirtualWorld.md @@ -23,7 +23,7 @@ This function always returns **true**. ## Examples -```c +```pawn new PlayerPickup[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/SetPlayerPos.md b/frontend/docs/scripting/functions/SetPlayerPos.md index afe7699d4b7e..a956dd6209e0 100644 --- a/frontend/docs/scripting/functions/SetPlayerPos.md +++ b/frontend/docs/scripting/functions/SetPlayerPos.md @@ -24,7 +24,7 @@ Set a player's position. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/middle", true)) @@ -37,7 +37,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerPosFindZ.md b/frontend/docs/scripting/functions/SetPlayerPosFindZ.md index 902691ff4d5d..9c9e59ccdaed 100644 --- a/frontend/docs/scripting/functions/SetPlayerPosFindZ.md +++ b/frontend/docs/scripting/functions/SetPlayerPosFindZ.md @@ -24,11 +24,11 @@ This sets the players position then adjusts the players z-coordinate to the near ## Examples -```c +```pawn SetPlayerPosFindZ(playerid, 1234.5, 1234.5, 1000.0); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerRaceCheckpoint.md b/frontend/docs/scripting/functions/SetPlayerRaceCheckpoint.md index caad1071a0d5..8503fc94cb77 100644 --- a/frontend/docs/scripting/functions/SetPlayerRaceCheckpoint.md +++ b/frontend/docs/scripting/functions/SetPlayerRaceCheckpoint.md @@ -29,13 +29,13 @@ Creates a race checkpoint. When the player enters it, the [OnPlayerEnterRaceChec ## Examples -```c +```pawn SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_NORMAL, 644.3091, 1767.0223, 4.9970, 650.6734, 1812.0367, 4.9970, 3.0); ``` Another example: -```c +```pawn //from Yagu's race filterscript, (c) by Yagu public SetRaceCheckpoint(playerid, Airrace, target, next) { @@ -58,7 +58,7 @@ public SetRaceCheckpoint(playerid, Airrace, target, next) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerScore.md b/frontend/docs/scripting/functions/SetPlayerScore.md index 6ddb0729ad62..c1785dde34cc 100644 --- a/frontend/docs/scripting/functions/SetPlayerScore.md +++ b/frontend/docs/scripting/functions/SetPlayerScore.md @@ -22,7 +22,7 @@ Set a player's score. Players' scores are shown in the scoreboard (shown by hold ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Add 1 to this killer's score. We must check it is valid first. diff --git a/frontend/docs/scripting/functions/SetPlayerShopName.md b/frontend/docs/scripting/functions/SetPlayerShopName.md index dd530cba0d6a..9ad7db94bcda 100644 --- a/frontend/docs/scripting/functions/SetPlayerShopName.md +++ b/frontend/docs/scripting/functions/SetPlayerShopName.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/enter", cmdtext)) @@ -35,7 +35,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerSkillLevel.md b/frontend/docs/scripting/functions/SetPlayerSkillLevel.md index ac2138805bfd..83a6dd2da3a1 100644 --- a/frontend/docs/scripting/functions/SetPlayerSkillLevel.md +++ b/frontend/docs/scripting/functions/SetPlayerSkillLevel.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { // Make the player use single-handed sawn-off shotguns. @@ -30,7 +30,7 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerSkin.md b/frontend/docs/scripting/functions/SetPlayerSkin.md index 80044ec721a0..2686f82b4a6c 100644 --- a/frontend/docs/scripting/functions/SetPlayerSkin.md +++ b/frontend/docs/scripting/functions/SetPlayerSkin.md @@ -24,7 +24,7 @@ Note that 'success' is reported even when skin ID is invalid (not 0-311, or 74), ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/fireman", true) == 0) @@ -37,7 +37,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -```c +```pawn SetPlayerSkinFix(playerid, skinid) { if (!IsPlayerConnected(playerid)) @@ -86,7 +86,7 @@ SetPlayerSkinFix(playerid, skinid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerSpecialAction.md b/frontend/docs/scripting/functions/SetPlayerSpecialAction.md index 372c93ce6026..c1552c8c76fb 100644 --- a/frontend/docs/scripting/functions/SetPlayerSpecialAction.md +++ b/frontend/docs/scripting/functions/SetPlayerSpecialAction.md @@ -22,7 +22,7 @@ This function allows to set players special action. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/handsup", true) == 0) @@ -39,7 +39,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetPlayerTeam.md b/frontend/docs/scripting/functions/SetPlayerTeam.md index 9c0e62828869..51b162f5eaed 100644 --- a/frontend/docs/scripting/functions/SetPlayerTeam.md +++ b/frontend/docs/scripting/functions/SetPlayerTeam.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { // Set a player's team to 4 when they spawn @@ -29,7 +29,7 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerTime.md b/frontend/docs/scripting/functions/SetPlayerTime.md index 54414d9f002a..541274267f6f 100644 --- a/frontend/docs/scripting/functions/SetPlayerTime.md +++ b/frontend/docs/scripting/functions/SetPlayerTime.md @@ -23,7 +23,7 @@ Sets the game time for a player. If a player's clock is enabled ([TogglePlayerCl ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/noon", true)) @@ -40,7 +40,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerVelocity.md b/frontend/docs/scripting/functions/SetPlayerVelocity.md index cb21feee5d38..f9bffa272454 100644 --- a/frontend/docs/scripting/functions/SetPlayerVelocity.md +++ b/frontend/docs/scripting/functions/SetPlayerVelocity.md @@ -24,7 +24,7 @@ Set a player's velocity on the X, Y and Z axes. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/jump", cmdtext)) diff --git a/frontend/docs/scripting/functions/SetPlayerVirtualWorld.md b/frontend/docs/scripting/functions/SetPlayerVirtualWorld.md index 85ed3605bd38..2532d3bb1824 100644 --- a/frontend/docs/scripting/functions/SetPlayerVirtualWorld.md +++ b/frontend/docs/scripting/functions/SetPlayerVirtualWorld.md @@ -22,7 +22,7 @@ Set the virtual world of a player. They can only see other players or vehicles t ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/world3", true) == 0) @@ -34,7 +34,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerWantedLevel.md b/frontend/docs/scripting/functions/SetPlayerWantedLevel.md index 41f1feda3207..7241b4990d10 100644 --- a/frontend/docs/scripting/functions/SetPlayerWantedLevel.md +++ b/frontend/docs/scripting/functions/SetPlayerWantedLevel.md @@ -22,7 +22,7 @@ Set a player's wanted level (6 brown stars under HUD). ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/turnuptheheat", true) == 0) diff --git a/frontend/docs/scripting/functions/SetPlayerWeather.md b/frontend/docs/scripting/functions/SetPlayerWeather.md index ec262f4cdadf..eb9b8a093802 100644 --- a/frontend/docs/scripting/functions/SetPlayerWeather.md +++ b/frontend/docs/scripting/functions/SetPlayerWeather.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/storm", true)) @@ -32,7 +32,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetPlayerWorldBounds.md b/frontend/docs/scripting/functions/SetPlayerWorldBounds.md index 61dacc81456b..fe472d9a877d 100644 --- a/frontend/docs/scripting/functions/SetPlayerWorldBounds.md +++ b/frontend/docs/scripting/functions/SetPlayerWorldBounds.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerSpawn(playerid) { SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0); @@ -43,7 +43,7 @@ public OnPlayerSpawn(playerid) (South) ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/SetSVarFloat.md b/frontend/docs/scripting/functions/SetSVarFloat.md index 569931b1f711..ce109f35031e 100644 --- a/frontend/docs/scripting/functions/SetSVarFloat.md +++ b/frontend/docs/scripting/functions/SetSVarFloat.md @@ -24,7 +24,7 @@ Set a float server variable. ## Examples -```c +```pawn // set "Version" SetSVarFloat("Version", 0.37); diff --git a/frontend/docs/scripting/functions/SetSVarInt.md b/frontend/docs/scripting/functions/SetSVarInt.md index c4cd2b1a5e9c..4d4d385bf9a2 100644 --- a/frontend/docs/scripting/functions/SetSVarInt.md +++ b/frontend/docs/scripting/functions/SetSVarInt.md @@ -24,7 +24,7 @@ Set an integer server variable. ## Examples -```c +```pawn // set "Version" SetSVarInt("Version", 37); diff --git a/frontend/docs/scripting/functions/SetSVarString.md b/frontend/docs/scripting/functions/SetSVarString.md index 8c5ec2c17d23..71965dd96ef2 100644 --- a/frontend/docs/scripting/functions/SetSVarString.md +++ b/frontend/docs/scripting/functions/SetSVarString.md @@ -25,7 +25,7 @@ Set a string server variable. ## Examples -```c +```pawn // set "Version" SetSVarString("Version", "0.3.7"); diff --git a/frontend/docs/scripting/functions/SetServerRule.md b/frontend/docs/scripting/functions/SetServerRule.md index 305bbb84c2c7..8faac964c966 100644 --- a/frontend/docs/scripting/functions/SetServerRule.md +++ b/frontend/docs/scripting/functions/SetServerRule.md @@ -25,7 +25,7 @@ Returns true if the function executed successfully, otherwise false. ## Examples -```c +```pawn public OnGameModeInit() { SetServerRule("discord", "discord.gg/samp"); @@ -33,7 +33,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetServerRuleFlags.md b/frontend/docs/scripting/functions/SetServerRuleFlags.md index ee50d014a8bb..bbf10c291980 100644 --- a/frontend/docs/scripting/functions/SetServerRuleFlags.md +++ b/frontend/docs/scripting/functions/SetServerRuleFlags.md @@ -30,7 +30,7 @@ Returns **true** if the function executed successfully, otherwise **false**. ## Examples -```c +```pawn public OnGameModeInit() { AddServerRule("discord", "discord.gg/samp"); diff --git a/frontend/docs/scripting/functions/SetSpawnInfo.md b/frontend/docs/scripting/functions/SetSpawnInfo.md index bbb412d3f75c..0c19d3a93c13 100644 --- a/frontend/docs/scripting/functions/SetSpawnInfo.md +++ b/frontend/docs/scripting/functions/SetSpawnInfo.md @@ -31,7 +31,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerRequestClass(playerid, classid) { // This simple example demonstrates how to spawn every player automatically with @@ -41,7 +41,7 @@ public OnPlayerRequestClass(playerid, classid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetTeamCount.md b/frontend/docs/scripting/functions/SetTeamCount.md index b97740c82ecd..7ddb7d8dbe4e 100644 --- a/frontend/docs/scripting/functions/SetTeamCount.md +++ b/frontend/docs/scripting/functions/SetTeamCount.md @@ -2,7 +2,7 @@ title: SetTeamCount sidebar_label: SetTeamCount description: This function is used to change the amount of teams used in the gamemode. -tags: [] +tags: ["player", "team"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { // We use 18 teams in this use Team-Deathmatch mode, define it; diff --git a/frontend/docs/scripting/functions/SetTimer.md b/frontend/docs/scripting/functions/SetTimer.md index 4f169c5d4449..3f30acc4fc05 100644 --- a/frontend/docs/scripting/functions/SetTimer.md +++ b/frontend/docs/scripting/functions/SetTimer.md @@ -23,7 +23,7 @@ Timer IDs start at **1**. ## Examples -```c +```pawn public OnGameModeInit() { print("Starting timer..."); @@ -37,7 +37,7 @@ public OneSecondTimer() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetTimerEx.md b/frontend/docs/scripting/functions/SetTimerEx.md index e7b150617a5f..8892638586eb 100644 --- a/frontend/docs/scripting/functions/SetTimerEx.md +++ b/frontend/docs/scripting/functions/SetTimerEx.md @@ -40,7 +40,7 @@ The array (`a`) and string (`s`) specifiers are unusable in SA-MP. Passing array ## Examples -```c +```pawn SetTimerEx("EndAntiSpawnKill", 5000, false, "i", playerid); // EndAntiSpawnKill - The function that will be called // 5000 - 5000 MS (5 seconds). This is the interval. The timer will be called after 5 seconds. @@ -53,7 +53,7 @@ SetTimerEx("EndAntiSpawnKill", 5000, false, "i", playerid); **Implementation:** -```c +```pawn // The event callback (OnPlayerSpawn) - we will start a timer here public OnPlayerSpawn(playerid) { @@ -83,7 +83,7 @@ public EndAntiSpawnKill(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetVehicleAngularVelocity.md b/frontend/docs/scripting/functions/SetVehicleAngularVelocity.md index f01acc0d0620..13c384ecff65 100644 --- a/frontend/docs/scripting/functions/SetVehicleAngularVelocity.md +++ b/frontend/docs/scripting/functions/SetVehicleAngularVelocity.md @@ -30,7 +30,7 @@ Sets the angular X, Y and Z velocity of a vehicle ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/spin", cmdtext)) @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetVehicleBeenOccupied.md b/frontend/docs/scripting/functions/SetVehicleBeenOccupied.md index 860eef079821..89cccd4db324 100644 --- a/frontend/docs/scripting/functions/SetVehicleBeenOccupied.md +++ b/frontend/docs/scripting/functions/SetVehicleBeenOccupied.md @@ -26,7 +26,7 @@ Sets the vehicle's occupancy. ## Examples -```c +```pawn SetVehicleBeenOccupied(vehicleid, true); ``` diff --git a/frontend/docs/scripting/functions/SetVehicleDead.md b/frontend/docs/scripting/functions/SetVehicleDead.md index aac1383a2c19..767040c03ca8 100644 --- a/frontend/docs/scripting/functions/SetVehicleDead.md +++ b/frontend/docs/scripting/functions/SetVehicleDead.md @@ -26,7 +26,7 @@ Sets the vehicle to dead. ## Examples -```c +```pawn SetVehicleDead(vehicleid, true); ``` diff --git a/frontend/docs/scripting/functions/SetVehicleHealth.md b/frontend/docs/scripting/functions/SetVehicleHealth.md index 924b84ffd94b..82c5739b54a1 100644 --- a/frontend/docs/scripting/functions/SetVehicleHealth.md +++ b/frontend/docs/scripting/functions/SetVehicleHealth.md @@ -22,7 +22,7 @@ Set a vehicle's health. When a vehicle's health decreases the engine will produc ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/fixengine", cmdtext, true) == 0) @@ -38,7 +38,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetVehicleNumberPlate.md b/frontend/docs/scripting/functions/SetVehicleNumberPlate.md index 58e4593fd54e..3fae38677e8f 100644 --- a/frontend/docs/scripting/functions/SetVehicleNumberPlate.md +++ b/frontend/docs/scripting/functions/SetVehicleNumberPlate.md @@ -22,13 +22,13 @@ Set a vehicle numberplate. ## Examples -```c +```pawn new vehicleid = CreateVehicle(542, 2074.73, 1089.89, 10.51, 0.0, -1, -1, -1); SetVehicleNumberPlate(vehicleid, "ABCD 123"); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetVehicleOccupiedTick.md b/frontend/docs/scripting/functions/SetVehicleOccupiedTick.md index 3c94d16a48b0..b1e9a93ce67c 100644 --- a/frontend/docs/scripting/functions/SetVehicleOccupiedTick.md +++ b/frontend/docs/scripting/functions/SetVehicleOccupiedTick.md @@ -32,7 +32,7 @@ Set the occupied tick of a vehicle. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); diff --git a/frontend/docs/scripting/functions/SetVehicleParamsEx.md b/frontend/docs/scripting/functions/SetVehicleParamsEx.md index e99107c13156..79cc791ac923 100644 --- a/frontend/docs/scripting/functions/SetVehicleParamsEx.md +++ b/frontend/docs/scripting/functions/SetVehicleParamsEx.md @@ -28,7 +28,7 @@ Sets a vehicle's parameters for all players. ## Examples -```c +```pawn // If setting a single parameter, you should obtain the current parameters so they aren't ALL changed new engine, lights, alarm, doors, bonnet, boot, objective; @@ -38,7 +38,7 @@ GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, object SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed to VEHICLE_PARAMS_ON (1) ``` -```c +```pawn // On top of our script, declaring a global variable new gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; @@ -79,7 +79,7 @@ public DisableVehicleAlarm(vehicleid) - `VEHICLE_PARAMS_OFF` (0) - `VEHICLE_PARAMS_ON` (1) -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md b/frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md index c5a101536a90..c39ef37b4033 100644 --- a/frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md +++ b/frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md @@ -24,7 +24,7 @@ Set the parameters of a vehicle for a player. ## Examples -```c +```pawn // sometime earlier: SetVehicleParamsForPlayer(iPlayerVehicle, iPlayerID, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_OFF); @@ -38,7 +38,7 @@ GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iB SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, VEHICLE_PARAMS_OFF); ``` -```c +```pawn // Locks own car for all players, except the player who used the command. public OnPlayerCommandText(playerid, cmdtext[]) { @@ -63,7 +63,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -```c +```pawn // Will show vehicle markers for players streaming in for 0.3a+ new iVehicleObjective[MAX_VEHICLES][2]; @@ -90,7 +90,7 @@ public OnVehicleStreamIn(vehicleid, forplayerid) Another way by theAlone -```c +```pawn //Top new myMarkedCar; @@ -111,7 +111,7 @@ public OnVehicleStreamIn(vehicleid, forplayerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetVehicleParamsSirenState.md b/frontend/docs/scripting/functions/SetVehicleParamsSirenState.md index be84047fa30f..b1db6d8ed5ae 100644 --- a/frontend/docs/scripting/functions/SetVehicleParamsSirenState.md +++ b/frontend/docs/scripting/functions/SetVehicleParamsSirenState.md @@ -20,7 +20,7 @@ Turn the siren for a vehicle on or off. ## Examples -```c +```pawn SetVehicleParamsSirenState(vehicleid, true); ``` diff --git a/frontend/docs/scripting/functions/SetVehiclePos.md b/frontend/docs/scripting/functions/SetVehiclePos.md index fb003cafe94e..8a11d04c4b53 100644 --- a/frontend/docs/scripting/functions/SetVehiclePos.md +++ b/frontend/docs/scripting/functions/SetVehiclePos.md @@ -24,13 +24,13 @@ Set a vehicle's position ## Examples -```c +```pawn // Put the player's vehicle at the coordinates 0.0, 0.0, 3.0 (center of SA) new vehicleid = GetPlayerVehicleID(playerid); SetVehiclePos(vehicleid, 0.0, 0.0, 3.0); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetVehicleRespawnDelay.md b/frontend/docs/scripting/functions/SetVehicleRespawnDelay.md index 9a33c2f5e3ae..553d9a9bfc6d 100644 --- a/frontend/docs/scripting/functions/SetVehicleRespawnDelay.md +++ b/frontend/docs/scripting/functions/SetVehicleRespawnDelay.md @@ -20,7 +20,7 @@ Set the respawn delay of a vehicle. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); diff --git a/frontend/docs/scripting/functions/SetVehicleRespawnTick.md b/frontend/docs/scripting/functions/SetVehicleRespawnTick.md index ccee85cef052..cbe09fd8ba8d 100644 --- a/frontend/docs/scripting/functions/SetVehicleRespawnTick.md +++ b/frontend/docs/scripting/functions/SetVehicleRespawnTick.md @@ -32,7 +32,7 @@ Set the respawn tick of a vehicle. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); diff --git a/frontend/docs/scripting/functions/SetVehicleSpawnInfo.md b/frontend/docs/scripting/functions/SetVehicleSpawnInfo.md index 2111260cc3a9..1b2d9208dd10 100644 --- a/frontend/docs/scripting/functions/SetVehicleSpawnInfo.md +++ b/frontend/docs/scripting/functions/SetVehicleSpawnInfo.md @@ -28,7 +28,7 @@ Adjusts vehicle model, spawn location, colours, respawn delay and interior. ## Examples -```c +```pawn public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); diff --git a/frontend/docs/scripting/functions/SetVehicleToRespawn.md b/frontend/docs/scripting/functions/SetVehicleToRespawn.md index b5a9475bdc27..bce292cbf33c 100644 --- a/frontend/docs/scripting/functions/SetVehicleToRespawn.md +++ b/frontend/docs/scripting/functions/SetVehicleToRespawn.md @@ -21,7 +21,7 @@ Sets a vehicle back to the position at where it was created. ## Examples -```c +```pawn // Respawns the all vehicles for (new i = 1; i < MAX_VEHICLES; i++) { diff --git a/frontend/docs/scripting/functions/SetVehicleVelocity.md b/frontend/docs/scripting/functions/SetVehicleVelocity.md index 8a809839754c..d70b5f15fbc2 100644 --- a/frontend/docs/scripting/functions/SetVehicleVelocity.md +++ b/frontend/docs/scripting/functions/SetVehicleVelocity.md @@ -24,7 +24,7 @@ Sets the X, Y and Z velocity of a vehicle. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/jump", cmdtext)) @@ -38,7 +38,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/SetVehicleVirtualWorld.md b/frontend/docs/scripting/functions/SetVehicleVirtualWorld.md index 3dbcb70aafe7..df6930a6d614 100644 --- a/frontend/docs/scripting/functions/SetVehicleVirtualWorld.md +++ b/frontend/docs/scripting/functions/SetVehicleVirtualWorld.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 10); SetPlayerVirtualWorld(playerid, 10); ``` diff --git a/frontend/docs/scripting/functions/SetVehicleZAngle.md b/frontend/docs/scripting/functions/SetVehicleZAngle.md index f61f59d57a1b..287f4e6adef9 100644 --- a/frontend/docs/scripting/functions/SetVehicleZAngle.md +++ b/frontend/docs/scripting/functions/SetVehicleZAngle.md @@ -22,7 +22,7 @@ Set the Z rotation (yaw) of a vehicle. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/flip", true) == 0) @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetWeather.md b/frontend/docs/scripting/functions/SetWeather.md index 327c6fc06cec..6cd6f04ebb7b 100644 --- a/frontend/docs/scripting/functions/SetWeather.md +++ b/frontend/docs/scripting/functions/SetWeather.md @@ -2,7 +2,7 @@ title: SetWeather sidebar_label: SetWeather description: Set the world weather for all players. -tags: [] +tags: ["world", "weather"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/sandstorm", true)) @@ -31,7 +31,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/SetWorldTime.md b/frontend/docs/scripting/functions/SetWorldTime.md index c5eaa148b87b..ff323800c403 100644 --- a/frontend/docs/scripting/functions/SetWorldTime.md +++ b/frontend/docs/scripting/functions/SetWorldTime.md @@ -19,12 +19,12 @@ This function does not return any specific values. ## Examples -```c +```pawn // Set the time to 12 o'clock (noon) SetWorldTime(12); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/ShowMenuForPlayer.md b/frontend/docs/scripting/functions/ShowMenuForPlayer.md index d8b0877db68c..e41eb84636d9 100644 --- a/frontend/docs/scripting/functions/ShowMenuForPlayer.md +++ b/frontend/docs/scripting/functions/ShowMenuForPlayer.md @@ -22,7 +22,7 @@ Shows a [previously created](CreateMenu) menu for a player. ## Examples -```c +```pawn new Menu:exampleMenu; public OnGameModeInit() @@ -42,7 +42,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/ShowNameTags.md b/frontend/docs/scripting/functions/ShowNameTags.md index 693610458487..fbf6a0de49de 100644 --- a/frontend/docs/scripting/functions/ShowNameTags.md +++ b/frontend/docs/scripting/functions/ShowNameTags.md @@ -2,7 +2,7 @@ title: ShowNameTags sidebar_label: ShowNameTags description: Toggle the drawing of nametags, health bars and armor bars above players. -tags: [] +tags: ["player", "nametag"] --- ## Description @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { // This will fully disable all player nametags @@ -28,7 +28,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/ShowObjectForPlayer.md b/frontend/docs/scripting/functions/ShowObjectForPlayer.md index 2c131595ebc1..456ed5aaa070 100644 --- a/frontend/docs/scripting/functions/ShowObjectForPlayer.md +++ b/frontend/docs/scripting/functions/ShowObjectForPlayer.md @@ -26,7 +26,7 @@ Show an object for a player that is hidden with [HideObjectForPlayer](HideObject ## Examples -```c +```pawn new gObject; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/ShowPickupForPlayer.md b/frontend/docs/scripting/functions/ShowPickupForPlayer.md index f5df9e76d823..0a9a2f0a312a 100644 --- a/frontend/docs/scripting/functions/ShowPickupForPlayer.md +++ b/frontend/docs/scripting/functions/ShowPickupForPlayer.md @@ -22,7 +22,7 @@ This function always returns **true**. ## Examples -```c +```pawn new g_Pickup; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/ShowPlayerDialog.md b/frontend/docs/scripting/functions/ShowPlayerDialog.md index 7c7546c5bbd6..b5b356809930 100644 --- a/frontend/docs/scripting/functions/ShowPlayerDialog.md +++ b/frontend/docs/scripting/functions/ShowPlayerDialog.md @@ -28,7 +28,7 @@ Shows the player a synchronous (only one at a time) dialog box. ## Examples -```c +```pawn // Define the dialog IDs either with an enum: enum { @@ -65,7 +65,7 @@ ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "Buy Weapon", " ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Buy Weapon", "Weapon\tPrice\tAmmo\nDeagle\t$5000\t100\nSawnoff\t$5000\t100\nPistol\t$1000\t50", "Select", "Cancel"); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/ShowPlayerMarkers.md b/frontend/docs/scripting/functions/ShowPlayerMarkers.md index 7f167309908b..5910e29bd66d 100644 --- a/frontend/docs/scripting/functions/ShowPlayerMarkers.md +++ b/frontend/docs/scripting/functions/ShowPlayerMarkers.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { // Player markers only visible to nearby players @@ -35,7 +35,7 @@ public OnGameModeInit() | 1 | PLAYER_MARKERS_MODE_GLOBAL | | 2 | PLAYER_MARKERS_MODE_STREAMED | -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/ShowPlayerNameTagForPlayer.md b/frontend/docs/scripting/functions/ShowPlayerNameTagForPlayer.md index c70ede7122c3..1a790e678613 100644 --- a/frontend/docs/scripting/functions/ShowPlayerNameTagForPlayer.md +++ b/frontend/docs/scripting/functions/ShowPlayerNameTagForPlayer.md @@ -23,7 +23,7 @@ This functions allows you to toggle the drawing of player nametags, healthbars a ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { // The player who typed /nameoff will not be able to see any other players nametag. @@ -40,7 +40,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/ShowVehicle.md b/frontend/docs/scripting/functions/ShowVehicle.md index 060e0e0c6a72..36a75e917ec2 100644 --- a/frontend/docs/scripting/functions/ShowVehicle.md +++ b/frontend/docs/scripting/functions/ShowVehicle.md @@ -25,7 +25,7 @@ Shows the hidden vehicle. ## Examples -```c +```pawn new g_Vehicle; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/SpawnPlayer.md b/frontend/docs/scripting/functions/SpawnPlayer.md index 519d25a3bc50..440143d25bff 100644 --- a/frontend/docs/scripting/functions/SpawnPlayer.md +++ b/frontend/docs/scripting/functions/SpawnPlayer.md @@ -21,7 +21,7 @@ tags: ["player"] ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/spawn", true) == 0) @@ -33,7 +33,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/StartRecordingPlayback.md b/frontend/docs/scripting/functions/StartRecordingPlayback.md index 1e4f491047ee..d41fa614b43b 100644 --- a/frontend/docs/scripting/functions/StartRecordingPlayback.md +++ b/frontend/docs/scripting/functions/StartRecordingPlayback.md @@ -2,7 +2,7 @@ title: StartRecordingPlayback sidebar_label: StartRecordingPlayback description: This will run a .rec file which has to be saved in the npcmodes/recordings folder. -tags: [] +tags: ["npc", "recording", "playback"] --- :::warning @@ -22,7 +22,7 @@ This will run a .rec file which has to be saved in the `npcmodes/recordings` fol ## Examples -```c +```pawn public OnNPCEnterVehicle(vehicleid, seatid) { StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER, "at400_lv_to_sf_x1"); diff --git a/frontend/docs/scripting/functions/StartRecordingPlayerData.md b/frontend/docs/scripting/functions/StartRecordingPlayerData.md index 2221b992f49a..12215c1b931e 100644 --- a/frontend/docs/scripting/functions/StartRecordingPlayerData.md +++ b/frontend/docs/scripting/functions/StartRecordingPlayerData.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn if (!strcmp("/recordme", cmdtext)) { if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) diff --git a/frontend/docs/scripting/functions/StopAudioStreamForPlayer.md b/frontend/docs/scripting/functions/StopAudioStreamForPlayer.md index bfe8ccaa38c4..f55a808be21a 100644 --- a/frontend/docs/scripting/functions/StopAudioStreamForPlayer.md +++ b/frontend/docs/scripting/functions/StopAudioStreamForPlayer.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { // If the player exits a vehicle diff --git a/frontend/docs/scripting/functions/StopObject.md b/frontend/docs/scripting/functions/StopObject.md index 1f8269d50dca..5e992a5990fd 100644 --- a/frontend/docs/scripting/functions/StopObject.md +++ b/frontend/docs/scripting/functions/StopObject.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new gAirportGate; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/StopPlayerHoldingObject.md b/frontend/docs/scripting/functions/StopPlayerHoldingObject.md index c69903d05e76..ecefa496869f 100644 --- a/frontend/docs/scripting/functions/StopPlayerHoldingObject.md +++ b/frontend/docs/scripting/functions/StopPlayerHoldingObject.md @@ -19,7 +19,7 @@ Removes attached objects. ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { if (IsPlayerHoldingObject(playerid)) @@ -30,7 +30,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/StopPlayerObject.md b/frontend/docs/scripting/functions/StopPlayerObject.md index e1cf31ca4cf1..9ea453b316ed 100644 --- a/frontend/docs/scripting/functions/StopPlayerObject.md +++ b/frontend/docs/scripting/functions/StopPlayerObject.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) diff --git a/frontend/docs/scripting/functions/StopRecordingPlayback.md b/frontend/docs/scripting/functions/StopRecordingPlayback.md index 9ef66b06cb03..e032f6e6d021 100644 --- a/frontend/docs/scripting/functions/StopRecordingPlayback.md +++ b/frontend/docs/scripting/functions/StopRecordingPlayback.md @@ -2,7 +2,7 @@ title: StopRecordingPlayback sidebar_label: StopRecordingPlayback description: This will stop the current .rec file which is being ran by the NPC, making it stay idle until some other order is given. -tags: [] +tags: ["npc", "recording", "playback"] --- :::warning @@ -17,7 +17,7 @@ This will stop the current .rec file which is being ran by the NPC, making it st ## Examples -```c +```pawn public OnNPCExitVehicle(vehicleid, seatid) { StopRecordingPlayback(); diff --git a/frontend/docs/scripting/functions/StopRecordingPlayerData.md b/frontend/docs/scripting/functions/StopRecordingPlayerData.md index 5b499e3665e7..bab7ee04fa39 100644 --- a/frontend/docs/scripting/functions/StopRecordingPlayerData.md +++ b/frontend/docs/scripting/functions/StopRecordingPlayerData.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/stoprecording", cmdtext)) diff --git a/frontend/docs/scripting/functions/TextDrawAlignment.md b/frontend/docs/scripting/functions/TextDrawAlignment.md index 32889796c06b..e9ef1e6cf4a8 100644 --- a/frontend/docs/scripting/functions/TextDrawAlignment.md +++ b/frontend/docs/scripting/functions/TextDrawAlignment.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn /* TEXT_DRAW_ALIGN_LEFT TEXT_DRAW_ALIGN_CENTER @@ -37,7 +37,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TextDrawBackgroundColor.md b/frontend/docs/scripting/functions/TextDrawBackgroundColor.md index 6e77f563f510..4ef03d9796e2 100644 --- a/frontend/docs/scripting/functions/TextDrawBackgroundColor.md +++ b/frontend/docs/scripting/functions/TextDrawBackgroundColor.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -32,7 +32,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TextDrawBackgroundColour.md b/frontend/docs/scripting/functions/TextDrawBackgroundColour.md index 32e466fef7f4..629dfe66f67f 100644 --- a/frontend/docs/scripting/functions/TextDrawBackgroundColour.md +++ b/frontend/docs/scripting/functions/TextDrawBackgroundColour.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -34,7 +34,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TextDrawBoxColor.md b/frontend/docs/scripting/functions/TextDrawBoxColor.md index d3b9416fb07c..7b90964c5dc0 100644 --- a/frontend/docs/scripting/functions/TextDrawBoxColor.md +++ b/frontend/docs/scripting/functions/TextDrawBoxColor.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -32,7 +32,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawBoxColour.md b/frontend/docs/scripting/functions/TextDrawBoxColour.md index 54dc09427df4..33969e94ffdd 100644 --- a/frontend/docs/scripting/functions/TextDrawBoxColour.md +++ b/frontend/docs/scripting/functions/TextDrawBoxColour.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -34,7 +34,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawColor.md b/frontend/docs/scripting/functions/TextDrawColor.md index b255aec6530f..c402721edd14 100644 --- a/frontend/docs/scripting/functions/TextDrawColor.md +++ b/frontend/docs/scripting/functions/TextDrawColor.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -31,7 +31,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawColour.md b/frontend/docs/scripting/functions/TextDrawColour.md index 716df45f7a5a..23a235009060 100644 --- a/frontend/docs/scripting/functions/TextDrawColour.md +++ b/frontend/docs/scripting/functions/TextDrawColour.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -33,7 +33,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TextDrawCreate.md b/frontend/docs/scripting/functions/TextDrawCreate.md index e1b661e1dcca..9a274f8680ae 100644 --- a/frontend/docs/scripting/functions/TextDrawCreate.md +++ b/frontend/docs/scripting/functions/TextDrawCreate.md @@ -24,7 +24,7 @@ Textdraw IDs start at **0**. ## Examples -```c +```pawn // This variable is used to store the id of the textdraw // so that we can use it throught the script new Text:gMyTextdraw; @@ -45,7 +45,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TextDrawDestroy.md b/frontend/docs/scripting/functions/TextDrawDestroy.md index c57e6b579278..3ee0636ea354 100644 --- a/frontend/docs/scripting/functions/TextDrawDestroy.md +++ b/frontend/docs/scripting/functions/TextDrawDestroy.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawFont.md b/frontend/docs/scripting/functions/TextDrawFont.md index 299f97a4e8d0..304b24400911 100644 --- a/frontend/docs/scripting/functions/TextDrawFont.md +++ b/frontend/docs/scripting/functions/TextDrawFont.md @@ -26,7 +26,7 @@ This function does not return any specific values. ## Examples -```c +```pawn /* TEXT_DRAW_FONT_0 TEXT_DRAW_FONT_1 @@ -46,7 +46,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawGetAlignment.md b/frontend/docs/scripting/functions/TextDrawGetAlignment.md index 430022736936..50cc6a8bcde1 100644 --- a/frontend/docs/scripting/functions/TextDrawGetAlignment.md +++ b/frontend/docs/scripting/functions/TextDrawGetAlignment.md @@ -21,7 +21,7 @@ Returns the textdraw text alignment. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetBackgroundColor.md b/frontend/docs/scripting/functions/TextDrawGetBackgroundColor.md index 1dff625f1bdc..7dfa10f993be 100644 --- a/frontend/docs/scripting/functions/TextDrawGetBackgroundColor.md +++ b/frontend/docs/scripting/functions/TextDrawGetBackgroundColor.md @@ -21,7 +21,7 @@ Returns the background color of the textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetBackgroundColour.md b/frontend/docs/scripting/functions/TextDrawGetBackgroundColour.md index 3ee3cb2bb028..bb49a17203cc 100644 --- a/frontend/docs/scripting/functions/TextDrawGetBackgroundColour.md +++ b/frontend/docs/scripting/functions/TextDrawGetBackgroundColour.md @@ -21,7 +21,7 @@ Returns the background colour of the textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetBoxColor.md b/frontend/docs/scripting/functions/TextDrawGetBoxColor.md index e89d05eef520..edd6ca404738 100644 --- a/frontend/docs/scripting/functions/TextDrawGetBoxColor.md +++ b/frontend/docs/scripting/functions/TextDrawGetBoxColor.md @@ -21,7 +21,7 @@ Returns the box color of the textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetBoxColour.md b/frontend/docs/scripting/functions/TextDrawGetBoxColour.md index 1c1a27419687..766a3d63de18 100644 --- a/frontend/docs/scripting/functions/TextDrawGetBoxColour.md +++ b/frontend/docs/scripting/functions/TextDrawGetBoxColour.md @@ -21,7 +21,7 @@ Returns the box colour of the textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetColor.md b/frontend/docs/scripting/functions/TextDrawGetColor.md index c010e2de2a3c..d09170fbf9e3 100644 --- a/frontend/docs/scripting/functions/TextDrawGetColor.md +++ b/frontend/docs/scripting/functions/TextDrawGetColor.md @@ -21,7 +21,7 @@ Returns the text color of the textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetColour.md b/frontend/docs/scripting/functions/TextDrawGetColour.md index d6902b70c1e3..c03152a02bef 100644 --- a/frontend/docs/scripting/functions/TextDrawGetColour.md +++ b/frontend/docs/scripting/functions/TextDrawGetColour.md @@ -21,7 +21,7 @@ Returns the text colour of the textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetFont.md b/frontend/docs/scripting/functions/TextDrawGetFont.md index 2f49d56ef425..e09bb828ae69 100644 --- a/frontend/docs/scripting/functions/TextDrawGetFont.md +++ b/frontend/docs/scripting/functions/TextDrawGetFont.md @@ -21,7 +21,7 @@ Returns the textdraw font. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetLetterSize.md b/frontend/docs/scripting/functions/TextDrawGetLetterSize.md index 554eaeb17954..24cb0f8a22e9 100644 --- a/frontend/docs/scripting/functions/TextDrawGetLetterSize.md +++ b/frontend/docs/scripting/functions/TextDrawGetLetterSize.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetOutline.md b/frontend/docs/scripting/functions/TextDrawGetOutline.md index 03d7c7bf0b6e..e8686cf6e73a 100644 --- a/frontend/docs/scripting/functions/TextDrawGetOutline.md +++ b/frontend/docs/scripting/functions/TextDrawGetOutline.md @@ -21,7 +21,7 @@ Returns the textdraw outline size. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetPos.md b/frontend/docs/scripting/functions/TextDrawGetPos.md index 0b3cac46904e..3a4a170a02c0 100644 --- a/frontend/docs/scripting/functions/TextDrawGetPos.md +++ b/frontend/docs/scripting/functions/TextDrawGetPos.md @@ -19,7 +19,7 @@ Gets the position (in-screen x & y) of a textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetPreviewModel.md b/frontend/docs/scripting/functions/TextDrawGetPreviewModel.md index 9508b2a9206f..db181bea0cd3 100644 --- a/frontend/docs/scripting/functions/TextDrawGetPreviewModel.md +++ b/frontend/docs/scripting/functions/TextDrawGetPreviewModel.md @@ -21,7 +21,7 @@ Returns the 3D textdraw preview model. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetPreviewRot.md b/frontend/docs/scripting/functions/TextDrawGetPreviewRot.md index 47dfa62da46e..8e49908eec23 100644 --- a/frontend/docs/scripting/functions/TextDrawGetPreviewRot.md +++ b/frontend/docs/scripting/functions/TextDrawGetPreviewRot.md @@ -21,7 +21,7 @@ Gets the rotation and zoom of a 3D model preview textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetPreviewVehCol.md b/frontend/docs/scripting/functions/TextDrawGetPreviewVehCol.md index 4b6550cb43d8..2fbbde72801b 100644 --- a/frontend/docs/scripting/functions/TextDrawGetPreviewVehCol.md +++ b/frontend/docs/scripting/functions/TextDrawGetPreviewVehCol.md @@ -19,7 +19,7 @@ Gets the preview vehicle colors of a 3D preview textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetPreviewVehicleColours.md b/frontend/docs/scripting/functions/TextDrawGetPreviewVehicleColours.md index 636fb8c61b41..992e65c7e59f 100644 --- a/frontend/docs/scripting/functions/TextDrawGetPreviewVehicleColours.md +++ b/frontend/docs/scripting/functions/TextDrawGetPreviewVehicleColours.md @@ -19,7 +19,7 @@ Gets the preview vehicle colours of a 3D preview textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetShadow.md b/frontend/docs/scripting/functions/TextDrawGetShadow.md index 54cb3a6ac33a..f540968e56e7 100644 --- a/frontend/docs/scripting/functions/TextDrawGetShadow.md +++ b/frontend/docs/scripting/functions/TextDrawGetShadow.md @@ -21,7 +21,7 @@ Returns the textdraw shadow size. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetString.md b/frontend/docs/scripting/functions/TextDrawGetString.md index 51dd60f3eae8..94b4c511ced1 100644 --- a/frontend/docs/scripting/functions/TextDrawGetString.md +++ b/frontend/docs/scripting/functions/TextDrawGetString.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawGetTextSize.md b/frontend/docs/scripting/functions/TextDrawGetTextSize.md index ac5bfd8531d5..663ca24f974a 100644 --- a/frontend/docs/scripting/functions/TextDrawGetTextSize.md +++ b/frontend/docs/scripting/functions/TextDrawGetTextSize.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawHideForAll.md b/frontend/docs/scripting/functions/TextDrawHideForAll.md index d32fc19b1845..3bc0fc845412 100644 --- a/frontend/docs/scripting/functions/TextDrawHideForAll.md +++ b/frontend/docs/scripting/functions/TextDrawHideForAll.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawHideForPlayer.md b/frontend/docs/scripting/functions/TextDrawHideForPlayer.md index 379a784acbf0..a8c7d56a1ec6 100644 --- a/frontend/docs/scripting/functions/TextDrawHideForPlayer.md +++ b/frontend/docs/scripting/functions/TextDrawHideForPlayer.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawIsBox.md b/frontend/docs/scripting/functions/TextDrawIsBox.md index 8b5608f4a872..6596b84a93b8 100644 --- a/frontend/docs/scripting/functions/TextDrawIsBox.md +++ b/frontend/docs/scripting/functions/TextDrawIsBox.md @@ -23,7 +23,7 @@ Returns **true** if the textdraw is box, otherwise **false**. ## Example Usage -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawIsProportional.md b/frontend/docs/scripting/functions/TextDrawIsProportional.md index 25ce9cc6cb60..c373b0cb5b22 100644 --- a/frontend/docs/scripting/functions/TextDrawIsProportional.md +++ b/frontend/docs/scripting/functions/TextDrawIsProportional.md @@ -23,7 +23,7 @@ Returns **true** if the textdraw is proportional, otherwise **false**. ## Example Usage -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawIsSelectable.md b/frontend/docs/scripting/functions/TextDrawIsSelectable.md index 1fc5dedc153b..440e8024a939 100644 --- a/frontend/docs/scripting/functions/TextDrawIsSelectable.md +++ b/frontend/docs/scripting/functions/TextDrawIsSelectable.md @@ -23,7 +23,7 @@ Returns **true** if the textdraw is selectable, otherwise **false**. ## Example Usage -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawLetterSize.md b/frontend/docs/scripting/functions/TextDrawLetterSize.md index 3a8d787efeac..e281cb3bcda5 100644 --- a/frontend/docs/scripting/functions/TextDrawLetterSize.md +++ b/frontend/docs/scripting/functions/TextDrawLetterSize.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -32,7 +32,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawSetOutline.md b/frontend/docs/scripting/functions/TextDrawSetOutline.md index 75285a485014..faab7f8e4083 100644 --- a/frontend/docs/scripting/functions/TextDrawSetOutline.md +++ b/frontend/docs/scripting/functions/TextDrawSetOutline.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -31,7 +31,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawSetPos.md b/frontend/docs/scripting/functions/TextDrawSetPos.md index f5cb28c2628f..2e1add86e10d 100644 --- a/frontend/docs/scripting/functions/TextDrawSetPos.md +++ b/frontend/docs/scripting/functions/TextDrawSetPos.md @@ -19,7 +19,7 @@ Sets the position (in-screen x & y) of a textdraw. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawSetPreviewModel.md b/frontend/docs/scripting/functions/TextDrawSetPreviewModel.md index 3e984c020bc1..83692ec6f0b4 100644 --- a/frontend/docs/scripting/functions/TextDrawSetPreviewModel.md +++ b/frontend/docs/scripting/functions/TextDrawSetPreviewModel.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -40,7 +40,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawSetPreviewRot.md b/frontend/docs/scripting/functions/TextDrawSetPreviewRot.md index b5c8a947d281..025db68d4df3 100644 --- a/frontend/docs/scripting/functions/TextDrawSetPreviewRot.md +++ b/frontend/docs/scripting/functions/TextDrawSetPreviewRot.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -41,7 +41,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/TextDrawSetPreviewVehCol.md b/frontend/docs/scripting/functions/TextDrawSetPreviewVehCol.md index 320326ef6d58..c116f784e330 100644 --- a/frontend/docs/scripting/functions/TextDrawSetPreviewVehCol.md +++ b/frontend/docs/scripting/functions/TextDrawSetPreviewVehCol.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -39,7 +39,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/TextDrawSetPreviewVehicleColours.md b/frontend/docs/scripting/functions/TextDrawSetPreviewVehicleColours.md index 57bbf6e8e191..514a995651a5 100644 --- a/frontend/docs/scripting/functions/TextDrawSetPreviewVehicleColours.md +++ b/frontend/docs/scripting/functions/TextDrawSetPreviewVehicleColours.md @@ -23,7 +23,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -41,7 +41,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/TextDrawSetProportional.md b/frontend/docs/scripting/functions/TextDrawSetProportional.md index addc592e0c79..219bb8d61840 100644 --- a/frontend/docs/scripting/functions/TextDrawSetProportional.md +++ b/frontend/docs/scripting/functions/TextDrawSetProportional.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -31,7 +31,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawSetSelectable.md b/frontend/docs/scripting/functions/TextDrawSetSelectable.md index 6b36248c0ae0..2fb3fcead5ac 100644 --- a/frontend/docs/scripting/functions/TextDrawSetSelectable.md +++ b/frontend/docs/scripting/functions/TextDrawSetSelectable.md @@ -20,7 +20,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -32,7 +32,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawSetShadow.md b/frontend/docs/scripting/functions/TextDrawSetShadow.md index e5ae51232ac0..604399d3f0e1 100644 --- a/frontend/docs/scripting/functions/TextDrawSetShadow.md +++ b/frontend/docs/scripting/functions/TextDrawSetShadow.md @@ -22,7 +22,7 @@ Sets the size of a textdraw's text's shadow. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -33,7 +33,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TextDrawSetString.md b/frontend/docs/scripting/functions/TextDrawSetString.md index 3e3bb7359976..18d1aad2a80d 100644 --- a/frontend/docs/scripting/functions/TextDrawSetString.md +++ b/frontend/docs/scripting/functions/TextDrawSetString.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -49,7 +49,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/TextDrawSetStringForPlayer.md b/frontend/docs/scripting/functions/TextDrawSetStringForPlayer.md index 9ed161a47cb9..bc4a43ab8827 100644 --- a/frontend/docs/scripting/functions/TextDrawSetStringForPlayer.md +++ b/frontend/docs/scripting/functions/TextDrawSetStringForPlayer.md @@ -24,7 +24,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -60,7 +60,7 @@ public OnPlayerRequestClass(playerid, classid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/TextDrawShowForAll.md b/frontend/docs/scripting/functions/TextDrawShowForAll.md index 60bf6f113b10..b997c383b62d 100644 --- a/frontend/docs/scripting/functions/TextDrawShowForAll.md +++ b/frontend/docs/scripting/functions/TextDrawShowForAll.md @@ -21,7 +21,7 @@ Shows a textdraw for all players. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/TextDrawShowForPlayer.md b/frontend/docs/scripting/functions/TextDrawShowForPlayer.md index eea34a5c9b38..37f94a590bba 100644 --- a/frontend/docs/scripting/functions/TextDrawShowForPlayer.md +++ b/frontend/docs/scripting/functions/TextDrawShowForPlayer.md @@ -22,7 +22,7 @@ Shows a [textdraw](TextDrawCreate) for a specific player. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -38,7 +38,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TextDrawTextSize.md b/frontend/docs/scripting/functions/TextDrawTextSize.md index 106c7b100bae..f1a272319101 100644 --- a/frontend/docs/scripting/functions/TextDrawTextSize.md +++ b/frontend/docs/scripting/functions/TextDrawTextSize.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -32,7 +32,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TextDrawUseBox.md b/frontend/docs/scripting/functions/TextDrawUseBox.md index c9a05fd8bdaa..bac20965fada 100644 --- a/frontend/docs/scripting/functions/TextDrawUseBox.md +++ b/frontend/docs/scripting/functions/TextDrawUseBox.md @@ -22,7 +22,7 @@ Toggle whether a textdraw uses a box or not. ## Examples -```c +```pawn new Text:gMyTextdraw; public OnGameModeInit() @@ -33,7 +33,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/ToggleChatTextReplacement.md b/frontend/docs/scripting/functions/ToggleChatTextReplacement.md index e6c3cc645fcb..459488b497d5 100644 --- a/frontend/docs/scripting/functions/ToggleChatTextReplacement.md +++ b/frontend/docs/scripting/functions/ToggleChatTextReplacement.md @@ -2,7 +2,7 @@ title: ToggleChatTextReplacement sidebar_label: ToggleChatTextReplacement description: Toggles the chat input filter. -tags: [] +tags: ["chat"] --- @@ -23,7 +23,7 @@ This function does not return any specific value. ## Examples -```c +```pawn public OnGameModeInit() { ToggleChatTextReplacement(false); @@ -31,7 +31,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/TogglePlayerClock.md b/frontend/docs/scripting/functions/TogglePlayerClock.md index db3c11cea812..dcc9aca400cf 100644 --- a/frontend/docs/scripting/functions/TogglePlayerClock.md +++ b/frontend/docs/scripting/functions/TogglePlayerClock.md @@ -22,7 +22,7 @@ Toggle the in-game clock (top-right corner) for a specific player. When this is ## Examples -```c +```pawn public OnPlayerConnect(playerid) { TogglePlayerClock(playerid, true); // Show the clock @@ -30,7 +30,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TogglePlayerControllable.md b/frontend/docs/scripting/functions/TogglePlayerControllable.md index 62c4c197adeb..9b174e2e2038 100644 --- a/frontend/docs/scripting/functions/TogglePlayerControllable.md +++ b/frontend/docs/scripting/functions/TogglePlayerControllable.md @@ -22,7 +22,7 @@ Toggles whether a player can control their character or not. The player will als ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { // Freezes a player when they types /freezeme diff --git a/frontend/docs/scripting/functions/TogglePlayerGhostMode.md b/frontend/docs/scripting/functions/TogglePlayerGhostMode.md index 849e1a61fb6a..b52a21db09ca 100644 --- a/frontend/docs/scripting/functions/TogglePlayerGhostMode.md +++ b/frontend/docs/scripting/functions/TogglePlayerGhostMode.md @@ -23,7 +23,7 @@ This function always returns true. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/ghostmode", true)) diff --git a/frontend/docs/scripting/functions/TogglePlayerSpectating.md b/frontend/docs/scripting/functions/TogglePlayerSpectating.md index ef2cfb5844f9..4d7063a33733 100644 --- a/frontend/docs/scripting/functions/TogglePlayerSpectating.md +++ b/frontend/docs/scripting/functions/TogglePlayerSpectating.md @@ -24,7 +24,7 @@ Toggle whether a player is in spectator mode or not. While in spectator mode a p ## Examples -```c +```pawn public OnPlayerDeath(playerid, killerid, WEAPON:reason) { TogglePlayerSpectating(playerid, true); @@ -33,7 +33,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/TogglePlayerWidescreen.md b/frontend/docs/scripting/functions/TogglePlayerWidescreen.md index ec542e0052c9..2fa04adc6e08 100644 --- a/frontend/docs/scripting/functions/TogglePlayerWidescreen.md +++ b/frontend/docs/scripting/functions/TogglePlayerWidescreen.md @@ -24,7 +24,7 @@ Toggle player's widescreen. ## Examples -```c +```pawn public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/widescreen", true)) diff --git a/frontend/docs/scripting/functions/ToggleVehicleSirenEnabled.md b/frontend/docs/scripting/functions/ToggleVehicleSirenEnabled.md index acfee07bdec7..2026532a8efe 100644 --- a/frontend/docs/scripting/functions/ToggleVehicleSirenEnabled.md +++ b/frontend/docs/scripting/functions/ToggleVehicleSirenEnabled.md @@ -20,7 +20,7 @@ Turn the siren for a vehicle on or off. ## Examples -```c +```pawn ToggleVehicleSirenEnabled(vehicleid, true); ``` diff --git a/frontend/docs/scripting/functions/UnBlockIpAddress.md b/frontend/docs/scripting/functions/UnBlockIpAddress.md index 48c02fb3bcbd..6153fb4f80ae 100644 --- a/frontend/docs/scripting/functions/UnBlockIpAddress.md +++ b/frontend/docs/scripting/functions/UnBlockIpAddress.md @@ -19,7 +19,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { UnBlockIpAddress("127.0.0.1"); diff --git a/frontend/docs/scripting/functions/Update3DTextLabelText.md b/frontend/docs/scripting/functions/Update3DTextLabelText.md index cee1d6d77710..8b5d706ba120 100644 --- a/frontend/docs/scripting/functions/Update3DTextLabelText.md +++ b/frontend/docs/scripting/functions/Update3DTextLabelText.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new Text3D:mylabel; public OnGameModeInit() @@ -34,7 +34,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/UpdatePlayer3DTextLabelText.md b/frontend/docs/scripting/functions/UpdatePlayer3DTextLabelText.md index 7c825003a9bf..2291a226c323 100644 --- a/frontend/docs/scripting/functions/UpdatePlayer3DTextLabelText.md +++ b/frontend/docs/scripting/functions/UpdatePlayer3DTextLabelText.md @@ -21,7 +21,7 @@ Updates a player 3D Text Label's text and color This function does not return any specific values. -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/UpdateVehicleDamageStatus.md b/frontend/docs/scripting/functions/UpdateVehicleDamageStatus.md index 8b5673567e81..a028ba3bca5e 100644 --- a/frontend/docs/scripting/functions/UpdateVehicleDamageStatus.md +++ b/frontend/docs/scripting/functions/UpdateVehicleDamageStatus.md @@ -29,7 +29,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new VEHICLE_PANEL_STATUS:panels, VEHICLE_DOOR_STATUS:doors, diff --git a/frontend/docs/scripting/functions/UseGangZoneCheck.md b/frontend/docs/scripting/functions/UseGangZoneCheck.md index 83e22f760a53..649bf77bf940 100644 --- a/frontend/docs/scripting/functions/UseGangZoneCheck.md +++ b/frontend/docs/scripting/functions/UseGangZoneCheck.md @@ -24,7 +24,7 @@ Enables the callback when a player enters/leaves this zone. ## Examples -```c +```pawn new gGangZoneID = INVALID_GANG_ZONE; public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/UsePlayerGangZoneCheck.md b/frontend/docs/scripting/functions/UsePlayerGangZoneCheck.md index a726d0447da1..a9e276c084c9 100644 --- a/frontend/docs/scripting/functions/UsePlayerGangZoneCheck.md +++ b/frontend/docs/scripting/functions/UsePlayerGangZoneCheck.md @@ -25,7 +25,7 @@ Enables the callback when a player enters/leaves this zone. ## Examples -```c +```pawn // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; diff --git a/frontend/docs/scripting/functions/UsePlayerPedAnims.md b/frontend/docs/scripting/functions/UsePlayerPedAnims.md index a8d7f0770ba7..49771f1db781 100644 --- a/frontend/docs/scripting/functions/UsePlayerPedAnims.md +++ b/frontend/docs/scripting/functions/UsePlayerPedAnims.md @@ -15,7 +15,7 @@ This function does not return any specific values. ## Examples -```c +```pawn public OnGameModeInit() { UsePlayerPedAnims(); @@ -23,7 +23,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/VectorSize.md b/frontend/docs/scripting/functions/VectorSize.md index cbebbbcbe633..3a10c8574ca2 100644 --- a/frontend/docs/scripting/functions/VectorSize.md +++ b/frontend/docs/scripting/functions/VectorSize.md @@ -21,7 +21,7 @@ The norm (length) of the provided vector as a **float**. ## Examples -```c +```pawn stock Float:GetDistanceBetweenPoints(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2) { return VectorSize(x1 - x2, y1 - y2, z1 - z2); diff --git a/frontend/docs/scripting/functions/VehicleCanHaveComponent.md b/frontend/docs/scripting/functions/VehicleCanHaveComponent.md index 8b61abfc91e3..58bfb37d5801 100644 --- a/frontend/docs/scripting/functions/VehicleCanHaveComponent.md +++ b/frontend/docs/scripting/functions/VehicleCanHaveComponent.md @@ -24,7 +24,7 @@ Is the component legal on the vehicle model? ## Examples -```c +```pawn new vehicleid = GetPlayerVehicleID(playerid); if (VehicleCanHaveComponent(GetVehicleModel(vehicleid), 1010)) diff --git a/frontend/docs/scripting/functions/VehicleColourIndexToColour.md b/frontend/docs/scripting/functions/VehicleColourIndexToColour.md index a9b28f855e91..31095640a4e0 100644 --- a/frontend/docs/scripting/functions/VehicleColourIndexToColour.md +++ b/frontend/docs/scripting/functions/VehicleColourIndexToColour.md @@ -20,7 +20,7 @@ Convert a car colour index to a HEX colour (RGBA). ## Examples -```c +```pawn new colour = VehicleColourIndexToColour(3, 0xFF); ``` diff --git a/frontend/docs/scripting/functions/acos.md b/frontend/docs/scripting/functions/acos.md index e1a7bf21d675..c39ac70cab4b 100644 --- a/frontend/docs/scripting/functions/acos.md +++ b/frontend/docs/scripting/functions/acos.md @@ -19,7 +19,7 @@ The angle in degrees, in the interval [0.0,180.0]. ## Examples -```c +```pawn //The arc cosine of 0.500000 is 60.000000 degrees. public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/argindex.md b/frontend/docs/scripting/functions/argindex.md index 63f4db786cc1..a0c0b2655154 100644 --- a/frontend/docs/scripting/functions/argindex.md +++ b/frontend/docs/scripting/functions/argindex.md @@ -20,7 +20,7 @@ Get the name of the argument at the given index after **--**. **true** - the argument was found, **false** - it wasn't. -## Notes +## Good to know Separate parameters also count for the index here. diff --git a/frontend/docs/scripting/functions/argvalue.md b/frontend/docs/scripting/functions/argvalue.md index 5e52f6540f92..412dd3d54c66 100644 --- a/frontend/docs/scripting/functions/argvalue.md +++ b/frontend/docs/scripting/functions/argvalue.md @@ -19,7 +19,7 @@ Get the number of arguments passed to the script (those after **--**). **true** - the argument was found with value, **false** - it wasn't. -## Notes +## Good to know Separate parameters also count for the index here. diff --git a/frontend/docs/scripting/functions/asin.md b/frontend/docs/scripting/functions/asin.md index 423411963da6..5303016269b9 100644 --- a/frontend/docs/scripting/functions/asin.md +++ b/frontend/docs/scripting/functions/asin.md @@ -19,7 +19,7 @@ The angle in degrees, in the interval [-90.0,+90.0]. ## Examples -```c +```pawn //The arc sine of 0.500000 is 30.000000 degrees. public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/atan.md b/frontend/docs/scripting/functions/atan.md index e3b4a47a1441..a319ea8f4195 100644 --- a/frontend/docs/scripting/functions/atan.md +++ b/frontend/docs/scripting/functions/atan.md @@ -19,7 +19,7 @@ The angle in degrees, in the interval [-90.0,+90.0]. ## Examples -```c +```pawn //The arc tangent of 1.000000 is 45.000000 degrees. public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/atan2.md b/frontend/docs/scripting/functions/atan2.md index ddd126b57ea1..fe4bf2c0b479 100644 --- a/frontend/docs/scripting/functions/atan2.md +++ b/frontend/docs/scripting/functions/atan2.md @@ -26,7 +26,7 @@ The angle in degrees, in the interval [-180.0,+180.0]. ## Examples -```c +```pawn //The arc tangent for (x=-10.000000, y=10.000000) is 135.000000 degrees. public OnGameModeInit() diff --git a/frontend/docs/scripting/functions/clamp.md b/frontend/docs/scripting/functions/clamp.md index 8393a8ff03b7..e354c4edf7aa 100644 --- a/frontend/docs/scripting/functions/clamp.md +++ b/frontend/docs/scripting/functions/clamp.md @@ -21,7 +21,7 @@ Force a value to be inside a range. ## Examples -```c +```pawn new valueA = 3, valueB = 7, diff --git a/frontend/docs/scripting/functions/db_close.md b/frontend/docs/scripting/functions/db_close.md index dcca194527a4..949748f1a466 100644 --- a/frontend/docs/scripting/functions/db_close.md +++ b/frontend/docs/scripting/functions/db_close.md @@ -21,7 +21,7 @@ Closes a SQLite database connection that was opened with [db_open](db_open). ## Examples -```c +```pawn static DB:gDBConnectionHandle; // ... @@ -65,7 +65,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_field_name.md b/frontend/docs/scripting/functions/db_field_name.md index 02e9cfe3559b..3bcbfb8edbe3 100644 --- a/frontend/docs/scripting/functions/db_field_name.md +++ b/frontend/docs/scripting/functions/db_field_name.md @@ -28,7 +28,7 @@ Returns 1 if result set handle is valid, otherwise 0. ## Examples -```c +```pawn static DB:gDBConnectionHandle; public OnGameModeInit() @@ -89,7 +89,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_free_result.md b/frontend/docs/scripting/functions/db_free_result.md index 103f7c9b960c..c1822f2724ee 100644 --- a/frontend/docs/scripting/functions/db_free_result.md +++ b/frontend/docs/scripting/functions/db_free_result.md @@ -25,7 +25,7 @@ Returns 1 if result set handle is valid, otherwise 0. ## Examples -```c +```pawn // entity_storage.inc EntityStorage_SpawnAll(DB:connectionHandle) @@ -44,7 +44,7 @@ EntityStorage_SpawnAll(DB:connectionHandle) } ``` -```c +```pawn // mode.pwn #include diff --git a/frontend/docs/scripting/functions/db_get_field.md b/frontend/docs/scripting/functions/db_get_field.md index 4067b195a441..ddb053c73c30 100644 --- a/frontend/docs/scripting/functions/db_get_field.md +++ b/frontend/docs/scripting/functions/db_get_field.md @@ -28,7 +28,7 @@ Returns 1 if result set handle is valid and the column is available, otherwise 0 ## Example -```c +```pawn // examples.inc // ... @@ -100,7 +100,7 @@ Examples_ListNames(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -151,7 +151,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_get_field_assoc.md b/frontend/docs/scripting/functions/db_get_field_assoc.md index 15c74ec09a34..9125ed0bc9e1 100644 --- a/frontend/docs/scripting/functions/db_get_field_assoc.md +++ b/frontend/docs/scripting/functions/db_get_field_assoc.md @@ -28,7 +28,7 @@ Returns 1 if result set handle is valid and the column is available, otherwise 0 ## Examples -```c +```pawn // examples.inc // ... @@ -60,7 +60,7 @@ Examples_ListNames(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -111,7 +111,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_get_field_assoc_float.md b/frontend/docs/scripting/functions/db_get_field_assoc_float.md index b4de0a666d4c..bbbcba7a08e8 100644 --- a/frontend/docs/scripting/functions/db_get_field_assoc_float.md +++ b/frontend/docs/scripting/functions/db_get_field_assoc_float.md @@ -26,7 +26,7 @@ Retrieved value as floating point number. ## Example -```c +```pawn // examples.inc // ... @@ -61,7 +61,7 @@ Float:Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -112,7 +112,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_get_field_assoc_int.md b/frontend/docs/scripting/functions/db_get_field_assoc_int.md index fd8244c525a8..e8a9c813fe2f 100644 --- a/frontend/docs/scripting/functions/db_get_field_assoc_int.md +++ b/frontend/docs/scripting/functions/db_get_field_assoc_int.md @@ -26,7 +26,7 @@ Retrieved value as an integer. ## Example -```c +```pawn // examples.inc // ... @@ -61,7 +61,7 @@ Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -112,7 +112,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_get_field_float.md b/frontend/docs/scripting/functions/db_get_field_float.md index afc0c532aced..2dc2e61bddc6 100644 --- a/frontend/docs/scripting/functions/db_get_field_float.md +++ b/frontend/docs/scripting/functions/db_get_field_float.md @@ -26,7 +26,7 @@ Retrieved value as a floating point number. ## Example -```c +```pawn // examples.inc // ... @@ -101,7 +101,7 @@ Float:Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -152,7 +152,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_get_field_int.md b/frontend/docs/scripting/functions/db_get_field_int.md index c0fd4e83c9a2..5754f2b7b4c2 100644 --- a/frontend/docs/scripting/functions/db_get_field_int.md +++ b/frontend/docs/scripting/functions/db_get_field_int.md @@ -26,7 +26,7 @@ Retrieved value as an integer. ## Example -```c +```pawn // examples.inc // ... @@ -101,7 +101,7 @@ Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -152,7 +152,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_get_mem_handle.md b/frontend/docs/scripting/functions/db_get_mem_handle.md index f46e6967a76e..9a08c6ae4ede 100644 --- a/frontend/docs/scripting/functions/db_get_mem_handle.md +++ b/frontend/docs/scripting/functions/db_get_mem_handle.md @@ -27,7 +27,7 @@ Returns the memory handle of the database connection handle. ## Examples -```c +```pawn static DB:gDBConnectionHandle; // ... @@ -72,7 +72,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_get_result_mem_handle.md b/frontend/docs/scripting/functions/db_get_result_mem_handle.md index 60672262fac5..1a65bfda1363 100644 --- a/frontend/docs/scripting/functions/db_get_result_mem_handle.md +++ b/frontend/docs/scripting/functions/db_get_result_mem_handle.md @@ -27,7 +27,7 @@ Returns the memory handle of the database result set handle. ## Examples -```c +```pawn static DB:gDBConnectionHandle; // ... @@ -77,7 +77,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_next_row.md b/frontend/docs/scripting/functions/db_next_row.md index d3a819c4c071..56c60ea77815 100644 --- a/frontend/docs/scripting/functions/db_next_row.md +++ b/frontend/docs/scripting/functions/db_next_row.md @@ -25,7 +25,7 @@ Returns 1 if result set handle is valid and the last row is not reached yet, oth ## Examples -```c +```pawn // examples.inc // ... @@ -57,7 +57,7 @@ Examples_ListNames(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -108,7 +108,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_num_fields.md b/frontend/docs/scripting/functions/db_num_fields.md index 2b231bb0ff04..d29a32f7f421 100644 --- a/frontend/docs/scripting/functions/db_num_fields.md +++ b/frontend/docs/scripting/functions/db_num_fields.md @@ -25,7 +25,7 @@ The number of fields in the result. ## Example -```c +```pawn // examples.inc // ... @@ -100,7 +100,7 @@ Float:Examples_CalculateSum(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -151,7 +151,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_num_rows.md b/frontend/docs/scripting/functions/db_num_rows.md index c2e66b38ec36..243ad8cdea7f 100644 --- a/frontend/docs/scripting/functions/db_num_rows.md +++ b/frontend/docs/scripting/functions/db_num_rows.md @@ -25,7 +25,7 @@ The number of rows in the result. ## Examples -```c +```pawn // examples.inc // ... @@ -57,7 +57,7 @@ Examples_ListNames(DB:dbConnectionHandle) } ``` -```c +```pawn // mode.pwn // ... @@ -108,7 +108,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_open.md b/frontend/docs/scripting/functions/db_open.md index 333a75199081..274ce65f420b 100644 --- a/frontend/docs/scripting/functions/db_open.md +++ b/frontend/docs/scripting/functions/db_open.md @@ -20,7 +20,7 @@ Returns index (**starting at 1**) of the database connection. ## Examples -```c +```pawn static DB:gDBConnectionHandle; // ... @@ -64,7 +64,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/db_query.md b/frontend/docs/scripting/functions/db_query.md index 517663616970..8b757854e66e 100644 --- a/frontend/docs/scripting/functions/db_query.md +++ b/frontend/docs/scripting/functions/db_query.md @@ -26,7 +26,7 @@ The query result index (**starting at 1**) if successful, otherwise 0. ## Examples -```c +```pawn // entity_storage.inc EntityStorage_SpawnAll(DB:connectionHandle) @@ -45,7 +45,7 @@ EntityStorage_SpawnAll(DB:connectionHandle) } ``` -```c +```pawn // mode.pwn #include @@ -94,7 +94,7 @@ public OnGameModeExit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/deleteproperty.md b/frontend/docs/scripting/functions/deleteproperty.md index 64965a6bafee..756b93d8ad77 100644 --- a/frontend/docs/scripting/functions/deleteproperty.md +++ b/frontend/docs/scripting/functions/deleteproperty.md @@ -21,11 +21,11 @@ The value of the property. If the property does not exist, the function returns ## Examples -```c +```pawn deleteproperty(0, "", 123984334); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/existproperty.md b/frontend/docs/scripting/functions/existproperty.md index 61e4a8c9e305..bcbd7f702df3 100644 --- a/frontend/docs/scripting/functions/existproperty.md +++ b/frontend/docs/scripting/functions/existproperty.md @@ -21,14 +21,14 @@ True if the property exists and false otherwise. ## Examples -```c +```pawn if (existproperty(0, "", 123984334)) { //the property exists, do something } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/fattrib.md b/frontend/docs/scripting/functions/fattrib.md index eaab1e80601d..3dea8789db53 100644 --- a/frontend/docs/scripting/functions/fattrib.md +++ b/frontend/docs/scripting/functions/fattrib.md @@ -23,7 +23,7 @@ Set the file attributes. ## Examples -```c +```pawn // Change file modification time to 'Thu Mar 07 2024 06:28:15' if (fattrib("file.txt", 1709792895)) { @@ -37,7 +37,7 @@ else } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/fblockread.md b/frontend/docs/scripting/functions/fblockread.md index bc61285acf65..391a5c2bc9bf 100644 --- a/frontend/docs/scripting/functions/fblockread.md +++ b/frontend/docs/scripting/functions/fblockread.md @@ -21,7 +21,7 @@ The number of cells read. Zero, if the file end has been reached. ## Examples -```c +```pawn // Define "some_enum" enum _:some_enum { @@ -73,7 +73,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fblockwrite.md b/frontend/docs/scripting/functions/fblockwrite.md index fdaba2fda519..8f1a5838b7a9 100644 --- a/frontend/docs/scripting/functions/fblockwrite.md +++ b/frontend/docs/scripting/functions/fblockwrite.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn // Define "some_enum" enum _:some_enum { @@ -56,7 +56,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fclose.md b/frontend/docs/scripting/functions/fclose.md index c625c731f4bf..049971f76647 100644 --- a/frontend/docs/scripting/functions/fclose.md +++ b/frontend/docs/scripting/functions/fclose.md @@ -21,7 +21,7 @@ Closes a file. Files should always be closed when the script no longer needs the ## Examples -```c +```pawn // Open "file.txt" in "append only" mode new File:handle = fopen("file.txt", io_append); @@ -43,7 +43,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fcopy.md b/frontend/docs/scripting/functions/fcopy.md index d173062401d0..e7046b33241e 100644 --- a/frontend/docs/scripting/functions/fcopy.md +++ b/frontend/docs/scripting/functions/fcopy.md @@ -22,7 +22,7 @@ Copy a file. ## Examples -```c +```pawn if (fcopy("example.txt", "file.txt")) { // Success @@ -35,7 +35,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fcreatedir.md b/frontend/docs/scripting/functions/fcreatedir.md index 029008957898..3aeab7a96bb4 100644 --- a/frontend/docs/scripting/functions/fcreatedir.md +++ b/frontend/docs/scripting/functions/fcreatedir.md @@ -21,7 +21,7 @@ Create a directory. ## Examples -```c +```pawn if (fcreatedir("logs")) { // Success @@ -34,7 +34,7 @@ else } ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/fexist.md b/frontend/docs/scripting/functions/fexist.md index 4dc988bdc1e4..2f0f1bead720 100644 --- a/frontend/docs/scripting/functions/fexist.md +++ b/frontend/docs/scripting/functions/fexist.md @@ -19,7 +19,7 @@ The number of files that match the pattern. ## Examples -```c +```pawn // Check, if "file.txt" exists if (fexist("file.txt")) { diff --git a/frontend/docs/scripting/functions/fflush.md b/frontend/docs/scripting/functions/fflush.md index 5ff34be25118..3afa81e44975 100644 --- a/frontend/docs/scripting/functions/fflush.md +++ b/frontend/docs/scripting/functions/fflush.md @@ -23,7 +23,7 @@ Flush a file to disk (ensure all writes are complete). Actually just calls [flen ## Examples -```c +```pawn // Open "file.txt" in "append only" mode new File:handle = fopen("file.txt", io_append); diff --git a/frontend/docs/scripting/functions/fgetchar.md b/frontend/docs/scripting/functions/fgetchar.md index 0ad32eae09bd..baa3a4827160 100644 --- a/frontend/docs/scripting/functions/fgetchar.md +++ b/frontend/docs/scripting/functions/fgetchar.md @@ -21,7 +21,7 @@ If succeed, it returns the extended ASCII or UTF-8 value of the character at the ## Examples -```c +```pawn // Open "file.txt" in "read only" mode new File:handle = fopen("file.txt", io_read); @@ -48,7 +48,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/filecrc.md b/frontend/docs/scripting/functions/filecrc.md index 7e06ab1c2744..5164966df9be 100644 --- a/frontend/docs/scripting/functions/filecrc.md +++ b/frontend/docs/scripting/functions/filecrc.md @@ -21,7 +21,7 @@ The 32-bit CRC value of the file, or **0** if the file cannot be opened. ## Examples -```c +```pawn new crc = filecrc("file.txt"); if (crc) @@ -36,7 +36,7 @@ else } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/flength.md b/frontend/docs/scripting/functions/flength.md index 4db9a49b3bfe..73f3e37ca184 100644 --- a/frontend/docs/scripting/functions/flength.md +++ b/frontend/docs/scripting/functions/flength.md @@ -19,7 +19,7 @@ The length of a file, in bytes. ## Examples -```c +```pawn // Open "file.txt" in "read only" mode new File:handle = fopen("file.txt", io_read); @@ -41,7 +41,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/float.md b/frontend/docs/scripting/functions/float.md index 4c7cd10cf87a..eac6264a53a9 100644 --- a/frontend/docs/scripting/functions/float.md +++ b/frontend/docs/scripting/functions/float.md @@ -19,7 +19,7 @@ The given integer as a float ## Examples -```c +```pawn new Float:FloatValue; new Value = 52; FloatValue = float(Value); // Converts Value(52) into a float and stores it in 'FloatValue' (52.0) diff --git a/frontend/docs/scripting/functions/floatabs.md b/frontend/docs/scripting/functions/floatabs.md index e4f87114c251..e28567c8bce9 100644 --- a/frontend/docs/scripting/functions/floatabs.md +++ b/frontend/docs/scripting/functions/floatabs.md @@ -19,7 +19,7 @@ The absolute value of the float (as a float value). ## Examples -```c +```pawn new Float:value; value = floatabs(47.0); // This will return 47.0 diff --git a/frontend/docs/scripting/functions/floatadd.md b/frontend/docs/scripting/functions/floatadd.md index 9959eed76640..ed08c51959b9 100644 --- a/frontend/docs/scripting/functions/floatadd.md +++ b/frontend/docs/scripting/functions/floatadd.md @@ -20,7 +20,7 @@ The sum of the two given floats. ## Examples -```c +```pawn public OnGameModeInit() { new Float:Number1 = 2, Float:Number2 = 3; // Declares two floats, Number1 (2) and Number2 (3) diff --git a/frontend/docs/scripting/functions/floatcmp.md b/frontend/docs/scripting/functions/floatcmp.md index 5aea638ad7de..7e62da6860e4 100644 --- a/frontend/docs/scripting/functions/floatcmp.md +++ b/frontend/docs/scripting/functions/floatcmp.md @@ -20,7 +20,7 @@ floatcmp can be used to compare float values to each other, to validate the comp ## Examples -```c +```pawn new value; value = floatcmp(2.0, 2.0); // Returns 0 because they match. diff --git a/frontend/docs/scripting/functions/floatcos.md b/frontend/docs/scripting/functions/floatcos.md index 22f5ae8e6c49..5e910ca33cad 100644 --- a/frontend/docs/scripting/functions/floatcos.md +++ b/frontend/docs/scripting/functions/floatcos.md @@ -20,7 +20,7 @@ The cosine of the value entered. ## Examples -```c +```pawn public OnGameModeInit() { printf("The cosine from 90° is %.0f", floatcos(90.0, degrees)); @@ -29,7 +29,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/floatdiv.md b/frontend/docs/scripting/functions/floatdiv.md index b985c12fb4d2..5f0991f56265 100644 --- a/frontend/docs/scripting/functions/floatdiv.md +++ b/frontend/docs/scripting/functions/floatdiv.md @@ -20,7 +20,7 @@ The quotient of the two given floats. ## Examples -```c +```pawn public OnGameModeInit() { new Float:Number1 = 8.05, Float:Number2 = 3.5; // Declares two floats, Number1 (8.05) and Number2 (3.5) diff --git a/frontend/docs/scripting/functions/floatfract.md b/frontend/docs/scripting/functions/floatfract.md index 7657c0bf772e..6d0b97b5b54a 100644 --- a/frontend/docs/scripting/functions/floatfract.md +++ b/frontend/docs/scripting/functions/floatfract.md @@ -19,7 +19,7 @@ The fractional part of the float, as a float value. ## Examples -```c +```pawn new Float:fFract = floatfract(3.14159); // returns 0.14159 ``` diff --git a/frontend/docs/scripting/functions/floatlog.md b/frontend/docs/scripting/functions/floatlog.md index 625e0cea0464..836cf82cdc76 100644 --- a/frontend/docs/scripting/functions/floatlog.md +++ b/frontend/docs/scripting/functions/floatlog.md @@ -20,7 +20,7 @@ The logarithm as a float value. ## Examples -```c +```pawn public OnGameModeInit() { printf("The logarithm of 15.0 with the base 10.0 is %.1f", floatlog(15.0, 10.0)); diff --git a/frontend/docs/scripting/functions/floatmul.md b/frontend/docs/scripting/functions/floatmul.md index 5a44278521dc..c9688b6366db 100644 --- a/frontend/docs/scripting/functions/floatmul.md +++ b/frontend/docs/scripting/functions/floatmul.md @@ -20,7 +20,7 @@ The product of the two given floats ## Examples -```c +```pawn public OnGameModeInit() { new Float:Number1 = 2.3, Float:Number2 = 3.5; // Declares two floats, Number1 (2.3) and Number2 (3.5) @@ -30,7 +30,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/floatpower.md b/frontend/docs/scripting/functions/floatpower.md index 1fe5dbedee15..5236086876d2 100644 --- a/frontend/docs/scripting/functions/floatpower.md +++ b/frontend/docs/scripting/functions/floatpower.md @@ -20,7 +20,7 @@ The result of 'value' to the power of 'exponent'. ## Examples -```c +```pawn printf("2 to the power of 8 is %.1f", floatpower(2.0, 8.0)); // Result: 256.0 ``` diff --git a/frontend/docs/scripting/functions/floatround.md b/frontend/docs/scripting/functions/floatround.md index 97758fb8031d..0c6f3e86cf5e 100644 --- a/frontend/docs/scripting/functions/floatround.md +++ b/frontend/docs/scripting/functions/floatround.md @@ -20,21 +20,21 @@ The rounded value as an integer. ## Examples -```c +```pawn new value = floatround(3.3, floatround_ceil); printf("3.3 rounded to %d", value); // 3.3 rounded to 4 ```
-```c +```pawn new value = floatround(50.996229); printf("50.996229 rounded to %d", value); // 50.996229 rounded to 51 ```
-```c +```pawn new value = floatround(270.0034); printf("270.0034 rounded to %d", value); // 270.0034 rounded to 270 ``` diff --git a/frontend/docs/scripting/functions/floatsin.md b/frontend/docs/scripting/functions/floatsin.md index c769296d74d0..4a42e1f4a377 100644 --- a/frontend/docs/scripting/functions/floatsin.md +++ b/frontend/docs/scripting/functions/floatsin.md @@ -20,7 +20,7 @@ The sine of the value entered. ## Examples -```c +```pawn GetPosInFrontOfPlayer(playerid, Float:distance, &Float:x, &Float:y, &Float:z) { if (GetPlayerPos(playerid, x, y, z)) // this functions returns 0 if the player is not connected @@ -37,7 +37,7 @@ GetPosInFrontOfPlayer(playerid, Float:distance, &Float:x, &Float:y, &Float:z) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/floatsqroot.md b/frontend/docs/scripting/functions/floatsqroot.md index 1f5e7c4968cd..87ae0e45c7bd 100644 --- a/frontend/docs/scripting/functions/floatsqroot.md +++ b/frontend/docs/scripting/functions/floatsqroot.md @@ -19,11 +19,11 @@ The square root of the input value, as a float. ## Examples -```c +```pawn new Float:sqroot = floatsqroot(25.0); // Returns 5.0, because 5x5 = 25 ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/floatstr.md b/frontend/docs/scripting/functions/floatstr.md index 8d5c20d6d0ff..ae2aab9651dd 100644 --- a/frontend/docs/scripting/functions/floatstr.md +++ b/frontend/docs/scripting/functions/floatstr.md @@ -19,7 +19,7 @@ The requested float value. ## Examples -```c +```pawn new string[4] = "6.9"; // A STRING holding a FLOAT. new Float:value = floatstr(string); diff --git a/frontend/docs/scripting/functions/floatsub.md b/frontend/docs/scripting/functions/floatsub.md index 1ead22e49b71..381f336bade0 100644 --- a/frontend/docs/scripting/functions/floatsub.md +++ b/frontend/docs/scripting/functions/floatsub.md @@ -20,7 +20,7 @@ The difference of the two given floats. ## Examples -```c +```pawn public OnGameModeInit() { new Float:Number1 = 5, Float:Number2 = 2; // Declares two floats, Number1 (5) and Number2 (2) diff --git a/frontend/docs/scripting/functions/floattan.md b/frontend/docs/scripting/functions/floattan.md index 4a9999d25c4a..cb15df5970bb 100644 --- a/frontend/docs/scripting/functions/floattan.md +++ b/frontend/docs/scripting/functions/floattan.md @@ -20,7 +20,7 @@ The tangent from the value entered. ## Examples -```c +```pawn public OnGameModeInit() { printf("The tangent from 30° is %.0f", floattan(30.0, degrees)); @@ -29,7 +29,7 @@ public OnGameModeInit() } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fmatch.md b/frontend/docs/scripting/functions/fmatch.md index 4ce97d1720bb..35506e619a48 100644 --- a/frontend/docs/scripting/functions/fmatch.md +++ b/frontend/docs/scripting/functions/fmatch.md @@ -24,7 +24,7 @@ Find a filename matching a pattern. ## Examples -```c +```pawn if (fmatch("file.txt", "*.txt")) { print("The file matches the pattern."); @@ -35,7 +35,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fopen.md b/frontend/docs/scripting/functions/fopen.md index 38344692adc3..df885ff379e9 100644 --- a/frontend/docs/scripting/functions/fopen.md +++ b/frontend/docs/scripting/functions/fopen.md @@ -24,7 +24,7 @@ Returns the file handle. This handle is used for reading and writing. **io_read mode:** -```c +```pawn // Open "file.txt" in "read only" mode new File:handle = fopen("file.txt", io_read); @@ -56,7 +56,7 @@ else **io_write mode:** -```c +```pawn // Open "file.txt" in "write only" mode new File:handle = fopen("file.txt", io_write); @@ -83,7 +83,7 @@ else **io_readwrite mode:** -```c +```pawn // Open "file.txt" in "read and write" mode new File:handle = fopen("file.txt", io_readwrite); @@ -122,7 +122,7 @@ else **io_append mode:** -```c +```pawn // Open "file.txt" in "append only" mode new File:handle = fopen("file.txt", io_append); @@ -144,7 +144,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/format.md b/frontend/docs/scripting/functions/format.md index b1c1aaf10c86..23731604a056 100644 --- a/frontend/docs/scripting/functions/format.md +++ b/frontend/docs/scripting/functions/format.md @@ -42,7 +42,7 @@ You can also specify a variable field width or precision by using an asterisk (` ## Examples -```c +```pawn new result[128]; new number = 42; format(result, sizeof(result), "The number is %i.", number); // The number is 42. @@ -54,7 +54,7 @@ format(result, sizeof(result), "This is a %s containing the number %i.", string,
-```c +```pawn new string[64]; format(string, sizeof(string), "Your score is: %d", GetPlayerScore(playerid)); SendClientMessage(playerid, 0xFF8000FF, string); @@ -62,7 +62,7 @@ SendClientMessage(playerid, 0xFF8000FF, string);
-```c +```pawn new string[32]; new hour, minute, second; gettime(hour, minute, second); @@ -74,13 +74,13 @@ format(string, sizeof(string), "The time is %02d:%02d:%02d.", hour, minute, seco A quite easy way to insert the literal percent sign (%) is by doing the following. -```c +```pawn new string[32]; format(string, sizeof(string), "43%s of my shirts are black.", "%%"); SendClientMessage(playerid, 0xFF8000FF, string); ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fputchar.md b/frontend/docs/scripting/functions/fputchar.md index e209671a0616..504df2e83960 100644 --- a/frontend/docs/scripting/functions/fputchar.md +++ b/frontend/docs/scripting/functions/fputchar.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn // Open "file.txt" in "write only" mode new File:handle = fopen("file.txt", io_write); @@ -42,7 +42,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fread.md b/frontend/docs/scripting/functions/fread.md index 6fe79a635c53..f6a1f5dc27f8 100644 --- a/frontend/docs/scripting/functions/fread.md +++ b/frontend/docs/scripting/functions/fread.md @@ -22,7 +22,7 @@ The length of **string** (the read text) as an integer. ## Examples -```c +```pawn // Open "file.txt" in "read only" mode new File:handle = fopen("file.txt", io_read); @@ -52,7 +52,7 @@ else
-```c +```pawn // Open "file.txt" in "read and write" mode new File:handle = fopen("file.txt"); @@ -86,7 +86,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fremove.md b/frontend/docs/scripting/functions/fremove.md index f5f00306ca2a..e894111bcb4c 100644 --- a/frontend/docs/scripting/functions/fremove.md +++ b/frontend/docs/scripting/functions/fremove.md @@ -23,7 +23,7 @@ Delete a file. **Delete a file:** -```c +```pawn if (fremove("example.txt")) { print("The file \"example.txt\" removed."); @@ -36,7 +36,7 @@ else **Delete a directory:** -```c +```pawn if (fremove("logs")) { print("The directory \"logs\" removed."); @@ -47,7 +47,7 @@ else } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/frename.md b/frontend/docs/scripting/functions/frename.md index aa548c78c073..656a6219c945 100644 --- a/frontend/docs/scripting/functions/frename.md +++ b/frontend/docs/scripting/functions/frename.md @@ -22,7 +22,7 @@ Rename a file. ## Examples -```c +```pawn if (frename("example.txt", "file.txt")) { // Success diff --git a/frontend/docs/scripting/functions/fseek.md b/frontend/docs/scripting/functions/fseek.md index 3147806c973f..d9169e52b9eb 100644 --- a/frontend/docs/scripting/functions/fseek.md +++ b/frontend/docs/scripting/functions/fseek.md @@ -21,7 +21,7 @@ The new position; relative to the start of the file. ## Examples -```c +```pawn // Open "file.txt" in "read only" mode new File:handle = fopen("file.txt", io_read); @@ -49,7 +49,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/fstat.md b/frontend/docs/scripting/functions/fstat.md index 9410293d6734..069ff7528857 100644 --- a/frontend/docs/scripting/functions/fstat.md +++ b/frontend/docs/scripting/functions/fstat.md @@ -27,7 +27,7 @@ Return the size and the timestamp of a file. ## Examples -```c +```pawn new size, timestamp, diff --git a/frontend/docs/scripting/functions/ftell.md b/frontend/docs/scripting/functions/ftell.md index 3257046a8398..a38e36b53de5 100644 --- a/frontend/docs/scripting/functions/ftell.md +++ b/frontend/docs/scripting/functions/ftell.md @@ -21,7 +21,7 @@ The current position, relative to the start of the file. ## Examples -```c +```pawn // Open "file.txt" in "read only" mode new File:handle = fopen("file.txt", io_read); diff --git a/frontend/docs/scripting/functions/ftemp.md b/frontend/docs/scripting/functions/ftemp.md index f4e135f63dc0..0e082796da8d 100644 --- a/frontend/docs/scripting/functions/ftemp.md +++ b/frontend/docs/scripting/functions/ftemp.md @@ -15,7 +15,7 @@ The temporary file handle. **0** if failed. ## Examples -```c +```pawn // Create a temporary file stream new File:t_handle = ftemp(); @@ -107,7 +107,7 @@ else } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/funcidx.md b/frontend/docs/scripting/functions/funcidx.md index ad53ccd2e2c9..b87cf0bcc6fe 100644 --- a/frontend/docs/scripting/functions/funcidx.md +++ b/frontend/docs/scripting/functions/funcidx.md @@ -21,7 +21,7 @@ The ID of the function (IDs start at **0**). ## Examples -```c +```pawn public OnFilterScriptInit() { printf("ID of OnFilterScriptInit: %d", funcidx("OnFilterScriptInit")); diff --git a/frontend/docs/scripting/functions/fwrite.md b/frontend/docs/scripting/functions/fwrite.md index 307d234a74ab..3c8e7f28a7cb 100644 --- a/frontend/docs/scripting/functions/fwrite.md +++ b/frontend/docs/scripting/functions/fwrite.md @@ -20,7 +20,7 @@ The length of the written string as an integer. ## Examples -```c +```pawn // Open "file.txt" in "write only" mode new File:handle = fopen("file.txt", io_write); @@ -44,7 +44,7 @@ else
-```c +```pawn // Open "file.txt" in "read and write" mode new File:handle = fopen("file.txt"); @@ -80,7 +80,7 @@ else
-```c +```pawn // Open "file.txt" in "append only" mode new File:handle = fopen("file.txt", io_append); @@ -102,7 +102,7 @@ else } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/getarg.md b/frontend/docs/scripting/functions/getarg.md index 084a3231acb3..67e6f1a57ea7 100644 --- a/frontend/docs/scripting/functions/getarg.md +++ b/frontend/docs/scripting/functions/getarg.md @@ -20,7 +20,7 @@ The value of the argument. ## Examples -```c +```pawn SomeFunc(...) { printf("%i", getarg(3)); diff --git a/frontend/docs/scripting/functions/getdate.md b/frontend/docs/scripting/functions/getdate.md index fa4a98b1d31e..b9f78180f6b2 100644 --- a/frontend/docs/scripting/functions/getdate.md +++ b/frontend/docs/scripting/functions/getdate.md @@ -21,7 +21,7 @@ The number of days since the start of the year. ## Examples -```c +```pawn new Year, Month, Day, Days; Days = getdate(Year, Month, Day); printf("%02d/%02d/%d", Day, Month, Year); diff --git a/frontend/docs/scripting/functions/getproperty.md b/frontend/docs/scripting/functions/getproperty.md index 115b091e7260..7faf23f26e95 100644 --- a/frontend/docs/scripting/functions/getproperty.md +++ b/frontend/docs/scripting/functions/getproperty.md @@ -22,7 +22,7 @@ The value of a property when the name is passed in; fills in the string argument ## Examples -```c +```pawn new value[16]; getproperty(0, "", 123984334, value); @@ -32,7 +32,7 @@ strunpack(value, value, sizeof(value)); print(value); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/gettime.md b/frontend/docs/scripting/functions/gettime.md index d5bbe32cbc28..e8e3c49d0575 100644 --- a/frontend/docs/scripting/functions/gettime.md +++ b/frontend/docs/scripting/functions/gettime.md @@ -21,7 +21,7 @@ The function itself returns a [Unix Timestamp](https://en.wikipedia.org/wiki/Uni ## Examples -```c +```pawn new hours, minutes, @@ -33,7 +33,7 @@ printf("%02d:%02d:%02d", hours, minutes, seconds); printf("Seconds since midnight 1st January 1970: %d", timestamp); ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/gpci.md b/frontend/docs/scripting/functions/gpci.md index 8e27187fa117..4b80d650e2e4 100644 --- a/frontend/docs/scripting/functions/gpci.md +++ b/frontend/docs/scripting/functions/gpci.md @@ -2,7 +2,7 @@ title: gpci sidebar_label: gpci description: Fetch the CI (computer/client identification) of a user, this is linked to their SAMP/GTA on their computer. -tags: [] +tags: ["player", "administration"] --- ## Description @@ -31,7 +31,7 @@ This function will return the string value of a user's CI. **SA-MP server:** -```c +```pawn #include #if !defined gpci @@ -52,7 +52,7 @@ public OnPlayerConnect(playerid) **open.mp server:** -```c +```pawn #include public OnPlayerConnect(playerid) @@ -64,7 +64,7 @@ public OnPlayerConnect(playerid) } ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/heapspace.md b/frontend/docs/scripting/functions/heapspace.md index 0ffe2a7eb17b..94ffd460a3fd 100644 --- a/frontend/docs/scripting/functions/heapspace.md +++ b/frontend/docs/scripting/functions/heapspace.md @@ -15,7 +15,7 @@ The free space on the heap in bytes. The stack and the heap occupy a shared memo ## Examples -```c +```pawn public OnGameModeInit() { printf("Heapspace: %i kilobytes", heapspace() / 1024); diff --git a/frontend/docs/scripting/functions/ispacked.md b/frontend/docs/scripting/functions/ispacked.md index 45f0bb2381c0..ef7ea9754dd3 100644 --- a/frontend/docs/scripting/functions/ispacked.md +++ b/frontend/docs/scripting/functions/ispacked.md @@ -19,7 +19,7 @@ Checks if the given string is packed. ## Examples -```c +```pawn // Create a packed string new string[24 char]; diff --git a/frontend/docs/scripting/functions/listenport.md b/frontend/docs/scripting/functions/listenport.md index 2f813ba19ff3..31e18f9e8f1d 100644 --- a/frontend/docs/scripting/functions/listenport.md +++ b/frontend/docs/scripting/functions/listenport.md @@ -23,7 +23,7 @@ Sets up the port number to listen at. This function always returns **0**. -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/max.md b/frontend/docs/scripting/functions/max.md index f4b864a069e3..0c739dd9e499 100644 --- a/frontend/docs/scripting/functions/max.md +++ b/frontend/docs/scripting/functions/max.md @@ -22,7 +22,7 @@ If both are equivalent, `value1` is returned. ## Examples -```c +```pawn public OnGameModeInit() { new a, b, result; diff --git a/frontend/docs/scripting/functions/memcpy.md b/frontend/docs/scripting/functions/memcpy.md index ee65d6f59b12..207965bbf27d 100644 --- a/frontend/docs/scripting/functions/memcpy.md +++ b/frontend/docs/scripting/functions/memcpy.md @@ -23,7 +23,7 @@ Copy bytes from one location to another. ## Examples -```c +```pawn // Concatenate two strings with memcpy new destination[64] = "This is ", diff --git a/frontend/docs/scripting/functions/min.md b/frontend/docs/scripting/functions/min.md index 05f7b6009df3..0671272a5e90 100644 --- a/frontend/docs/scripting/functions/min.md +++ b/frontend/docs/scripting/functions/min.md @@ -22,7 +22,7 @@ If both are equivalent, `value1` is returned. ## Examples -```c +```pawn public OnGameModeInit() { diff --git a/frontend/docs/scripting/functions/numargs.md b/frontend/docs/scripting/functions/numargs.md index cedb30e41c93..93647d708057 100644 --- a/frontend/docs/scripting/functions/numargs.md +++ b/frontend/docs/scripting/functions/numargs.md @@ -15,7 +15,7 @@ The number of arguments passed. ## Examples -```c +```pawn SomeFunction(...) { printf("numargs(): %i", numargs()); diff --git a/frontend/docs/scripting/functions/print.md b/frontend/docs/scripting/functions/print.md index 5fdebeae5d61..ad443e794883 100644 --- a/frontend/docs/scripting/functions/print.md +++ b/frontend/docs/scripting/functions/print.md @@ -42,7 +42,7 @@ Most systems also support the bright/bold versions of these colours. The followi ## Examples -```c +```pawn public OnGameModeInit() { print("Gamemode started."); diff --git a/frontend/docs/scripting/functions/printf.md b/frontend/docs/scripting/functions/printf.md index 730534d80cff..f024f8616eca 100644 --- a/frontend/docs/scripting/functions/printf.md +++ b/frontend/docs/scripting/functions/printf.md @@ -40,7 +40,7 @@ You can also specify a variable field width or precision by using an asterisk (` ## Examples -```c +```pawn new number = 42; printf("The number is %d.", number); // The number is 42. @@ -51,7 +51,7 @@ new character = 64; printf("I'm %c home", character); // I'm @ home ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/random.md b/frontend/docs/scripting/functions/random.md index 45ce911d489c..f594590b9c4f 100644 --- a/frontend/docs/scripting/functions/random.md +++ b/frontend/docs/scripting/functions/random.md @@ -19,7 +19,7 @@ A random number ranging from 0 to max-1. ## Examples -```c +```pawn new value = random(5); // 'value' might be 0, 1, 2, 3 or 4. (5 possible values) @@ -27,7 +27,7 @@ new value = random(5); Here's an example of how to script random spawnpoints: -```c +```pawn new Float:RandomSpawn[][4] = { // Positions, (X, Y, Z and Facing Angle) @@ -50,7 +50,7 @@ public OnPlayerSpawn(playerid) } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/setproperty.md b/frontend/docs/scripting/functions/setproperty.md index 7543d34a1d18..08800072a9f1 100644 --- a/frontend/docs/scripting/functions/setproperty.md +++ b/frontend/docs/scripting/functions/setproperty.md @@ -24,7 +24,7 @@ This function does not return any specific values. **Storing Integers** -```c +```pawn setproperty(.name = "MyInteger", .value = 42); new value = getproperty(.name = "MyInteger"); @@ -33,7 +33,7 @@ printf("Value that was stored is: %d", value); **Storing Strings** -```c +```pawn setproperty(0, "", 123984334, ":)"); new value[4]; @@ -46,13 +46,13 @@ print(value); Or... seeing as _all_ the parameters are optional, a piece of code like this similar: -```c +```pawn setproperty(.value = 123984334, .string = ":)"); // The rest is the same as above. ``` -## Notes +## Good to know :::tip diff --git a/frontend/docs/scripting/functions/strcat.md b/frontend/docs/scripting/functions/strcat.md index 2b202cc7dc0f..85c9caba0376 100644 --- a/frontend/docs/scripting/functions/strcat.md +++ b/frontend/docs/scripting/functions/strcat.md @@ -21,7 +21,7 @@ The length of the new destination string. ## Examples -```c +```pawn new string[40] = "Hello"; strcat(string, " World!"); diff --git a/frontend/docs/scripting/functions/strcmp.md b/frontend/docs/scripting/functions/strcmp.md index ecfa7a37d0ff..43e0b1b2f34e 100644 --- a/frontend/docs/scripting/functions/strcmp.md +++ b/frontend/docs/scripting/functions/strcmp.md @@ -26,7 +26,7 @@ tags: ["string"] ## Examples -```c +```pawn new string1[] = "Hello World"; new string2[] = "Hello World"; @@ -47,7 +47,7 @@ if (!strcmp(string1, string2) && !isnull(string1) && !isnull(string2)) #endif ``` -## Notes +## Good to know :::warning diff --git a/frontend/docs/scripting/functions/strcopy.md b/frontend/docs/scripting/functions/strcopy.md index 4c33f8b8c65d..84219d875df4 100644 --- a/frontend/docs/scripting/functions/strcopy.md +++ b/frontend/docs/scripting/functions/strcopy.md @@ -23,7 +23,7 @@ The length of the new destination string. ## Examples -```c +```pawn new playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); diff --git a/frontend/docs/scripting/functions/strdel.md b/frontend/docs/scripting/functions/strdel.md index 358e832f6a8f..2999d8c91deb 100644 --- a/frontend/docs/scripting/functions/strdel.md +++ b/frontend/docs/scripting/functions/strdel.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn new string[42] = "We will delete everything apart from this"; strdel(string, 0, 37); // string is now "this" ``` diff --git a/frontend/docs/scripting/functions/strequal.md b/frontend/docs/scripting/functions/strequal.md index 5804dc97b07a..5b0db586a755 100644 --- a/frontend/docs/scripting/functions/strequal.md +++ b/frontend/docs/scripting/functions/strequal.md @@ -24,7 +24,7 @@ Compares two strings to see if they are the same. ## Examples -```c +```pawn new string1[] = "Hello World"; new string2[] = "Hello World"; @@ -39,7 +39,7 @@ else } ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/strfind.md b/frontend/docs/scripting/functions/strfind.md index e81c903449b2..0050c70deec5 100644 --- a/frontend/docs/scripting/functions/strfind.md +++ b/frontend/docs/scripting/functions/strfind.md @@ -22,7 +22,7 @@ The number of characters before the sub string (the sub string's start position) ## Examples -```c +```pawn if (strfind("Are you in here?", "you", true) != -1) // Returns 4, because the start of 'you' (y) is at index 4 in the string { SendClientMessageToAll(0xFFFFFFFF, "I found you!"); diff --git a/frontend/docs/scripting/functions/strfloat.md b/frontend/docs/scripting/functions/strfloat.md index 1eee60617fa2..744b8566c84e 100644 --- a/frontend/docs/scripting/functions/strfloat.md +++ b/frontend/docs/scripting/functions/strfloat.md @@ -21,7 +21,7 @@ The requested float value. ## Examples -```c +```pawn new string[4] = "6.9"; // A STRING holding a FLOAT. new Float:value = strfloat(string); @@ -29,7 +29,7 @@ new Float:value = strfloat(string); SetPlayerPos(playerid, 0.0, 0.0, value); ``` -## Notes +## Good to know :::note diff --git a/frontend/docs/scripting/functions/strins.md b/frontend/docs/scripting/functions/strins.md index 7c19bdf39e59..6ef7812927f4 100644 --- a/frontend/docs/scripting/functions/strins.md +++ b/frontend/docs/scripting/functions/strins.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn // Add an [AFK] tag to the start of players' names new playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); diff --git a/frontend/docs/scripting/functions/strlen.md b/frontend/docs/scripting/functions/strlen.md index 488fda640924..f9db5ed7a7d0 100644 --- a/frontend/docs/scripting/functions/strlen.md +++ b/frontend/docs/scripting/functions/strlen.md @@ -19,7 +19,7 @@ The length of the string as an integer. ## Examples -```c +```pawn new stringLength = strlen("This is an example string."); // stringLength is now set to 26 ``` diff --git a/frontend/docs/scripting/functions/strmid.md b/frontend/docs/scripting/functions/strmid.md index 44ac4673d34d..04118a9e3bd3 100644 --- a/frontend/docs/scripting/functions/strmid.md +++ b/frontend/docs/scripting/functions/strmid.md @@ -23,7 +23,7 @@ The number of characters stored in `dest[]` ## Examples -```c +```pawn new string[6]; strmid(string, "Extract 'HELLO' without the !!!!: HELLO!!!!", 34, 39); // string contains "HELLO" ``` diff --git a/frontend/docs/scripting/functions/strpack.md b/frontend/docs/scripting/functions/strpack.md index 2c7b991c7db9..9c32b88e77a2 100644 --- a/frontend/docs/scripting/functions/strpack.md +++ b/frontend/docs/scripting/functions/strpack.md @@ -21,7 +21,7 @@ The number of characters packed. ## Examples -```c +```pawn new string[32 char]; strpack(string, "Hi, how are you?"); ``` diff --git a/frontend/docs/scripting/functions/strunpack.md b/frontend/docs/scripting/functions/strunpack.md index 0dc647c85914..07592c41bd45 100644 --- a/frontend/docs/scripting/functions/strunpack.md +++ b/frontend/docs/scripting/functions/strunpack.md @@ -21,7 +21,7 @@ The number of characters packed. ## Examples -```c +```pawn new string[17]; new pstring[17 char] = !"Hi, how are you?"; strunpack(string, pstring); diff --git a/frontend/docs/scripting/functions/strval.md b/frontend/docs/scripting/functions/strval.md index 12acc94c64bb..58a69305354a 100644 --- a/frontend/docs/scripting/functions/strval.md +++ b/frontend/docs/scripting/functions/strval.md @@ -19,7 +19,7 @@ The integer value of the string. **0** if the string is not numeric. ## Examples -```c +```pawn new string[4] = "250"; new iValue = strval(string); // iValue is now '250' ``` diff --git a/frontend/docs/scripting/functions/tolower.md b/frontend/docs/scripting/functions/tolower.md index 5d5ac36fe2b6..4cb720ea7662 100644 --- a/frontend/docs/scripting/functions/tolower.md +++ b/frontend/docs/scripting/functions/tolower.md @@ -19,7 +19,7 @@ The ASCII value of the character provided as lowercase. ## Examples -```c +```pawn public OnPlayerText(playerid, text[]) { text[0] = tolower(text[0]); diff --git a/frontend/docs/scripting/functions/toupper.md b/frontend/docs/scripting/functions/toupper.md index 1d4ae9626733..85ae1f1a1a98 100644 --- a/frontend/docs/scripting/functions/toupper.md +++ b/frontend/docs/scripting/functions/toupper.md @@ -19,7 +19,7 @@ The ASCII value of the character provided, but in uppercase. ## Examples -```c +```pawn public OnPlayerText(playerid, text[]) { text[0] = toupper(text[0]); diff --git a/frontend/docs/scripting/functions/uudecode.md b/frontend/docs/scripting/functions/uudecode.md index 750644f885fc..812077d39ea3 100644 --- a/frontend/docs/scripting/functions/uudecode.md +++ b/frontend/docs/scripting/functions/uudecode.md @@ -21,7 +21,7 @@ This function does not return any specific values. ## Examples -```c +```pawn uudecode(normalString, encodedString); ``` diff --git a/frontend/docs/scripting/functions/uuencode.md b/frontend/docs/scripting/functions/uuencode.md index 7548bf6ced5b..bea3c481f0c5 100644 --- a/frontend/docs/scripting/functions/uuencode.md +++ b/frontend/docs/scripting/functions/uuencode.md @@ -22,7 +22,7 @@ This function does not return any specific values. ## Examples -```c +```pawn uuencode(encodedString, normalString, 45); ``` diff --git a/frontend/docs/scripting/functions/valstr.md b/frontend/docs/scripting/functions/valstr.md index 32bb8ae96339..b3f631bd974f 100644 --- a/frontend/docs/scripting/functions/valstr.md +++ b/frontend/docs/scripting/functions/valstr.md @@ -21,19 +21,19 @@ This function does not return any specific values. ## Examples -```c +```pawn new string[4]; new value = 250; valstr(string, value); // string is now "250" ``` -## Notes +## Good to know :::warning Passing a high value to this function can cause the server to freeze/crash. Fixes are available. Below is a fix that can be put straight in to your script (before valstr is used anywhere). open.mp includes this fix. -```c +```pawn // valstr fix by Slice stock FIX_valstr(dest[], value, bool:pack = false) { diff --git a/frontend/docs/scripting/language/ControlStructures.md b/frontend/docs/scripting/language/ControlStructures.md index 6c0af448f258..38cb3c833ee5 100644 --- a/frontend/docs/scripting/language/ControlStructures.md +++ b/frontend/docs/scripting/language/ControlStructures.md @@ -2,6 +2,7 @@ title: "Control Structures" sidebar_label: "Control Structures" description: An overview of control structures in the Pawn language +tags: ["pawn", "language"] --- ## Conditionals @@ -10,7 +11,7 @@ description: An overview of control structures in the Pawn language An if statement checks if something is true and does something if it is. -```c +```pawn new a = 5; if (a == 5) @@ -23,7 +24,7 @@ The code within the brackets after the "if" is called the condition, there are a In the example above both "a" and 5 are symbols, functions can also be symbols: -```c +```pawn if (SomeFunction() == 5) { print("SomeFunction() is 5"); @@ -34,7 +35,7 @@ That will test the return value of SomeFunction (see below) against 5. You can also combine checks to check multiple things: -```c +```pawn new a = 5, b = 3; @@ -46,7 +47,7 @@ if (a == 5 && b != 3) That example checks that a is equal to 5 AND b is not equal to 3, however b is 3 so the check fails. -```c +```pawn new a = 5, b = 3; @@ -60,7 +61,7 @@ That examples checks that a is equal to 5 OR b is not equal to 3, b equals 3 so Also it is possible to chain the comparisons together without the explicit AND-ing of two different comparisons. -```c +```pawn new idx = 3; @@ -94,7 +95,7 @@ The following are symbols you can use in comparisons and their explanations. Som The other main aspect of if statements is brackets, these control the order things are done in: -```c +```pawn new a = 3, b = 3, @@ -107,19 +108,19 @@ if (a == 5 && b == 3 || c == 1) There are two ways of looking at the above statement: -```c +```pawn if ((a == 5 && b == 3) || c == 1) ``` And: -```c +```pawn if (a == 5 && (b == 3 || c == 1)) ``` The first version will check if a is 5 and b is 3, if that is false (i.e. one or both of them are not their respective values) it will check if c is 1. (a == 5 && b == 3) is false as you should know from above, so you replace that group with FALSE: -```c +```pawn if (FALSE || c == 1) ``` @@ -127,13 +128,13 @@ We know FALSE cannot be true (as it is not true by definition), however c is 1 s The second version checks if a is 5, if it is it checks if either b is 3 or c is 1. The game will do the a == 5 part first but for clarity we'll do it backwards. (b == 3 || c == 1) is true, both halves are true, although only one needs to be, so going into our if statement we have: -```c +```pawn if (a == 5 && TRUE) ``` (a == 5) is false, because a is 3, so we have: -```c +```pawn if (FALSE && TRUE) ``` @@ -147,7 +148,7 @@ This little example shows how using brackets can change the outcome of a check, else basically does something if an if check fails: -```c +```pawn new a = 5; if (a == 3) // False @@ -164,7 +165,7 @@ else An else if is a check which occurs if the first if check fails to check something else: -```c +```pawn new a = 5; if (a == 1) @@ -183,7 +184,7 @@ else You can have an many of these as you like (you can only have one if and one else in a group of checks): -```c +```pawn new a = 4; if (a == 1) @@ -210,7 +211,7 @@ else else ifs will only check the value as it was when the ifs start, so you can't do: -```c +```pawn new a = 5; if (a == 5) @@ -230,7 +231,7 @@ To get round this you would simply make the else if an if. '?' and ':' together are called a triadic operator, they basically act as an if statement inside another statement: -```c +```pawn new a, b = 3; @@ -246,7 +247,7 @@ else That's a simple example to assign a variable based on another variable, however it can be made much shorter: -```c +```pawn new a, b = 3; @@ -255,7 +256,7 @@ a = (b == 3) ? (5) : (7); The part before the '?' is the conditional, this is exactly the same as a normal conditional. The part between the '?' and the ':' is the value to return if the condition is true, the other part is the value to return if the condition is false. You can stack them up the same as else ifs too: -```c +```pawn new a, b = 3; @@ -279,7 +280,7 @@ else Can be written as: -```c +```pawn new a, b = 3; @@ -288,7 +289,7 @@ a = (b == 1) ? (2) : ((b == 2) ? (3) : ((b == 3) ? (4) : (5))); This is actually more similar to doing: -```c +```pawn new a, b = 3; @@ -324,7 +325,7 @@ But they're equivalent (in this example anyway). "while" loops do something while the condition specified is true. A condition is exactly the same format as the condition in an if statement, it is just checked repeatedly and the code done if it is true every time it is checked: -```c +```pawn new a = 9; while (a < 10) @@ -341,7 +342,7 @@ That code will check if 'a' is less than 10. If it is, the code inside the brace A "for" loop is essentially a compressed "while" loop. A "for" statement has three sections; initialization, condition and finalization. As a "for" loop, the "while" example above would be written: -```c +```pawn for (new a = 9; a < 10; a++) { // Code in the loop @@ -351,7 +352,7 @@ for (new a = 9; a < 10; a++) That's a simple code to loop through all players: -```c +```pawn for (new i, a = GetMaxPlayers(); i < a; i++) { if (IsPlayerConnected(i)) @@ -363,7 +364,7 @@ for (new i, a = GetMaxPlayers(); i < a; i++) Any of the conditions can be omitted simply by putting no code in them: -```c +```pawn new a = 9; for ( ; a < 10; ) @@ -380,7 +381,7 @@ This example makes it a little easier to show how a "for" loop matches up to a " A do-while loop is a while loop where the condition comes after the code inside the loop instead of before. This means that the code inside will always be executed at least once because it is done before the check is done: -```c +```pawn new a = 10; do @@ -398,7 +399,7 @@ If that was a standard while loop a would not be incremented as the (a < 10) che This is essentially what the loops above compile to, the use of goto is generally discouraged however it's interesting to see exactly what a loop is doing: -```c +```pawn new a = 9; @@ -416,7 +417,7 @@ if (a < 10) OBOE stands for Off By One Error. This is a very common mistake where a loop runs for one too many or two few times. E.g: -```c +```pawn new a = 0, b[10]; @@ -436,7 +437,7 @@ You have to be especially careful of OBOEs when using do-while loops as they ALW A switch statement is basically a structured if/else if/else system (similar to how for is a structured while). The easiest way to explain it is with an example: -```c +```pawn new a = 5; switch (a) @@ -462,7 +463,7 @@ switch (a) This is functionally equivalent to: -```c +```pawn new a = 5; if (a == 1) @@ -487,7 +488,7 @@ However it is slightly clearer to see what is going on. An important thing to note here is the different ways in which ifs and switches are processed: -```c +```pawn switch (SomeFunction()) { case 1: {} @@ -498,7 +499,7 @@ switch (SomeFunction()) That will call SomeFunction() ONCE and compare it's result 3 times. -```c +```pawn if (SomeFunction() == 1) {} else if (SomeFunction() == 2) {} else if (SomeFunction() == 3) {} @@ -506,7 +507,7 @@ else if (SomeFunction() == 3) {} That will call SomeFunction() three times, which is very inefficient, a switch is more like doing: -```c +```pawn new result = SomeFunction(); if (result == 1) {} @@ -520,29 +521,29 @@ For those of you who know C the PAWN switch is slightly different, the individua case statements (the "case X:" parts of the switch statement) can have other options besides a single number. You can compare a value to a list of numbers (replacing fall-through in C) or even a range of values: -```c +```pawn case 1, 2, 3, 4: ``` This case will trigger if the symbol being tested is 1, 2, 3, or 4, it's the same as doing: -```c +```pawn if (bla == 1 || bla == 2 || bla == 3 || bla == 4) ``` but far more concise. Numbers in lists do not have to be consecutive, in fact if they are it's better to do: -```c +```pawn case 1 .. 4: ``` This case will do exactly the same as above but by checking a range instead of a list, it is the same as doing: -```c +```pawn if (bla >= 1 && bla <= 4) ``` -```c +```pawn new a = 4; switch (a) @@ -572,7 +573,7 @@ This is the equivalent to else in if statements, it does something if all the ot goto is essentially a jump, it goes to a label without question (i.e. there's no condition to need to be true). You can see an example above in the if-goto loop. -```c +```pawn goto my_label; // This section will be jumped over @@ -588,7 +589,7 @@ The use of gotos is widely discouraged due to their effect on program flow. break breaks out of a loop, ending it prematurely: -```c +```pawn for (new a = 0; a < 10; a++) { if (a == 5) break; @@ -601,7 +602,7 @@ This loop will go 6 times but code after the break will only be executed 5 times continue basically skips a loop iteration -```c +```pawn for (new a = 0; a < 3; a++) { if (a == 1) continue; @@ -611,13 +612,13 @@ for (new a = 0; a < 3; a++) That will give the output of: -```c +```pawn a = 0 a = 2 ``` The continue basically jumps to the closing brace of the loop, as hinted at above you have to be careful when using continue with some loops: -```c +```pawn new a = 0; while (a < 3) @@ -634,7 +635,7 @@ This looks very similar to the other example however this time the continue will return stops a function and goes back to the point in code which called the function in the first place: -```c +```pawn main() { print("1"); @@ -660,7 +661,7 @@ Because the print("2"); line will never be reached. You can also use return to return a value: -```c +```pawn main() { print("1"); @@ -687,7 +688,7 @@ The symbol you return can be a number, a variable or even another function (in w You can also store return values for later use: -```c +```pawn main() { print("1"); diff --git a/frontend/docs/scripting/language/Directives.md b/frontend/docs/scripting/language/Directives.md index b603885cd5ba..9fbe4799c1fc 100644 --- a/frontend/docs/scripting/language/Directives.md +++ b/frontend/docs/scripting/language/Directives.md @@ -1,6 +1,7 @@ --- title: "Keywords: Directives" sidebar_label: "Keywords: Directives" +tags: ["pawn", "language"] --- Directives are instructions passed to the compiler to control how it interprets your source code. @@ -9,21 +10,21 @@ Directives are instructions passed to the compiler to control how it interprets This checks if constant expression is true and if not halts the compile. -```c +```pawn #define MOO 10 #assert MOO > 5 ``` This will compile fine. -```c +```pawn #define MOO 1 #assert MOO > 5 ``` That won't and will give a fatal error. This is similar to: -```c +```pawn #define MOO 1 #if MOO <= 5 #error MOO check failed @@ -48,20 +49,20 @@ Which may or may not be helpful. `#define` is a text replacement directive, wherever the first symbol of the define is found the rest of it will be placed. -```c +```pawn #define MOO 7 printf("%d", MOO); ``` Will be changed to: -```c +```pawn printf("%d", 7); ``` This is why all defines are lost in decompilation as they don't exist when the code is compiled (all directives are pre-processed). Defines don't have to contain numbers: -```c +```pawn #define PL new i = 0; i < MAX_PLAYERS; i++) if (IsPlayerConnected(i) for (PL) printf("%d connected", i); @@ -71,7 +72,7 @@ Will compile to the player loop we all know and love (despise). Notice how the b Another little known fact about defines is that they can be multi-line if you escape the new line. Generally a new line ends the define however the following is valid: -```c +```pawn #define PL \ new i = 0; i < MAX_PLAYERS; i++) \ if (IsPlayerConnected(i) @@ -86,7 +87,7 @@ The `\` character means the define continues onto a new line. The third major characteristic of defines is their ability to have what are effectively parameters. These are `%0` to `%9` and behave very similarly to normal parameters: -```c +```pawn #define MOO(%0) \ ((%0) * 7) @@ -95,19 +96,19 @@ printf("%d", MOO(6)); That will output 42 (no, not chosen randomly). Notice the excessive brackets in the define? This is because defines are straight text replacements so that will compile as: -```c +```pawn printf("%d", ((6) * 7)); ``` That's fine as it is but let's take this example: -```c +```pawn printf("%d", MOO(5 + 6)); ``` You would expect that to compile to output 77 ((5 + 6) \* 7) and with the brackets it will, however without the brackets you have: -```c +```pawn #define MOO(%0) \ %0 * 7 @@ -116,13 +117,13 @@ printf("%d", MOO(5 + 6)); Which converts to: -```c +```pawn printf("%d", MOO(5 + 6 * 7)); ``` Which, due to the order of operations, compules as (5 + (6 \* 7)), whiche is 47 and very wrong. One interesting fact about the parameters is that if you have too many, the last one is all the extra ones. So doing: -```c +```pawn #define PP(%0,%1) \ printf(#%0, %1) @@ -145,7 +146,7 @@ As `%1` contains "hi", "hello", "hi". You may have also noticed the use of `#` t `#elseif` is like else if but for #if. -```c +```pawn #define MOO 10 #if MOO == 9 @@ -177,7 +178,7 @@ This halts the compiler instantly and gives a custom error message. See #assert `#if` is to the proprocessor what if is to code. You can choose exactly what to compile and what not to from here. For example consider the following code: -```c +```pawn #define LIMIT 10 if (LIMIT < 10) @@ -188,7 +189,7 @@ if (LIMIT < 10) That will compile as: -```c +```pawn if (10 < 10) { printf("Limit too low"); @@ -197,7 +198,7 @@ if (10 < 10) Which will clearly never be true and the compiler knows it - so it tells you so, giving you a "constant expression" warning. The question is, if it will never be true what's the point of including it at all? You could just remove the code but then there will be no checks if someone changes LIMIT and recompiles. This is what #if is for. Unlike normal if which gives a warning if the expression is constant, #if expressions MUST be constant. So: -```c +```pawn #define LIMIT 10 #if LIMIT < 10 @@ -209,7 +210,7 @@ That will check that the limit is not too small when you compile and if it is wi Here's another example: -```c +```pawn #define LIMIT 10 if (LIMIT < 10) @@ -224,7 +225,7 @@ else Again this is a constant check, which will give a warning, but both prints will be compiled when we KNOW only one will ever run. Using #if this becomes: -```c +```pawn #define LIMIT 10 #if LIMIT < 10 @@ -240,13 +241,13 @@ That way only the printf which is required will be compiled and the other one wi This takes all the code from a specified file and inserts it into your code at the point at which the include line is. There are two types of include: relative and system (I just made those terms up, if you have better ones please say). Relative includes use double quotes around the filename and are located relative to the current file, so: -```c +```pawn #include "me.pwn" ``` would include the file "me.pwn" from the same directory as the file including that file. The other type, system, includes the file from the "include" directory that is located either in same directory as is Pawn compiler or parent directory(paths:"include","../include"): -```c +```pawn #include "" ``` @@ -254,11 +255,11 @@ Would include the file "me.inc" (note the lack of extension, you can specify one Both these types can take directories: -```c +```pawn #include "folder/me.pwn" ``` -```c +```pawn #include ``` @@ -268,7 +269,7 @@ Both of those will include a file one directory down from their respective defau This is one of the most complex directives. It has a number of options to control how your script works. An example setting would look like: -```c +```pawn #pragma ctrlchar '$' ``` @@ -287,7 +288,7 @@ That changes the escape character from \ to $, so a new line, instead of being " ### Deprecated -```c +```pawn new gOldVariable = 5; @@ -304,7 +305,7 @@ This is similar to #include but if the file doesn't exist the compilation doesn' **myinc.inc** -```c +```pawn #if defined _MY_INC_INC #endinput #endif @@ -315,7 +316,7 @@ stock MyIncFunc() {printf("Hello");} **Gamemode:** -```c +```pawn #tryinclude main() @@ -332,7 +333,7 @@ That will only call MyIncFunc if the file with it in was found and compiled. Thi Removes a previously defined macro or constant symbol. -```c +```pawn #define MOO 10 printf("%d", MOO); #undef MOO @@ -341,7 +342,7 @@ printf("%d", MOO); That will fail to compile as MOO doesn't exist anymore by the time the second printf is reached. -```c +```pawn enum { e_example = 300 }; diff --git a/frontend/docs/scripting/language/Initialisers.md b/frontend/docs/scripting/language/Initialisers.md index 16e8b53aac3b..911a90d78e7d 100644 --- a/frontend/docs/scripting/language/Initialisers.md +++ b/frontend/docs/scripting/language/Initialisers.md @@ -1,11 +1,12 @@ --- title: "Keywords: Initialisers" sidebar_label: "Keywords: Initialisers" +tags: ["pawn", "language"] --- ## `const` -```c +```pawn new const MY_CONSTANT[] = {1, 2, 3}; ``` @@ -18,7 +19,7 @@ Enumerations are a very useful system for representing large groups of data and By far the most common use is as array definitions: -```c +```pawn enum E_MY_ARRAY { E_MY_ARRAY_MONEY, @@ -37,7 +38,7 @@ public OnPlayerConnect(playerid) That will create an array with two slots for every player. Into the one referenced by E_MY_ARRAY_MONEY it'll put 0 when a player connects and 5 into E_MY_ARRAY_GUN. Without an enum this would look like: -```c +```pawn new gPlayerData[MAX_PLAYERS][2]; @@ -50,7 +51,7 @@ public OnPlayerConnect(playerid) And that is how the first compiles. This is OK, however it's less readable - what is slot 0 for and what is slot 1 for? And it's less flexible, what if you want to add another slot between 0 and 1, you have to rename all your 1s to 2s, add the new one and hope you didn't miss anything, wheras with an enum you would just do: -```c +```pawn enum E_MY_ARRAY { E_MY_ARRAY_MONEY, @@ -73,7 +74,7 @@ Recompile and everything will be updated for you. So how does an enum know what values to give things? The full format of an enum is: -```c +```pawn enum NAME (modifier) { NAME_ENTRY_1 = value, @@ -85,7 +86,7 @@ enum NAME (modifier) However much of this is implied. By default, if you don't specify a modifier it becomes (+= 1), this means that every value in the enum is the last value in the enum + 1, so for: -```c +```pawn enum E_EXAMPLE { E_EXAMPLE_0, @@ -96,7 +97,7 @@ enum E_EXAMPLE The first value (E_EXAMPLE_0) is 0 (by default if no other value is specified), so the second value (E_EXAMPLE_1) is 1 (0 + 1) and the third value (E_EXAMPLE_2) is 2 (1 + 1). This makes the value of E_EXAMPLE 3 (2 + 1), the name of the enum is also the last value in the enum. If we change the modifier we get different values: -```c +```pawn enum E_EXAMPLE (+= 5) { E_EXAMPLE_0, @@ -107,14 +108,14 @@ enum E_EXAMPLE (+= 5) In that example every value is the last value + 5 so, starting from 0 again, we get: E_EXAMPLE_0 = 0, E_EXAMPLE_1 = 5, E_EXAMPLE_2 = 10, E_EXAMPLE = 15. If you were to declare an array of: -```c +```pawn new gEnumArray[E_EXAMPLE]; ``` You would get an array 15 cells big however you would only be able to access cells 0, 5 and 10 using the enum values (you could however still use normal numbers). Lets look at another example: -```c +```pawn enum E_EXAMPLE (*= 2) { E_EXAMPLE_0, @@ -125,7 +126,7 @@ enum E_EXAMPLE (*= 2) In this all the values are 0. Why? Well the first value by default is 0, then 0 \* 2 = 0, then 0 \* 2 = 0 and 0 \* 2 = 0. So how do we correct this? This is what custom values are for: -```c +```pawn enum E_EXAMPLE (*= 2) { E_EXAMPLE_0 = 1, @@ -136,7 +137,7 @@ enum E_EXAMPLE (*= 2) That sets the first value to 1, so you end up with 1, 2, 4 and 8. Creating an array with that would give you an 8 cell array with named access to cells 1, 2 and 4. You can set whichever values you like and as many values as you like: -```c +```pawn enum E_EXAMPLE (*= 2) { E_EXAMPLE_0, @@ -147,13 +148,13 @@ enum E_EXAMPLE (*= 2) Gives: -```c +```pawn 0, 1, 2, 4 ``` While: -```c +```pawn enum E_EXAMPLE (*= 2) { E_EXAMPLE_0 = 1, @@ -164,7 +165,7 @@ enum E_EXAMPLE (*= 2) Gives: -```c +```pawn 1, 1, 1, 2 ``` @@ -172,7 +173,7 @@ It's not advised to use anything but += 1 for arrays. You can also use arrays in enums: -```c +```pawn enum E_EXAMPLE { E_EXAMPLE_0[10], @@ -185,7 +186,7 @@ That would make E_EXAMPLE_0 = 0, E_EXAMPLE_1 = 10, E_EXAMPLE_2 = 11 and E_EXAMPL enums items can also have tags, so for out original example: -```c +```pawn enum E_MY_ARRAY { E_MY_ARRAY_MONEY, @@ -210,7 +211,7 @@ That will not give a tag mismatch. Enums can also be used as tags themselves: -```c +```pawn enum E_MY_TAG (<<= 1) { E_MY_TAG_NONE, @@ -226,19 +227,19 @@ new That will create a new variable and assign it the value 6 (4 | 2), and it will have a custom tag so doing: -```c +```pawn gMyTagVar = 7; ``` Will generate a tag mismatch warning, although you can use tag overwrites to bypass it: -```c +```pawn gMyTagVar = E_MY_TAG:7; ``` This can be very useful for flag data (i.e. one bit for some data), or even combined data: -```c +```pawn enum E_MY_TAG (<<= 1) { E_MY_TAG_NONE, @@ -257,7 +258,7 @@ Which will produce a value of 1543 (0x0607). Finally, as stated originally, enums can be used to replace defines by ommitting the name: -```c +```pawn #define TEAM_NONE 0 #define TEAM_COP 1 #define TEAM_ROBBER 2 @@ -268,7 +269,7 @@ Finally, as stated originally, enums can be used to replace defines by ommitting I'm sure many of you have seen loads of things like that to define teams. It's all well and good but it's very static. That can easilly be replaced by an enum to handle numeric assignments automatically: -```c +```pawn enum { TEAM_NONE, @@ -282,7 +283,7 @@ enum Those all have the same values as they had before, and can be used in exactly the same way: -```c +```pawn new gPlayerTeam[MAX_PLAYERS] = {TEAM_NONE, ...}; @@ -302,7 +303,7 @@ public OnPlayerRequestSpawn(playerid) While we're on the subject there is a much better way of defining teams based on this method: -```c +```pawn enum (<<= 1) { TEAM_NONE, @@ -316,7 +317,7 @@ enum (<<= 1) Now TEAM_COP is 1, TEAM_ROBBER is 2, TEAM_CIV is 4 etc, which in binary is 0b00000001, 0b00000010 and 0b00000100. This means that if a player's team is 3 then they are in both the cop team and the robber team. That may sound pointless but it does open up possibilities: -```c +```pawn enum (<<= 1) { TEAM_NONE, @@ -333,19 +334,19 @@ Using that you can be in both a normal team and the admin team using only a sing To add a player to a team: -```c +```pawn gPlayerTeam[playerid] |= TEAM_COP; ``` To remove a player from a team: -```c +```pawn gPlayerTeam[playerid] &= ~TEAM_COP; ``` To check if a player is in a team: -```c +```pawn if (gPlayerTeam[playerid] & TEAM_COP) ``` @@ -355,7 +356,7 @@ Very simple and very useful. forward tells the compiler that a function is coming later. It is required for all public functions however can be used in other places. It's use is "forward" followed by the full name and parameters of the function you want to forward, followed by a semicolon: -```c +```pawn forward MyPublicFunction(playerid, const string[]); public MyPublicFunction(playerid, const string[]) @@ -365,7 +366,7 @@ public MyPublicFunction(playerid, const string[]) As well as being required for all publics forward can be used to fix a rare warning when a function which returns a tag result (e.g. a float) is used before it's declared. -```c +```pawn main() { new @@ -380,7 +381,7 @@ Float:MyFloatFunction() This will give a reparse warning because the compiler doesn't know how to convert the return of the function to a float because it doesn't know if the function returns a normal number or a float. Clearly in this example it returns a float. This can either be solved by putting the function at a point in the code before it's used: -```c +```pawn Float:MyFloatFunction() { return 5.0; @@ -395,7 +396,7 @@ main() Or by forwarding the function so the compiler knows what to do: -```c +```pawn forward Float:MyFloatFunction(); main() @@ -416,13 +417,13 @@ Note the forward includes the return tag too. A native function is one defined in the virtual machine (i.e. the thing which runs the script), not in the script itself. You can only define native functions if they're coded into SA:MP or a plugin, however you can create fake natives. Because the native functions from .inc files are detected by pawno and listed in the box on the right hand side of pawno it can be useful to use native to get your own custom functions listed there. A normal native declaration could look like: -```c +```pawn native printf(const format[], {Float, _}:...); ``` If you want your own functions to appear without being declared native you can do: -```c +```pawn /* native MyFunction(playerid); */ @@ -432,13 +433,13 @@ PAWNO doesn't recognise comments like that so will add the function to the list The other interesting thing you can do with native is rename/overload functions: -```c +```pawn native my_print(const string[]) = print; ``` Now the function print doesn't actually exist. It is still in SA:MP, and the compiler knows it's real name thanks to the "= print" part, but if you try call it in PAWN you will get an error as you have renamed print internally to my_print. As print now doesn't exist you can define it just like any other function: -```c +```pawn print(const string[]) { my_print("Someone called print()"); @@ -452,14 +453,14 @@ Now whenever `print` is used in a script your function will be called instead of This is the core of variables, one of the most important keywords about. new declares a new variable: -```c +```pawn new myVar = 5; ``` That will create a variable, name it myVar and assign it the value of 5. By default all variables are 0 if nothing is specified: -```c +```pawn new myVar; @@ -470,7 +471,7 @@ Will give "0". A variable's scope is where it can be used. Scope is restricted by braces (the curly brackets - {} ), any variable declared inside a set of braces can only be used within those braces. -```c +```pawn if (a == 1) { // Braces start the line above this one @@ -497,7 +498,7 @@ If a global variable (i.e. one declared outside a function) is declared new, it **File1.pwn:** -```c +```pawn MyFunc1() { // Error, gMyVar doesn't exist yet @@ -520,7 +521,7 @@ MuFunc2() **file2.pwn:** -```c +```pawn MyFunc3() { // This is also fine as this file is included in the first file after the declaration and new is not file restricted @@ -532,7 +533,7 @@ MyFunc3() This allows you to overload operators for custom tags. For example: -```c +```pawn stock BigEndian:operator=(b) { return BigEndian:(((b >>> 24) & 0x000000FF) | ((b >>> 8) & 0x0000FF00) | ((b << 8) & 0x00FF0000) | ((b << 24) & 0xFF000000)); @@ -548,13 +549,13 @@ main() Normal pawn numbers are stored in what's called little endian. This operator allows you to define an assignment to convert a normal number to a big endian number. The difference between big endian and little endian is the byte order. 7 in little endian is stored as: -```c +```pawn 07 00 00 00 ``` 7 in big endian is stored as: -```c +```pawn 00 00 00 07 ``` @@ -562,13 +563,13 @@ Therefore if you print the contents of a big endian stored number it will try re You can overload the following operators: -```c +```pawn +, -, *, /, %, ++, --, ==, !=, <, >, <=, >=, ! and = ``` Also note that you can make them do whatever you like: -```c +```pawn stock BigEndian:operator+(BigEndian:a, BigEndian:b) { return BigEndian:42; @@ -593,7 +594,7 @@ A public function has it's textual name stored in the amx file, unlike normal fu **Calling a function by name:** -```c +```pawn forward MyPublicFunc(); main() @@ -609,7 +610,7 @@ public MyPublicFunc() public functions prefixed by either "public" or "@" and, as mentioned in the forward section, all require forwarding: -```c +```pawn forward MyPublicFunc(); forward @MyOtherPublicFunc(var); @@ -636,7 +637,7 @@ main, used in most of these examples, is similar to a public function in that it All SA:MP callbacks are public and called from outside the script automatically: -```c +```pawn public OnPlayerConnect(playerid) { printf("%d connected", playerid); @@ -647,7 +648,7 @@ When someone joins the server it will automatically look up this public function If you want to call a public function from inside the script however you do not have to call it by name, public functions also behave as normal functions too: -```c +```pawn forward MyPublicFunc(); main() @@ -669,7 +670,7 @@ A static variable is like a global new variable but with a more limited scope. W **file1.pwn** -```c +```pawn MyFunc1() { // Error, gMyVar doesn't exist yet @@ -692,7 +693,7 @@ MuFunc2() **file2.pwn** -```c +```pawn MyFunc3() { // This is also fine as this file is included in the first file after the declaration and new is not file restricted @@ -704,7 +705,7 @@ And modifying it for static would give: **file1.pwn** -```c +```pawn MyFunc1() { // Error, g_sMyVar doesn't exist yet @@ -727,7 +728,7 @@ MuFunc2() **file2.pwn** -```c +```pawn MyFunc3() { // Error, g_sMyVar is limited to only the file (or section) in which it was declared, this is a different file @@ -739,7 +740,7 @@ This means you can have two globals of the same name in different files. If you use static locally (i.e. in a function) then the variable, like local variables created with new, can only be used within the scope (based on braces - see the section on "new") in which it was declared. However unlike "new" variables "static" variables do not loose their value between calls. -```c +```pawn main() { for (new loopVar = 0; loopVar < 4; loopVar++) @@ -760,7 +761,7 @@ MyFunc() Every time the function is called i is reset to 0, so the resulting output will be: -```c +```pawn 0 1 0 @@ -773,7 +774,7 @@ Every time the function is called i is reset to 0, so the resulting output will If we replace the "new" with "static" we get: -```c +```pawn main() { for (new loopVar = 0; loopVar < 4; loopVar++) @@ -794,7 +795,7 @@ MyFunc() And, as static locals keep their value between calls, the resulting output it: -```c +```pawn 0 1 1 @@ -807,7 +808,7 @@ And, as static locals keep their value between calls, the resulting output it: The value given in the declaration (if one is given, like new, static variables default to 0) is the value assigned to the variable the first time the function is called. So if "static i = 5;" were used instead the result would be: -```c +```pawn 5 6 6 @@ -826,7 +827,7 @@ You can also have static functions which can only be called from the file in whi stock is used to declare variables and functions which may not be used but which you don't want to generate unused warnings for. With variables stock is like const in that it is a modifier, not a full declaration, so you could have: -```c +```pawn new stock gMayBeUsedVar; @@ -838,7 +839,7 @@ If the variable or function is used the compiler will include it, if it is not u stock is most commonly used for custom libraries. If you write a library you provide a whole load of functions for other people to use but you've no idea if they'll use them or not. If your code gives loads of warnings for every function a person doesn't use people will complain (unless it's on purpose as they HAVE to use that function (e.g. for initialising variables). Having said that however, going from personal experience with YSI people will complain anyway. -```c +```pawn main() { Func1(); @@ -857,7 +858,7 @@ Func2() Here Func2 is never called so the compiler will give a warning. This may be useful as you may have forgotten to call it, as is generally the case in a straight script, however if Func1 and Func2 are in a library the user may simply not need Func2 so you do: -```c +```pawn main() { Func1(); diff --git a/frontend/docs/scripting/language/Operators.md b/frontend/docs/scripting/language/Operators.md index 6053a557a787..a2a8f5492013 100644 --- a/frontend/docs/scripting/language/Operators.md +++ b/frontend/docs/scripting/language/Operators.md @@ -1,25 +1,26 @@ --- title: "Keywords: Operators" sidebar_label: "Keywords: Operators" +tags: ["pawn", "language"] --- ## `char` char returns the number of cells required to hold the given number of characters in a packed string. I.e. the number of 4-byte cells required to hold a given number of bytes. For example: -```c +```pawn 4 char ``` Returns 1. -```c +```pawn 3 char ``` Returns 1 (you can't have 3/4 of a variable). -```c +```pawn 256 char ``` @@ -27,7 +28,7 @@ Returns 64 (256 divided by 4). This is generally used in variable declarations. -```c +```pawn new someVar[40 char]; ``` @@ -40,7 +41,7 @@ For more information on packed strings read pawn-lang.pdf. Checks if a symbol exists. Generally used in #if statements: -```c +```pawn new someVar = 5; #if defined someVar @@ -52,7 +53,7 @@ new Most commonly it's used to check if a define is defined and generate code accordingly: -```c +```pawn #define FILTERSCRIPT #if defined FILTERSCRIPT @@ -76,7 +77,7 @@ public OnGameModeInit() Returns the size in ELEMENTS of an array: -```c +```pawn new someVar[10]; printf("%d", sizeof (someVar)); @@ -84,13 +85,13 @@ printf("%d", sizeof (someVar)); Output: -```c +```pawn 10 ``` And: -```c +```pawn new someVar[2][10]; printf("%d %d", sizeof (someVar), sizeof (someVar[])); @@ -98,7 +99,7 @@ printf("%d %d", sizeof (someVar), sizeof (someVar[])); Gives: -```c +```pawn 2 10 ``` @@ -110,7 +111,7 @@ This again is related to the PAWN autonoma code and thus not covered here. This returns a number representing the tag of a variable: -```c +```pawn new someVar, Float:someFloat; @@ -119,19 +120,19 @@ printf("%d %d", tagof (someVar), tagof (someFloat)); Gives: -```c +```pawn -./,),(-*,( -1073741820 ``` Which is a slight bug but basically means: -```c +```pawn 0x80000000 0xC0000004 ``` To check, for example, if a variable is a float (with the tag 'Float:'): -```c +```pawn new Float: fValue = 6.9; new tag = tagof (fValue); diff --git a/frontend/docs/scripting/language/Statements.md b/frontend/docs/scripting/language/Statements.md index 22dbf912f871..df8a6a057ad5 100644 --- a/frontend/docs/scripting/language/Statements.md +++ b/frontend/docs/scripting/language/Statements.md @@ -1,13 +1,14 @@ --- title: "Keywords: Statements" sidebar_label: "Keywords: Statements" +tags: ["pawn", "language"] --- ## `assert` Aborts execution with a runtime error if the expression evaluates to logically false. Seems to work only in the main() block. The assert statement should be used to indicate a logical(programmer's) error, never a run-time(user's) error. -```c +```pawn main() { assert (MAX_PLAYERS == GetMaxPlayers()); // ascertain that the definition of MAX_PLAYERS is equal to the actual number of server slots in use @@ -18,7 +19,7 @@ main() Breaks out of a loop instantly, only leaves the top level loop, not all current loops. -```c +```pawn for (new i = 0; i < 10; i++) { printf("%d", i); @@ -31,7 +32,7 @@ for (new i = 0; i < 10; i++) Will produce: -```c +```pawn 0 1 2 @@ -42,7 +43,7 @@ Will produce: While: -```c +```pawn for (new i = 0; i < 10; i++) { if (i == 5) @@ -55,7 +56,7 @@ for (new i = 0; i < 10; i++) Will produce: -```c +```pawn 0 1 2 @@ -69,7 +70,7 @@ As the loop is instantly exited neither loop gets to 10 and the second one ends Handles a specific result in a switch statement. The result can be either a single number, a selection of numbers or a range of numbers: -```c +```pawn new switchVar = 10; switch (switchVar) @@ -101,7 +102,7 @@ switch (switchVar) Similar to break but just goes on to the next loop itteration. It is important to note that the point to which it jumps varies depending on which loop type you use. -```c +```pawn for (new i = 0; i < 10; i++) { if (i == 5) @@ -114,7 +115,7 @@ for (new i = 0; i < 10; i++) Will produce: -```c +```pawn 0 1 2 @@ -128,7 +129,7 @@ Will produce: A continue after the print will basically do nothing. In a for loop continue jumps to the third statement in the for statement (in this example the "i++;" bit), this is different to how it behaves in a while loop: -```c +```pawn new i = 0; while (i < 10) @@ -152,7 +153,7 @@ default handles switch statement results which aren't handled explicitly by case do is a type of loop which can be used with while to produce a loop which will always be run at least once. Note the semi-colon after the while () in the following example: -```c +```pawn new i = 10; do @@ -165,13 +166,13 @@ while (i < 10); "i" is clearly not less that 10 but this loop will produce: -```c +```pawn 10 ``` anyway. The similar while loop: -```c +```pawn new i = 10; while (i < 10) @@ -185,7 +186,7 @@ Will not give any output as the condition instantly fails. These are also useful for avoiding double checks: -```c +```pawn new checkVar = 10; if (checkVar == 10) @@ -202,7 +203,7 @@ if (checkVar == 10) This isn't obviously a major issue but you are checking checkVar twice in quick succession at the start of the loop, which is quite pointless, however the if is required as you need to do code if the condition is true but outside the loop (this is a fairly common situation). This can be improved by doing: -```c +```pawn new checkVar = 10; if (checkVar == 10) @@ -224,7 +225,7 @@ In this instance the result will be exactly the same but crucially with one less else is called when an if statement fails (assuming it is present): -```c +```pawn new checkVar = 5; if (checkVar == 10) @@ -239,7 +240,7 @@ else else can also be combined with if: -```c +```pawn new checkVar = 2; if (checkVar == 1) @@ -260,7 +261,7 @@ else This exits the current program instantly. -```c +```pawn main() { exit; @@ -272,7 +273,7 @@ main() A for loop is a type of loop involving three stages, initialisation, comparison and update. These are each separated by a semicolon (Wink and can each be excluded by just setting a blank space. The most basic for loop is: -```c +```pawn for ( ; ; ) {} ``` @@ -280,7 +281,7 @@ This has no initialisation, no comparison and no update and as a result will go One of the more common loops is: -```c +```pawn for (new i = 0; i < MAX_PLAYERS; i++) { printf("%d", i); @@ -289,7 +290,7 @@ for (new i = 0; i < MAX_PLAYERS; i++) The initialisation in this loop is: -```c +```pawn new i = 0; ``` @@ -297,7 +298,7 @@ The semicolon marks the end of the initialisation. This declares a new variable, The result of this loop is all the numbers from 0 to 499 inclusive being printed out. The equivalent while loop (ignoring the effects of continue) would be: -```c +```pawn new i = 0; while (i < MAX_PLAYERS) @@ -309,7 +310,7 @@ while (i < MAX_PLAYERS) The three stages can be made a lot more complex if required using commas for the first and last sections and standard comparisons for the middle section: -```c +```pawn for (new i = 0, j = 200; i < MAX_PLAYERS && j > 10; i++, j -= 2) { printf("%d %d", i, j); @@ -320,7 +321,7 @@ This will create two new variables and set them to 0 and 200, then loop while on As stated before the scope of variables is limited to the loop usually: -```c +```pawn for (new i = 0; i < MAX_PLAYERS; i++) { printf("%d", i); @@ -330,7 +331,7 @@ printf("%d", i); That will produce an error as "i" doesn't exist after the loop ends. However: -```c +```pawn new i = 0; for ( ; i < MAX_PLAYERS; i++) @@ -342,7 +343,7 @@ printf("%d", i); Is fine as "i" is not declared in the loop. You could also initialise "i" in the loop but not declare it there: -```c +```pawn new i; for (i = 0; i < MAX_PLAYERS; i++) @@ -356,7 +357,7 @@ printf("%d", i); goto and labels are generally discouraged in the coding community as what they do can usually be done better by restructuring your code properly. However basically a goto is a jump: -```c +```pawn goto my_label; printf("This will never be printed"); my_label: @@ -365,7 +366,7 @@ printf("This will be printed"); The compiler however doesn't handle goto very well so that will not be optimised at all and things like: -```c +```pawn stock MyFunction() { new @@ -384,7 +385,7 @@ stock MyFunction() Will give a warning about inconsistent return types as it things the true branch doesn't return anything when it actually does, just in a very roundabout way. Also: -```c +```pawn MyFunction() { new @@ -403,7 +404,7 @@ Will give an unreachable code warning despite the fact it actually is reachable. The basic syntax is: -```c +```pawn label: goto label; @@ -415,7 +416,7 @@ The label should be on a line on it's own and ends in a colon, NOT a semicolon. If is one of the most important operators. It determines wether something should be done or not and acts accordingly, it, along with goto, is the basis of almost all other control structures: -```c +```pawn for (new i = 0; i < 10; i++) { } @@ -423,7 +424,7 @@ for (new i = 0; i < 10; i++) Is equivalent to: -```c +```pawn new i = 0; for_loop: @@ -450,7 +451,7 @@ The conditions if can take are way too many for this post however some are liste Obviously with these you can build up complex conditionals: -```c +```pawn if (a == b && (c != d || f < g)) ``` @@ -460,7 +461,7 @@ That will be true if a is the same as b and either f is less than g or c is not This breaks out a function and can return data to the calling function: -```c +```pawn MyFunction() { new @@ -475,7 +476,7 @@ OtherFunction() someVar will now be 5. -```c +```pawn MyFunction() { if (SomeFunction()) @@ -492,7 +493,7 @@ SomeFunction() That will either return 1 or 0 to the calling function's if statement. 1 is true and 0 if false so the text will only be printed if 1 is returned. However: -```c +```pawn MyFunction() { if (SomeFunction()) @@ -511,7 +512,7 @@ That will return 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10. Anything which is not 0 is You can also use return with strings: -```c +```pawn MyFunction() { printf("%s", SomeFunction()); @@ -529,7 +530,7 @@ Will print "Hello" (without the quotes). You also don't have to return anything: -```c +```pawn MyFunction() { SomeFunction(); @@ -543,7 +544,7 @@ SomeFunction() However if you do this you must make sure the function's return is never used: -```c +```pawn MyFunction() { if (SomeFunction()) @@ -560,7 +561,7 @@ SomeFunction() Here SomeFunction is not returning anything however MyFunction is checking if the value returned from SomeFunction is true or not - it's neither as it just doesn't exist, so you will get a compiler error. No return is the default, so: -```c +```pawn SomeFunction() { return; @@ -569,7 +570,7 @@ SomeFunction() And: -```c +```pawn SomeFunction() { } @@ -579,7 +580,7 @@ Are the same. Finally, you can't mix return values: -```c +```pawn MyFunction() { SomeFunction(); @@ -600,7 +601,7 @@ SomeFunction() This will give an error because it doesn't know what to do. -```c +```pawn SomeFunction() { if (random(2)) @@ -616,7 +617,7 @@ Is also not allowed as the default return is nothing. sleep is a psudo-function which makes execution pause for a given number of milliseconds: -```c +```pawn printf("Time 0s"); sleep(1000); printf("Time 1s"); @@ -632,7 +633,7 @@ state is part of the PAWN state machine and autonoma system, see [this thread](h switch is basically a structured if/else if/else system: -```c +```pawn switch (someVar) { case 1: @@ -656,7 +657,7 @@ switch (someVar) Is just a slightly more efficient (and much cleaner) way of doing: -```c +```pawn if (someVar == 1) { printf("one"); @@ -679,7 +680,7 @@ else while is a loop type similar to for and do..while. The basic operation is an if statement done which if true does some code and jumps back to the if. If it's false it goes to after the loop code - there is no else. Going back to the goto example: -```c +```pawn new i = 0; for_loop: @@ -692,7 +693,7 @@ if (i < 10) This can also be written as: -```c +```pawn new i = 0; while (i < 10) diff --git a/frontend/docs/scripting/language/Style.md b/frontend/docs/scripting/language/Style.md index f2edafa4779e..3903f4e05268 100644 --- a/frontend/docs/scripting/language/Style.md +++ b/frontend/docs/scripting/language/Style.md @@ -2,6 +2,7 @@ title: "Pawn Style Guide" sidebar_label: "Pawn Style Guide" description: A short guide on the generally accepted naming conventions and other aspects of Pawn source code. +tags: ["pawn", "language"] --- This document is a short guide on the generally accepted naming conventions and other aspects of Pawn source code to aid easier communication of intent and streamline debugging and sharing of code. @@ -17,19 +18,19 @@ See also: A statement is a piece of code that imperatively tells the host program to do something. A statement is a valid piece of code that yields some result. -```c +```pawn a = b + c; ``` This is a statement composed of a variable being assigned the result of an [Expression](#expression). -```c +```pawn SetPlayerColor(playerid, 0xFF4700FF); ``` This is a statement telling the program to call a function with some arguments. -```c +```pawn x + 8 ``` @@ -39,7 +40,7 @@ This is _not_ a statement as the result is not used anywhere, this is just an [E A compound statement is a collection of statements surrounded by braces. -```c +```pawn { new message[] = "hi!"; print(message); @@ -48,7 +49,7 @@ A compound statement is a collection of statements surrounded by braces. This is a compound statement composed of two statements. -```c +```pawn if (a == b) { print("hello!"); @@ -57,7 +58,7 @@ if (a == b) This is a compound statement with an `if` condition, this is usually referred to as an "if statement". -```c +```pawn return Function1(), Function2(), Function3(); ``` @@ -69,7 +70,7 @@ An expression is a piece of syntax that yields a value, it's not a valid stateme Expressions are often composed to form statements. -```c +```pawn a + b ``` diff --git a/frontend/docs/scripting/language/Tags.md b/frontend/docs/scripting/language/Tags.md index f97802451588..45c954113bc6 100644 --- a/frontend/docs/scripting/language/Tags.md +++ b/frontend/docs/scripting/language/Tags.md @@ -2,6 +2,7 @@ title: "Scripting: Tags" sidebar_label: "Scripting: Tags" description: A guide for Tags, a type-like feature of the Pawn language providing safety features for working with values of different intent. +tags: ["pawn", "language"] --- ## Introduction @@ -12,7 +13,7 @@ There are two types of tag - strong tags (starting with a capital letter) and we A very simple example is the following: -```c +```pawn new File:myfile = fopen("file.txt", io_read); myFile += 4; @@ -24,7 +25,7 @@ The `fopen` function will return a value with a tag of type `File:`, there is no As mentioned above a strong tag is any tag starting with a capital letter. Examples of these in SA:MP include: -```c +```pawn Float: File: Text: @@ -32,7 +33,7 @@ Text: These cannot be mixed with other variable types and will always issue a warning when you try to do so: -```c +```pawn new Float:myFloat, File:myFile, @@ -51,7 +52,7 @@ myBlank = myFloat; // _: (none) = Float:, "tag mismatch" warning A weak tag behaves mostly the same as a strong tag however the compiler will not issue a warning when the destination is tagless and the source is a weak tag. For example compare the following strong and weak tag codes, the first with the strong tag will give a warning, the second with the weak tag will not: -```c +```pawn new Strong:myStrong, weak:myWeak, @@ -63,13 +64,13 @@ myNone = myWeak; // No warning However the reverse is not true: -```c +```pawn myWeak = myNone; // Warning ``` This is also true with functions, calling a function with a tagless parameter, passing a weak tagged variable will not give a warning: -```c +```pawn new weak:myWeak; MyFunction(myWeak); @@ -84,7 +85,7 @@ MyFunction(myVar) But calling a function with a tagged parameter (weak or strong), passing an untagged parameter will give a warning. Examples of weak tags in SA:MP are less well known as such though are often used and include: -```c +```pawn bool: filemode: floatround_method: @@ -96,7 +97,7 @@ floatround_method: Declaring a variable with a tag is very simple, just write the tag, there's no need to define a tag in advance in any way however this is possible and does have it's uses as will become apparent later: -```c +```pawn new Mytag:myVariable; ``` @@ -107,7 +108,7 @@ Declaring a variable with one of the existing tags will allow you to use that va Creating a function to take or return a tag is very simple, just prefix the relevant part with the desired tag type, for example: -```c +```pawn Float:GetValue(File:fHnd, const name[]) { ... @@ -122,7 +123,7 @@ Operators such as `+`, `==`, `>` etc can be overloaded for different tags, i.e. An operator is exactly like a normal function but instead of a function name you use "operator(**symbol**)" where (**symbol**) is the operator you want to overwrite. The valid operators are: -```c +```pawn + - = @@ -142,7 +143,7 @@ An operator is exactly like a normal function but instead of a function name you Things like `\`, `*`, `=` etc are done automatically. Things like `&` etc can't be overloaded. You can also overload an operator multiple times with different combinations of tag. For example: -```c +```pawn stock Float:operator=(Mytag:oper) { return float(_:oper); @@ -151,7 +152,7 @@ stock Float:operator=(Mytag:oper) If you add that to your code and do: -```c +```pawn new Float:myFloat, Mytag:myTag; @@ -165,13 +166,13 @@ You will no longer get a compiler warning as you would have before because the ` In the overloading example above the functional line was: -```c +```pawn return float(_:oper); ``` This is an example of tag overwriting, the `_:` in front of oper means the compiler basically ignores the fact that oper has a tag type of Mytag: and treats it as tag type `_:` (i.e. no tag type). The function `float` tags a normal number so must be passed one. In that example it is assumed that `Mytag` stores an ordinary integer but overwriting must be dealt with very carefully, for example the following will give very odd results: -```c +```pawn new Float:f1, Float:f2 = 4.0; diff --git a/frontend/docs/scripting/language/Variables.md b/frontend/docs/scripting/language/Variables.md index 8dd72de09524..be307b378f1c 100644 --- a/frontend/docs/scripting/language/Variables.md +++ b/frontend/docs/scripting/language/Variables.md @@ -2,6 +2,7 @@ title: "Basics: Variables" sidebar_label: "Basics: Variables" description: A beginner's guide to variables in Pawn +tags: ["pawn", "language"] --- ## Variables @@ -14,7 +15,7 @@ The reason why variables are so important is because they are basically small un Following is the syntax for variable declaration: -```c +```pawn // Creating (more appropriately, 'declaring') a variable named 'myVariable new myVariable; @@ -26,7 +27,7 @@ new myVariable; The declaration syntax can be better understood by looking at some examples: -```c +```pawn new var; new ammo; new score; @@ -36,13 +37,13 @@ new topScore; Each of the above defined variable has a value by default, which is zero. There are different ways of assigning values to a variable. One method is directly assigning a value to the variable as it’s declared: -```c +```pawn new letters = 25; ``` In the above example, a variable named ‘letters’ is being declared, with a value of 25. You will notice an equal sign which is a simple Assignment Operator that can be used for assigning values to variables. It evaluates the expression on its right and assigns the resultant value to the variable referenced on its left side. Other than assigning values directly at the declaration, you can also do it in later parts of the code: -```c +```pawn new letters; letters = 25; @@ -52,7 +53,7 @@ letters = 25; Modifying a variable's value is possible only if the part of the code where you’re referencing the variable is within the scope of that variable. Scope of a variable depends upon the code block or position where that variable was declared. For example a variable being declared outside any block of code, usually in the beginning of the script, has a ‘Global’ scope and can be accessed from anywhere within the script: -```c +```pawn #include new g_var = 5; @@ -84,7 +85,7 @@ public OnPlayerConnect(playerid) Other than ‘Global’ (scoped) variables, there are ‘local’ or ‘private’ variables that can be accessed only from inside the block of code where they were declared. -```c +```pawn #include public OnFilterScriptInit() @@ -108,7 +109,7 @@ If you try to compile the code above, the compiler will show an error which is r One important thing to note is that you cannot declare variables with the same names if their scopes intercede. For example if you already have a variable named ‘score’ on a global scope, you cannot create another variable named ‘score’ on the global scope as well as a local one, and this is true for other way around as well (if you already have a local variable, avoid declaring a global variable with the same name). -```c +```pawn #include new g_score; @@ -131,7 +132,7 @@ Now that you know how to declare variables, you need to know the naming rules fo #### Examples: -```c +```pawn new new; // Incorrect: Using a reserved word new _new; // Correct @@ -150,7 +151,7 @@ new Internet; // Correct After that, now lets look at some examples of what types of data can be stored in variable and how: -```c +```pawn new letter = 'M'; @@ -173,7 +174,7 @@ new sentence = "This is a sentence"; A variable is capable of holding a character, integer value, boolean (true or false) and a float value (decimal value). The comments in the above code show that storing a string in a variable results into an error (as strings can be stored in _Arrays_ only). Other than that, assigning a float value to a variable will result in a compiler warning, which can be avoided by adding ‘tags’. Without proper tags, the script will show warnings upon compilation but will be executable. Tags tell the compiler about the type of data that is intended to be stored in the variable, which in turn informs us in the form of errors or warning if we make a program-breaking mistake in the code. Example of tags: -```c +```pawn new decimalValue = 1.0; // Incorrect new bool:decimalValue = 1.0 // Incorrect new Float:decimalValue = 1.0; // Correct @@ -187,7 +188,7 @@ Using correct tags is important to avoid any bugs or errors during program execu Pawn being a typeless language allows us to store different types of data in the same variable which can be useful in some cases and troublesome in others, but such usage of variables is not recommended. -```c +```pawn #include public OnFilterScriptInit() diff --git a/frontend/docs/scripting/language/reference/00-Contents.md b/frontend/docs/scripting/language/reference/00-Contents.md index 3b70a170b8d7..38cc53f0209f 100644 --- a/frontend/docs/scripting/language/reference/00-Contents.md +++ b/frontend/docs/scripting/language/reference/00-Contents.md @@ -1,3 +1,7 @@ +--- +tags: ["pawn", "language", "reference"] +--- + # PAWN ![Pawn](https://i.ibb.co/SRbRt3C/pawn-icon-daddy-DOT-small.png) diff --git a/frontend/docs/scripting/language/reference/01-Foreword.md b/frontend/docs/scripting/language/reference/01-Foreword.md index 0ffd3d51aa23..798299c3545a 100644 --- a/frontend/docs/scripting/language/reference/01-Foreword.md +++ b/frontend/docs/scripting/language/reference/01-Foreword.md @@ -1,3 +1,7 @@ +--- +tags: ["pawn", "language", "reference"] +--- + # Foreword --- diff --git a/frontend/docs/scripting/language/reference/02-A-tutorial-introduction.md b/frontend/docs/scripting/language/reference/02-A-tutorial-introduction.md index 27f1e2944722..be5cc2b63de2 100644 --- a/frontend/docs/scripting/language/reference/02-A-tutorial-introduction.md +++ b/frontend/docs/scripting/language/reference/02-A-tutorial-introduction.md @@ -1,3 +1,7 @@ +--- +tags: ["pawn", "language", "reference"] +--- + # A tutorial introduction --- @@ -12,7 +16,7 @@ string; printing “Hello world” is a classic example. In pawn, the program wo Listing: hello.p -```c +```pawn main() printf "Hello world\n" ``` @@ -58,7 +62,7 @@ pawn syntax (and it has the same semantics as the earlier example): Listing: hello.p — C style -```c +```pawn #include main() @@ -114,7 +118,7 @@ values using an algorithm invented by Euclides. Listing: gcd.p -```c +```pawn /* the greatest common divisor of two values, using Euclides’ algorithm */ main() @@ -226,7 +230,7 @@ Symbolic constants look like variables, but they cannot be changed. Listing: sieve.p -```c +```pawn /* Print all primes below 100, using the "Sieve of Eratosthenes" */ main() @@ -302,7 +306,7 @@ and the sequence is 1, 1, 2, 3, 5, 8, 13, 21,. . . Listing: fib.p -```c +```pawn /* Calculation of Fibonacci numbers by iteration */ main() @@ -402,7 +406,7 @@ negative year values for BC years and positive (non-zero) values for AD years. Listing: julian.p -```c +```pawn /* calculate Julian Day number from a date, and vice versa */ main() @@ -561,7 +565,7 @@ not support rational numbers at all. Listing: c2f.p -```c +```pawn main() { new Rational: Celsius @@ -635,7 +639,7 @@ operation: applying it twice on the same text reveals the original. Listing: rot13.p -```c +```pawn /* Simple encryption, using ROT13 */ main() @@ -709,7 +713,7 @@ that shows a few new features of the pawn language. Listing: wcount.p -```c +```pawn /* word count: count words on a string that the user types */ main() @@ -805,7 +809,7 @@ previous pawn programs, and it also displays a few other features, such as globa variables and named parameters. Listing: queue.p -```c +```pawn /* Priority queue (for simple text strings) */ enum message @@ -1029,7 +1033,7 @@ steps. The algorithm is completely in the findtargets function. Listing: set.p -```c +```pawn /* Set operations, using bit arithmetic */ main() @@ -1102,7 +1106,7 @@ of elements in the set. A straightforward function that does this is below: Listing: simple bitcount function -```c +```pawn bitcount(set) { new count = 0 @@ -1120,7 +1124,7 @@ That is, the following function iterates only once if the input value has only o Listing: improved bitcount function -```c +```pawn bitcount(set) { new count = 0 @@ -1210,7 +1214,7 @@ The main program for a Reverse Polish Notation calculator is below: Listing: rpn.p -```c +```pawn /* a simple RPN calculator */ #include strtok #include stack @@ -1239,7 +1243,7 @@ file rpnparse.inc, reproduced below: Listing: rpnparse.inc -```c +```pawn /* main rpn parser and lexical analysis, part of the RPN calculator */ #include #include @@ -1361,7 +1365,7 @@ array size of word. Listing: strtok.inc -```c +```pawn /* extract words from a string (words must be separated by white space) */ #include @@ -1412,7 +1416,7 @@ and resetting the stack, there is a third function that clears the stack. Listing: stack.inc -```c +```pawn /* stack functions, part of the RPN calculator */ #include @@ -1541,7 +1545,7 @@ before the advent of the mouse. Listing: turtle.p -```c +```pawn @keypressed(key) { /* get current position */ @@ -1621,7 +1625,7 @@ allow for a “broadcast” mode so that more than two people can chat with each Listing: chat.p -```c +```pawn #include @receivestring(const message[], const source[]) @@ -1736,7 +1740,7 @@ in a different colour. Listing: comment.p -```c +```pawn /* parse C comments interactively, using events and a state machine */ main() @@ -1902,7 +1906,7 @@ re-entry of the state. Listing: traffic.p -```c +```pawn /* traffic light synchronizer, using states in an event-driven model */ #include