28.02.2015, 20:33
Estou tentando fazer uma tecla em que o player aperte e vб para frente, mas da as seguinte warning:
local variable "Z" shadows a variable at a preceding level
Estou usando o Cуdigo abaixo que achei aki no fуrum.
local variable "Z" shadows a variable at a preceding level
Estou usando o Cуdigo abaixo que achei aki no fуrum.
pawn Код:
if((newkeys & 2) && (!IsPlayerInAnyVehicle(playerid)))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
GetXYInFrontOfPlayer(playerid, X, Y, 1); // '5' й a distancia.
SetPlayerPos(playerid, X, Y, Z);
}
pawn Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}