SA-MP Forums Archive
TogglePlayerSpectating and Y_Classes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TogglePlayerSpectating and Y_Classes (/showthread.php?tid=481380)



TogglePlayerSpectating and Y_Classes - dusk - 15.12.2013

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?


Re: TogglePlayerSpectating and Y_Classes - Zamora - 15.12.2013

Write the /spec and /specoff here..


Re: TogglePlayerSpectating and Y_Classes - dusk - 15.12.2013

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.


Re: TogglePlayerSpectating and Y_Classes - Zamora - 15.12.2013

Edit: didn't read the code well.


Re: TogglePlayerSpectating and Y_Classes - dusk - 15.12.2013

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;
    }



Re: TogglePlayerSpectating and Y_Classes - Zamora - 15.12.2013

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.


Re: TogglePlayerSpectating and Y_Classes - dusk - 15.12.2013

Nop, didn't help.


Re: TogglePlayerSpectating and Y_Classes - dusk - 17.12.2013

I think I still need help


Re: TogglePlayerSpectating and Y_Classes - dusk - 19.12.2013

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


Re: TogglePlayerSpectating and Y_Classes - dusk - 24.12.2013

bump