14.10.2012, 17:14
Help me fix this
Line:308
Line 663:
Line 308:
Line 663:
PHP код:
wcrp\utils.pwn(308) : warning 219: local variable "Z" shadows a variable at a preceding level
wcrp\utils.pwn(663) : warning 219: local variable "Z" shadows a variable at a preceding level
PHP код:
public SendAreaMessage(Float:radi, Float:X, Float:Y, Float:Z, string[],color)
{
new Float:posx, Float:posy, Float:posz;
new Float:tempposx, Float:tempposy, Float:tempposz;
foreach(Player,i)
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (X -posx);
tempposy = (Y -posy);
tempposz = (Z -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, color, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, color, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, color, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, color, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, color, string);
}
}
return 1;
}
PHP код:
#define DEG_TO_RAD(%1) %1*(3.14159265 / 180)
stock movePlayerBack(playerid, Float:distance) {
new Float:X,Float:Y,Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
A += 90;
A = DEG_TO_RAD(A);
X -= floatcos(A) * distance;
Y -= floatsin(A) * distance;
SetPlayerPos(playerid, X, Y, Z);
return 1;
}
PHP код:
public SendAreaMessage(Float:radi, Float:X, Float:Y, Float:Z, string[],color)
PHP код:
new Float:X,Float:Y,Float:Z, Float:A;