SA-MP Forums Archive
/noclip or /fly - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /noclip or /fly (/showthread.php?tid=353693)



/noclip or /fly - grantism - 24.06.2012

I've seen it on some servers you can /fly or /noclip and fly around the city like spiderman, anyone know?
I've already searched and couldn't find anything.


Re: /noclip or /fly - Grand_Micha - 24.06.2012

Like spiderman? I saw a grappling-hook plug-in once, it uses MapAndreas. Otherwise, I don't know what exactly you are looking for.


Re: /noclip or /fly - McFellow - 24.06.2012

Some people use /fly


Re: /noclip or /fly - McFellow - 24.06.2012

Try this
pawn Код:
CMD:fly(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 2) {
        new Float:px, Float:py, Float:pz, Float:pa;
        GetPlayerFacingAngle(playerid,pa);
        if(pa >= 0.0 && pa <= 22.5) {             //n1
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px, py+30, pz+5);
        }
        if(pa >= 332.5 && pa < 0.0) {             //n2
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px, py+30, pz+5);
        }
        if(pa >= 22.5 && pa <= 67.5) {            //nw
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px-15, py+15, pz+5);
        }
        if(pa >= 67.5 && pa <= 112.5) {           //w
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px-30, py, pz+5);
        }
        if(pa >= 112.5 && pa <= 157.5) {          //sw
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px-15, py-15, pz+5);
        }
        if(pa >= 157.5 && pa <= 202.5) {          //s
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px, py-30, pz+5);
        }
        if(pa >= 202.5 && pa <= 247.5) {          //se
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px+15, py-15, pz+5);
        }
        if(pa >= 247.5 && pa <= 292.5) {          //e
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px+30, py, pz+5);
        }
        if(pa >= 292.5 && pa <= 332.5) {          //e
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPos(playerid, px+15, py+15, pz+5);
        }
    }
    else {
        SendClientMessageEx(playerid, COLOR_GRAD1, "   You are not an Admin!");
    }
    return 1;
}



Re: /noclip or /fly - Grand_Micha - 24.06.2012

I have a simpler solution. You can yourself lucky because I already scripted this function.

Код:
stock SetPlayerForwardVelocity(playerid,Float:Velocity, Float:Z1)
{
new Float:Getx1, Float:Gety1, Float:Getz1;
new Float:AngleZ1;
new Float:SpeedX1, Float:SpeedY1;
new Float:Mulx1, Float:Muly1;
GetPlayerVelocity(playerid, Getx1 ,Gety1 ,Getz1);
GetPlayerFacingAngle(playerid,AngleZ1);
SpeedX1 = floatsin(-AngleZ1, degrees);
SpeedY1 = floatcos(-AngleZ1, degrees);
Mulx1 = floatmul(Velocity, SpeedX1);
Muly1 = floatmul(Velocity, SpeedY1);
SetPlayerVelocity(playerid, floatadd(Mulx1,Getx1), floatadd(Muly1, Gety1), floatadd(Getz1, Z1));
return 1;
}
And for /fly:

Код:
return SetPlayerForwardVelocity(playerid,0.6, 0.4);