Hidden Trailer - Enter Checkpoint not working.
#1

When i go to the checkpoint and nothing appears to OnPlayerEnterCheckpoint. It's a Blank Checkpoint.
Код:
forward HiddenTrailerMissions(playerid);
public HiddenTrailerMissions(playerid)
{
        if (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 591)
        {
			new message[50];
            HiddenTrailer_PlayerJob[playerid] = 1;
            SetPlayerCheckpoint(playerid, -1073.4313, -1306.4890, 129.2188, 15);
            SendClientMessage(playerid, HIDDEN, "You have found a hidden trailer!");
            SendClientMessage(playerid, HIDDEN, "Deliver it to 'The Den'");
            format(message,sizeof(message), "~w~Deliver the ~p~hidden trailer ~w~to ~r~'the den'");
            PlayerTextDrawSetString(playerid, work[playerid], message);
            KillTimer(htimer);
        }
        return 1;
}
Код:
public OnPlayerEnterCheckpoint(playerid)
{
	if(GetPlayerTeam(playerid) == 1)
	{
		if (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 591)
		{
			switch(HiddenTrailer_PlayerJob[playerid])
			{
				case 1:
				{
                    HiddenTrailer_PlayerJob[playerid] = -1;
                    TogglePlayerControllable(playerid, 0);
                    SendClientMessage(playerid, HIDDEN, "You have delivered a hidden trailer!");
                    SendClientMessage(playerid, HIDDEN, "You recieved $10000 and 5 points");
                    GivePlayerMoney(playerid, 10000);
                    SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
                    SendClientMessageToAll(HIDDEN, "A hidden trailer has been delivered");
                    SetVehiclePos(GetVehicleTrailer(GetPlayerVehicleID(playerid)), 2940, -8288, -52);
                    DisablePlayerCheckpoint(playerid);
                    htimer = SetTimerEx("HiddenTrailerMissions", 2500, true, "i", playerid);
                    print("Hidden Trailers Called");

				}
            return 1;
		}
	}
}
Reply
#2

Bump.
Reply
#3

Did u use SetPlayerTeam(playerid, 1); ?

I think on public OnPlayerEnterCheckpoint don't pass the if.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	if(GetPlayerTeam(playerid) == 1) //We don't pass it.
	{
              
        }
        return 1;
}
Be sure the player it's in id 1 team.
Reply
#4

Quote:
Originally Posted by kingmk
Посмотреть сообщение
Did u use SetPlayerTeam(playerid, 1); ?

I think on public OnPlayerEnterCheckpoint don't pass the if.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	if(GetPlayerTeam(playerid) == 1) //We don't pass it.
	{
              
        }
        return 1;
}
Be sure the player it's in id 1 team.
Yes it's connected. But i think i need array for the checkpoint? to make the checkpoint to work?
Reply
#5

You don't need arrays for checkpoints to work, if you have more than 1 checkpoint, you should declare an ID for your checkpoints and check the ID of the checkpoint the user has entered. I can't check your code completely as I am on phone but I am more or less sure one of your if/case statements in onplayerentercheckpoint is bugged. What I can suggest is debugging everything through the console. Print out every step and see what's wrong.
Reply
#6

Quote:
Originally Posted by Rufio
Посмотреть сообщение
You don't need arrays for checkpoints to work, if you have more than 1 checkpoint, you should declare an ID for your checkpoints and check the ID of the checkpoint the user has entered. I can't check your code completely as I am on phone but I am more or less sure one of your if/case statements in onplayerentercheckpoint is bugged. What I can suggest is debugging everything through the console. Print out every step and see what's wrong.
I just debugged it and it called and does not call the checkpoint entering. I don't get it about ID. cause i have ID in array. but it's a Mission ID. i think it's not actually ID
Код:
forward HiddenTrailerMissions(playerid);
public HiddenTrailerMissions(playerid)
{
    if (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 591)
    {
        new message[100];
        SetPlayerCheckpoint(playerid, -1073.4313, -1306.4890, 129.2188, 15);
        HiddenTrailer_PlayerJob[playerid] = 1;
        SendClientMessage(playerid, HIDDEN, "You have found a hidden trailer!");
        SendClientMessage(playerid, HIDDEN, "Deliver it to 'The Den'");
        format(message,sizeof(message), "~w~Deliver the ~p~hidden trailer ~w~to ~r~'the den'");
        PlayerTextDrawSetString(playerid, work[playerid], message);
        print("CALL 1");
        KillTimer(htimer);
    }
    return 1;
}
Reply
#7

I dont know if I am just sleepy but you are missing a closing bracket } in your switch.
Reply
#8

Quote:
Originally Posted by Rufio
Посмотреть сообщение
I dont know if I am just sleepy but you are missing a closing bracket } in your switch.
On?

Код:
OnPlayerEnterCheckpoint
Reply
#9

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
On?

Код:
OnPlayerEnterCheckpoint
Correct.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)