C:\Documents and Settings\Vul\Plocha\FilterScripts\mod.pwn(889) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Documents and Settings\Vul\Plocha\FilterScripts\mod.pwn(1107) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Documents and Settings\Vul\Plocha\FilterScripts\mod.pwn(1107) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Documents and Settings\Vul\Plocha\FilterScripts\mod.pwn(1107) : warning 219: local variable "z" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Warnings.
radek 889:
new pName[MAX_PLAYER_NAME + 1];
radek 1107:
new Float:x, Float:y, Float:z;
zde cele
stock GetClosestPlayer(playerid)
{
new Float:x, Float:y, Float:z;
new Float:x2, Float:y2, Float:z2;
new Float:distance, Float:distance2;
new ClosestPlayer;
GetPlayerPos(playerid, x, y, z);
distance = 9999;
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(i != playerid)
{
GetPlayerPos(i, x2, y2, z2);
x = x - x2;
y = y - y2;
distance2 = floatsqroot(x*x+y*y);
if(distance2 < distance)
{
distance = distance2;
ClosestPlayer = i;
}
}
}
return ClosestPlayer;
}
Dotaz
BTomas 0
takze... zde to je..
radek 889:
radek 1107:
zde cele
Link to comment
Share on other sites
4 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now