Improving my fly command please help
#1

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?
Reply
#2

Why don't you just use that include?
Reply
#3

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
Reply
#4

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

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
Reply
#6

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

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

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

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
Reply
#10

anyone?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)