[HELP] Cars wont display GameText
#1

I am trying to make it where someone enters the car, and when they get into the car it says CIVILIAN VEHICLE as GameText, but I only want it for a certain car id (405). but it is not working for some reason. anyone?
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == 2)
    {
        new vehicleid = GetVehicleModel(vehicleid);
        if(GetVehicleModel(405))
        {
            GameTextForPlayer(playerid, "Civilian Vehicle", 3000, 3);
            return 1;
        }
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
        return 1;
    }
    return 1;
}
Reply
#2

Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == 2)
    {
        new vehicleid = GetVehicleModel(vehicleid);//assigning vehicleid a value with vehicleid in it??
        if(GetVehicleModel(405))
        {
            GameTextForPlayer(playerid, "Civilian Vehicle", 3000, 3);
            return 1;
        }
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
        return 1;
    }
    return 1;
}
ok that is your code... with errors marked

try this:
Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == 2)
    {
        new vehicleid = GetPlayerVehicleID(playerid);//thiss will return the vehicleid
        if(GetVehicleModel(405))
        {
            GameTextForPlayer(playerid, "Civilian Vehicle", 3000, 3);
            return 1;
        }
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
        return 1;
    }
    return 1;
}
Reply
#3

that didnt work but this did! Thanks for the help!
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == 2)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicleid) == 405)
        {
            GameTextForPlayer(playerid, "Civilian Vehicle", 3000, 3);
            return 1;
        }
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
        return 1;
    }
    return 1;
}
Reply
#4

lol i didnt see fail at getvehiclemodel
Reply
#5

lol its all good! thanks bro!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)