stock IsPlayerNearALawEnforcement(playerid)
{
new team = GetPlayerTeam(playerid);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
foreach (new i : Player)
{
if (i != playerid)
{
if (team != gTeam(i) == TEAM_COP)
{
if (IsPlayerInRangeOfPoint(i, 20.0, x, y, z))
{
return true;
}
}
}
}
return false;
}
stock IsPlayerNearALawEnforcement(playerid, Float: Radius)
{
new team = GetPlayerTeam(playerid);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new Float:range = GetPlayerDistanceFromPoint(playerid, x, y, z);
if(range <= Radius) return 1;
foreach (new i : Player)
{
if (i != playerid)
{
if (team != gTeam(i) == TEAM_COP)
{
if (IsPlayerInRangeOfPoint(i, 20.0, x, y, z))
{
return true;
}
}
}
}
return false;
}
stock IsPlayerNearALawEnforcement(playerid, Float: Radius)
{
new team = GetPlayerTeam(playerid);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
foreach (new i : Player)
{
if (i != playerid)
{
if (team != gTeam(i) == TEAM_COP)
{
if (IsPlayerInRangeOfPoint(i, 20.0, x, y, z))
{
return true;
}
}
}
}
return Radius >= GetPlayerDistanceFromPoint(playerid, x, y, z);
}
stock IsPlayerNearALawEnforcement(playerid, Float:radius)
{
new team = GetPlayerTeam(playerid);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
foreach (new i : Player)
{
if (i == playerid) continue;
if (team != gTeam(i) == TEAM_COP)
{
if (IsPlayerInRangeOfPoint(i, radius, x, y, z))
{
return true;
}
}
}
return false;
}
|
error 012: invalid function call, not a valid address warning 215: expression has no effect error 001: expected token: ";", but found ")" error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line |
if (team != gTeam(i) == TEAM_COP)
if (team != gTeam(i) && gTean(i) == TEAM_COP)
error 012: invalid function call, not a valid address warning 215: expression has no effect error 001: expected token: ";", but found ")" error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line
if (team != gTeam(i) == TEAM_COP)
task WantedLevelReduce[60000]()
{
foreach (new i : Player)
{
if(gTeam[i] == TEAM_CIV)
{
if(GetPlayerWantedLevel(i) >= 1 && IsPlayerNearALawEnforcement(i, 70))
{
SetPlayerWantedLevelEx(i, GetPlayerWantedLevel(i)-1);
}
}
}
}
|
Still getting that error.
Another question, i made a timer to reduce player's wanted level every 60 seconds if there isn't a cop in a range of 70 meters, so i did in this way: pawn Код:
Basically: No cop in a range of 70 meters = reduce 1 wanted level. Is it correct? |
if(GetPlayerWantedLevel(i) >= 1 && !IsPlayerNearALawEnforcement(i, 70))
|
error 012: invalid function call, not a valid address warning 215: expression has no effect error 001: expected token: ";", but found ")" error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line |