ATC help
#1

My ATC system is failing may someone look at it and tell me whats wrong?

Its totally bugged :S

pawn Код:
#include <a_samp>
#include <zcmd>

new ISLSCLOSED = 0;
new ISLVCLOSED = 0;
new ISSFCLOSED = 0;

forward Landing(playerid);
forward TakingOff(playerid);
forward OpenRunway();

CMD:takeoff(playerid, params[])
{
    if(IsPlayerInAnyVehicle(GetPlayerVehicleID(playerid)) != 520 || 577 || 511 || 592 || 512 || 513 || 519 || 593 || 553 || 476 || 487 || 417 || 469) return SendClientMessage(playerid,0xFF0000FF,"Your Not In An Aircraft!");
    else
    {
        GameTextForPlayer(playerid,"~g~Contacting Tower...",3000,5);
        SetTimerEx("TakingOff",3000,false,"ii",0,playerid);
    }
    return true;
}

CMD:land(playerid, params[])
{
    if(IsPlayerInAnyVehicle(GetPlayerVehicleID(playerid)) != 520 || 577 || 511 || 592 || 512 || 513 || 519 || 593 || 553 || 476 || 487 || 417 || 469) return SendClientMessage(playerid,0xFF0000FF,"Your Not In An Aircraft!");
    else
    {
        GameTextForPlayer(playerid,"~g~Contacting Tower...",3000,5);
        SetTimerEx("Landing",3000,false,"ii",1,playerid);
    }
    return true;
}

public Landing(playerid)
{
    new str[128];
    if (IsPlayerInRangeOfPoint(playerid,500,2061.8948,-2379.8354,16.1250) == 1)
    {
    if (ISLSCLOSED == 0)
    {
        ISLSCLOSED = 1;
        SetTimerEx("OpenRunway",20000,false,"i",0);
        format(str,sizeof str,"~w~LS-ATC: ~g~Positive, Runway Clear..");
        GameTextForPlayer(playerid,str,5000,5);
        new pName[24];
        GetPlayerName(playerid,pName,64);
        format(str,sizeof str,"[ATC]: %s Is Preparing To Land At Los Santos International Airport",pName);
        SendClientMessageToAll(0xFFFF00FF,str);
    }
    else
    {
        format(str,sizeof str,"~w~LS-ATC: ~r~Negative, Runway In Use..");
        GameTextForPlayer(playerid,str,5000,5);
    }
    }
    else if (IsPlayerInRangeOfPoint(playerid,500,1306.2268,1262.2083,14.2656 ) == 1)
    {
    if (ISLVCLOSED == 0)
    {
        ISLVCLOSED = 1;
        SetTimerEx("OpenRunway",20000,false,"i",1);
        format(str,sizeof str,"~w~LV-ATC: ~g~Positive, Runway Clear..");
        GameTextForPlayer(playerid,str,5000,5);
        new pName[24];
        GetPlayerName(playerid,pName,64);
        format(str,sizeof str,"[ATC]: %s Is Preparing To Land At Las Venturas Airport",pName);
        SendClientMessageToAll(0xFFFF00FF,str);
    }
    else
    {
        format(str,sizeof str,"~w~LV-ATC: ~r~Negative, Runway In Use..");
        GameTextForPlayer(playerid,str,5000,5);
    }
    }
    else if (IsPlayerInRangeOfPoint(playerid,500,-1294.7537,62.1835,14.1484) == 1)
    {
    if (ISSFCLOSED == 0)
    {
        ISSFCLOSED = 1;
        SetTimerEx("OpenRunway",20000,false,"i",2);
        format(str,sizeof str,"~w~SF-ATC: ~g~Positive, Runway Clear..");
        GameTextForPlayer(playerid,str,5000,5);
        new pName[24];
        GetPlayerName(playerid,pName,64);
        format(str,sizeof str,"[ATC]: %s Is Preparing To Land At Easter Basin Airport",pName);
        SendClientMessageToAll(0xFFFF00FF,str);
    }
    else
    {
        format(str,sizeof str,"~w~SF-ATC: ~r~Negative, Runway In Use..");
        GameTextForPlayer(playerid,str,5000,5);
    }
    }
}

public TakingOff(playerid)
{
    new str[128];
    if (IsPlayerInRangeOfPoint(playerid,500,2061.8948,-2379.8354,16.1250) == 1)
    {
    if (ISLSCLOSED == 0)
    {
        ISLSCLOSED = 1;
        SetTimerEx("OpenRunway",20000,false,"i",0);
        format(str,sizeof str,"~w~LS-ATC: ~g~Positive, Runway Clear..");
        GameTextForPlayer(playerid,str,5000,5);
        new pName[24];
        GetPlayerName(playerid,pName,64);
        format(str,sizeof str,"[ATC]: %s Is Taking Off From Los Santos International Airport",pName);
        SendClientMessageToAll(0xFFFF00FF,str);
    }
    else
    {
        format(str,sizeof str,"~w~LS-ATC: ~r~Negative, Runway In Use..");
        GameTextForPlayer(playerid,str,5000,5);
    }
    }
    else if (IsPlayerInRangeOfPoint(playerid,500,1306.2268,1262.2083,14.2656 ) == 1)
    {
    if (ISLVCLOSED == 0)
    {
        ISLVCLOSED = 1;
        SetTimerEx("OpenRunway",20000,false,"i",1);
        format(str,sizeof str,"~w~LV-ATC: ~g~Positive, Runway Clear..");
        GameTextForPlayer(playerid,str,5000,5);
        new pName[24];
        GetPlayerName(playerid,pName,64);
        format(str,sizeof str,"[ATC]: %s Is Taking Off From Las Venturas Airport",pName);
        SendClientMessageToAll(0xFFFF00FF,str);
    }
    else
    {
        format(str,sizeof str,"~w~LV-ATC: ~r~Negative, Runway In Use..");
        GameTextForPlayer(playerid,str,5000,5);
    }
    }
    else if (IsPlayerInRangeOfPoint(playerid,500,-1294.7537,62.1835,14.1484) == 1)
    {
    if (ISSFCLOSED == 0)
    {
        ISSFCLOSED = 1;
        SetTimerEx("OpenRunway",20000,false,"i",2);
        format(str,sizeof str,"~w~SF-ATC: ~g~Positive, Runway Clear..");
        GameTextForPlayer(playerid,str,5000,5);
        new pName[24];
        GetPlayerName(playerid,pName,64);
        format(str,sizeof str,"[ATC]: %s Is Taking Off From Easter Basin Airport",pName);
        SendClientMessageToAll(0xFFFF00FF,str);
    }
    else
    {
        format(str,sizeof str,"~w~SF-ATC: ~r~Negative, Runway In Use..");
        GameTextForPlayer(playerid,str,5000,5);
    }
    }
}

public OpenRunway()
{
    if(ISLSCLOSED == 1)
    {
        ISLSCLOSED = 0;
    }
    else if(ISSFCLOSED == 1)
    {
        ISSFCLOSED = 0;
    }
    else if(ISLVCLOSED == 1)
    {
        ISLVCLOSED = 0;
    }
}
EDIT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)