[HELP]CAR MISSION
#7

Quote:
Originally Posted by [Aka]Dragonu
Посмотреть сообщение
It works thank you, but i have a problem it gives me 1 warning here is my OnPlayerEnterVehicle :

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

    if(vehicleid == 123) // Switch 123 to your vehicle ID
    {
        if(gTeam[playerid] == TEAM_COP) // or GetPlayerTeam
        {
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            SetPlayerPos(playerid,X+2,Y,Z);
            SendClientMessage(playerid,COLOR_GREY,"You are cop. You must defend this vehicle from stealers!");
            return 1;
        }
        else
        {
            return 1;
        }
    }
    return 1;

    if(GetVehicleModel(vehicleid) == 449){PutPlayerInVehicle(playerid, vehicleid, 0);} // Tram
    //if(GetVehicleModel(vehicleid) == 537){PutPlayerInVehicle(playerid, vehicleid, 0);} // Freight // There are no bugs with trains.
    //if(GetVehicleModel(vehicleid) == 538){PutPlayerInVehicle(playerid, vehicleid, 0);} // Streak // There are no bugs with trains.

    //if(GetVehicleModel(vehicleid) == 570){if(ispassenger == 1){PutPlayerInVehicle(playerid, vehicleid, ispassenger);}} // Streak Carriage // This public doesn't support Carriage's
    //if(GetVehicleModel(vehicleid) == 590){if(ispassenger == 1){PutPlayerInVehicle(playerid, vehicleid, ispassenger);}} // Freibox Carriage // This public doesn't support Carriage's

    if(GetVehicleModel(vehicleid) == 441){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Bandit
    if(GetVehicleModel(vehicleid) == 464){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Baron
    if(GetVehicleModel(vehicleid) == 465){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Raider
    if(GetVehicleModel(vehicleid) == 501){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Goblin
    if(GetVehicleModel(vehicleid) == 564){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Tiger
    if(GetVehicleModel(vehicleid) == 594){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Cam
    return 1;
}
And the warning is :
pawn Код:
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(13832) : warning 225: unreachable code
line 13832 is :
pawn Код:
if(GetVehicleModel(vehicleid) == 449){PutPlayerInVehicle(playerid, vehicleid, 0);} // Tram
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

    if(vehicleid == 123) // Switch 123 to your vehicle ID
    {
        if(gTeam[playerid] == TEAM_COP) // or GetPlayerTeam
        {
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            SetPlayerPos(playerid,X+2,Y,Z);
            SendClientMessage(playerid,COLOR_GREY,"You are cop. You must defend this vehicle from stealers!");
            return 1;
        }
        else
        {
            return 1;
        }
    }

    if(GetVehicleModel(vehicleid) == 449){PutPlayerInVehicle(playerid, vehicleid, 0);} // Tram
    //if(GetVehicleModel(vehicleid) == 537){PutPlayerInVehicle(playerid, vehicleid, 0);} // Freight // There are no bugs with trains.
    //if(GetVehicleModel(vehicleid) == 538){PutPlayerInVehicle(playerid, vehicleid, 0);} // Streak // There are no bugs with trains.

    //if(GetVehicleModel(vehicleid) == 570){if(ispassenger == 1){PutPlayerInVehicle(playerid, vehicleid, ispassenger);}} // Streak Carriage // This public doesn't support Carriage's
    //if(GetVehicleModel(vehicleid) == 590){if(ispassenger == 1){PutPlayerInVehicle(playerid, vehicleid, ispassenger);}} // Freibox Carriage // This public doesn't support Carriage's

    if(GetVehicleModel(vehicleid) == 441){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Bandit
    if(GetVehicleModel(vehicleid) == 464){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Baron
    if(GetVehicleModel(vehicleid) == 465){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Raider
    if(GetVehicleModel(vehicleid) == 501){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Goblin
    if(GetVehicleModel(vehicleid) == 564){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Tiger
    if(GetVehicleModel(vehicleid) == 594){PutPlayerInVehicle(playerid, vehicleid, 0);} // RC-Cam
    return 1;
}
PS: I don't think OnPlayerEnterVehicle is called when you try to enter RC vehicles.
Reply


Messages In This Thread
[HELP]CAR MISSION - by [Aka]Dragonu - 03.03.2011, 19:25
Re: [HELP]CAR MISSION - by [Aka]Dragonu - 04.03.2011, 20:38
Re: [HELP]CAR MISSION - by Marricio - 04.03.2011, 20:43
Re: [HELP]CAR MISSION - by [Aka]Dragonu - 04.03.2011, 21:01
Re: [HELP]CAR MISSION - by Marricio - 04.03.2011, 21:09
Re: [HELP]CAR MISSION - by [Aka]Dragonu - 05.03.2011, 06:53
Re: [HELP]CAR MISSION - by Th3Angel - 05.03.2011, 07:08
Re: [HELP]CAR MISSION - by [Aka]Dragonu - 05.03.2011, 07:11
Re: [HELP]CAR MISSION - by [Aka]Dragonu - 05.03.2011, 13:20
Re: [HELP]CAR MISSION - by [Aka]Dragonu - 29.08.2011, 10:20

Forum Jump:


Users browsing this thread: 2 Guest(s)