Skip to content

Documentation

RIDE-2DAY edited this page Mar 10, 2019 · 11 revisions
DissolvePlayerScreen(playerid, init_color, end_color, Func:response_func<i> = NO_TRANSITION_RESPONSE)

Used to dissolve player's screen from a color to another.

  • playerid - The ID of the player who will have the screen dissolved.
  • init_color - The start color where the dissolution begins.
  • end_color - The finish color where the dissolution ends.
  • Func:response_func - Optional function which will be called once the transition ends.
public OnPlayerConnect(playerid)
{
    DissolvePlayerScreen(playerid, 0x00000000, 0x000000FF, &Fade_OnPlayerConnect);
    return 1;
}

Fade_OnPlayerConnect(playerid)
{
    /*
        Right now player's screen is black.
        Let's dissolve it from black to blank (transparent).
        Notice we won't call any function now.
    */
    DissolvePlayerScreen(playerid, 0x000000FF, 0x00000000);
}

DissolvePlayerScreenToBlack(playerid, Func:response_func<i> = NO_TRANSITION_RESPONSE)

Used to dissolve player's screen from blank (transparent) to black.

  • playerid - The ID of the player who will have the screen dissolved.
  • Func:response_func - Optional function which will be called once the transition ends.
public OnPlayerConnect(playerid)
{
    /*
        This does exactly the same as the example above
        but as you can see, it's way shorter.
    */
    DissolvePlayerScreenToBlack(playerid, &Fade_OnPlayerConnect);
    return 1;
}

Fade_OnPlayerConnect(playerid)
{
    // Right now player's screen is black.
    SendClientMessage(playerid, -1, "The transition is complete, your screen is black.");
}

DissolvePlayerScreenToBlank(playerid, Func:response_func<i> = NO_TRANSITION_RESPONSE)

Used to dissolve player's screen from black to blank (transparent).

  • playerid - The ID of the player who will have the screen dissolved.
  • Func:response_func - Optional function which will be called once the transition ends.
public OnPlayerConnect(playerid)
{
    DissolvePlayerScreenToBlack(playerid, &Fade_OnPlayerConnect);
    return 1;
}

Fade_OnPlayerConnect(playerid)
{
    /*
        Right now player's screen is black.
        Let's dissolve it to blank (transparent):
    */
    DissolvePlayerScreenToBlank(playerid, &ReturnToBlank);
}

ReturnToBlank(playerid)
{
    SendClientMessage(playerid, -1, "The transition is complete, your screen is transparent.");
}

IsPlayerScreenDissolving(playerid)

Checks if player's screen is in a transition.

  • playerid - The ID of the player to check.
YCMD:checkmyself(playerid, params[], help)
{
    if(IsPlayerScreenDissolving(playerid))
    {
        SendClientMessage(playerid, -1, "Your screen is in a transition.");
    }
    return 1;
}