Jump to content

Comanda /specoff


SeNaToRuL.

Recommended Posts

Salut utilizez gamemode burned si cand dau /specoff imi da respawn.. dar eu vreau sa ma teleporteze in ultima locatie..

Comanda:

YCMD:specoff(playerid, params[], help) {
    if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] < 2) return SCM(playerid, COLOR_WHITE, AdminOnly);
    if(Spectate[playerid] == 255) return true;
    TogglePlayerControllable(playerid, 1);
    TogglePlayerSpectating(playerid, 0);
    SetPlayerInterior(playerid,Unspec[playerid][sPint]);
    PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
    PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
    Unspec[playerid][sLocal] = 255;
    gTeam[playerid] = PlayerInfo[playerid][pTeam];
    SetPlayerToTeamColor(playerid);
    SCM(playerid, -1, "Nu mai esti spectator!");
    //SpawnPlayer(playerid);
    Iter_Remove(MySpec[Spectate[playerid]], playerid);
    Spectate[playerid] = 255;
    SpecPlayers[playerid] = 0;
    LastRecon[playerid] = 1;
    PlayerTextDrawHide(playerid, SpectatorTD);
    return true;
}

Link to comment
Share on other sites

  • 3 years later...

new PlayerLastPos[MAX_PLAYERS][3];

 

YCMD:specoff(playerid, params[], help) {

    if (PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] < 2) return SCM(playerid, COLOR_WHITE, AdminOnly);

    

    if (Spectate[playerid] == 255) return SCM(playerid, COLOR_GREY, "You are not in spectate mode.");

    

    TogglePlayerControllable(playerid, 1);

    TogglePlayerSpectating(playerid, 0);

    

    if (PlayerLastPos[playerid][0] != 0.0) {

        SetPlayerPos(playerid, PlayerLastPos[playerid][0], PlayerLastPos[playerid][1], PlayerLastPos[playerid][2]);

    } else {

         SpawnPlayer(playerid);

    }

    

    

    SCM(playerid, -1, "You are no longer in spectate mode!");

    

    Iter_Remove(MySpec[Spectate[playerid]], playerid);

    Spectate[playerid] = 255;

    SpecPlayers[playerid] = 0;

    LastRecon[playerid] = 1;

    PlayerTextDrawHide(playerid, SpectatorTD);

    

    PlayerLastPos[playerid][0] = 0.0;

    PlayerLastPos[playerid][1] = 0.0;

    PlayerLastPos[playerid][2] = 0.0;

    

    return true;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.