SA-MP Forums Archive
Check if there are 2 aimers? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Check if there are 2 aimers? (/showthread.php?tid=260393)



Check if there are more than 1 aimers? - 0ne - 08.06.2011

I got lubys function

pawn Код:
stock IsPlayerAiming(playerid, aimid)
{
// Luby's function.
new Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2;
GetPlayerPos(playerid, X1, Y1, Z1);
GetPlayerPos(aimid, X2, Y2, Z2);
new Float:Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
if(Distance < 100)
{
new Float:A;
GetPlayerFacingAngle(playerid, A);
X1 += (Distance * floatsin(-A, degrees));
Y1 += (Distance * floatcos(-A, degrees));
Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
if(Distance <= 2.0)
{
return true;
}
}
return false;
}
How could i check if there are 2 aimers at one player?

edit: check my below posts


Re: Check if there are 2 aimers? - Mauzen - 08.06.2011

pawn Код:
new count;
for(new i = 0; i < MAX_PLAYERS; i ++)
{
    if(IsPlayerAiming(i, aimid)) count ++;
}
Like this?


Re: Check if there are 2 aimers? - 0ne - 08.06.2011

Well kind of, you see i want to check if there are more than 1 aimer and then if there are like 4, i could use some define like: multiplayerid which is those 4 players, but that multiplayerid would check later each player in that define a tickcount of all of those aimers, i cannot think of this way , i know its possible because i done it one time but after a scripting break i dont remember how and i got my all scripts deleted


Re: Check if there are 2 aimers? - 0ne - 09.06.2011

Any help please? Might be a better explanation:

If there are more than 1 aimer i want to define all of them to a 1var/string or something to check all of their tickcount by using only one line or something like that.


Re: Check if there are 2 aimers? - 0ne - 11.06.2011

Bump,help please. this is very important to me