Spec showing to all
#1

This is one of the Luxadmin command for admin. The problem is that when I do /spec [playerid]

This text sends to all player "[Spec] %s (ID:%d) is testing %s (ID:%d)" Obviously he could see that I 'am spectating him Really fail. How this to show Only for me and Admins?

pawn Код:
dcmd_spec(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid) || AccInfo[playerid][pVip] >= 1)
    {
        if(AccInfo[playerid][pGps] != -1)
        return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}>> First Disable the Gps System! (/gps off)");

        if(!strlen(params) || !IsNumeric(params)) return
        SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /spec [PlayerID]") &&
        SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Function: Will spec a specified Player");

        new specplayerid = ReturnUser(params);
        if(AccInfo[specplayerid][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
        return SendClientMessage(playerid,0xFFFFFFFF,"{FF0000}>> You cannot use this command on this admin");

        if(IsPlayerConnected(specplayerid) && specplayerid != INVALID_PLAYER_ID)
        {
            if(specplayerid == playerid)
            return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}>> You cannot spectate Yourself");

            if(GetPlayerState(specplayerid) == PLAYER_STATE_SPECTATING && AccInfo[specplayerid][SpecID] != INVALID_PLAYER_ID)
            return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}>> Player spectating someone else");

            if(GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 2 && GetPlayerState(specplayerid) != 3)
            return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}>> Player not Spawned");

            if((AccInfo[specplayerid][Level] != ServerInfo[MaxAdminLevel]) || (AccInfo[specplayerid][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] == ServerInfo[MaxAdminLevel]))
            {
                new string[128];
                format(string, sizeof(string), "[Spec] %s (ID:%d) is testing %s (ID:%d)", PlayerName2(playerid), playerid, PlayerName2(specplayerid), specplayerid);
                for(new i;i < MAX_PLAYERS; i++) if(AccInfo[playerid][Level] >= 1) SendClientMessage(i, grey, string);
                GetPlayerPos(playerid,Pos[playerid][0],Pos[playerid][1],Pos[playerid][2]);
                GetPlayerFacingAngle(playerid,Pos[playerid][3]);
                SendCommandToAdmins(playerid,"LSpec");
                SendClientMessage(playerid,blue,"Spectating On");
                return StartSpectate(playerid, specplayerid);
            }
            else return SendClientMessage(playerid, 0xFFFFFFFF,"{FF0000}>> You cannot spectate the highest level admin");
        }
        else return ErrorMessages(playerid, 2);
    }
    else return ErrorMessages(playerid, 1);
}
Reply
#2

This line
Код:
for(new i;i < MAX_PLAYERS; i++) if(AccInfo[playerid][Level] >= 1 && AccInfo[playerid][admin] > 0) SendClientMessage(i, grey, string);
just added this
Код:
 && AccInfo[playerid][admin] > 0
change admin var. if yours is diffrent
Reply
#3

Quote:
Originally Posted by detter
Посмотреть сообщение
This line
Код:
for(new i;i < MAX_PLAYERS; i++) if(AccInfo[playerid][Level] >= 1 && AccInfo[playerid][admin] > 0) SendClientMessage(i, grey, string);
just added this
Код:
 && AccInfo[playerid][admin] > 0
change admin var. if yours is diffrent
Thanks man after adding that and test to the server. I can still see that i was being spectated.
Reply
#4

Hi anyone?? Message still sending to all. Only admin and I should see the message "[Spec] %s (ID:%d) is testing %s (ID:%d)"
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)