OnPlayerEnterVehicle
#1

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new modelid = GetVehicleModel(playerid);
    if(modelid == 574)
    {
        {
            TextDrawShowForPlayer(playerid, Textdraw12);
            TextDrawShowForPlayer(playerid, Textdraw13);
            TextDrawShowForPlayer(playerid, Textdraw14);
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "* You are not a street cleaner!");
        ClearAnimations(playerid);
    }
    return 1;
}

When I try to enter a infernus (ID 411 instead of sweeper, ID 574) it says "You are not a street cleaner".
How is that possible?
Reply
#2

Quite simple, if the vehicle you are entering is not a sweeper you'll get that message.
Reply
#3

Because you wrote if the vehicle model is 574, then show the textdraws. But any other vehicle than 574 show me the message "* You are not a street cleaner!".

I guess you wanted to have this:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new modelid = GetVehicleModel(playerid);
    if(modelid == 574)
    {
        if( /* put your variable of the job */ )
        {
            TextDrawShowForPlayer(playerid, Textdraw12);
            TextDrawShowForPlayer(playerid, Textdraw13);
            TextDrawShowForPlayer(playerid, Textdraw14);
        }
        else
        {
            SendClientMessage(playerid, -1, "* You are not a street cleaner!");
            ClearAnimations(playerid);
        }
    }
   
    return 1;
}
Reply
#4

-delete-
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)