GetVehicleModel help.
#1

Hello, today I was scripting, but I faced a problem.
the problem is I don't know how to get player's vehicle id, to get VehicleModel.
PHP код:
CMD:blabla(playerid,params[])
{
  if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid0xFF0000FF"ERROR: You're not in any vehicle!");
     new 
dialog[1024], string[128];
     
format(stringsizeof string,"Vehicle owner: %s | Vehicle name: %s \n Color1 : %d, color2 : %d | Vehicle ID: %d "VehicleInfo[vehicleid][owner], 
I couldn't do more, because second const, is related to car model , and I couldn't get player's vehicle ID. Can some one help me please?
Reply
#2

The vehicle ID the player is in? GetPlayerVehicleID
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The vehicle ID the player is in? GetPlayerVehicleID
There is no way with getplayervehicleid to take id as an string. so It doesn't help.
Reply
#4

Isn't there intval as strval, and you can use %i in format.
Reply
#5

Why would you even need a string, the integer value returns is more than enough and it DOES help:

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
pawn Код:
// modelid:
GetVehicleModel(vehicleid)

// owner's name:
VehicleInfo[vehicleid][owner]
"vehicleid" is needed to get the name and colors of the vehicle as well.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)