SA-MP Forums Archive
GetPlayerVehicleID not working. - 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: GetPlayerVehicleID not working. (/showthread.php?tid=99927)



GetPlayerVehicleID not working. - Striker_Moe - 01.10.2009

Код:
	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?


Re: GetPlayerVehicleID not working. - member - 01.10.2009

try changing this:

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

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



Re: GetPlayerVehicleID not working. - Striker_Moe - 01.10.2009

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;
}



Re: GetPlayerVehicleID not working. - Correlli - 01.10.2009

Remember that vehicleid is NOT modelid.


Re: GetPlayerVehicleID not working. - Striker_Moe - 01.10.2009

..means?

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


Re: GetPlayerVehicleID not working. - shady91 - 01.10.2009

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


Re: GetPlayerVehicleID not working. - JoeyZack - 01.10.2009

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;
}



Re: GetPlayerVehicleID not working. - Striker_Moe - 01.10.2009

Still not.


Re: GetPlayerVehicleID not working. - Correlli - 01.10.2009

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.


Re: GetPlayerVehicleID not working. - Striker_Moe - 01.10.2009

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.