SA-MP Forums Archive
[HELP] Cars wont display GameText - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Cars wont display GameText (/showthread.php?tid=164275)



[HELP] Cars wont display GameText - Emanuel_Rodriguez - 30.07.2010

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;
}



Re: [HELP] Cars wont display GameText - legodude - 30.07.2010

Код:
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;
}



Re: [HELP] Cars wont display GameText - Emanuel_Rodriguez - 30.07.2010

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;
}



Re: [HELP] Cars wont display GameText - legodude - 30.07.2010

lol i didnt see fail at getvehiclemodel


Re: [HELP] Cars wont display GameText - Emanuel_Rodriguez - 30.07.2010

lol its all good! thanks bro!