• Уважаемый Гость.
    - Прежде чем создать свою тему, пожалуйста, попробуй воспользоваться этим -> ПОИСКОМ !!!
    - После решения Вашего вопроса (проблемы) - нажмите "Лучший ответ", на сообщении, которое его решило. За игнорирование этого действия - Вы получите соответствующее предупреждение. Мы - стараемся Вам помочь. Уделите 10 секунд - чтобы нажать кнопку. (Если у Вас нет такой возможности - укажите в последнем своем сообщении какой ответ Вы считаете лучшим. Наши модераторы сделают это за Вас)
    ЗАПРЕЩЕНО:
    - Cоздавать темы с названиями "Помогите", "Плиз", "Ошибка", "Не могу найти", "Хелп" и тому подобное;
    - Cоздавать темы без детального описания того, что нужно исправить.
    - Cоздавать темы из одного скриншота.
    За игнор правил форума - Ваша тема будет удалена, а Вы получите системное предупреждение.

Рекон не показывает игроков, которые находятся на пассажирском месте.

Frend Williams

Умник
Доброй ночи. Слежка за игроком работает до тех пор пока тот не сядет в машину на пассажирское место.
Код:
PHP:
CMD:re(playerid,params[])
{
    if(PlayerInfo[playerid][bAdmin] < 1) return 1;
    if(!strcmp(params[0],"off",true))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && GetPVarInt(playerid, "Spectate"))
        {
            TogglePlayerSpectating(playerid,false);
            HideMenuForPlayer(specmenu, playerid);
        }
    }
    if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, 0xbdbabdaa, "{f7c300}Подсказка:{bdbabd} /re(con) [ид игрока]");
    if(!IsPlayerConnected(params[0])) return 1;
    if(PlayerInfo[params[0]][pAntiBot] == 1) return 1;
    if(!strcmp(PlayerInfo[params[0]][pIP], "255.255.255.255", true) && PlayerInfo[playerid][bAdmin] != 15) return 1;
    if(PlayerInfo[params[0]][bAdmin] >= 14 && PlayerInfo[playerid][bAdmin] < 15) return scm_error(playerid, "Вы не можете следить за администратором 14-го уровня.");
    PlayerTextDrawDestroy(playerid,PlayerText:ReconPlayerText[playerid][0]);
    PlayerTextDrawDestroy(playerid,PlayerText:ReconPlayerText[playerid][1]);

     ReconPlayerText[playerid][0] = CreatePlayerTextDraw(playerid,589.00, 145.00, "Loading");
    PlayerTextDrawAlignment(playerid,ReconPlayerText[playerid][0], 2);
    PlayerTextDrawLetterSize(playerid,ReconPlayerText[playerid][0],  0.240000, 0.899999);
    ReconPlayerText[playerid][1] = CreatePlayerTextDraw(playerid,578.00, 165.00, "1 : 1 / 8~n~0~n~0~n~50~n~0~n~0 / 0~n~86~n~0 : 0 ~n~0 / 0 : 0%~n~0 / 0 : 0%~n~23 : 0");
    PlayerTextDrawLetterSize(playerid,ReconPlayerText[playerid][1], 0.199999, 0.899999);
    for(new x=0x0; x < 2; x ++)
    {
        PlayerTextDrawBackgroundColor(playerid,ReconPlayerText[playerid][x], 255);
        PlayerTextDrawFont(playerid,ReconPlayerText[playerid][x], 1);
        PlayerTextDrawColor(playerid,ReconPlayerText[playerid][x], -1);
        PlayerTextDrawSetOutline(playerid,ReconPlayerText[playerid][x], 1);
        PlayerTextDrawSetProportional(playerid,ReconPlayerText[playerid][x], 1);
        PlayerTextDrawSetShadow(playerid,ReconPlayerText[playerid][x],0);
    }
    if(!GetPVarInt(playerid, "Spectate"))
    {
        GetPlayerPos(playerid, gPlayerPosition[playerid][0],gPlayerPosition[playerid][1],gPlayerPosition[playerid][2]);
        gPlayerInformation[playerid][0] = GetPlayerInterior(playerid);
        gPlayerInformation[playerid][1] = GetPlayerVirtualWorld(playerid);
    }
    TogglePlayerSpectating(playerid, true);
    SetPlayerInterior(playerid,GetPlayerInterior(params[0]));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(params[0]));
    if(IsPlayerInAnyVehicle(params[0])) PlayerSpectateVehicle(playerid, GetPVarInt(params[0],"VehicleEnters"));
    else PlayerSpectatePlayer(playerid, params[0]);
    for(new x; x < 2; x ++) PlayerTextDrawShow(playerid, PlayerText:ReconPlayerText[playerid][x]);
    TextDrawShowForPlayer(playerid, ReconText);
    SetPVarInt(playerid, "Spectate", true);
    SetPVarInt(playerid, "SpectateID", params[0]);
    ShowMenuForPlayer(specmenu,playerid);
    if(PlayerInfo[playerid][bAdmin] < 14)
    {
        loop::players(i)
        {
            if(SpecChat[i] == true)
            {
                format(string, 128, "[A] Администратор %s начал слежку за игроком %s[%d].",getPlayerName(playerid),PlayerInfo[params[0]][pNames],params[0]);
                SendClientMessage(i,COLOR_GREY,string);
            }
        }
    }
    return 1;
}
Код:
loop::players(m)
    {
        if(GetPlayerState(m) == PLAYER_STATE_SPECTATING && GetPVarInt(m, "SpectateID") == playerid)
        {
            TogglePlayerSpectating(m,false);
            HideMenuForPlayer(specmenu, m);
            GameTextForPlayer(m,"~r~PLAYER DISCONNECTED", 1000, 3);
        }
    }
Код:
if(GetPVarInt(playerid, "Spectate") && GetPVarInt(playerid, "SpectateID") != -1)
    {
        SetPlayerPos(playerid, gPlayerPosition[playerid][0],gPlayerPosition[playerid][1],gPlayerPosition[playerid][2]);
        SetPlayerInterior(playerid, gPlayerInformation[playerid][0]);
        SetPlayerVirtualWorld(playerid, gPlayerInformation[playerid][1]);
        DeletePVar(playerid, "Spectate"), SetPVarInt(playerid, "SpectateID", -1);
        TextDrawHideForPlayer(playerid, ReconText);
          PlayerTextDrawDestroy(playerid, PlayerText:ReconPlayerText[playerid][0]);
        PlayerTextDrawDestroy(playerid, PlayerText:ReconPlayerText[playerid][1]);
        return 1;
    }
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
    new Menu:Current = GetPlayerMenu(playerid);
    if(Current == specmenu)
    {
        string="";
        switch(row)
        {
            case 0:
            {
                if(PlayerInfo[playerid][bAdmin] < 1) return 1;
                PlayerTextDrawDestroy(playerid,PlayerText:ReconPlayerText[playerid][0]);
                PlayerTextDrawDestroy(playerid,PlayerText:ReconPlayerText[playerid][1]);

                ReconPlayerText[playerid][0] = CreatePlayerTextDraw(playerid,589.00, 145.00, "Loading");
                PlayerTextDrawAlignment(playerid,ReconPlayerText[playerid][0], 2);
                PlayerTextDrawLetterSize(playerid,ReconPlayerText[playerid][0],  0.240000, 0.899999);
                ReconPlayerText[playerid][1] = CreatePlayerTextDraw(playerid,578.00, 165.00, "1 : 1 / 8~n~0~n~0~n~50~n~0~n~0 / 0~n~86~n~0 : 0 ~n~0 / 0 : 0%~n~0 / 0 : 0%~n~23 : 0");
                PlayerTextDrawLetterSize(playerid,ReconPlayerText[playerid][1], 0.199999, 0.899999);
                for(new x=0x0; x < 2; x ++)
                {
                    PlayerTextDrawBackgroundColor(playerid,ReconPlayerText[playerid][x], 255);
                    PlayerTextDrawFont(playerid,ReconPlayerText[playerid][x], 1);
                    PlayerTextDrawColor(playerid,ReconPlayerText[playerid][x], -1);
                    PlayerTextDrawSetOutline(playerid,ReconPlayerText[playerid][x], 1);
                    PlayerTextDrawSetProportional(playerid,ReconPlayerText[playerid][x], 1);
                    PlayerTextDrawSetShadow(playerid,ReconPlayerText[playerid][x],0);
                }
                if(!GetPVarInt(playerid, "Spectate"))
                {
                    GetPlayerPos(playerid, gPlayerPosition[playerid][0],gPlayerPosition[playerid][1],gPlayerPosition[playerid][2]);
                    gPlayerInformation[playerid][0] = GetPlayerInterior(playerid);
                    gPlayerInformation[playerid][1] = GetPlayerVirtualWorld(playerid);
                }
                TogglePlayerSpectating(playerid, true);
                SetPlayerInterior(playerid,GetPlayerInterior(GetPVarInt(playerid, "SpectateID")));
                SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(GetPVarInt(playerid, "SpectateID")));
                if(IsPlayerInAnyVehicle(GetPVarInt(playerid, "SpectateID"))) PlayerSpectateVehicle(playerid, GetPVarInt(GetPVarInt(playerid, "SpectateID"),"VehicleEnters"));
                else PlayerSpectatePlayer(playerid, GetPVarInt(playerid, "SpectateID"));
                for(new x; x < 2; x ++) PlayerTextDrawShow(playerid, PlayerText:ReconPlayerText[playerid][x]);
                TextDrawShowForPlayer(playerid, ReconText);
                ShowMenuForPlayer(specmenu,playerid);
            }
            case 1:
            {
                if(PlayerInfo[playerid][bAdmin] < 4) return SCM(playerid, COLOR_GREY, "Эта функция недоступна на Вашем уровне администратора");
                if(PlayerInfo[GetPVarInt(playerid, "SpectateID")][bAdmin] > 0)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Администратор не может быть заморожен!");
                    ShowMenuForPlayer(specmenu,playerid);
                    return true;
                }
                TogglePlayerControllable(GetPVarInt(playerid, "SpectateID"), (GetPVarInt(GetPVarInt(playerid, "SpectateID"), "AC_TogglePlayer") ? true : false));
                SetPVarInt(GetPVarInt(playerid, "SpectateID"), "AC_TogglePlayer", (GetPVarInt(GetPVarInt(playerid, "SpectateID"), "AC_TogglePlayer") ? false : true));
                if(GetPVarInt(GetPVarInt(playerid, "SpectateID"), "AC_TogglePlayer")) format(string,85, "[A] %s был заморожен администратором %s",PlayerInfo[GetPVarInt(playerid, "SpectateID")][pNames] ,getPlayerName(playerid));
                else format(string,86, "[A] %s был разморожен администратором %s",PlayerInfo[GetPVarInt(playerid, "SpectateID")][pNames] ,getPlayerName(playerid));
                ABroadCast(0xFF9000AA,string,1);
                ShowMenuForPlayer(specmenu,playerid);
            }
            case 2:
            {
                if(PlayerInfo[playerid][bAdmin] < 2) return SCM(playerid, COLOR_GREY, "Эта функция недоступна на Вашем уровне администратора");
                format(string, sizeof(string), "[A] Администратор %s дал пинка игроку %s",getPlayerName(playerid),PlayerInfo[GetPVarInt(playerid, "SpectateID")][pNames]);
                ABroadCast(COLOR_GRAD1,string,0);
                new Float:Xq,Float:Yq,Float:Zq;
                new Float:shealth;
                GetPlayerHealth(GetPVarInt(playerid, "SpectateID"), shealth);
                SetPlayerHealth(GetPVarInt(playerid, "SpectateID"), shealth-5);
                PlayerPlaySound(GetPVarInt(playerid, "SpectateID"), 1130, Xq, Yq, Zq+5);
                GetPlayerPos(GetPVarInt(playerid, "SpectateID"),Xq,Yq,Zq);
                SetPlayerPos(GetPVarInt(playerid, "SpectateID"),Xq,Yq,Zq+5);
                ShowMenuForPlayer(specmenu,playerid);
            }
            case 3:
            {
                if(PlayerInfo[playerid][bAdmin] < 3) return SCM(playerid, COLOR_GREY, "Эта функция недоступна на Вашем уровне администратора");
                if(PlayerInfo[GetPVarInt(playerid, "SpectateID")][bAdmin] > 12 && PlayerInfo[playerid][bAdmin] < 14) return SCM(playerid, 0xbdbabdaa, "[Ошибка]: Администратор выше 12 уровня");
                new string123[128];
                format(string123,128, "%s | REGIP: %s | IP: %s",PlayerInfo[GetPVarInt(playerid, "SpectateID")][pNames],PlayerInfo[GetPVarInt(playerid, "SpectateID")][pIpReg],PlayerInfo[GetPVarInt(playerid, "SpectateID")][pIP]);
                SendClientMessage(playerid,0xFFFF00FF,string123);
                ShowMenuForPlayer(specmenu,playerid);
            }
            case 4: { ShowStats(playerid,GetPVarInt(playerid, "SpectateID")); ShowMenuForPlayer(specmenu,playerid); }
            case 5: cmd_reoff(playerid);
        }
       }
    return 1;
}
Код:
if(GetPVarInt(playerid, "Spectate") && GetPVarInt(playerid, "SpectateID") != -1) UpdateRecon(playerid, GetPVarInt(playerid, "SpectateID"));
            else if(GetPVarInt(playerid, "Spectate") && GetPVarInt(playerid, "SpectateID") == -1) DeletePVar(playerid, "Spectate"), SetPVarInt(playerid, "SpectateID", -1), TextDrawHideForPlayer(playerid, ReconText), PlayerTextDrawDestroy(playerid, PlayerText:ReconPlayerText[playerid][0]), PlayerTextDrawDestroy(playerid, PlayerText:ReconPlayerText[playerid][1]);
Код:
case KEY_ANALOG_LEFT:
        {
            if(PRESSED(KEY_ANALOG_LEFT))
            {
                if(GetPVarInt(playerid, "InteriorBuy"))
                {
                    if(GetPVarInt(playerid, "Interiors") <= 0) SetPVarInt(playerid, "Interiors", sizeof(Cam_Pos_Interior)-2), SetPVarInt(playerid, "Interiors_1", sizeof(Interiors));
                    else SetPVarInt(playerid, "Interiors", GetPVarInt(playerid, "Interiors")-2), SetPVarInt(playerid, "Interiors_1", GetPVarInt(playerid, "Interiors_1")-1);
                    InteriorViewing(playerid, GetPVarInt(playerid, "Interiors"));
                }
                else if(GetPVarInt(playerid, "Spectate") && GetPVarInt(playerid, "SpectateID") != -1)
                {
                    if(GetPlayerPoolSize() == 1) return 1;
                    new specid = GetPVarInt(playerid, "SpectateID")-1;
                    spectate_1: if(specid == -1) specid = GetPlayerPoolSize();
                    if(!IsPlayerConnected(specid))
                    {
                        specid--;
                        goto spectate_1;
                    }
                    if(PlayerInfo[specid][bAdmin] >= 14)
                    {
                        specid--;
                        SCMF(playerid,CGRAY,"Слежка за основателем запрещена, слежка перенесена на игрока: %s(%d)", PlayerInfo[specid][pNames], specid);
                        goto spectate_1;
                    }
                    if(!strcmp(PlayerInfo[specid][pIP], "255.255.255.255", true))
                    {
                        specid--;
                        goto spectate_1;
                    }
                    if(PlayerInfo[specid][pAntiBot] == 1)
                    {
                        specid--;
                        goto spectate_1;
                    }
                    SetPVarInt(playerid, "SpectateID", specid);
                    SetPlayerInterior(playerid,GetPlayerInterior(GetPVarInt(playerid, "SpectateID")));
                    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(GetPVarInt(playerid, "SpectateID")));
                    if(IsPlayerInAnyVehicle(GetPVarInt(playerid, "SpectateID"))) PlayerSpectateVehicle(playerid, GetPVarInt(GetPVarInt(playerid, "SpectateID"),"VehicleEnters"));
                    else PlayerSpectatePlayer(playerid, GetPVarInt(playerid, "SpectateID"));
                }
Код:
stock UpdateRecon(playerid, i)
{
    if(!IsPlayerConnected(i))
    {
        TogglePlayerSpectating(playerid,false);
        DeletePVar(playerid, "Spectate"), SetPVarInt(playerid, "SpectateID", -1);
        TextDrawHideForPlayer(playerid, ReconText), PlayerTextDrawDestroy(playerid, PlayerText:ReconPlayerText[playerid][0]), PlayerTextDrawDestroy(playerid, PlayerText:ReconPlayerText[playerid][1]);
        SetPlayerPos(playerid,gPlayerPosition[playerid][0],gPlayerPosition[playerid][1],gPlayerPosition[playerid][2]);
        SetPlayerInterior(playerid, gPlayerInformation[playerid][0]);
        SetPlayerVirtualWorld(playerid, gPlayerInformation[playerid][1]);
        return 1;
    }
    new Float:armour,Float:health,Float:healthcar,vehicleid=GetPVarInt(playerid,"VehicleEnters");
    string="";
    GetPlayerArmour(i, armour);
    GetPlayerHealth(i, health);
    GetVehicleHealth(GetPVarInt(i,"VehicleEnters"),healthcar);
    new speedlimit;
    new Float:armour228;
    GetPlayerArmour(i, armour228);
    if(GetPlayerState(i) == PLAYER_STATE_DRIVER || GetPlayerState(i) == PLAYER_STATE_PASSENGER)
    {
        new modelid = GetVehicleModel(GetPVarInt(i,"VehicleEnters"));
        if(modelid>=400) speedlimit=SpeedLimit[modelid-400];
        else speedlimit=28;
    }
    else speedlimit=28;
    format(string,70,"~w~%s~n~ID: %d %s",getPlayerName(i),i,(pTemp[i][pAFK]>=3) ? ("~r~AFK") : (""));
    PlayerTextDrawSetString(playerid,ReconPlayerText[playerid][0],string);
    format(string,200,"%d : %d / %d~n~%d~n~%d~n~%d~n~%d~n~%d / %d~n~%d~n~%d : %d ~n~%d / %d : %d%%~n~%d / %d : %d%%~n~%d",
    PlayerInfo[i][pLevel],PlayerInfo[i][pExp],(PlayerInfo[i][pLevel]+1)*4,PlayerInfo[i][pWarns],armour228,floatround(health),
    GetPlayerState(i)!=2 && GetPlayerState(i) != 3 && vehicleid != INVALID_PLAYER_ID ? -1 : floatround(healthcar),// хп машины
    SpeedPlayer(i),// скорость
    (speedlimit >= 28) ? (speedlimit) : (28),// максимальная скорость
    GetPlayerPing(i),// пинг
    GetPlayerAmmo(i),(GetWeaponSlotEx(GetPlayerWeapon(i)) != -1) ? (PlayerInfo[i][pAmmo][GetWeaponSlotEx(GetPlayerWeapon(i))]) : (-1),// патроны
    GetPVarInt(i,"r_shot"),GetPVarInt(i,"r_shot_hit"),
    GetPVarInt(i,"r_shot_hit") > 1 && GetPVarInt(i,"r_shot") > 1 ? ((GetPVarInt(i,"r_shot_hit")+1)*100/(GetPVarInt(i,"r_shot")+1)) : (0),
    GetPVarInt(i,"r_shot_10"),GetPVarInt(i,"r_shot_hit_10"),
    GetPVarInt(i,"r_shot_hit") > 1 && GetPVarInt(i,"r_shot") > 1 ? ((GetPVarInt(i,"r_shot_hit_10")+1)/(GetPVarInt(i,"r_shot_10")+1)*100) : (0),
    (pTemp[i][pAFK] >= 3)?(pTemp[i][pAFK]):(0));
    PlayerTextDrawSetString(playerid,ReconPlayerText[playerid][1],string);
    return 1;
}
 

Вложения

Сверху Снизу