Function OnPlayerStateChange(playerid, newstate, oldstate)
{
FRAC_OnPlayerStateChange(playerid, newstate, oldstate);
new string[256];
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
for(new p=0;p<MAX_PLAYERS;p++)
{
if(GetPlayerVehicleSeat(playerid) == 0 && GetPlayerVehicleID(playerid) == acar [p])
{
if(PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pSupporter] == 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Du kannst keine Supporter Fahrzeuge fahren.");
}
}
}
if(IsABike(GetPlayerVehicleID(playerid)))
{
switch(GetPlayerSkin(playerid))
{
#define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
case 0, 65, 74, 149, 208, 273: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
}
}
}
else
{
RemovePlayerAttachedObject(playerid, SLOT);
}
if(oldstate == PLAYER_STATE_ONFOOT && (newstate == PLAYER_STATE_DRIVER))
{
new SName[MAX_PLAYER_NAME]; GetPlayerName(playerid,SName,MAX_PLAYER_NAME);
SetPlayerArmedWeapon(playerid,0);
if(EnterLockedV[playerid] <= 0)return 1;
if(EnterLockedV[playerid] == GetPlayerVehicleID(playerid))return SCMToAllF(Rot,"Spieler '%s' wurde vom Server gekickt. Grund: Enter locked Vehicle!",SName);
}
if((newstate == PLAYER_STATE_ONFOOT) && ((oldstate == PLAYER_STATE_DRIVER)))
{
for(new j=0; j<11; j++) GivePlayerWeaponEx(playerid, Weapons[playerid][j], Ammo[playerid][j]);
return 1;
}
printf("newstate = %d / playerid: %d", newstate, playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
printf("in");
for(new j=0; j<11; j++) GetPlayerWeaponData(playerid, j, Weapons[playerid][j], Ammo[playerid][j]);
ResetPlayerWeapons(playerid);
new vid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
printf("engine: %d", engine);
if(engine == VEHICLE_PARAMS_OFF)
{
SendClientMessage(playerid,COLOR_PURPLE2,"Der Motor ist Ausgeschaltet, drücke die STRG Taste um den Motor zu starten.");
}
}
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
new Weap[2];
GetPlayerWeaponData(playerid, 4, Weap[0], Weap[1]);
SetPlayerArmedWeapon(playerid, Weap[0]);
}
if(newstate==PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
{
if(PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24)
{
IsTowTrucker[playerid]=1;
TowTruckers++;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"*Nutze die Strg Taste, um ein Auto abzuschleppen.");
}
}
}
else if(TowTruckers > 0 && newstate == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, COLOR_YELLOW4, "Wenn Probleme auftreten ruf den Ordnungstienst mit /noamt.");
}
else if(newstate == PLAYER_STATE_ONFOOT &&(IsTowTrucker[playerid] == 1))
{
IsTowTrucker[playerid] = 0;
TowTruckers--;
}
else if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 417)
{
SetPlayerPosEx(playerid, 1261.269,-803.480,1185.830);
SetPlayerFacingAngle(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
InLevi[playerid] = GetPlayerVehicleID(playerid);
}
else if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 548)
{
SetPlayerPosEx(playerid, 89.773613, 2027.749756, 2865.647705);
SetPlayerFacingAngle(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
InCargo[playerid] = GetPlayerVehicleID(playerid);
}
else if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 427 && IsACop(playerid))
{
SetPlayerPosEx(playerid, 260.4671,118.6456,1029.7023);
SetPlayerFacingAngle(playerid, 178.6620);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 3);
InEnfo[playerid] = GetPlayerVehicleID(playerid);
}
else if(newstate == PLAYER_STATE_PASSENGER && PlayerInfo[playerid][pJailed] > 0 && !IsAPlane(GetPlayerVehicleID(playerid)))
{
FreezePlayer(playerid);
UnFreezePlayer(playerid);
}