SA-MP Forums Archive
[Ajuda] Comando Spec - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Comando Spec (/showthread.php?tid=593533)



Comando Spec - Guss - 06.11.2015

Olб, eu tenho um problema. Eu uso o meu comando /spec, mas quando eu uso o comando /specoff e eu sinto falta assistindo. Mais uma vez eu uso / id Spectar sobre ele e nгo vai me deixar, a mensagem "Esse jogador jб estб sendo observado" e mais uma vez eu nгo posso ver o jogador com o mesmo id.

Comando:
PHP Code:
dcmd_spec(playeridparams[])
{
    new 
lookupid;
    if(
sscanf(params"u"lookupid)) return SendUsage(playerid"/spec (id)");
    if(!
IsPlayerConnected(lookupid)) return SendError(playerid"Jogador offline.");
    if(
IsPlayerBeiningSpectated(lookupid) && pSpectatingPlayer[playerid] != lookupid) return SendError(playerid"Esse jogador jб estб sendo observado");
    
    if(!
IsPlayerSpectating(playerid))
    {
        
GetPlayerPos(playeridpSpectatingPos[playerid][0], pSpectatingPos[playerid][1], pSpectatingPos[playerid][2]);
        
GetPlayerFacingAngle(playeridpSpectatingPos[playerid][3]);
          
GetPlayerHealth(playerid,pSpectatingHealth[playerid]);
        
pSpectatingInterior[playerid] = GetPlayerInterior(playerid);
        
pSpectatingVirtualWorld[playerid] = GetPlayerVirtualWorld(playerid);
        new 
weapon[13], ammo[13];
        for(new 
0<= 12++)
        {
            
GetPlayerWeaponData(playeridiweapon[i], ammo[i]);
            
pSpectatingWeapons[playerid][GetWeaponSlotSpectating(weapon[i])] = weapon[i];
            
pSpectatingAmmo[playerid][GetWeaponSlotSpectating(weapon[i])] = ammo[i];
        }
    }
    
sSpectating[playerid] = true;
    
TogglePlayerSpectating(playeridtrue);
    
sBeingSpectated[lookupid] = true;
    
pSpectatingPlayer[playerid] = lookupid;
    
    if(
IsPlayerInAnyVehicle(lookupid))
    {
        
SetPlayerVirtualWorld(playeridGetVehicleVirtualWorld(GetPlayerVehicleID(lookupid)));
        
PlayerSpectateVehicle(playeridGetPlayerVehicleID(lookupid));
    }
    else
    {
        
SetPlayerInterior(playeridGetPlayerInterior(lookupid));
        
SetPlayerVirtualWorld(playeridGetPlayerVirtualWorld(lookupid));
        
PlayerSpectatePlayer(playeridlookupid);
    }
    return 
1;

Ajuda por favor