Hallo Breadfisher,
Ich habe zum ersten diese Frage:
Ein Carrespawn der Nur die Autos respawnt, in denen niemand sitzt.
Ich habe bisher das hier, funktioniert aber nicht.
public respawn1()
{
for(new car=0; car<CAR_AMOUNT; car++)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInVehicle(i,car))
{
SetVehicleToRespawn(car);
}
}
}
}
Außerdem möchte ich wissen wie ich solche autos abfragen kann.
Ich habe bisher das:
Ganz oben
new mafiacar[20];
OnGameModeInit
mafiacar[0] = AddStaticVehicleEx(461,-2126.8042,-198.2708,35.1260,178.7568,0,0,120); // PCJ-600
mafiacar[1] = AddStaticVehicleEx(461,-2123.2434,-198.3822,35.1274,178.0929,0,0,120); // PCJ-600
mafiacar[2] = AddStaticVehicleEx(461,-2119.2800,-198.4120,34.9782,180.0665,0,0,120); // PCJ-600
mafiacar[3] = AddStaticVehicleEx(461,-2115.1516,-198.3057,34.9784,180.8700,0,0,120); // PCJ-600
mafiacar[4] = AddStaticVehicleEx(560,-2110.9583,-198.6398,35.0467,181.0719,0,0,120); // Sultan
mafiacar[5] = AddStaticVehicleEx(560,-2106.4497,-198.6165,35.0455,179.8409,0,0,120); // Sultan
mafiacar[6] = AddStaticVehicleEx(565,-2102.7234,-198.2435,34.9448,179.0478,0,0,120); // Flash
mafiacar[7] = AddStaticVehicleEx(565,-2099.1660,-198.2727,34.9448,179.8367,0,0,120); // Flash
mafiacar[8] = AddStaticVehicleEx(602,-2146.5298,-185.7304,35.0255,270.2766,0,0,120); // Alpha
mafiacar[9] = AddStaticVehicleEx(602,-2146.2710,-189.6474,35.0252,270.5887,0,0,120); // Alpha
mafiacar[10] = AddStaticVehicleEx(559,-2146.2283,-194.0125,34.9766,270.1035,0,0,120); // Jester
mafiacar[11] = AddStaticVehicleEx(559,-2146.1184,-198.1598,34.9767,270.0538,0,0,120); // Jester
mafiacar[12] = AddStaticVehicleEx(447,-2108.0471,-248.2785,35.4969,359.5152,0,0,120); // Sparrow
mafiacar[13] = AddStaticVehicleEx(447,-2119.3010,-248.2973,35.4973,356.4030,0,0,120); // Sparrow
mafiacar[14] = AddStaticVehicleEx(487,-2107.7427,-228.8056,35.4959,359.7357,0,0,120); // Maverick
mafiacar[15] = AddStaticVehicleEx(487,-2117.8132,-228.0952,35.4972,359.1709,0,0,120); // Maverick
mafiacar[16] = AddStaticVehicleEx(589,-2134.6343,-226.7227,35.4439,269.9948,0,0,120); // Club
mafiacar[17] = AddStaticVehicleEx(589,-2134.4541,-230.8558,35.4404,269.2176,0,0,120); // Club
mafiacar[18] = AddStaticVehicleEx(589,-2134.3525,-235.0373,35.4408,270.7840,0,0,120); // Club
mafiacar[19] = AddStaticVehicleEx(589,-2134.0134,-239.1152,35.4415,270.6306,0,0,120); // Club
OnPlayerStateChange
for(new pol = 0;pol<27;pol++)
if(GetPlayerVehicleID(playerid) == policecar[pol])
{
if(gTeam[playerid] == TEAM_POLICE || adminlebencheck[playerid] == 1)
{
return 1;
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,rot,"Fehler: Du bist nicht Teil der Polizei");
return 1;
}
}
Es funktioniert nur leider nicht.
Man kann trotzdem mit jedem Auto fahren.
Und ich möchte eigentlich nicht direkt über if(vehicleid == xyz) gehn.
Dachte, so kann man das auch irgentwie lösen.
Bzw. kann man überhaupt mit einem array[] die vehicle abfragen ?