PHP код:
CMD:spec(playerid, params[])
{
if(sscanf(params,"u",params[0])) return SendClientMessage(playerid, -1, "{00C3EA}» {FFFFFF}/spec [ID]");
if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, -1, "{FF0000}» {FFFFFF}Usuario no conectado");
if(params[0] == playerid) return SendClientMessage(playerid, -1, "{00C3EA}» {FF0000}No puedes spectearte a ti mismo");
if(GetPlayerState(params[0]) == PLAYER_STATE_SPECTATING) return SendClientMessage(playerid, -1, "{00C3EA}» {FFFFFF}Ese usuario estб specteando a otra persona");
if(GetPlayerState(params[0]) != 1 && GetPlayerState(params[0]) != 2 && GetPlayerState(params[0]) != 3) return SendClientMessage(playerid, -1, "El usuario no ha spawneado");
TogglePlayerSpectating(playerid,1);
if(IsPlayerInAnyVehicle(params[0]))
{
PlayerSpectateVehicle(playerid,GetPlayerVehicleID(params[0]));
}
else
{
PlayerSpectatePlayer(playerid,params[0]);
}
return 1;
}
CMD:specoff(playerid, params[])
{
if(Informacion[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "{FF0000}» {FFFFFF}No tienes permiso para utilizar este comando");
if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) return SendClientMessage(playerid, -1, "{FF0000}» {FFFFFF}No estas specteando a nadie");
TogglePlayerSpectating(playerid, false);
return 1;
}
Ahн te deje esos dos, los que te deje andan bien.
Yendo a los tuyos, te falta usar TogglePlayerSpectating.
https://sampwiki.blast.hk/wiki/TogglePlayerSpectating
Y el comando SpecOff no es necesario usar Sscanf, solo usa una funciуn para comprobar si estas specteando, si da false usas TogglePlayerSpectating(playerid, false);