Mission problem.
#1

Hey all,

I'm trying to make some missions where you have to steal a car and deliver it at the faction's hideout, problem is, I'm quite new to scripting, I figured how to set the checkpoint and stuff, but now I have two problems/questions:

1. When I was going to the car I had to steal, I went past the checkpoint where I had to deliver it, so I figured I missed a checkpoint in the script. When I went through it, it said that I succesfully stole the car, while I wasnt even in it. How can I make the script check if I'm in the right car?

2. Is it possible to make the script choose a random mission, because I'm making a series of car stealing missions, about 30 missions I think, and I want to make it so that if you say /stealcar, you'll get a random mission of one of those 30 or so missions.

Thanks in advance,
Wicky.
Reply
#2

Bump.
Reply
#3

1. Create a new variable to store the vehicles ID and check if you're in that car when entering the checkpoint
pawn Код:
new car1;
//ongamemodeinit
car1 = CreateVehicle(..);
//onplayerentercheckpoint (the one where you check the player)
if(GetPlayerVehicleID(playerid) == car1)
{
  // was the correct car
}
2. Yes, just make a random under the /stealcar command.
pawn Код:
if(strcmp(cmdtext, "/stealcar", true) == 0)
{
  new r = random(30);
  switch(r)
  {
   case 0: // start car steal 1
   case 1: // start car steal 2
// ect ect
Reply
#4

Alright, thanks a lot man!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)