CMD:ff(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1) { new Float:px, Float:py, Float:pz, Float:pa; GetPlayerFacingAngle(playerid, pa); if(pa >= 0.0 && pa <= 22.5) // { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px, py+20, pz); } if(pa >= 332.5 && pa < 0.0) //n2 { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px, py+20, pz); } if(pa >= 22.5 && pa <= 67.5) //nw { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px-10, py+10, pz); } if(pa >= 67.5 && pa <= 112.5) //w { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px-20, py, pz); } if(pa >= 112.5 && pa <= 157.5) //sw { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px-10, py-10, pz); } if(pa >= 157.5 && pa <= 202.5) //s { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px, py-20, pz); } if(pa >= 202.5 && pa <= 247.5)//se { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px+10, py-10, pz); } if(pa >= 247.5 && pa <= 292.5)//e { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px+20, py, pz); } if(pa >= 292.5 && pa <= 332.5)//e { GetPlayerPos(playerid, px, py, pz); SetPlayerPos(playerid, px+10, py+10, pz); } return 1; } } return 1; }
CMD:ff(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new Float:px, Float:py, Float:pz, Float:pa;
GetPlayerFacingAngle(playerid, pa);
if(pa >= 0.0 && pa <= 22.5) //
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px, py+20, pz);
}
else if(pa >= 332.5 && pa < 0.0) //n2
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px, py+20, pz);
}
else if(pa >= 22.5 && pa <= 67.5) //nw
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px-10, py+10, pz);
}
else if(pa >= 67.5 && pa <= 112.5) //w
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px-20, py, pz);
}
else if(pa >= 112.5 && pa <= 157.5) //sw
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px-10, py-10, pz);
}
else if(pa >= 157.5 && pa <= 202.5) //s
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px, py-20, pz);
}
else if(pa >= 202.5 && pa <= 247.5)//se
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px+10, py-10, pz);
}
else if(pa >= 247.5 && pa <= 292.5)//e
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px+20, py, pz);
}
else if(pa >= 292.5 && pa <= 332.5)//e
{
GetPlayerPos(playerid, px, py, pz);
SetPlayerPos(playerid, px+10, py+10, pz);
}
}
}
return 1;
}
Loose indentation means that you aren't tabulating/indenting your code at a certain/appropriate level. Also, they are warnings, not errors. You can run your script with warnings, but it's always advised to fix them, and not just avoid/ignore them.
pawn Код:
|
stock 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));
}
CMD:ff(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid, px, py, pz); // Or you could use SetPlayerPosFindZ if you prefer not to use a z coordinate.
GetXYInFrontOfPlayer(playerid, px, py, 20.0);
SetPlayerPos(playerid, px, py, pz);
}
}
return 1;
}