### OnScriptInit Example for Script Initialization Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_scriptinit/features.md This snippet shows how to use OnScriptInit to perform actions when a script starts. It demonstrates printing context information like gamemode/filterscript status and plugin availability. ```pawn // Hooks are now available, as are all other YSI features. hook OnScriptInit() { printf("================================"); printf("|| ||"); printf("|| My Mode Started! ||"); printf("|| ||"); printf("================================"); printf("|| ||"); printf("|| Context information: ||"); printf("|| ||"); printf("|| - Gamemode? %s ||", Server_IsGameMode() ? ("yes") : ("no ")); printf("|| - Filterscript? %s ||", Server_IsFilterscript() ? ("yes") : ("no ")); printf("|| - JIT plugin? % ||", Server_JITExists() ? ("yes") : ("no ")); printf("|| %s ||" , Server_JITComplete() ? ("(compiled)") : ("(failed) ")); printf("|| - CrashDetect plugin? %s ||", Server_CrashDetectExists() ? ("yes") : ("no ")); printf("|| ||"); printf("================================"); } ``` -------------------------------- ### Deferred Call via Timer Setup Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_inline/features.md Sets up a timer to call a function later, deferring its execution. This example shows the initial setup before memory management for closures is considered. ```pawn forward InlineTimerCall(Func:tt<>); public InlineTimerCall(Func:tt<> { @.tt(); } SetInlineTimer(Func:tt<>, delay, bool:repeat) { SetTimerEx("InlineTimerCall", delay, repeat, "i", _:tt); } PrintLater(a, b, c) { inline const PrintNow() { printf("a = %d, b = %d, c = %d", a, b, c); } SetInlineTimer(using inline PrintNow, 1000, false); } ``` -------------------------------- ### Separate Arguments Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_args/features.md Demonstrates that '-' and '/' override parameter assumptions, treating '--start' as a separate argument. ```pawn --help --start ``` -------------------------------- ### Handling `new` keyword with macro chaining Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/internal.md Demonstrates a more complex macro setup where the `new` keyword is part of a chain. This example ensures valid output even if the `new` keyword is not matched by the initial macro. ```pawn #define S: new MACRO_3||| #define new%0|||%1||| new other,%1; #define MACRO_3|||%1; %1 ``` -------------------------------- ### Basic Profiling Setup and Execution Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_profiling/quick-start.md This snippet shows the basic setup for using y_profiling, including necessary includes and defining functions to be profiled. It also displays the expected output after running the profiling. ```pawn #define RUN_PROFILINGS #include #include PROFILE__ LoopV1() { new i = 0; while (i != 10) { ++i; } } PROFILE__ LoopV2() { for (new i = 0; i != 10; ++i) { } } main() {} ``` ```text ||========================|| || STARTING PROFILINGS... || ||========================|| Timing "LoopV1"... Mean = 120.00ns Mode = 120.00ns Median = 120.00ns Range = 4.00ns Timing "LoopV2"... Mean = 124.00ns Mode = 124.00ns Median = 124.00ns Range = 9.00ns *** Profilings: 2 ||======================|| || PROFILINGS COMPLETE! || ||======================|| *** Time: 2496ms ``` -------------------------------- ### Example of `new` detection with `OTHER` prefix Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/internal.md Demonstrates matching `new` after a specific prefix, showing how `%0` and `%1` capture surrounding text. This example matches `MY OTHER newt` where `%0` is a space and `%1` is `t`. ```pawn MY OTHER newt||| ``` -------------------------------- ### Server_GetStartTime Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_serverdata/api.md Retrieves the script's start time as a Unix timestamp. This function relies on the ScriptInit_GetStartTime function to determine the start time. ```APIDOC ## Server_GetStartTime ### Description Get the start time of the script, previously determined by ScriptInit_GetStartTime, as a unix timestamp. ### Syntax ```c Server_GetStartTime() ``` ### Remarks Get the start time of the script, previously determined by ScriptInit_GetStartTime, as a unix timestamp. ### Depends on YSI_gsStartTime ### Estimated stack usage 1 cells ``` -------------------------------- ### Example Usage of PRINT Macro Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_als/quick-start.md Demonstrates how to use the PRINT macro to debug the 'OnPlayerConnect' callback. ```pawn PRINT ``` -------------------------------- ### Server_GetStartDateTime Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_serverdata/api.md Retrieves the date and time when the server started. ```APIDOC ## Server_GetStartDateTime ### Description Retrieves the date and time when the server started. ### Method Server_GetStartDateTime(&year, &month, &day, &hour, &minute, &second) ### Parameters #### Path Parameters - **year** (&year) - Required - Description - **month** (&month) - Required - Description - **day** (&day) - Required - Description - **hour** (&hour) - Required - Description - **minute** (&minute) - Required - Description - **second** (&second) - Required - Description ``` -------------------------------- ### Java Annotation Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/annotations.md Illustrates the syntax of annotations in Java using @JsonIgnore. ```csharp class Container { @JsonIgnore() public int Var; } ``` -------------------------------- ### Script_GetStartString Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_scriptdata/api.md Retrieves the time the script started, as a string. ```APIDOC ## Script_GetStartString ### Description Retrieves the time the script started, as a string. ### Syntax Script_GetStartString(output[], size) ### Parameters - output[]: (string) - size: (integer) ### Returns - string: The time the script started. ``` -------------------------------- ### _yGI Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Players/y_groups/api.md Initializes the global group and function pointers when the group system starts up. ```APIDOC ## _yGI ### Description Initializes the global group and function pointers when the group system starts up. ### Parameters #### Path Parameters - **&ni** (&ni_INFO) - Initialization parameter. - **&na** (&na_INFO) - Initialization parameter. - **&nu** (&nu_INFO) - Initialization parameter. ### Remarks This function is called when the group system first starts up to initialise the global group and all the various function pointers. The way the "_gchain" macro works means that the fact that "ni" etc are references is irrelevant; however, it does make the code LOOK much nicer and like assigning to the variables does have some wider meaning. If this is called with "ni = -1", it is special code to temporarily set or restore the defaults for use with the "GROUP_ADD" macro. So basically, it is poor design giving two distinct uses to a single function. ``` -------------------------------- ### Positional Argument Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_args/features.md Demonstrates a simple string positional argument. ```pawn Hello ``` -------------------------------- ### POSTINIT__ Macro Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_scriptinit/features.md Use `POSTINIT__` for initializations that must run after `OnScriptInit`. Each `POSTINIT__` function must have a unique name. ```pawn POSTINIT__ VehicleStreamer() { printf("Vehicle Streamer initialised"); } ``` -------------------------------- ### Get True Starts of Multi-Iterator Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/api.md Accesses the number of starts in a multi-iterator. This is a native function. ```pawn Iter_Starts(iter[]) ``` -------------------------------- ### Iter_Begin Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/api.md Gets a reference point before the start of the iterator. ```APIDOC ## Iter_Begin ### Description Retrieves a reference point that is positioned conceptually before the first element of the iterator. ### Method N/A (Native Function) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```pawn Iter_Begin(IteratorArray:Name[]) ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Basic SendClientMessage Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Players/y_text/quick-start.md A standard way to send messages to players, which requires recompilation for changes. ```pawn SendClientMessage(playerid, COLOUR_RED, "Hello there"); ``` -------------------------------- ### PREINIT__ Macro Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_scriptinit/features.md Use `PREINIT__` for lightweight initializations that must run before `OnScriptInit`. Each `PREINIT__` function must have a unique name. ```pawn PREINIT__ VehicleStreamer() { printf("Vehicle Streamer installed"); } ``` -------------------------------- ### Test with Initialization, Execution, and Closing Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_testing/quick-start.md Demonstrates a test with setup (init) and teardown (close) phases. The init phase saves player health, the test phase modifies it, and the close phase restores it. ```pawn #define RUN_TESTS // Auto-run tests. #define RUN_SLOW_TESTS // Also slow tests. #include new Float:gPreviousHealth; @testinit() MyCrashingTest(playerid) { // Save their health to restore later. GetPlayerHealth(playerid, gPreviousHealth); } @test() MyCrashingTest(playerid) { SetPlayerHealth(playerid, 20.0); new arr[5], idx = 5; // Oops, crashed. ASSERT(arr[idx] == 0); } @testclose() MyCrashingTest(playerid) { // Restore their health. SetPlayerHealth(playerid, gPreviousHealth); } ``` -------------------------------- ### I@E Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_inline/api.md Gets the start of an inline function's code block and removes itself from the compiled code. It can optionally copy the stack back. ```APIDOC ## I@E ### Description AKA. Inline_Entry. This function gets the start of an inline function's code block. It then removes itself from the compiled code so that it can never be called again. If "constFunc" is 3, copy the stack back, if it isn't don't. ### Parameters #### Query Parameters - **s** (s_INFO) - Required - Unknown purpose. - **constFunc** (constFunc_INFO) - Optional - If set to 3, copies the stack back. ### Remarks This function is used to mark the entry point of inline code and ensure it's only executed once. ``` -------------------------------- ### Include Profilings and Run All Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_profiling/api.md Compile profiling functions and run all defined profiles with standard console output. ```pawn #define INCLUDE_PROFILINGS #include #include Profile:CodeToProfile() { // CODE GOES HERE } main() { // Run all the profiles, with standard outputs. Profiling_RunAll(); // OR: // Run all the profiles, but with less output, and report the number found. new profilings. Profiling_Run(profilings); } ``` -------------------------------- ### Get Public Variable Name by Prefix Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_amx/api.md Retrieves the name of a public variable that starts with a specific prefix. Useful for iterating through variables with a common naming scheme. ```pawn AMX_GetPubvarNamePrefix(idx, buffer[], pattern) ``` -------------------------------- ### Get Public Variable Pointer by Prefix Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_amx/api.md Retrieves a pointer to the data of a public variable that starts with a specific prefix. Useful for accessing data of a group of related variables. ```pawn AMX_GetPubvarPointerPrefix(idx, &buffer, pattern) ``` -------------------------------- ### OnCodeInit Example for Code Generation Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_scriptinit/features.md This snippet demonstrates how to use OnCodeInit for code generation, targeting a function for rewriting and emitting new assembly code. It's called early in the JIT compilation process. ```pawn ReturnFive() { // To be changed to be correct! return 3; } public OnCodeInit() { // Generate some code. new ctx[AsmContext]; // Target `ReturnFive` for rewriting. AsmInitPtr(ctx, addressof (ReturnFive<>), 16); // Write the correct code (`ctx` is used implicitly here). @emit PROC @emit CONST.pri 5 @emit RETN // Basic ALS forwarding only! #if defined Example_OnCodeInit Example_OnCodeInit(); #endif return 1; } #undef OnCodeInit #define OnCodeInit Example_OnCodeInit #if defined Example_OnCodeInit forward Example_OnCodeInit(); #endif ``` -------------------------------- ### C-style Varargs Compatibility with va_args and va_start Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_va/features.md Provides examples of using `va_args<>` and `va_start<>` for C-style vararg function compatibility, aliased to `...` and `___` respectively. ```pawn SendFormattedMessage1(playerid, colour, const msg[], ...) { new str[128] format(str, sizeof (str), msg, ___(3)); } ``` ```pawn SendFormattedMessage2(playerid, colour, const msg[], va_args<> { new str[128] va_format(str, sizeof (str), msg, va_start<3>); } ``` -------------------------------- ### Get Public Variable Entry by Prefix Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_amx/api.md Scans the public variables table for entries whose names start with a specified prefix. Prefixes are 4-byte values derived from the first four characters of a name for efficient comparison. ```pawn AMX_GetPubvarEntryPrefix(idx, &buffer, pattern) ``` ```pawn new idx = 0, buffer; while ((idx = AMX_GetPubvarEntryPrefix(idx, buffer, _A))) { } ``` -------------------------------- ### Install YSI-Includes with sampctl Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/installation.md Use this command to install the YSI-Includes library and its dependencies via sampctl. ```bash sampctl package install pawn-lang/YSI-Includes@5.x ``` -------------------------------- ### Parameter Starting with Hyphen (Colon Separator) Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_args/features.md Illustrates using ':' to assign a parameter that starts with a hyphen to an argument. ```pawn -e=--i ``` -------------------------------- ### Get Iterator End Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/api.md Gets a pointer to the position after the end of the iterator, similar to a MAX_PLAYERS concept. This is a native function. ```pawn Iter_End(iter[]) ``` -------------------------------- ### y_svar Initialization and Declaration Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_svar/quick-start.md Shows the required setup for y_svar, including defining a mode name and including the library. It then illustrates various ways to declare server-wide variables using 'svar', including enums and multi-dimensional arrays. ```pawn #define MODE_NAME "UniqueName" #include ``` ```pawn enum E_EXAMPLE { E_EXAMPLE_A, Float:E_EXAMPLE_B, E_EXAMPLE_C[24] } svar gExampleEnum[E_EXAMPLE]; svar gExample1D[200]; svar gExample2D[200][200]; svar gExample2DEnum[200][E_EXAMPLE]; svar gExampleEnum2D[E_EXAMPLE][200]; ``` ```pawn main { printf("E_EXAMPLE_A = %d", gExampleEnum[E_EXAMPLE_A]); gExample2DEnum[55][E_EXAMPLE_B] = 98.3; } ``` -------------------------------- ### Get Iterator Beginning Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/api.md Gets a pointer to the theoretical beginning of the iterator, which is positioned before the first element. This is a native function. ```pawn Iter_Begin(iter[]) ``` -------------------------------- ### Basic Command with Help Information Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_commands/features.md This snippet shows a basic command that includes a help parameter to display usage information. It handles cases where the help flag is present or when no parameters are provided. ```pawn @cmd() me(playerid, params[], help) { if (help) return SendClientMessage(playerid, COLOUR_GREETING, "Role-play an action. Example: '/me jumps'"); if (IsNull(params)) return SendClientMessage(playerid, COLOUR_FAILURE, "You must enter an action"); new str[144]; format(str, sizeof (str), "** %s %s **", ReturnPlayerName(playerid), params); SendClientMessageToAll(COLOUR_GREETING, str); return 1; } ``` -------------------------------- ### Native SetTimer Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_timers/quick-start.md Demonstrates how to set up repeating and delayed timers using the native Pawn SetTimer functions. Requires explicit forward declarations and SetTimerEx for parameters. ```pawn #include forward RepeatingTimer(); forward DelayedTimer(playerid); public RepeatingTimer() { printf("Called every N seconds."); } public DelayedTimer(playerid) { printf("May be called after N seconds"); } main() { SetTimer("RepeatingTimer", 1000, 1); SetTimerEx("DelayedTimer", 500, 0, "i", 42); } ``` -------------------------------- ### Parameter Starting with Hyphen (Equals Separator) Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_args/features.md Shows using '=' to assign a parameter that starts with a hyphen to a long-form argument. ```pawn --decrement=--i ``` -------------------------------- ### Find Character in String (Unbounded Start) Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_utils/api.md Similar to chrfind, but historically allowed searching from an unbounded start position. Depends on ChrFind. ```pawn chrfindp(needle, haystack[], start) ``` -------------------------------- ### Basic Callback Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_als/quick-start.md A standard Pawn callback function demonstrating a simple print statement. This serves as a baseline for understanding more complex callback manipulations. ```pawn public OnPlayerCommandText(playerid) { printf("OnPlayerCommandText(%d)", playerid); return 1; } ``` -------------------------------- ### Add Start Point to Race Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_races/quick-start.md Defines a starting grid point for a race. This is used in conjunction with checkpoints to set up the race course. ```pawn foreign Race_AddStart(raceid, Float:x, Float:y, Float:z, Float:a) ``` -------------------------------- ### Basic y_svar Usage Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_svar/quick-start.md Demonstrates declaring a server-wide string variable, saving it via a command, and displaying it on game mode initialization. The variable is automatically saved and loaded between mode restarts. ```pawn #define MODE_NAME "SavedText" #include svar gSavedText[200]; public OnGameModeInit() { printf("Saved Text: %s", gSavedText); } YCMD:settext(playerid, params[], help) { if (help) return SendClientMessage(playerid, 0xFF0000AA, "Sets the saved text"); strcpy(gSavedText, params); return 1; } ``` -------------------------------- ### ZipWith3_ Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_functional/api.md Demonstrates using ZipWith3_ to process three input arrays with a callback function. The callback can utilize closures for variables from its surrounding scope. ```pawn RemoveBins(playerid) { ZipWith3_({ RemoveBuildingForPlayer(playerid, 1337, Float:_0, Float:_1, Float:_2, 2.0) }, gBinXs, gBinYs, gBinZs); } ``` -------------------------------- ### Add Start Points and Checkpoints to a Race Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_races/quick-start.md Adds starting positions and checkpoints to a race. This defines the race track and where players begin. ```pawn // Add some points to the starting grid. // This is a drag race between two cars along the LV airstrip. // X, Y, Z, Angle. Race_AddStart(gRace, 425.0, 2488.0, 16.2, 90.0); Race_AddStart(gRace, 425.0, 2512.0, 16.2, 90.0); // Add two checkpoints - its a drag race there and back! // No angle this time. Arrows and chequred flags are done automatically. Race_AddCheckpoint(gRace, -78.5, 2500.0, 16.1); Race_AddCheckpoint(gRace, 434.0, 2500.0, 16.1); ``` -------------------------------- ### Basic y_users Setup Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Players/y_users/quick-start.md Includes necessary y_users components and defines for mode name and password hashing. Required for basic player registration and login functionality. ```pawn #define MODE_NAME "MyMode" #define PP_WP native WP_Hash(target[], size, text[]); #include #include #include ``` -------------------------------- ### Initialize y_cgen Library with VA_OnCodeInit Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_cgen/internal.md This public function is responsible for the initial setup of the y_cgen library. It performs necessary initializations, including setting up the code space and disassembler context. ```pawn VA_OnCodeInit() ``` -------------------------------- ### Get Written Slot with Circular_Push Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_circular/features.md Use this to get the slot index after pushing data, allowing immediate manipulation of the newly written data. ```pawn new slot = Circular_Push(buffer, data); buffer[slot][3] = 7; ``` -------------------------------- ### YSI LAM@1 Placeholder for Lambda Start Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_functional/internal.md A placeholder function denoting the start of lambda code. All parameters are dummies used for code scanning and generation space padding. ```pawn LAM@1(idx, pattern0, pattern1, pattern2, pattern3) ``` -------------------------------- ### Argument with Parameter Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_args/features.md Shows how an argument like --help can take a subsequent word as its parameter. ```pawn --help start ``` -------------------------------- ### Corrected foreach loop initialization Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/internal.md Shows the correct way to initialize a foreach loop by starting with the value stored in the last slot of the iterator array, ensuring a valid starting point. ```pawn for (new i = Iterator@MyIter[4]; i != 7; i = Iterator@MyIter[i]) { printf("%d", i); } ``` -------------------------------- ### Basic y_users and y_uvar Setup Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_uvar/quick-start.md This snippet shows the necessary includes and data structure for managing per-player variables using y_users and y_uvar. It defines a basic player data structure and a global array to hold this data for each player. ```pawn #define MODE_NAME "Mode_Test_1" #include #include enum E_PLAYER_DATA { E_PLAYER_DATA_SKIN, Float:E_PLAYER_DATA_HEALTH } uvar gPlayerData[MAX_PLAYERS][E_PLAYER_DATA]; ``` -------------------------------- ### y_timers Task and Timer Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_timers/quick-start.md Shows how to define repeating tasks and delayed timers using the y_timers include. Syntax is more concise and parameters are defined directly within the function signature. ```pawn #include task RepeatingTimer[1000]() { printf("Called every 1 seconds."); } timer DelayedTimer[500](playerid) { printf("May be called after 0.5 seconds"); } main() { defer DelayedTimer(42); } ``` -------------------------------- ### Class_A Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_classes/api.md Gets the angle (A) of a class. ```APIDOC ## Class_A ### Description Gets the angle (A) of a class. ### Parameters #### Path Parameters - **classid** (classid_INFO) - Required - The ID of the class. ### Returns - None ### Remarks - None ``` -------------------------------- ### Create and Initialize a Race with Options Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_races/quick-start.md A more concise way to create and initialize a race by passing optional parameters directly to Race_Create. ```pawn public OnScriptInit() { gRace = Race_Create(.laps = 0, .entry = 200); } ``` -------------------------------- ### Foreach with 'new' and Colon Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/internal.md Illustrates the expansion of a foreach loop when using the 'new' keyword followed by a colon, showing the intermediate steps of macro replacement. ```pawn foreach (new playerid : Player) ``` ```pawn // Detect and replace `foreach`.... for (new Y_FOREACH_SECOND|||Y_FOREACH_THIRD|||new playerid : Player||| ) // Detect and replace `new`... for (Y_FOREACH_THIRD||| Y_FOREACH_SECOND|||new playerid ||| Player||| ) ``` -------------------------------- ### Class_Y Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_classes/api.md Gets the Y coordinate of a class. ```APIDOC ## Class_Y ### Description Gets the Y coordinate of a class. ### Parameters #### Path Parameters - **classid** (classid_INFO) - Required - The ID of the class. ### Returns - None ### Remarks - None ``` -------------------------------- ### ZipWithIdx Example with Inline Function Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_functional/api.md Shows how to use ZipWithIdx with a normal 'using' inline function for processing two input arrays and storing results in an output array, passing the current index to the callback. ```pawn inline AddAndMul(a, b, c) { return a + (b * c); } ZipWithIdx(using inline AddAndMul, gInput1, gInput2, gResult); ``` -------------------------------- ### Class_Z Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_classes/api.md Gets the Z coordinate of a class. ```APIDOC ## Class_Z ### Description Gets the Z coordinate of a class. ### Parameters #### Path Parameters - **classid** (classid_INFO) - Required - The ID of the class. ### Returns - None ### Remarks - None ``` -------------------------------- ### Class_X Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_classes/api.md Gets the X coordinate of a class. ```APIDOC ## Class_X ### Description Gets the X coordinate of a class. ### Parameters #### Path Parameters - **classid** (classid_INFO) - Required - The ID of the class. ### Returns - None ### Remarks - None ``` -------------------------------- ### Task Syntax Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_timers/quick-start.md Illustrates the general syntax for defining 'task' and 'ptask' functions with their respective delays and parameters. ```pawn task FUNCTION_NAME[DELAY]() { CODE(); } ptask FUNCTION_NAME[DELAY](playerid) { CODE(); } ``` -------------------------------- ### Initialize and Push Data to a Circular Buffer Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_circular/quick-start.md Demonstrates initializing a circular buffer and pushing data until it reaches capacity, showing how older data is overwritten. Use this to manage a fixed-size queue where the oldest elements are discarded. ```pawn new buffer[4][1]; Circular_Init(buffer); // Count: 0, Contents: - - - - Circular_Push(buffer, 1); // Count: 1, Contents: 1 - - - Circular_Push(buffer, 2); // Count: 2, Contents: 1 2 - - Circular_Push(buffer, 3); // Count: 3, Contents: 1 2 3 - Circular_Push(buffer, 4); // Count: 4, Contents: 1 2 3 4 Circular_Push(buffer, 5); // Count: 4, Contents: 2 3 4 5 Circular_Push(buffer, 6); // Count: 4, Contents: 3 4 5 6 Circular_Push(buffer, 7); // Count: 4, Contents: 4 5 6 7 ``` -------------------------------- ### INI_ReverseWhitespace Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_ini/api.md Finds the starting position of whitespace in a string. ```APIDOC ## INI_ReverseWhitespace ### Description Finds the starting position of whitespace in a string. ### Parameters #### Path Parameters - **str[]** (str[]_INFO) - Description - **pos** (pos_INFO) - Description ### Returns - Start of the whitespace. (position) ``` -------------------------------- ### Define ProfileInit and Profile Functions Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_profiling/api.md Declare an optional initialization function called once before profiling and the main profiling function. ```pawn ProfileInit:CodeToProfile() { // CALLED JUST ONCE BEFORE THE PROFILING } Profile:CodeToProfile() { // CODE GOES HERE } ``` -------------------------------- ### Decorator Parameter Expansion Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_decorator/quick-start.md Illustrates how parameters passed to a decorator and function signature are expanded by the decorator__ macro. This shows the available parameters for code generation. ```pawn #define DECORATOR_EXAMPLE:%8$(%0)(%1)(%2)(%3)(%4)(%5) EXAMPLE_NO_PARAMS:EXAMPLE_W_PARAMS:%8$(%0)(%1)(%2)(%3)(%4)(%5) #define EXAMPLE_NO_PARAMS:%8$()(%1)(%2)(%3)(%4)(%5) %8$ /* whatever - don't forget `%8$`! */ #define EXAMPLE_W_PARAMS:%8$(%0)(%1)(%2)(%3)(%4)(%5) %8$ /* whatever - don't forget `%8$`! */ ``` -------------------------------- ### Color Functions Source: https://github.com/pawn-lang/ysi-includes/wiki/Function-List-(as-of-3.1) Functions for setting and getting colors. ```APIDOC ## SetColoursCanHaveSpaces ### Description Enables or disables the ability for color names to contain spaces. ### Method (Not specified, likely a function call) ### Parameters - **set**: bool - Description: Whether to allow spaces (true) or not (false). ## SetColour ### Description Sets a color by name. ### Method (Not specified, likely a function call) ### Parameters - **name[]**: const string - Description: The name of the color. - **color**: (type not specified) - Description: The color value. ## SetColourHash ### Description Sets a color by its hash. ### Method (Not specified, likely a function call) ### Parameters - **hash**: (type not specified) - Description: The hash of the color. - **color**: (type not specified) - Description: The color value. ## GetColour ### Description Gets a color by name. ### Method (Not specified, likely a function call) ### Parameters - **name[]**: const string - Description: The name of the color. - **alpha**: (type not specified, default 0xAA) - Description: The alpha value. ## GetColourStream ### Description Gets a color from a string stream. ### Method (Not specified, likely a function call) ### Parameters - **str[]**: const string - Description: The string containing the color information. - **idx**: &int - Description: The index to start reading from. - **alpha**: (type not specified, default 0xAA) - Description: The alpha value. ## GetColourHash ### Description Gets a color by its hash. ### Method (Not specified, likely a function call) ### Parameters - **hash**: (type not specified) - Description: The hash of the color. - **alpha**: (type not specified, default 0xAA) - Description: The alpha value. ``` -------------------------------- ### Timer Initialization with @init() Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/annotations.md Demonstrates using the @init() annotation to set up a timer that calls a specified function at regular intervals. ```pawn forward OneSecond(); @init() OneSecond() { SetTimer(#OneSecond, 1000, true); } public OneSecond() { // Code goes here. } ``` -------------------------------- ### Basic Sparse Array Usage Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_sparsearray/quick-start.md Demonstrates creating a sparse array, setting and getting values, and checking for element existence. Use this for managing data associated with player IDs where most players might not have data. ```pawn #include // Create the sparse array. static SparseArray:gArrests<>; public OnPlayerDisconnect(playerid, reason) { // Remove this player from the array. Sparse_UnSet(gArrests, playerid); } MakeArrest(playerid) { // Update their arrest count. new arrests = Sparse_Get(gArrests, playerid); if (arrests == cellmin) { // Default value. Sparse_Set(gArrests, playerid, 1); } else { Sparse_Set(gArrests, playerid, arrests + 1); } } bool:HasMadeArrests(playerid) { // Has this player ever made any arrests? return Sparse_Contains(gArrests, playerid); } ``` -------------------------------- ### Class_Skin Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_classes/api.md Gets the skin ID associated with a class. ```APIDOC ## Class_Skin ### Description Gets the skin ID associated with a class. ### Parameters #### Path Parameters - **classid** (classid_INFO) - Required - The ID of the class. ### Returns - None ### Remarks - None ``` -------------------------------- ### Player Password Hashing Setup Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Players/y_users/quick-start.md Sets up the player password hashing algorithm. PP_WP specifies the Whirlpool algorithm, which requires a specific native declaration and plugin. ```pawn #define PP_WP native WP_Hash(target[], size, text[]); ``` -------------------------------- ### TD_Name Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_td/api.md Sets or gets the name of a textdraw style. ```APIDOC ## TD_Name ### Description Sets or gets the name of a textdraw style. ### Parameters #### Path Parameters - **Style:styleID** (Style:styleID_INFO) - Description not provided - **name[]** (name[]_INFO) - Description not provided ### Returns - Description not provided ### Remarks - Description not provided ``` -------------------------------- ### Iter_End Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/api.md Gets a reference point after the end of the iterator. ```APIDOC ## Iter_End ### Description Retrieves a reference point that is positioned conceptually after the last element of the iterator. ### Method N/A (Native Function) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```pawn Iter_End(IteratorArray:Name[]) ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Rest Parameter Example Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_args/features.md Shows how '--' separates initial arguments from the 'rest' parameter, which captures all subsequent text as a single string. ```pawn --foo --bar -- Hello world! ``` -------------------------------- ### Circular_Count Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_circular/api.md Gets the number of items currently in the buffer. ```APIDOC ## Circular_Count ### Description Gets the number of items in the buffer. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```pawn new arr[5][5]; Circular_Init(arr); Circular_Count(arr); ``` ### Response #### Success Response (200) - **count** (integer) - The number of items in the buffer. #### Response Example ```json { "count": 1 } ``` ``` -------------------------------- ### Create and Initialize a Race Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_races/quick-start.md Creates a new race, sets the number of laps to 0, and defines the entry fee. This is the fundamental setup for any race. ```pawn #include new gRace; public OnScriptInit() { // Declare a new race. gRace = Race_Create(); // Set it to have 0 laps. Race_SetLaps(gRace, 0); // Set the price to join the race to $200. // Note that if you want, you can set this to // 0 and create your own payment system. Race_SetEntry(gRace, 200); } ``` -------------------------------- ### INI_Open Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_ini/api.md Starts a new buffer for an INI file if possible. ```APIDOC ## INI_Open ### Description Starts a new buffer for an INI file if possible. Doesn't actually open the file, just starts a new buffer if possible. ### Parameters #### Path Parameters - **filename[]** (string) - Required - filename[]_INFO ### Returns - INI - handle to the file or INI_NO_FILE. ### Remarks Doesn't actually open the file, just starts a new buffer if possible. ``` -------------------------------- ### Define and Run a Simple Test Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_testing/quick-start.md Defines a basic test that runs automatically on server start and asserts a condition. ```pawn #define RUN_TESTS // Auto-run tests. #include @test() MyTest() { ASSERT(MyFunctionCall() > 5); } ``` -------------------------------- ### XML_AddItem Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Storage/y_xml/api.md Starts the creation of a new tag to be written to a file. ```APIDOC ## XML_AddItem ### Description Starts the creation of a new tag to be written to a file. The structure has to be manually created then written. ### Parameters #### Path Parameters - **tag[]** (tag[]_INFO) - Required - The tag name. - **name[]** (name[]_INFO) - Required - The name of the item. ### Remarks Starts the creation of a new tag to be written to a file, the structure has to be manually created then written. There is no buffering of multiple tags before writing as a single tag can have quite a bit of data. ``` -------------------------------- ### Generic Help Command Implementation Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_commands/features.md This snippet provides a basic implementation for a generic help command that allows users to get information about other commands. It uses Command_ReProcess to handle command lookups. ```pawn @cmd() help(playerid, params[], help) { if (help) { SendClientMessage(playerid, COLOUR_GREETING, "Use `/help ` to get information about the command."); } else if (IsNull(params)) { SendClientMessage(playerid, COLOUR_FAILURE, "Please enter a command."); } else { Command_ReProcess(playerid, params, true); } return 1; } ``` -------------------------------- ### Iter_Starts Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/api.md Retrieves the starting index or count of elements in a multi-iterator. ```APIDOC ## Iter_Starts ### Description Accesses the number of starts in a multi-iterator. ### Syntax ```pawn Iter_Starts(iter[]) ``` ### Parameters * `iter` (Iterator []) - The name of the iterator to get the true starts of. ### Attributes * `native` ``` -------------------------------- ### Fallback /buy Command with Help Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_commands/features.md This is a general 'buy' command that acts as a fallback and also handles the '/help buy' request, providing a generic message if no specific buyable item is nearby. ```pawn @cmd() buy(playerid, params[], help) { if (help) { SendClientMessage(playerid, COLOUR_FAILURE, "Buy a thing you are stood near."); } else { SendClientMessage(playerid, COLOUR_FAILURE, "There is nothing here to buy."); } return 1; } ``` -------------------------------- ### Reference Parameter Passing with ... and & Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_va/features.md Demonstrates how to pass parameters by reference using both the ellipsis (...) and the '&' operator, which is supported for variable arguments. ```pawn RefArg(&a, &b) { printf("%d", ___(0)); } ``` -------------------------------- ### Property_GetSlotWeapon Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_properties/api.md Gets a player's stored weapons for spawning. ```APIDOC ## Property_GetSlotWeapon ### Description Gets a player's stored weapons for spawning. ### Parameters #### Path Parameters - **playerid** (playerid_INFO) - Required - The ID of the player. - **slot** (slot_INFO) - Required - The slot of the weapon. - **weaponslot** (weaponslot_INFO) - Required - The weapon slot. - **ammo** (ammo_INFO) - Required - The amount of ammo. ``` -------------------------------- ### ScriptInit_CallOnCodeInit Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_scriptinit/api.md This function serves as the main entry point for script initialization callbacks. It manages the execution of OnScriptInit and OnCodeInit, handles JIT and filterscript contexts, and performs essential startup tasks such as debugging information, profiling, and caching. ```APIDOC ## ScriptInit_CallOnCodeInit ### Description Manages the execution of script initialization callbacks (OnScriptInit, OnCodeInit) and performs startup tasks. ### Syntax ScriptInit_CallOnCodeInit(jit, fs) ### Parameters #### Path Parameters - **jit** (bool) - Required - Indicates if the callback is being called from the JIT plugin. - **fs** (bool) - Required - Indicates if the callback is being called within a filterscript. ### Remarks This function is the core of the script initialization process. It calls other callbacks, dumps debug information, profiles the startup, and caches compilation results, regardless of which initial callback is triggered first. ``` -------------------------------- ### Iter_RandomFree Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/api.md Gets a random unused slot from the specified iterator. ```APIDOC ## Iter_RandomFree ### Description Gets a random unused slot from an iterator. ### Syntax ```pawn Iter_RandomFree(iter[]) ``` ### Parameters #### Path Parameters - **iter** (Iterator []) - Required - Name of the iterator to get a random unused slot for. ### Remarks Wrapper for Iter_RandomFree_Internal. Native function. ``` -------------------------------- ### Loading Text Files Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Players/y_text/quick-start.md Demonstrates how to load text files and define languages using the `loadtext` and `Langs_Add` functions. ```pawn loadtext mode_text[section1], mode_text[section2], other_text[what], other_text[where]; ``` -------------------------------- ### Server_GetLongCallDefault Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_serverdata/api.md Gets the default long call time for crashdetect. ```APIDOC ## Server_GetLongCallDefault ### Description Get the default long call time for crashdetect. May not be the current setting. Simply stores the current value, resets it, restores the current and returns the old version. ### Method Server_GetLongCallDefault() ### Remarks Get the default long call time for crashdetect. May not be the current setting. Simply stores the current value, resets it, restores the current and returns the old version. ### Estimated stack usage 1 cells ``` -------------------------------- ### Basic y_commands Command Structure Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_commands/faqs.md Illustrates the standard structure for defining a command using y_commands, showing the typical function signature and parameter usage. ```pawn YCMD:mycommand(playerid, params[], help) { } ``` -------------------------------- ### Circular_Capacity Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_circular/api.md Gets the total number of slots available in the buffer. ```APIDOC ## Circular_Capacity ### Description Gets the total number of slots in the buffer. Always the same. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```pawn new arr[5][5]; Circular_Init(arr); Circular_Capacity(arr); ``` ### Response #### Success Response (200) - **capacity** (integer) - The total number of slots in the buffer. #### Response Example ```json { "capacity": 5 } ``` ``` -------------------------------- ### `CGen_SetupCodeSpace` Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_cgen/internal.md Initializes the storage for unused code and ensures that functions being overwritten by this code are left in a semi-valid state. ```APIDOC ## `CGen_SetupCodeSpace` ### Description Initializes the storage for unused code and ensures that functions being overwritten by this code are left in a semi-valid state. ### Syntax ```pawn CGen_SetupCodeSpace() ``` ### Remarks Initialises the storage for unused code, and ensures that the functions being clobbered by said code are at least left in a semi-valid state. ### Estimated stack usage 4 cells ``` -------------------------------- ### Get Weapon Slot Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Game/y_weapondata/quick-start.md Retrieves the weapon slot for a given weapon. ```APIDOC ## Weapon_GetSlot ### Description Retrieves the weapon slot for a given weapon. ### Function Signature ```pawn Weapon_GetSlot(weaponid); ``` ### Parameters * **weaponid** (integer) - The ID of the weapon. ### Return Value * (integer) - The weapon slot. ``` -------------------------------- ### Malloc_NextSlot Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_malloc/api.md Gets the next free block of memory after the current one. ```APIDOC ## Malloc_NextSlot ### Description Gets the next free block of memory after the current one. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **slot** (slot_INFO) - The current memory slot. ### Method Not applicable (function call) ### Endpoint Not applicable (function call) ### Request Example Not applicable (function call) ### Response #### Success Response - **Returns**: - #### Response Example Not applicable (function call) ``` -------------------------------- ### Initialize and Get Script Info Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Server/y_scriptdata/quick-start.md Includes the YSI ScriptData library and demonstrates how to check if the script is a filter script, retrieve the compiler version, and check if the cache has been loaded during script initialization. ```pawn #include public OnScriptInit() { printf("%d", Script_IsFilterScript()); printf("%d", Script_GetCompilerVersion()); printf("%d", Script_CacheLoaded()); } ``` -------------------------------- ### chrfind Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_utils/api.md Finds the position of a character within a string, starting from a specified offset. ```APIDOC ## chrfind ### Description Finds the position of a character within a string, starting from a specified offset. ### Syntax ```pawn chrfind(needle, haystack[], start) ``` ### Parameters #### Parameters - **needle** (character) - The character to find. - **haystack** (string array) - The string to find it in. - **start** (integer) - The offset to start from. ### Returns Fail - -1, Success - pos ### Depends on * [`ChrFind`] ``` -------------------------------- ### CTRL_OnCodeInit Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_functional/internal.md Initializes the functional programming system. This function sets up necessary components for lambda functions and other functional constructs to operate correctly. ```APIDOC ## CTRL_OnCodeInit ### Description Initialise the system for functional programming operations. ### Syntax ```pawn CTRL_OnCodeInit() ``` ### Remarks This function is essential for setting up the environment required by various functional programming utilities within YSI. It has dependencies on several code scanning and functional utility functions. ``` -------------------------------- ### Race_AddStart Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_races/quick-start.md Adds a starting point for a race at the specified coordinates and facing angle. ```APIDOC ## Race_AddStart ### Description Adds a starting point for a race at the specified coordinates and facing angle. ### Parameters - **raceid** (integer) - Required - The identifier of the race to add a start point to. - **x** (Float) - Required - The x-coordinate of the start point. - **y** (Float) - Required - The y-coordinate of the start point. - **z** (Float) - Required - The z-coordinate of the start point. - **a** (Float) - Required - The facing angle for the start point. ### Notes As well as points to follow, a race needs a starting grid. This function creates one point on that starting grid. ``` -------------------------------- ### Touch File Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Core/y_utils/api.md Creates a file if it does not exist, similar to the Unix 'touch' command. Use this to ensure a file exists without modifying its content. ```pawn ftouch(filename[]) ``` -------------------------------- ### Area_Delete Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Visual/y_areas/api.md Deletes an area slot. This function can only remove areas that are at the start of a list. ```APIDOC ## Area_Delete ### Description Removes an area slot. This operation is restricted to only deleting areas that are positioned at the beginning of an area list. ### Method DELETE (assumed) ### Endpoint /Area/Delete ### Parameters #### Request Body - **area** (object) - Required - Information about the area slot to delete. ### Request Example ```json { "area": { "id": 1 } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates if the deletion was successful. ### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Iterator Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Data/y_foreach/api.md Creates a new iterator pair, consisting of a starting point and an array. ```APIDOC ## Iterator ### Description Creates a new iterator start/array pair. ### Syntax ```pawn Iterator(name) ``` ### Parameters * `name` (any) - The name for the iterator. ### Tag `Iterator:` ### Attributes * `native` ``` -------------------------------- ### Skip Parameters with ... Source: https://github.com/pawn-lang/ysi-includes/blob/5.x/YSI_Coding/y_va/features.md Shows how to selectively pass or skip variable arguments. Includes a check for the minimum number of arguments. ```pawn PrintLess(...) { if (numargs() < 5) { return; } printf("%d %d %d", ___(2)); } ```