if(GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID) { SetPVarInt(playerid, "TargetPlayer", GetPlayerTargetPlayer(playerid)); return 1; }
if(playertextid == PlayerText) { if(!GetPVarInt(playerid, "TargetPlayer")) return SendClientMessage(playerid, -1, "(( {FF0000}Error: {FFFFFF}Вы не выбрали игрока! ))"); return 1; }
if(!GetPVarInt(playerid, "TargetPlayer")) return SendClientMessage(playerid, -1, "(( {FF0000}Error: {FFFFFF}Вы не выбрали игрока! ))");
if (playertextid == PlayerText) {
if (GetPVarInt(playerid, "TargetPlayer") == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "(( {FF0000}Error: {FFFFFF}Вы не выбрали игрока! ))");
return 1;
}
OnPlayerUpDate() {
SetPVarInt(playerid, "TargetPlayer", GetPlayerTargetPlayer(playerid));
return 1;
}
pawn Code:
|
public OnPlayerUpdate(playerid)
{
if(GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID)
{
new string[MAX_PLAYER_NAME + 10 + 3 + 3 + 5];
new Float:health;
GetPlayerHealth(GetPlayerTargetPlayer(playerid),health);
format(string, sizeof(string), "~w~%d", floatround(health, floatround_round));
PlayerTextDrawSetString(playerid, Target[playerid][4], string);
new Float:Armour;
GetPlayerArmour(GetPlayerTargetPlayer(playerid), Armour);
format(string, sizeof(string), "~w~%d", floatround(Armour, floatround_round));
PlayerTextDrawSetString(playerid, Target[playerid][5], string);
format(string, sizeof(string), "~w~%s ~g~(%i)", PN[GetPlayerTargetPlayer(playerid)], GetPlayerTargetPlayer(playerid));
PlayerTextDrawSetString(playerid, Target[playerid][6], string);
PlayerTextDrawShow(playerid, Target[playerid][0]);
PlayerTextDrawShow(playerid, Target[playerid][1]);
PlayerTextDrawShow(playerid, Target[playerid][2]);
PlayerTextDrawShow(playerid, Target[playerid][3]);
PlayerTextDrawShow(playerid, Target[playerid][4]);
PlayerTextDrawShow(playerid, Target[playerid][5]);
PlayerTextDrawShow(playerid, Target[playerid][6]);
SetPVarInt(playerid, "TargetPlayer", GetPlayerTargetPlayer(playerid));
return 1;
}
return 1;
}
Ты где у меня проверку видишь?! За пределы проверки вынеси, присвоение должно быть всегда.
|