19.10.2014, 09:04
pawn Код:
if(PRESSED(KEY_ACTION))
{
if(PlayerInfo[playerid][Team] == 2)
{
if(GetPlayerProgressBarValue(playerid, SniffBar[playerid]) >= 100)
{
new radius;
if(PlayerInfo[playerid][Avar] == 1) { radius = 50; }
else if(PlayerInfo[playerid][Avar] == 2) { radius = 100; }
else if(PlayerInfo[playerid][Avar] == 3) { radius = 150; }
new Float:x,Float:y,Float:z;
new secs;
if(PlayerInfo[playerid][Avar] == 1) { secs = 3000; }
if(PlayerInfo[playerid][Avar] == 2) { secs = 4000; }
if(PlayerInfo[playerid][Avar] == 3) { secs = 5000; }
foreach(Player,i)
{
if(i == playerid) continue;
if(IsPlayerInRangeOfPoint(i,radius,x,y,z))
{
if(PlayerInfo[i][Team] == 1)
{
//SetPlayerMarkerForPlayer(i,playerid,YELLOW); //0xFFFB00FF
SetPlayerMarkerForPlayer(playerid,i,YELLOW);
print("player is team 1");
}
else if(PlayerInfo[i][Team] == 2)
{
SetPlayerMarkerForPlayer(playerid,i,GREEN); // 0x0F7002FF
print("player is team 2");
}
}
else
{
printf(" player %i not near",i);
}
}
SetTimerEx("Sniff",secs,0,"d",playerid);
SetPlayerProgressBarValue(playerid,SniffBar[playerid],0);
UpdatePlayerProgressBar(playerid,SniffBar[playerid]);
ApplyAnimation(playerid,"PED","flee_lkaround_01",4.1,0,0,0,0,-1,0);
} else { print(" -100 "); }
} else { print(" team not 2"); }
return 1;
}
Thanks in advance.