Tach.
Mein Problem liegt darin, dass mache Spieler in die Fraktionscars einsteigen können und mance nicht.
Hier ist der Code:
Code
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new playerState = GetPlayerState(playerid);
if(playerState == PLAYER_STATE_DRIVER)
{
GetVehiclePos(vehicleid,fahrzeugPos[vehicleid][f_x],fahrzeugPos[vehicleid][f_y],fahrzeugPos[vehicleid][f_z]);
GetVehicleZAngle(vehicleid,fahrzeugPos[vehicleid][f_a]);
for(new i=0; i<sizeof(lspdCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != lspdCars[i])continue;
if(sInfo[playerid][fraktion] == 1)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(fbiCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != fbiCars[i])continue;
if(sInfo[playerid][fraktion] == 2)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(armyCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != armyCars[i])continue;
if(sInfo[playerid][fraktion] == 3)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(samdCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != samdCars[i])continue;
if(sInfo[playerid][fraktion] == 4)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(towingCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != towingCars[i])continue;
if(sInfo[playerid][fraktion] == 5)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(groveCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != groveCars[i])continue;
if(sInfo[playerid][fraktion] == 6)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(ballasCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != ballasCars[i])continue;
if(sInfo[playerid][fraktion] == 7)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(rifaCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != rifaCars[i])continue;
if(sInfo[playerid][fraktion] == 8)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(triadenCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != triadenCars[i])continue;
if(sInfo[playerid][fraktion] == 9)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(mafiaCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != mafiaCars[i])continue;
if(sInfo[playerid][fraktion] == 10)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(bikerCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != bikerCars[i])continue;
if(sInfo[playerid][fraktion] == 11)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
for(new i=0; i<sizeof(terrorCars); i++)
{
if(!IsVehicleStreamedIn(i, playerid))continue;
if(vehicleid != terrorCars[i])continue;
if(sInfo[playerid][fraktion] == 12)continue;
freezePlayer(playerid,1);
freezePlayer(playerid,0);
}
}
return 1;
}
Alles anzeigen
Vielleicht übersehe ich etwas.
Ich hoffe ihr könnt mir helfen.
Danke im Vorraus!
Mit freundlichen Grüßen MoritzF.