Urgent need help making /fly cmd
#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?

NOTE: the include gives me 3 functions to use can comeone edit my /fly command with these fuctions, so i type /fly and it actives the fly mode i type it again and it turns it off please help thx
Reply
#2

pawn Код:
#include <a_samp>
#include <fly>
 
public OnFilterScriptInit()
{
        print("=========================================\n");
        print("Fly include demo FS by Norck");
        print(" ");
        print("=========================================\n");
        return 1;
}
public OnPlayerConnect(playerid)
{
        InitFly(playerid);
        return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
        if(!strcmp(cmdtext,"/fly",true))
        {
            StartFly(playerid);
            return 1;
        }
        if(!strcmp(cmdtext,"/stopfly",true))
        {
            StopFly(playerid);
            return 1;
        }
        return 0;
}
Reply
#3

wtf im trying to get it to work with my admin system i dont want another FS i need my fly cmd edited
Reply
#4

come on anyone?
Reply
#5

Код:
#include <a_samp>
#include <fly>

public OnFilterScriptInit()
{
        print("=========================================\n");
        print("Fly include demo FS by Norck");
        print(" ");
        print("=========================================\n");
        return 1;
}
public OnPlayerConnect(playerid)
{
        InitFly(playerid);
        return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
        if(!strcmp(cmdtext,"/fly",true))
        {
            if(PInfo[playerid][Adminlevel] == 1)//your admin system
            {
            	StartFly(playerid);
            	return 1;
			}
			else
			    return 0;
            return 1;
        }
        if(!strcmp(cmdtext,"/stopfly",true))
        {
        	if(PInfo[playerid][Adminlevel] == 1)//your admin system
            {
            	StartFly(playerid);
            	return 1;
			}
			else
			    return 0;
            return 1;
        }
        return 0;
}
do you mean this? or what?
Reply
#6

pawn Код:
#include <fly>
new bool:IsFlying[MAX_PLAYERS] = false;
CMD:fly(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] < 2)  return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
    if(IsFlying[playerid] == false)
    {
        StartFly(playerid);
        IsFlying(playerid) = true;
    }
    else
    {
        StopFly(playerid);
        IsFlying[playerid] = false;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)