CMD:espiar(playerid, params[])
{
new PlayerID;
if(ChecarPermissoes(playerid)) return 1;
if(AdmServer(playerid, 1)) return 1;
if(sscanf(params, "i", PlayerID)) return Msg(playerid, -1, "{A9A9A9}Use:{FFFFFF} /Espiar [ID]");
if(!IsPlayerConnected(PlayerID)) return Msg(playerid, -1, "{A9A9A9}Jogador Nгo Conectado");
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, PlayerID);
Msg(playerid, -1, "Para parar de assistir use /Pespiar");
return 1;
}
CMD:espiar(playerid, params[])
{
new PlayerID;
if(ChecarPermissoes(playerid)) return 1;
if(AdmServer(playerid, 1)) return 1;
if(sscanf(params, "i", PlayerID)) return Msg(playerid, -1, "{A9A9A9}Use:{FFFFFF} /Espiar [ID]");
if(!IsPlayerConnected(PlayerID)) return Msg(playerid, -1, "{A9A9A9}Jogador Nгo Conectado");
TogglePlayerSpectating(playerid, 1);
if(IsPlayerInAnyVehicle(playerID))
{
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(playerID), SPECTATE_MODE_NORMAL);
}
else
{
PlayerSpectatePlayer(playerid, PlayerID);
}
Msg(playerid, -1, "Para parar de assistir use /Pespiar");
return 1;
}
https://sampwiki.blast.hk/wiki/PlayerSpectateVehicle
PHP код:
|
vlw mano essa funзгo mesmo! agora ele verifica caso esteja dentro do carro a camera fica como se estivesse dirigindo! @TOPICO FECHADO.
|
Exatamente, mas se o player estiver a pй e depois entrar no veнculo acredito que a cвmera volte a ficar em primeira pessoa.
|
new TimerSpec[MAX_PLAYERS]; CMD:espiar(playerid, params[]) { new PlayerID; if(ChecarPermissoes(playerid)) return 1; if(AdmServer(playerid, 1)) return 1; if(sscanf(params, "i", PlayerID)) return Msg(playerid, -1, "{A9A9A9}Use:{FFFFFF} /Espiar [ID]"); if(!IsPlayerConnected(PlayerID)) return Msg(playerid, -1, "{A9A9A9}Jogador Nгo Conectado"); Spectate(playerid, PlayerID); Msg(playerid, -1, "Para parar de assistir use /Pespiar"); return true; } CMD:pespiar(playerid) { KillTimer(TimerSpec[playerid]); TogglePlayerSpectating(playerid, 0); Msg(playerid, -1, "Vocк parou de espiar"); return true; } forward AtualizarSpec(playerid, targetid); public AtualizarSpec(playerid, targetid) { if(IsPlayerInAnyVehicle(targetid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid), SPECTATE_MODE_NORMAL); else PlayerSpectatePlayer(playerid, targetid); return true; } stock Spectate(playerid, targetid) { TogglePlayerSpectating(playerid, 1); TimerSpec[playerid] = SetTimerEx("AtualizarSpec", 2000, true, "dd", playerid, targetid); return true; }
Try now, guy. Agora й pra dar certo:
Код:
new TimerSpec[MAX_PLAYERS]; CMD:espiar(playerid, params[]) { new PlayerID; if(ChecarPermissoes(playerid)) return 1; if(AdmServer(playerid, 1)) return 1; if(sscanf(params, "i", PlayerID)) return Msg(playerid, -1, "{A9A9A9}Use:{FFFFFF} /Espiar [ID]"); if(!IsPlayerConnected(PlayerID)) return Msg(playerid, -1, "{A9A9A9}Jogador Nгo Conectado"); Spectate(playerid, PlayerID); Msg(playerid, -1, "Para parar de assistir use /Pespiar"); return true; } CMD:pespiar(playerid) { KillTimer(TimerSpec[playerid]); TogglePlayerSpectating(playerid, 0); Msg(playerid, -1, "Vocк parou de espiar"); return true; } forward AtualizarSpec(playerid, targetid); public AtualizarSpec(playerid, targetid) { if(IsPlayerInAnyVehicle(targetid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid), SPECTATE_MODE_NORMAL); else PlayerSpectatePlayer(playerid, targetid); return true; } stock Spectate(playerid, targetid) { TogglePlayerSpectating(playerid, 1); TimerSpec[playerid] = SetTimerEx("AtualizarSpec", 2000, true, "dd", playerid, targetid); return true; } |