pawn Код:
if(PlayerCuffed[i] == 1)
{
if(PlayerCuffedTime[i] <= 0)
{
//Frozen[i] = 0;
SetPVarInt(i, "IsFrozen", 0);
TogglePlayerControllable(i, 1);
PlayerCuffed[i] = 0;
SetPVarInt(i, "PlayerCuffed", 0);
PlayerCuffedTime[i] = 0;
ClearAnimations(i, 1);
SetPlayerSkin(i, GetPlayerSkin(i));
SetPlayerSpecialAction(i, SPECIAL_ACTION_NONE);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X, Y, Z);
SetPlayerPos(i, X, Y, Z);
if(PlayerDraggedBy[i] != INVALID_PLAYER_ID) {
IsCopDragging[PlayerDraggedBy[i]] = INVALID_PLAYER_ID;
PlayerDragged[i] = 0;
PlayerDraggedBy[i] = INVALID_PLAYER_ID;
}
if(IsPlayerAttachedObjectSlotUsed(i, 0))
RemovePlayerAttachedObject(i, 0);
}
else
{
PlayerCuffedTime[i] -= 1;
}
}
if(PlayerCuffed[i] == 2)
{
if(PlayerCuffedTime[i] <= 0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X, Y, Z);
new copinrange;
foreach(new j : Player) //ERROR AT THIS LINE
{
if(IsPlayerInRangeOfPoint(j, 30, X, Y, Z) && IsACop(j))
{
copinrange = 1;
}
}
if(copinrange == 0)
{
//Frozen[i] = 0;
ClearAnimations(i, 1);
SetPlayerSpecialAction(i, SPECIAL_ACTION_NONE);
DeletePVar(i, "IsFrozen");
GameTextForPlayer(i, "~r~You broke the cuffs, you're free!", 2500, 3);
if(IsPlayerAttachedObjectSlotUsed(i, 0))
RemovePlayerAttachedObject(i, 0);
TogglePlayerControllable(i, 1);
PlayerCuffed[i] = 0;
DeletePVar(i, "PlayerCuffed");
PlayerCuffedTime[i] = 0;
if(PlayerDraggedBy[i] != INVALID_PLAYER_ID) {
IsCopDragging[PlayerDraggedBy[i]] = INVALID_PLAYER_ID;
PlayerDragged[i] = 0;
PlayerDraggedBy[i] = INVALID_PLAYER_ID;
}
new string[76];
format(string, sizeof(string), "* %s has managed to wiggle out of the hand cuffs.", GetPlayerNameEx(i));
ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
PlayerCuffedTime[i] = 60;
}
}
else
{
PlayerCuffedTime[i] -= 1;
}
}
PHP код:
C:\Ma Stuff is Here\FUCKU\gamemodes\LAYLrp.pwn(64568) : error 017: undefined symbol "foreach"
C:\Ma Stuff is Here\FUCKU\gamemodes\LAYLrp.pwn(64568) : error 029: invalid expression, assumed zero
C:\Ma Stuff is Here\FUCKU\gamemodes\LAYLrp.pwn(64568) : error 017: undefined symbol "j"
C:\Ma Stuff is Here\FUCKU\gamemodes\LAYLrp.pwn(64568) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
pawn Код:
foreach(Player, j) {
if(IsPlayerInRangeOfPoint(j, 30, X, Y, Z) && IsACop(j)) {
copinrange = 1;
}
}
Actually, never mind. You can write it both ways. You can find the include here if you need it:
seems to be that you don't have newest foreach include.