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.