TogglePlayerSpectating and Y_Classes
#1

Hello, when I end player spectating, I get back to class selection but I can't do anything, the screen is flashing...

Any workaround or something?
Reply
#2

Write the /spec and /specoff here..
Reply
#3

pawn Код:
CMD:pzu(playerid,params[])
{
    new id;
    if(pInfo[playerid][AdminLevel] < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,RED,"Tu turi būti administratorius kad galėtum naudoti šią komandą!");
    if(SpectatingPlayer[playerid] != INVALID_PLAYER_ID)
    {
        set.WasSpectating[playerid]=true;
        TogglePlayerSpectating(playerid,false);
        SendClientMessage(playerid,ORANGE,"Baigėte prižiūrėjimą!");
        SpectatingPlayer[playerid] = INVALID_PLAYER_ID;
        return 1;
    }
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,RED,"Naudojimas /pzu [ŽaidėjoID/DalisVardo]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,RED,"Tokio žaidėjo nėra!");
    new Float:pos[3];
    GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    SetPVarFloat(playerid,"Spec_X",pos[0]);
    SetPVarFloat(playerid,"Spec_Y",pos[1]);
    SetPVarFloat(playerid,"Spec_Z",pos[2]);
    TogglePlayerSpectating(playerid,true);
    SpectatingPlayer[playerid] = id;
    PlayerSpectatePlayer(playerid,id);
    SendClientMessage(playerid,RED,"Pradėjote priežiūrą, norėdami ją baigti rašykite /pzu");
    return 1;
}
I save the position in PVars so I could put the player where he started when hes done.
Reply
#4

Edit: didn't read the code well.
Reply
#5

It's the one command, if the admin is specatating someone and types it again he stops:
pawn Код:
if(SpectatingPlayer[playerid] != INVALID_PLAYER_ID)
    {
        set.WasSpectating[playerid]=true;
        TogglePlayerSpectating(playerid,false);
        SendClientMessage(playerid,ORANGE,"Baigėte prižiūrėjimą!");
        SpectatingPlayer[playerid] = INVALID_PLAYER_ID;
        return 1;
    }
Reply
#6

pawn Код:
CMD:pzu(playerid,params[])
{
    new id;
    if(pInfo[playerid][AdminLevel] < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,RED,"Tu turi būti administratorius kad galėtum naudoti љią komandą!");
    if(SpectatingPlayer[playerid] != INVALID_PLAYER_ID)
    {
        set.WasSpectating[playerid]=true;
        TogglePlayerSpectating(playerid,false);
        SendClientMessage(playerid,ORANGE,"Baigėte priћiūrėjimą!");
        SpectatingPlayer[playerid] = INVALID_PLAYER_ID;
                            SetPlayerPos(playerid,pos[0],pos[1],pos[2]);
        return 1;
    }
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,RED,"Naudojimas /pzu [ЋaidėjoID/DalisVardo]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,RED,"Tokio ћaidėjo nėra!");
    new Float:pos[3];
    GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    TogglePlayerSpectating(playerid,true);
    SpectatingPlayer[playerid] = id;
    PlayerSpectatePlayer(playerid,id);
    SendClientMessage(playerid,RED,"Pradėjote prieћiūrą, norėdami ją baigti raљykite /pzu");
    return 1;
}
Try this.
Reply
#7

Nop, didn't help.
Reply
#8

I think I still need help
Reply
#9

Yes, I'm sure. I still need help with this:bump
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)