public UpdateTextdraw()
{
new szString[40];
foreach(Player, i)
{
// AFK
if (GetPVarInt(i, "AFK") == 1) TextDrawShowForPlayer(i, afk);
else TextDrawHideForPlayer(i, afk);
if (IsPlayerInAnyVehicle(i))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X, Y, Z);
// FUEL
format(szString, 40, "Fuel:~w~ %d", Gas[GetPlayerVehicleID(i)]);
TextDrawSetString(TD_0[i], szString);
// DIST
new Float:Dist;
Dist = GetDistanceBetweenPoints(X, Y, Z, IslandX[i], IslandY[i], IslandZ[i]);
if (GetPVarInt(i, "Flight") > 0 || GetPVarInt(i, "Work") > 0)
{
format(szString, 40, "DIST:~w~ %d", floatround(Dist, floatround_round));
TextDrawSetString(TD_4[i], szString);
}
else
{
TextDrawSetString(TD_4[i], "DIST:~w~ None");
}
// DMG
new Float:HP;
GetVehicleHealth(GetPlayerVehicleID(i), HP);
format(szString, 40, "DMG:~w~ %d", floatround(HP, floatround_round));
TextDrawSetString(TD_3[i], szString);
// ALT
format(szString, 40, "ALT:~w~ %d", floatround(Z, floatround_ceil));
TextDrawSetString(TD_5[i], szString);
// VEHICLE
format(szString, 40, "VEH:~w~ %s", GetVehicleFriendlyName(GetPlayerVehicleID(i)));
TextDrawSetString(TD_6[i], szString);
// STATUS
if (GetPVarInt(i, "Work") > 0)
{
TextDrawSetString(TD_7[i], "Status:~w~ Work");
}
if (GetPVarInt(i, "Flight") == 1)
{
TextDrawSetString(TD_7[i], "Status:~w~ On Route");
}
if (GetPVarInt(i, "Flight") == 0)
{
if (GetPVarInt(i, "Work") == 0)
{
if (IsAirVehicle(GetPlayerVehicleID(i)))
{
TextDrawSetString(TD_7[i], "Status:~w~ Flying");
}
else
{
TextDrawSetString(TD_7[i], "Status:~w~ None");
}
}
}
new szString[40], i;
foreach(Player, i)
foreach (new i : Player)
|
Update your foreach include to the lastest version, becauser you're using an old one and replace:
pawn Код:
pawn Код:
|
public UpdateTextdraw()
{
new szString[40];
foreach (new i : Player)
{
// AFK
if (GetPVarInt(i, "AFK") == 1) TextDrawShowForPlayer(i, afk);
else TextDrawHideForPlayer(i, afk);
if (IsPlayerInAnyVehicle(i))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X, Y, Z);
// FUEL
format(szString, 40, "Fuel:~w~ %d", Gas[GetPlayerVehicleID(i)]);
TextDrawSetString(TD_0[i], szString);
// DIST
new Float:Dist;
Dist = GetDistanceBetweenPoints(X, Y, Z, IslandX[i], IslandY[i], IslandZ[i]);
if (GetPVarInt(i, "Flight") > 0 || GetPVarInt(i, "Work") > 0)
{
format(szString, 40, "DIST:~w~ %d", floatround(Dist, floatround_round));
TextDrawSetString(TD_4[i], szString);
}
else
{
TextDrawSetString(TD_4[i], "DIST:~w~ None");
}
// DMG
new Float:HP;
GetVehicleHealth(GetPlayerVehicleID(i), HP);
format(szString, 40, "DMG:~w~ %d", floatround(HP, floatround_round));
TextDrawSetString(TD_3[i], szString);
// ALT
format(szString, 40, "ALT:~w~ %d", floatround(Z, floatround_ceil));
TextDrawSetString(TD_5[i], szString);
// VEHICLE
format(szString, 40, "VEH:~w~ %s", GetVehicleFriendlyName(GetPlayerVehicleID(i)));
TextDrawSetString(TD_6[i], szString);
// STATUS
if (GetPVarInt(i, "Work") > 0)
{
TextDrawSetString(TD_7[i], "Status:~w~ Work");
}
if (GetPVarInt(i, "Flight") == 1)
{
TextDrawSetString(TD_7[i], "Status:~w~ On Route");
}
if (GetPVarInt(i, "Flight") == 0)
{
if (GetPVarInt(i, "Work") == 0)
{
if (IsAirVehicle(GetPlayerVehicleID(i)))
{
TextDrawSetString(TD_7[i], "Status:~w~ Flying");
}
else
{
TextDrawSetString(TD_7[i], "Status:~w~ None");
}
}
}
error 017: undefined symbol "foreach" error 029: invalid expression, assumed zero error 017: undefined symbol "i" fatal error 107: too many error messages on one line
#include <a_samp>
#include <foreach>
|
Did you include it at the top?
pawn Код:
|
|
Did you get the latest version of foreach? The above doesn't work for older versions.
|