SA-MP Forums Archive
Spectating issue O_0 - 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: Spectating issue O_0 (/showthread.php?tid=560507)



Spectating issue O_0 - Anuris - 28.01.2015

Hello guys.

I really cannot understand what's the problem.

pawn Код:
else if(strcmp(cmd, "/re", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendMe(playerid, 0x00D900C8, "- Подсказка:{FFFFFF} /re [ID]");
        giveplayerid = strval(tmp);
        if(!IsPlayerConnected(giveplayerid)) return SendMe(playerid, CGRADD, NotFoundID);
        if(giveplayerid == playerid) return SendMe(playerid, CGRADD, ErrorMyId);
        ShowMenuForPlayer(mRecon,playerid);
        StartSpectate(playerid, giveplayerid);
        return 1;
    }
stock StartSpectate(playerid, specid)
{
    SetPlayerInterior(playerid, GetPlayerInterior(specid));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(specid));
    TogglePlayerSpectating(playerid, 1);
    if(IsPlayerInAnyVehicle(specid))
    {
        PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specid), SPECTATE_MODE_FIXED);
    }
    else
    {
        PlayerSpectatePlayer(playerid, specid, SPECTATE_MODE_FIXED);
        SendMes(playerid, -1, "[%i]", specid);
    }
    return 1;
}
As you can see, I've added "SendMes(playerid, -1, "[%i]", specid);" to be sure, that PlayerSpectatePlayer was executed.
Here how it works:


Re: Spectating issue O_0 - Raisingz - 28.01.2015

I think that if you use SPECTATE_MODE_NORMAL instead of FIXED it will work, I think that if you want FIXED to work you need to Set the player's camera aswell.


Re: Spectating issue O_0 - Anuris - 28.01.2015

Know what? You're genius!
Thanks!