06.11.2015, 18:55
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:
Ajuda por favor
Comando:
PHP Code:
dcmd_spec(playerid, params[])
{
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(playerid, pSpectatingPos[playerid][0], pSpectatingPos[playerid][1], pSpectatingPos[playerid][2]);
GetPlayerFacingAngle(playerid, pSpectatingPos[playerid][3]);
GetPlayerHealth(playerid,pSpectatingHealth[playerid]);
pSpectatingInterior[playerid] = GetPlayerInterior(playerid);
pSpectatingVirtualWorld[playerid] = GetPlayerVirtualWorld(playerid);
new weapon[13], ammo[13];
for(new i = 0; i <= 12; i ++)
{
GetPlayerWeaponData(playerid, i, weapon[i], ammo[i]);
pSpectatingWeapons[playerid][GetWeaponSlotSpectating(weapon[i])] = weapon[i];
pSpectatingAmmo[playerid][GetWeaponSlotSpectating(weapon[i])] = ammo[i];
}
}
sSpectating[playerid] = true;
TogglePlayerSpectating(playerid, true);
sBeingSpectated[lookupid] = true;
pSpectatingPlayer[playerid] = lookupid;
if(IsPlayerInAnyVehicle(lookupid))
{
SetPlayerVirtualWorld(playerid, GetVehicleVirtualWorld(GetPlayerVehicleID(lookupid)));
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(lookupid));
}
else
{
SetPlayerInterior(playerid, GetPlayerInterior(lookupid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(lookupid));
PlayerSpectatePlayer(playerid, lookupid);
}
return 1;
}