GetVehicleModel problem?
#1

Hi there.

I'm using this little code to get the vehiclemodel of every car I enter, but after a few cars, the number of the model gets stuck:

Код:
public OnPlayerEnterVehicle(playerid)
{
  new string[128];
  format(string,sizeof(string), "modelo vehiculo: %i", GetVehicleModel(playerid));
  SendClientMessage(playerid, 0x00ff0000, string);
	return 1;
}
This means that if I enter a vehicle with modelid of 401, then 565 and then 601, after a few cars it will always show 601 & I have to re-generate the cars reloading the FS to get it working again. But it happens again and again..

Is this a bug with the command or is something wrong that can be causing this?

Reply
#2

You're not using it correctly.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  new string[128];
  format(string, sizeof(string), "modelo vehiculo: %i", GetVehicleModel(vehicleid));
  SendClientMessage(playerid, 0x00ff0000, string);
  return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
https://sampwiki.blast.hk/wiki/GetVehicleModel
Reply
#3

Quote:
Originally Posted by Don Correlli
You're not using it correctly.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  new string[128];
  format(string, sizeof(string), "modelo vehiculo: %i", GetVehicleModel(vehicleid));
  SendClientMessage(playerid, 0x00ff0000, string);
  return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
https://sampwiki.blast.hk/wiki/GetVehicleModel
Yeah, how dumb of me... =D

I couldn't look at the wiki because it keeps saying "internal error 500" since a few days ago.

It's up & down all the time.

Thank you very much for the orientation.
Reply
#4

You're welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)