forward BallDown(playerid, Float:oldz); public BallDown(playerid, Float:oldz) { new Float:x, Float:y, Float:z; GetObjectPos(Ball, x, y, z); new Float:a; new Float:x2, Float:y2; GetPlayerPos(playerid, x2, y2, a); GetPlayerFacingAngle(playerid, a); x2 += (16 * floatsin(-a, degrees)); y2 += (16 * floatcos(-a, degrees)); MoveObject(Ball, x2, y2, oldz-0.8, 10.0+random(3)); Baller = 999; ShootingBall = 0; BallBounce = 1; return 1; } GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { new Float:a; GetPlayerPos(playerid, x, y, a); GetPlayerFacingAngle(playerid, a); if (GetPlayerVehicleID(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), a); } x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); }
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13350) : warning 219: local variable "a" shadows a variable at a preceding level C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13436) : warning 219: local variable "a" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
forward BallDown(playerid, Float:oldz);
public BallDown(playerid, Float:oldz)
{
new Float:x, Float:y, Float:z;
GetObjectPos(Ball, x, y, z);
new Float:a;
new Float:x2, Float:y2, Float:z2;
GetPlayerPos(playerid, x2, y2, z2);
GetPlayerFacingAngle(playerid, a);
x2 += (16 * floatsin(-a, degrees));
y2 += (16 * floatcos(-a, degrees));
MoveObject(Ball, x2, y2, oldz-0.8, 10.0+random(3));
Baller = 999;
ShootingBall = 0;
BallBounce = 1;
return 1;
}
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a,Float:z;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13350) : warning 219: local variable "a" shadows a variable at a preceding level C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13436) : warning 219: local variable "a" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
forward BallDown(playerid, Float:oldz);
public BallDown(playerid, Float:oldz)
{
new Float:x, Float:y, Float:z;
GetObjectPos(Ball, x, y, z);
new Float:a;
new Float:x2, Float:y2;
GetPlayerPos(playerid, x2, y2, z2); // its a hieght,not a facing angle :|
GetPlayerFacingAngle(playerid, a);
x2 += (16 * floatsin(-a, degrees));
y2 += (16 * floatcos(-a, degrees));
MoveObject(Ball, x2, y2, oldz-0.8, 10.0+random(3));
Baller = 999;
ShootingBall = 0;
BallBounce = 1;
return 1;
}
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
// new Float:a; you already used 1 like this,idk if it can couse in warnings but would be better if it will be changed
new Float:FA,Float:pz,Float:vz;
GetPlayerPos(playerid, x, y, pz); // its x,y,z not x,y,a
GetPlayerFacingAngle(playerid, FA);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), vz); //vehicle hieght not Facing Angle
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13350) : warning 219: local variable "a" shadows a variable at a preceding level C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13352) : error 017: undefined symbol "z2" C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13444) : warning 213: tag mismatch C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13445) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Clean script(shouldn't give you any error/warning,i hope):
pawn Код:
![]() |
Oh no!
Код:
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13350) : warning 219: local variable "a" shadows a variable at a preceding level C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13352) : error 017: undefined symbol "z2" C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13444) : warning 213: tag mismatch C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13445) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
forward BallDown(playerid, Float:oldz);
public BallDown(playerid, Float:oldz)
{
new Float:x, Float:y, Float:z;
GetObjectPos(Ball, x, y, z); // y are you using it ?
new Float:a;
new Float:x2, Float:y2,Float:z2;
GetPlayerPos(playerid, x2, y2, z2); // its a hieght,not a facing angle :|
GetPlayerFacingAngle(playerid, a);
x2 += (16 * floatsin(-a, degrees));
y2 += (16 * floatcos(-a, degrees));
MoveObject(Ball, x2, y2, oldz-0.8, 10.0+random(3));
Baller = 999;
ShootingBall = 0;
BallBounce = 1;
return 1;
}
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
// new Float:a; you already used 1 like this,idk if it can couse in warnings but would be better if it will be changed
new Float:FA,Float:pz,Float:vz;
GetPlayerPos(playerid, x, y, pz); // its x,y,z not x,y,a
GetPlayerFacingAngle(playerid, FA);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), vz); //vehicle hieght not Facing Angle
}
x += (distance * floatsin(-FA, degrees));
y += (distance * floatcos(-FA, degrees));
}
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(13350) : warning 219: local variable "a" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.