// Ports the player to the given player
COMMAND:ir(playerid, params[])
{
// Setup local variables
new OtherPlayer, Float

, Float:y, Float:z, PortMsg[128], IntID, WorldID;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/ir", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 2)
{
// Check if the player has a wanted level of less than 3
if (GetPlayerWantedLevel(playerid) < 3)
{
// Check if the player is not jailed
if (APlayerData[playerid][PlayerJailed] == 0)
{
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/ir <Player>\"");
else
{
// Check if that other player is online
if (IsPlayerConnected(OtherPlayer))
{
// Get the location of the other player
GetPlayerPos(OtherPlayer, x, y, z);
IntID = GetPlayerInterior(OtherPlayer);
WorldID = GetPlayerVirtualWorld(OtherPlayer);
// Port the player to the given location
SetPlayerVirtualWorld(playerid, WorldID);
SetPlayerInterior(playerid, IntID);
SetPlayerPos(playerid, x, y, z + 3.0);
// Let the player know about it
format(PortMsg, 128, "{FFFFFF}Voce foi ate o Player Indicado.");
SendClientMessage(playerid, 0x00808080, PortMsg);
}
else
SendClientMessage(playerid, 0xFF0000FF, "O Player nao esta Online");
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce nao pode usar /ir Preso");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce nao pode usar /ir quando esta Sendo Procurado");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
// This command let's an admin spectate another player
COMMAND:espiar(playerid, params[])
{
// Setup local variables
new OtherPlayer, Name[24], Msg[128];
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 2)
{
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /espiar [id]");
else
{
// Check if that other player is online
if (IsPlayerConnected(OtherPlayer))
{
// Get the player's name
GetPlayerName(OtherPlayer, Name, sizeof(Name));
// Turn spectating on
TogglePlayerSpectating(playerid, 1);
// Check if the other player is driving a vehicle
if (GetPlayerVehicleSeat(OtherPlayer) == -1)
{
// The other player is on foot, so spectate him
PlayerSpectatePlayer(playerid, OtherPlayer);
SetPlayerInterior(playerid, GetPlayerInterior(OtherPlayer));
APlayerData[playerid][SpectateID] = OtherPlayer;
APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_PLAYER;
}
else
{
// The other player is in a vehicle, so spectate the vehicle
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(OtherPlayer));
APlayerData[playerid][SpectateID] = OtherPlayer;
APlayerData[playerid][SpectateVehicle] = GetPlayerVehicleID(OtherPlayer);
APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_VEHICLE;
}
format(Msg, 128, "{00FF00}[BTC] Vocк estб espiando {FFFF00}%s.", Name);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[BTC] Esse jogador nгo estб online.");
}
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}