What am i doing wrong?
#1

Hey guys what i want this to do is when the person enters a vehicle it tells them the ID of the vehicle and the name of the vehicle (ye si have vehicle names at top of my script in correct order)

Help will be appreciated, Also i dont get any errors.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            {
                new vehid;
                vehid = GetVehicleModel(GetPlayerVehicleID(playerid));
                new string[100];
                format(string, 100, "Vehicle ID : %d Vehicle Name : %s" ,vehid, VehicleNames);
                SendClientMessage(playerid, COLOR_WHITE,string);
            }
            return 1;
        }
    }
    return 0;
}
Reply
#2

First, you don't need to do an IsPlayerInAnyVehicle check in the OnPlayerEnterVehicle callback (think it over) !
The vehicle ID and vehicle model ID are not the same, but i assume you mean the model id.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new
        vehid,
        string[64];
    vehid = GetVehicleModel(vehicleid);
    format(string, 100, "Model ID: %d Vehicle Name : %s" ,vehid, VehicleNames[vehid - 400]);
    SendClientMessage(playerid, COLOR_WHITE,string);
    return 1;
}
Reply
#3

Thank you so much!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)