zu 1 kann ich dir ein teil helfen. wie er aber vor dem auto stehen bleibt und die tür abgeschlossen ist weiß ich nicht.
new sfpdauto[26];
OnGameModeInit() //OnFilterScriptInit()
{
// ______SFPD______
//Police Car
sfpdauto[0] = CreateVehicle(597, -1616.3781,749.7031, -5.2422,179.6711, 86, 1, 800);
sfpdauto[1] = CreateVehicle(597, -1604.5389,749.7536, -5.2422,173.0910, 86, 1, 800);
sfpdauto[2] = CreateVehicle(597, -1612.8207, 750.2399, -5.4740, 180.0729, 86, 1, 800);
sfpdauto[3] = CreateVehicle(597, -1608.3560,750.2009, -5.4736,180.3843, 86, 1, 800);
sfpdauto[4] = CreateVehicle(597, -1600.4595,750.4750, -5.4728,180.6400, 86, 1, 800);
sfpdauto[5] = CreateVehicle(597, -1596.3026,750.1548, -5.4718,181.7798, 86, 1,800);
sfpdauto[6] = CreateVehicle(597, -1592.1467,750.4123, -5.4730, 179.6615, 86, 1, 800);
sfpdauto[7] = CreateVehicle(597, -1588.1224, 750.5228, -5.4746, 177.7831, 86, 1, 800);
sfpdauto[8] = CreateVehicle(597, -1584.0654, 750.5484, -5.4735,180.7048, 86, 1, 800);
sfpdauto[9] = CreateVehicle(597, -1580.0497, 750.3355, -5.4797, 180.3170, 86, 1, 800);
//Police Heli
sfpdauto[10] = CreateVehicle(497, -1679.5835, 705.9642, 30.6016, 95.7204, 86, 1, 800);
//Police Spezial
sfpdauto[11] = CreateVehicle(601, -1623.3063, 649.8629, -5.4733, 90.1021, 0, 1, 800);
sfpdauto[12] = CreateVehicle(528, -1622.8436, 653.5638, -5.4723, 90.5839, 0, 1, 800);
sfpdauto[13] = CreateVehicle(427, -1639.8529, 649.9787, -5.4765, 269.3743, 86, 1, 800);
sfpdauto[14] = CreateVehicle(427, -1639.0969 ,657.9473, -5.4834, 270.2426, 86, 1, 800);
sfpdauto[15] = CreateVehicle(427, -1639.7167, 666.2165, -5.4834, 268.7720, 86, 1, 800);
//Ranger
sfpdauto[16] = CreateVehicle(599, -1640.3381, 674.0170, -5.1987, 269.2324, 86, 1, 800);
sfpdauto[17] = CreateVehicle(599, -1640.2942, 678.0220, -5.1998, 270.1458, 86, 1, 800);
sfpdauto[18] = CreateVehicle(599, -1640.4838, 682.0898, -5.2004 ,270.3937, 86, 1, 800);
sfpdauto[19] = CreateVehicle(599, -1640.7704, 686.4244, -5.1992, 269.1693, 86, 1, 800);
//Mopeds
sfpdauto[20] = CreateVehicle(586, -1573.9181, 706.4676, -5.4727, 88.8371, 86, 1, 800);
sfpdauto[21] = CreateVehicle(586, -1573.2808, 709.9452, -5.4731, 88.8948, 86, 1, 800);
sfpdauto[22] = CreateVehicle(586, -1573.7507, 713.9541, -5.4733, 90.9377, 86, 1, 800);
sfpdauto[23] = CreateVehicle(586, -1573.5592, 718.4440, -5.4714, 88.5575, 86, 1, 800);
//Speedcars
sfpdauto[24] = CreateVehicle(506, -1616.5947, 733.3229, -5.4716 ,359.0839 ,0 , 0, 800);
sfpdauto[25] = CreateVehicle(415, -1612.3861, 732.8743, -5.4734, 0.1733, 0, 0, 800);
return 1;
}
//ich hoffe so klappt es, habs bisher nur mit AddStaticVehicle gemacht..
public OnPlayerStateChange(playerid, newstate, oldstate) // wenn er am steuer sitzt..
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
for(new j = 0;j<sizeof sfpdauto;j++)
{
if(vehicleid == sfpdauto[j])
{
if(gTeam[playerid] == TEAM_SFPD)
{
}
else
{
SendClientMessage(playerid,ROT,"Du besitzt keinen Schlüssel für dieses Auto!");
RemovePlayerFromVehicle(playerid); //hier wird der dann rausgeschmissen.
}
}
}
}
return 1;
}
//so wolltest du es ja nicht.. somit kann ich dur nur zum teil helfen:
OnPlayerEnterVehicle(..)
{
for(new j = 0;j<sizeof sfpdauto;j++)
{
if(vehicleid == sfpdauto[j])
{
if(gTeam[playerid] == TEAM_SFPD)
{
}
else
{
SendClientMessage(playerid,ROT,"Du besitzt keinen Schlüssel für dieses Auto!");
//das er stehen bleibt und die tüt net aufgeht...
}
}
}
return 1;
}