Jump to content
  • 0

pomoc AFK System 4 warnings


BTomas

Dotaz

takze... zde to je.. 

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;
}
Link to comment
Share on other sites

4 odpovědí na tuto otázku

Recommended Posts

  • 0

Tie premeny už máš niekde nadeklarované.

 

HELP je od toho pokiaľ si človek nevie rady, nie od toho že sem máš postnúť bez svojej snahy to vyriešiť. Nie sme tu od toho aby sme ti to vyriešili, ale aby sme ti to pomohli vyriešiť, respektíve ti poradili/nasmerovali ťa správnym smerom...

 

Ale keby si hľadal tak takéto errory sú tu riešeené 12165132165x a na googli ani nehovorím....

 

2x meraj, raz strihaj ;)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...