SPEC Command
#2

pawn Код:
//Top of your script:
new Float:Posxx, Float:Posyy, Float:Poszz;

dcmd_spec(playerid, params[])
{
    new id;
    if (sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec [ID]");
    else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_GREY, "* Player[ID] is not found!");
    else
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        GetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
        GetPlayerPos(playerid,Posxx,Posyy,Poszz);
        if(IsPlayerInAnyVehicle(id))
        {
            new int = GetPlayerInterior(id);
            SetPlayerInterior(playerid, int);
            TogglePlayerSpectating(playerid, 1);
            PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
        }
        else
        {
            new int = GetPlayerInterior(id);
            SetPlayerInterior(playerid, int);
            TogglePlayerSpectating(playerid, 1);
            PlayerSpectatePlayer(playerid, id);
        }
    }
    return 1;
}

dcmd_specoff(playerid, params[])
{
    #pragma unused params
    TogglePlayerSpectating(playerid, 0);
    Specing[playerid] = 0;
    SetPlayerPos(playerid,Posxx,Posyy,Poszz);
    return 1;
}
Untested but should work.
Reply


Messages In This Thread
SPEC Command - by UnknownGamer - 30.11.2012, 10:14
Re: SPEC Command - by Infinity90 - 30.11.2012, 10:24
Re: SPEC Command - by JaKe Elite - 30.11.2012, 10:28

Forum Jump:


Users browsing this thread: 1 Guest(s)