Help with making /work system.
#8

pawn Код:
if(strcmp(cmdtext, "/work", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1000, 1580.8534, 1534.2217, 10.8316))
        {
            //WorkInfo[playerid][IsWorking] = 1;
            SendClientMessage(playerid, COLOR_WHITE, "Complete flight from {FFFF00}LVAP {FFFFFF}to {FFFF00}SFAP.");
            SetPlayerCheckpoint(playerid, 1580.8534, 1534.2217, 10.8316, 5);
            return 1;
        }
        //Sf to Ls (Flight 2)
        else if(IsPlayerInRangeOfPoint(playerid, 1000, 1580.8534, 1534.2217, 10.8316))
        {
            //WorkInfo[playerid][IsWorking] = 2;
            SendClientMessage(playerid, COLOR_WHITE, "Complete flight from {FFFF00}SFAP {FFFFFF}to {FFFF00}LSAP.");
            SetPlayerCheckpoint(playerid, -1371.3795,-206.3711,14.1484, 5);
            return 1;
        }

        //Ls to Lv (Flight 3)
        else if(IsPlayerInRangeOfPoint(playerid, 1000, 1580.8534, 1534.2217, 10.8316))
        {
            //WorkInfo[playerid][IsWorking] = 3;
            SendClientMessage(playerid, COLOR_WHITE, "Complete flight from {FFFF00}LSAP {FFFFFF}to {FFFF00}LVAP.");
            SetPlayerCheckpoint(playerid, 1721.4504, -2415.5193, 13.5547, 5);
            return 1;
        }

    }
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(WorkInfo[playerid][IsWorking] = 1)
    {
        SetPlayerCheckpoint(playerid, 0.0, 0.0, 0.0, 5);//change coordinates to flight one landing
    }
    else if(WorkInfo[playerid][IsWorking] = 2)
    {
        SetPlayerCheckpoint(playerid, 0.0, 0.0, 0.0, 5);//change to flight 2 landing
    }
    else
    {
        SetPlayercheckpoint(playerid, 0.0, 0.0, 0.0, 5);//change to flight 3 landing
    }
    return 1;
}
Change your current code in /work with this one:
pawn Код:
else if (WorkInfo[playerid][IsWorking] > 0 && IsPlayerInPlane(playerid))
{
    SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Error: {FFFFFF}You are allready working!");
    return 1;
}
I've changed the variable WorkInfo[playerid][IsWorking]'s use:
pawn Код:
WorkInfo[playerid][IsWorking] == 1 //means Flight 1
WorkInfo[playerid][IsWorking] == 2 //means Flight 2
WorkInfo[playerid][IsWorking] //means Flight 3
If you wanna check if the player is working you can do:
pawn Код:
if(WorkInfo[playerid][IsWorking] > 0)
Reply


Messages In This Thread
Help with making /work system. - by Odyssey - 16.07.2011, 00:54
Re: Help with making /work system. - by Adil - 16.07.2011, 01:44
Re: Help with making /work system. - by Odyssey - 16.07.2011, 02:05
Re: Help with making /work system. - by DRIFT_HUNTER - 16.07.2011, 02:10
Re: Help with making /work system. - by Odyssey - 16.07.2011, 02:14
Re: Help with making /work system. - by DRIFT_HUNTER - 16.07.2011, 02:22
Re: Help with making /work system. - by Odyssey - 16.07.2011, 02:55
Re: Help with making /work system. - by Adil - 16.07.2011, 03:04
Re: Help with making /work system. - by Odyssey - 16.07.2011, 09:46
Re: Help with making /work system. - by Basicz - 16.07.2011, 10:09
Re: Help with making /work system. - by Odyssey - 16.07.2011, 10:36
Re: Help with making /work system. - by Basicz - 16.07.2011, 10:45

Forum Jump:


Users browsing this thread: 3 Guest(s)