GetPlayerVehicleID not working.
#1

Код:
	if(strcmp(cmd, "/start", true) == 0)
 	{
 	  if (mission2[playerid] = 1)
 	  {
    new vehicle;
		vehicle = GetPlayerVehicleID(playerid);
		if (vehicle = 548)
		{
  	SendClientMessage(playerid,NICESKY,"[MISSION] Good job. Now fly the Cargobob to the Big Ear.");
  	SendClientMessage(playerid,NICESKY,"[MISSION] Once there, use /loadbombs to load the bombs.");
  	return 1;
		}
		else
		{
		SendClientMessage(playerid,NICESKY,"[MISSION] Wrong vehicle.");
		}
		}
		return 1;
  }
Aight, but if you write /start in a other vehicle or on foot, it still returns as you are in the cargobob. Why?
Reply
#2

try changing this:

pawn Код:
if (vehicle = 548)
to this:

pawn Код:
if (vehicle == 548)
Reply
#3

Now it says "Wrong vehicle" even if you are in a Cargobob. D:

if(strcmp(cmd, "/start", true) == 0)
{
if (mission2[playerid] = 1)
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if (vehicle == 54
{
SendClientMessage(playerid,NICESKY,"[MISSION] Good job. Now fly the Cargobob to the Big Ear.");
SendClientMessage(playerid,NICESKY,"[MISSION] Once there, use /loadbombs to load the bombs.");
}
else
{
SendClientMessage(playerid,NICESKY,"[MISSION] Wrong vehicle.");
}
}
return 1;
}
Reply
#4

Remember that vehicleid is NOT modelid.
Reply
#5

..means?

I just want to check if the player is in a cargobob.
Reply
#6

pawn Код:
if(strcmp(cmd, "/start", true) == 0)
    {
    if (mission2[playerid] == 1)
    {
    new vehicle;
    vehicle = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(vehicle ) == 548)  // lmao you hade 596 thats lspd cop car cargobob id is 548
    {
    SendClientMessage(playerid,NICESKY,"[MISSION] Good job. Now fly the Cargobob to the Big Ear.");
    SendClientMessage(playerid,NICESKY,"[MISSION] Once there, use /loadbombs to load the bombs.");
    }
    else
    {
    SendClientMessage(playerid,NICESKY,"[MISSION] Wrong vehicle.");
    }
    }
    return 1;
   }
this will work for cargobob model id only
Reply
#7

pawn Код:
if(strcmp(cmd, "/start", true) == 0)

  if(mission2[playerid] == 1)
  {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 596)
    {
      SendClientMessage(playerid,NICESKY,"[MISSION] Good job. Now fly the Cargobob to the Big Ear.");
      SendClientMessage(playerid,NICESKY,"[MISSION] Once there, use /loadbombs to load the bombs.");
    }
    else
    {
      SendClientMessage(playerid,NICESKY,"[MISSION] Wrong vehicle.");
    }  
  }
  return 1;
}
Reply
#8

Still not.
Reply
#9

Quote:
Originally Posted by Mo3
..means?

I just want to check if the player is in a cargobob.
This is the example how to see which vehicle-id is which.
pawn Код:
public OnGameModeInit()
{
  AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); // vehicle-id is 1.
  AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); // vehicle-id is 2.
  AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); // vehicle-id is 3.
  // other code.
  AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); // vehicle-id is 4.
  AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); // vehicle-id is 5.
  // other code.
  AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); // vehicle-id is 6.
  return 1;
}
while 548 is the model-id of the Cargobob.
Reply
#10

New command:

if(strcmp(cmd, "/start", true) == 0)
{
if(mission2[playerid] == 1)
{
if(GetVehicleModel(playerid) == 596)
{
SendClientMessage(playerid,NICESKY,"[MISSION] Good job. Now fly the Cargobob to the Big Ear.");
SendClientMessage(playerid,NICESKY,"[MISSION] Once there, use /loadbombs to load the bombs.");
}
else
{
SendClientMessage(playerid,NICESKY,"[MISSION] Wrong vehicle.");
}
}
return 1;
}

Still not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)