03.05.2011, 12:51
I've made this function today:
But whenever I uses it,it returns me random lines.
Could anyone help me?
Thanks
pawn Код:
stock GetPlayerBusLine(playerid,line) {
new line;
new PlayerState = GetPlayerState(playerid);
if(playerState == PLAYER_STATE_PASSENGER) {
if(GetPlayerVehicleID(playerid) = Buses[0] || GetPlayerVehicleID(playerid) = Buses[1]) return line = 1;
if(GetPlayerVehicleID(playerid) = Buses[2] || GetPlayerVehicleID(playerid) = Buses[3]) return line = 2;
if(GetPlayerVehicleID(playerid) = Buses[4] || GetPlayerVehicleID(playerid) = Buses[5]) return line = 3;
if(GetPlayerVehicleID(playerid) = Buses[6] || GetPlayerVehicleID(playerid) = Buses[7]) return line = 4;
if(GetPlayerVehicleID(playerid) = Buses[8] || GetPlayerVehicleID(playerid) = Buses[9]) return line = 5;
if(GetPlayerVehicleID(playerid) = Buses[10] || GetPlayerVehicleID(playerid) = Buses[11]) return line = 6;
if(GetPlayerVehicleID(playerid) = Buses[12] || GetPlayerVehicleID(playerid) = Buses[13]) return line = 7;
if(GetPlayerVehicleID(playerid) = Buses[14] || GetPlayerVehicleID(playerid) = Buses[15]) return line = 8;
if(GetPlayerVehicleID(playerid) = Buses[16] || GetPlayerVehicleID(playerid) = Buses[17]) return line = 9;
if(GetPlayerVehicleID(playerid) = Buses[18] || GetPlayerVehicleID(playerid) = Buses[19]) return line = 10;
}
return 1;
}
Could anyone help me?
Thanks