forward AdminSpectate(playerid);
public AdminSpectate(playerid) // Timer update
{
new id;
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Player Not Connected.");
{
new Name[MAX_PLAYER_NAME], ip[16], tdstring[128];
new Float:health, Float:armour;
GetPlayerName(id, Name, sizeof(Name));
GetPlayerHealth(id, health);
GetPlayerArmour(id, armour);
GetPlayerIp(id, ip, 16);
format(tdstring, sizeof(tdstring), "Name: %s", Name);
TextDrawSetString(Textdraw0[id], tdstring);
format(tdstring, sizeof(tdstring), "Health: %.0f", health);
TextDrawSetString(Textdraw111[id], tdstring);
format(tdstring, sizeof(tdstring), "Armor: %.0f", armour);
TextDrawSetString(Textdraw2[id], tdstring);
format(tdstring, sizeof(tdstring), "Ping: %d", GetPlayerPing(id));
TextDrawSetString(Textdraw3[id], tdstring);
format(tdstring, sizeof(tdstring), "IP: %s", ip);
TextDrawSetString(Textdraw5[id], tdstring);
format(tdstring, sizeof(tdstring), "Money: $%d", GetPlayerMoney(id));
TextDrawSetString(Textdraw6[id], tdstring);
}
return 1;
}
CMD:spec
{
Spectating[playerid] = id;
TogglePlayerSpectating(playerid, 1);
new Name[MAX_PLAYER_NAME], ip[16], tdstring[128];
new Float:health, Float:armour;
GetPlayerName(id, Name, sizeof(Name));
GetPlayerHealth(id, health);
GetPlayerArmour(id, armour);
GetPlayerIp(id, ip, 16);
new png = GetPlayerPing(id);
TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
TextDrawShowForPlayer(playerid, Textdraw44[playerid]);
TextDrawShowForPlayer(playerid, Textdraw7[playerid]);
TextDrawShowForPlayer(playerid, Textdraw8[playerid]);
TextDrawShowForPlayer(playerid, Textdraw9[playerid]);
TextDrawShowForPlayer(playerid, Textdraw10[playerid]);
TextDrawShowForPlayer(playerid, Textdraw111[playerid]);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw5[playerid]);
format(tdstring, sizeof(tdstring), "Name: %s", Name);
TextDrawSetString(Textdraw0[id], tdstring);
format(tdstring, sizeof(tdstring), "Health: %.0f", health);
TextDrawSetString(Textdraw111[id], tdstring);
format(tdstring, sizeof(tdstring), "Armor: %.0f", armour);
TextDrawSetString(Textdraw2[id], tdstring);
format(tdstring, sizeof(tdstring), "Ping: %d", png);
TextDrawSetString(Textdraw3[id], tdstring);
format(tdstring, sizeof(tdstring), "IP: %s", ip);
TextDrawSetString(Textdraw5[id], tdstring);
format(tdstring, sizeof(tdstring), "Money: $%i", GetPlayerMoney(id));
TextDrawShowForPlayer(playerid, Textdraw6[playerid]);
TextDrawSetString(Textdraw6[id], tdstring);
PlayerSpectatePlayer(playerid, id);
}
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /spec [playerid]");
if(playerid == id) return SendClientMessage(playerid, COLOR_GREY, "You can't spectate yourself.");
CMD:spec(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0xFFFFFFAA, "{627D80}Error: You are not allowed to use this.");
new id;
if(sscanf(params, "d", id)) return SendClientMessage(playerid, 0xFFFFFFAA, "{627D80}Usage: /spec <ID>.");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFAA, "{627D80}That player is not connected!");
The code is there, i just didnt show it because i don't think it is necessary.
pawn Код:
|
//
TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
TextDrawShowForPlayer(playerid, Textdraw44[playerid]);
TextDrawShowForPlayer(playerid, Textdraw7[playerid]);
TextDrawShowForPlayer(playerid, Textdraw8[playerid]);
TextDrawShowForPlayer(playerid, Textdraw9[playerid]);
TextDrawShowForPlayer(playerid, Textdraw10[playerid]);
TextDrawShowForPlayer(playerid, Textdraw111[playerid]);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw5[playerid]);
format(tdstring, sizeof(tdstring), "Name: %s", Name);
TextDrawSetString(Textdraw0[id], tdstring);
format(tdstring, sizeof(tdstring), "Health: %.0f", health);
TextDrawSetString(Textdraw111[id], tdstring);
format(tdstring, sizeof(tdstring), "Armor: %.0f", armour);
TextDrawSetString(Textdraw2[id], tdstring);
format(tdstring, sizeof(tdstring), "Ping: %d", png);
TextDrawSetString(Textdraw3[id], tdstring);
format(tdstring, sizeof(tdstring), "IP: %s", ip);
TextDrawSetString(Textdraw5[id], tdstring);
format(tdstring, sizeof(tdstring), "Money: $%i", GetPlayerMoney(id));
TextDrawShowForPlayer(playerid, Textdraw6[playerid]);
TextDrawSetString(Textdraw6[id], tdstring);
//
format(tdstring, sizeof(tdstring), "Name: %s", Name);
TextDrawSetString(Textdraw0[id], tdstring);
format(tdstring, sizeof(tdstring), "Health: %.0f", health);
TextDrawSetString(Textdraw111[id], tdstring);
format(tdstring, sizeof(tdstring), "Armor: %.0f", armour);
TextDrawSetString(Textdraw2[id], tdstring);
format(tdstring, sizeof(tdstring), "Ping: %d", png);
TextDrawSetString(Textdraw3[id], tdstring);
format(tdstring, sizeof(tdstring), "IP: %s", ip);
TextDrawSetString(Textdraw5[id], tdstring);
format(tdstring, sizeof(tdstring), "Money: $%i", GetPlayerMoney(id));
TextDrawShowForPlayer(playerid, Textdraw6[id]);
TextDrawSetString(Textdraw6[id], tdstring);
TextDrawShowForPlayer(playerid, Textdraw3[id]);
TextDrawShowForPlayer(playerid, Textdraw0[id]);
TextDrawShowForPlayer(playerid, Textdraw44[id]);
TextDrawShowForPlayer(playerid, Textdraw7[id]);
TextDrawShowForPlayer(playerid, Textdraw8[id]);
TextDrawShowForPlayer(playerid, Textdraw9[id]);
TextDrawShowForPlayer(playerid, Textdraw10[id]);
TextDrawShowForPlayer(playerid, Textdraw111[id]);
TextDrawShowForPlayer(playerid, Textdraw2[id]);
TextDrawShowForPlayer(playerid, Textdraw5[id]);
new id = Spectating[playerid];