GetVehicleModel is an invalid function?
#1

pawn Код:
if(GetVehicleModel(vehicleid) == 411) // 411 is the infernus model
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Nice Infernus!");
    }
This was copy pasted from the SA-MP wiki of GetVehicleModel.

I've tried complying it into my script to see if it was my code, or what, and I get an error saying GetVehicleModel is an invalid function. Why's this?
Reply
#2

What's the exact error?
Reply
#3

Are there any plugins associated with the page that you are using? Possibly the object streamer?
Reply
#4

@MP2, like I said, GetVehicleModel is 'invalid'.
Код:
C:\Users\Jack\Desktop\GTA\ASP\LSPD Training\gamemodes\pd.pwn(1295) : error 010: invalid function or declaration
@Freddy

Would object streamers really cause GetVehicleModel to act differently? Using fallout's streamer, and no other plugins.
Reply
#5

Show that line, the line above it and the line below it.
Reply
#6

pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
SendErrorMessage(playerid, "  You're not in a vehice.");
return 1;
}
if(GetVehicleModel(vehicleid) == 411) // 411 is the infernus model
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Nice Infernus!");
    }
Nothing is below the GetVehicleModel.
Reply
#7

Show the GetVehicleModel function(stock).
Reply
#8

Nevermind I got it.

I forgot a { under IsPlayerinAnyVehicle, along with getting the vehicle ID.
Reply
#9

pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
{
SendErrorMessage(playerid, "  You're not in a vehice.");
return 1;
}
if(GetVehicleModel(vehicleid) == 411) // 411 is the infernus model
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Nice Infernus!");
    }
you where missing a {
Reply
#10

Indenting helps!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)