Problem with this simple job.
#1

Hi,
I'm trying to make a Trucker Job, and I'm having a few problems.

My current problems are as follows:

- I want to start the job at a specific location, and in a specific vehicle. I've scripted it in, but it isn't working. I can go anywhere around the map and do /truck while I'm in the vehicle. So the only part that works, is me being in the specific vehicle... But not the area.

I'm still testing it... but these are the current bugs I've found. Thanks for the help.

pawn Код:
new truckjobrunning = 0;
CMD:truck(playerid, params[])
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 455)
    {
            truckjobrunning = 1;
            SetPlayerCheckpoint(playerid, Checkpoint1, 3.0);
            GameTextForPlayer(playerid, "~g~You have started the job.", 3000, 3);
    }
    return 1;
}


public OnPlayerExitVehicle(playerid, vehicleid)
{
    if((truckjobrunning) == 1)
    {
        truckjobrunning = 0;
        SendClientMessage(playerid, COLOR_RED, "You left your truck behind, get in again if you want to continue your job.");

    }else if((truckjobrunning) == 0){

       
 }
}




public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 455)
     {
         SendClientMessage(playerid, COLOR_RED, "You can begin working with the command /truck");
     }
     return 0;
}




public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 455)
   {
     if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint1))
     {
          SetPlayerCheckpoint(playerid, Checkpoint2, 7.0);
          GameTextForPlayer(playerid, "~g~Drop off more items at the warehouse.", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint2))
     {
          SetPlayerCheckpoint(playerid, Checkpoint3, 7.0);
          GameTextForPlayer(playerid, "~g~Head to the power plant.", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint3))
     {
          SetPlayerCheckpoint(playerid, Checkpoint4, 7.0);
          GameTextForPlayer(playerid, "~g~Now go back to the truck center to get your paycheck.", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint4))
     {
         GivePlayerMoney(playerid, 600);
         GameTextForPlayer(playerid, "~g~You Completed the job, well done!", 3000, 3);
         SetVehicleToRespawn(1);
         DisablePlayerCheckpoint(playerid);
         truckjobrunning = 0;
     }
   }
}
Reply
#2

if(IsPlayerInRangeOfPoint(playerid, BLAH BLAH)

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
if(IsPlayerInRangeOfPoint(playerid, BLAH BLAH)

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Thanks for the information. Would this work?
pawn Код:
CMD:truck(playerid, params[])
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 455)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0,-62.0572,-1121.8473,1.3233)) return SendClientMessage(playerid, COLOR_LIMEGREEN, "You have started the job. Proceed to the checkpoint");
        {
            truckjobrunning = 1;
            SetPlayerCheckpoint(playerid, Checkpoint1, 3.0);
            GameTextForPlayer(playerid, "~g~You have started the job.", 3000, 3);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "You're not in range of the Truck Job. /jobhelp for more information");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)