SA-MP Forums Archive
Improving my fly command please help - 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: Improving my fly command please help (/showthread.php?tid=363999)



Improving my fly command please help - NinjaChicken - 29.07.2012

ok so i have this cmd

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);
            SetPlayerPosEx(playerid, px, py+30, pz+5);
        }
        if(pa >= 332.5 && pa < 0.0) {             //n2
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPosEx(playerid, px, py+30, pz+5);
        }
        if(pa >= 22.5 && pa <= 67.5) {            //nw
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPosEx(playerid, px-15, py+15, pz+5);
        }
        if(pa >= 67.5 && pa <= 112.5) {           //w
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPosEx(playerid, px-30, py, pz+5);
        }
        if(pa >= 112.5 && pa <= 157.5) {          //sw
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPosEx(playerid, px-15, py-15, pz+5);
        }
        if(pa >= 157.5 && pa <= 202.5) {          //s
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPosEx(playerid, px, py-30, pz+5);
        }
        if(pa >= 202.5 && pa <= 247.5) {          //se
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPosEx(playerid, px+15, py-15, pz+5);
        }
        if(pa >= 247.5 && pa <= 292.5) {          //e
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPosEx(playerid, px+30, py, pz+5);
        }
        if(pa >= 292.5 && pa <= 332.5) {          //e
            GetPlayerPos(playerid, px, py, pz);
            SetPlayerPosEx(playerid, px+15, py+15, pz+5);
        }
    }
    else {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
    }
    return 1;
}
but it does fuck all and i read up on this include
https://sampforum.blast.hk/showthread.php?tid=309467
can someone please edit my fly command to this include so it actually works?


Re: Improving my fly command please help - Finn - 29.07.2012

Why don't you just use that include?


Re: Improving my fly command please help - NinjaChicken - 29.07.2012

because that include doesnt add the command it gives us functions to make a command out of and i dont really know how to do it properly please help


Re: Improving my fly command please help - NinjaChicken - 29.07.2012

to be more clear ive got the include i just need helping making a command out of it using my admiin system


Re: Improving my fly command please help - Private200 - 29.07.2012

Change it to this one

pawn Код:
// Let the player use a jetpack
COMMAND:fly(playerid, params[])
{
    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/fly", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Check if the player's admin-level is at least 1
        if (APlayerData[playerid][PlayerLevel] >= 1)
        {
            // Equip the player with a jetpack
            SetPlayerSpecialAction(playerid, 2);
        }
        else
            return 0;
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}
And don't double post


Re: Improving my fly command please help - NinjaChicken - 29.07.2012

nooooo i wanted to use the functions on the include, i have a /jetpack cmd i need this


Re: Improving my fly command please help - Private200 - 29.07.2012

THen use that include , whats the problem o.O ,,,,, I gave you the example , and player with get equiped with jetpack


Re: Improving my fly command please help - NinjaChicken - 29.07.2012

omg, the include gives me 3 functions to make a command out of


Re: Improving my fly command please help - NinjaChicken - 29.07.2012

TO MAKE IT CLEAR: what i need is for someone to make me basically a /fly cmd with the include i posted to the type /fly it will enable the fly mode and say fly mode activated, they type it agian fly mode now de activated


Re: Improving my fly command please help - NinjaChicken - 29.07.2012

anyone?