Mission problem. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mission problem. (
/showthread.php?tid=149953)
Mission problem. -
WickyFramboise - 24.05.2010
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.
Re: Mission problem. -
WickyFramboise - 25.05.2010
Bump.
Re: Mission problem. -
Grim_ - 25.05.2010
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
Re: Mission problem. -
WickyFramboise - 27.05.2010
Alright, thanks a lot man!