public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective,string[235];
//Überprüfung auf NPCs
if(IsPlayerNPC(playerid)) return 1;
//Fraktionsautohaus
FRAC_OnPlayerStateChange(playerid, newstate, oldstate);
//ITroll
if(newstate == PLAYER_STATE_DRIVER)
{
SetPVarInt(playerid,"VehicleID",GetPlayerVehicleID(playerid));
}
//Spectatesystem
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i != INVALID_PLAYER_ID && !IsPlayerNPC(i) && IsPlayerConnected(i))
{
if(!IsPlayerNPC(i) && GetPlayerState(i) == PLAYER_STATE_SPECTATING && gSpectateID[i] == playerid)
{
if(oldstate == PLAYER_STATE_ONFOOT && (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)) PlayerSpectateVehicle(i,GetPlayerVehicleID(playerid));
else if((oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) && newstate == PLAYER_STATE_ONFOOT) PlayerSpectatePlayer(i,playerid);
}
}
}
//Autohaus
if(oldstate == PLAYER_STATE_DRIVER)
{
SetPVarInt(playerid,"VehicleID",0);
}
//Ordnungsamt Freikauf
if(Abgeschlepptt[vehicleid] == 1 && GetPVarInt(playerid,"BikeAbschleppen") == 0)
{
for(new fc;fc<sizeof(FactionCars);fc++)
{
if(vehicleid == FactionCars[fc][fCarid])
{
if(SpielerInfo[playerid][pFraktion] == FactionCars[fc][fFaction])
{
TogglePlayerControllable(playerid,false);
format(string,sizeof(string),"{FFFFFF}Fahrzeug: {00FFFF}%s\n{FFFFFF}Preis zum Freikaufen: {00FFFF}%i€\n\n{FFFFFF}Grund: {00FFFF}%s",VehicleNames[GetVehicleModel(vehicleid) - 400],AbgeschleppttPreis[vehicleid],FactionCars[fc][fGrund]);
ShowPlayerDialog(playerid,DIALOG_ABGESCHLEPPT,DIALOG_STYLE_MSGBOX,"{FFFFFF}Abgeschlepptes Fahrzeug",string,"Freikaufen","Abbrechen");
return 1;
}
SendClientMessage(playerid,COLOR_RED,"Du bist nicht der Besitzer dieses Fahrzeuges!");
TogglePlayerControllable(playerid,true);
return RemovePlayerFromVehicle(playerid);
}
}
}
//Transporter
if(newstate == PLAYER_STATE_DRIVER && vehicleid == Transporter && GetPVarInt(playerid,"TransporterRaub") == 0)
{
QuestCP2[playerid] = 377;
if(SpielerInfo[playerid][pFraktion] == 8)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2467.1875,-1350.9005,25.4922,5);
}
if(SpielerInfo[playerid][pFraktion] == 9)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2456.2729,-43.8187,26.4898,5);
}
if(SpielerInfo[playerid][pFraktion] == 10)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,-1888.2709,-201.3218,14.8043,5);
}
}
//Anti-Waffen Cheat
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case 592,577,511,512,520,593,553,476,519,460,513,548,425,417,487,488,497,563,447,469: PlayerWeapons[playerid][46]=true;
case 457: PlayerWeapons[playerid][2]=true;
case 596,597,598,599: PlayerWeapons[playerid][25]=true;
case 539: PlayerWeapons[playerid][46]=true;
}
}
//Anti Carchange & Car Vehicle Health & Anti Get-Car
if(newstate == PLAYER_STATE_DRIVER)
{
//Anti Carchange
PlayerEnterTime[playerid] = GetTickCount();
//Motor kaputt
if(MotorKaputt[vehicleid] > 0)
{
SendClientMessage(playerid,COLOR_RED,"Der Motor dieses Fahrzeuges ist kaputt, und kann nur von einem Mechatroniker repariert werden (/service)!");
}
if(Handbremse[vehicleid] > 0 && VehicleStarted[vehicleid] == true)
{
SendClientMessage(playerid,COLOR_RED,"Die Handbremse dieses Fahrzeuges ist noch angezogen, benutze (Taste 'NUM6') um diese zu lösen!");
}
if(VehicleHealth[vehicleid] > 1000.0)
{
VehicleHealth[vehicleid] = 1000.0;
SetVehicleHealthEx(vehicleid, 1000.0);
}
//Postbote
if(SpielerInfo[playerid][pJob] == 8)
{
if(GetPVarInt(playerid,"PostStatus") == 2)
{
if(GetVehicleModel(vehicleid) == 530)
{
ClearChat(playerid);
SendClientMessage(playerid,COLOR_WHITE,"Bitte lagere jetzt 10 Pakete in dein Postwagen, welche du anschließend ausliefern musst!");
SendClientMessage(playerid,COLOR_YELLOW2,"Info: Bitte fahre in den Checkpoint um ein Paket aufzuhebeln!");
SetPVarInt(playerid, "PostStatus",3);
new rand = random(sizeof(PosstCP));
SetPVarInt(playerid, "PostCP", 0);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, PosstCP[rand][0], PosstCP[rand][1], PosstCP[rand][2], 3.0);
PostCP[playerid] = 2;
}
}
if(GetPVarInt(playerid,"PostStatus") == 99)
{
if(GetVehicleModel(vehicleid) == 498)
{
ClearChat(playerid);
SendClientMessage(playerid,COLOR_WHITE,"Bitte trage jetzt die eingelagarten Pakete an die Kunden aus!");
SendClientMessage(playerid,COLOR_YELLOW2,"Info: Wenn du die Pakete schnell austrägst, könnte ein kleines Trinkgeld für dich herrausspringen!");
SetPVarInt(playerid, "PostStatus", 4);
DisablePlayerCheckpoint(playerid);
SetTimerEx("SetPaketCP",3331,false,"i",playerid);
}
}
}
}
if(oldstate == PLAYER_STATE_DRIVER)
{
//Carchange Anticheat
new hack_counter;
if((GetTickCount()-PlayerEnterTime[playerid]) < 220 && GetPVarInt(playerid,"Ban") == 0)
{
hack_counter++;
if(hack_counter >= 3)
{
if(SpielerInfo[playerid][pAdminlevel] > 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
format(string, sizeof(string), "Warnung: %s[%d] ist im Verdacht einen Carchange Cheat zu benutzen!", GetName(playerid), playerid);
SendAdminMessage(COLOR_RED, string);
}
else
{
TogglePlayerControllable(playerid, false);
BannEx(playerid,"Carchange Cheat",999);
SetVehicleToRespawn(vehicleid);
}
return 1;
}
}
else
{
hack_counter = 0;
}
//Taxi System
if(IsATaxi(vehicleid))
{
if(SpielerInfo[playerid][pJob] == 10 && GetPVarInt(playerid,"TaxiStarted") == 1)
{
SetPVarInt(playerid,"TaxiStarted",0);
PlayerTextDrawHide(playerid,Taxometer[playerid][0]);
PlayerTextDrawHide(playerid,Taxometer[playerid][1]);
PlayerTextDrawHide(playerid,Taxometer[playerid][2]);
PlayerTextDrawHide(playerid,Taxometer[playerid][3]);
PlayerTextDrawHide(playerid,Taxometer[playerid][4]);
PlayerTextDrawHide(playerid,Taxometer[playerid][5]);
PlayerTextDrawHide(playerid,Taxometer[playerid][6]);
Delete3DTextLabel(TaxiLabel[vehicleid]);
TaxiLabel[vehicleid] = INVALID_3D_TEXT;
PVehicleUse[vehicleid] = 0;
}
}
//Fahrschule Truckerschein
if(GetPVarInt(playerid, "InTschein") > 0)
{
ClearChat(playerid);
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_RED,"Du hast den Praxis Teil des Truckerscheines leider nicht bestanden, da du das Fahrzeug verlassen hast!");
SendClientMessage(playerid,COLOR_LIGHTRED,"Du hast die Hälfte des Truckerschein Preises zurück bekommen!");
MotorradCP[playerid] = 0;
GivePlayerEuro(playerid,2000);
SetPVarInt(playerid, "InTschein", 0);
SetPVarInt(playerid, "Fehlerpunkte", 0);
if(Truck[playerid] != -1)
{
DestroyVehicleEx(Truck[playerid]);
}
SetPlayerPosEx(playerid,2042.8374,-1885.1302,17.1259);
SetPlayerFacingAngle(playerid,358.7053);
SetPVarInt(playerid,"Fehlerpunkte",0);
Delete3DTextLabel(MotorradLabel[playerid]);
MotorradLabel[playerid] = INVALID_3D_TEXT;
LoadObjekte(playerid);
return 1;
}
//Fahrschule Motorradprüfung
if(GetPVarInt(playerid, "InMschein") > 0)
{
ClearChat(playerid);
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_RED,"Du hast den Praxis Teil des Motorradscheines leider nicht bestanden, da du das Fahrzeug verlassen hast!");
SendClientMessage(playerid,COLOR_LIGHTRED,"Du hast die Hälfte des Motorradschein Preises zurück bekommen!");
MotorradCP[playerid] = 0;
GivePlayerEuro(playerid,1500);
SetPVarInt(playerid, "InMschein", 0);
SetPVarInt(playerid, "Fehlerpunkte", 0);
if(Motorrad[playerid] != -1)
{
DestroyVehicleEx(Motorrad[playerid]);
}
SetPlayerPosEx(playerid,2042.8374,-1885.1302,17.1259);
SetPlayerFacingAngle(playerid,358.7053);
SetPVarInt(playerid,"Fehlerpunkte",0);
Delete3DTextLabel(MotorradLabel[playerid]);
MotorradLabel[playerid] = INVALID_3D_TEXT;
LoadObjekte(playerid);
RemovePlayerAttachedObject(playerid, 9);
return 1;
}
}
//Schein Abfrage
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
//Cuffed
if (GetPVarInt(playerid, "Cuffed") == 1)
{
TogglePlayerWalking(playerid,false);
RemovePlayerAttachedObject(playerid, 0);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
//Führerscheinabfrage
if(spawncar_job[vehicleid] != 90 && spawncar_job[vehicleid] != 101 && QuestWagen[playerid] != vehicleid && SpielerInfo[playerid][pAutoschein] != 1 && !IsABike(vehicleid) && !IsATruck(vehicleid) && !IsAPlane(vehicleid) && !IsABoat(vehicleid) && !IsAFahrrad(vehicleid) && GetPVarInt(playerid, "InFschein") < 1 && GetPVarInt(playerid, "StartDrift") == 0)
{
SetPlayerDrunkLevel(playerid, 25000);
SetPVarInt(playerid,"FDrunk",1);
SendClientMessage(playerid, COLOR_RED, "Du benötigst einen Führerschein um dieses Fahrzeug fahren zu können!");
}
//Flugscheinabfrage
if(SpielerInfo[playerid][pFlugSchein] != 1 && IsAPlane(vehicleid) && GetPVarInt(playerid, "InFlschein") < 1)
{
SetPlayerDrunkLevel(playerid, 25000);
SetPVarInt(playerid,"FDrunk",1);
SendClientMessage(playerid, COLOR_RED, "Du benötigst einen Flugschein um dieses/n Flugzeug(Helikopter) fliegen zu können!");
}
//Truckerschein
if(SpielerInfo[playerid][pTruckerschein] != 1 && IsATruck(vehicleid) && GetPVarInt(playerid, "InTschein") < 1)
{
SetPlayerDrunkLevel(playerid, 25000);
SetPVarInt(playerid,"FDrunk",1);
SendClientMessage(playerid, COLOR_RED, "Du benötigst einen Truckerschein um diesen Truck fahren zu können!");
}
//Bootsschein
if(SpielerInfo[playerid][pBootsSchein] != 1 && IsABoat(vehicleid) && GetPVarInt(playerid, "InBschein") < 1)
{
SetPlayerDrunkLevel(playerid, 25000);
SetPVarInt(playerid,"FDrunk",1);
SendClientMessage(playerid, COLOR_RED, "Du benötigst einen Bootschein um dieses Boot fahren zu können!");
}
//Motorradschein
if(SpielerInfo[playerid][pMotorradschein] != 1 && IsABikex(vehicleid) && GetPVarInt(playerid, "InMschein") < 1 && !IsAFahrrad(vehicleid) && vehicleid != StadiumCycle)
{
SetPlayerDrunkLevel(playerid, 25000);
SetPVarInt(playerid,"FDrunk",1);
SendClientMessage(playerid, COLOR_RED, "Du benötigst einen Motorradschein um dieses Motorrad fahren zu können!");
}
//Fahrschul Praxis Prüfung Beginn
//Fahrschul Autos
if(spawncar_job[vehicleid] == 90 && GetPVarInt(playerid,"InFschein") == 1)
{
ClearChat(playerid);
SetPVarInt(playerid, "SWarnungen",0);
SendClientMessage(playerid, COLOR_WHITE, "Herzlich Willkommen beim Führerschein Praxis Test!");
SendClientMessage(playerid, COLOR_WHITE, "Fahre nun die Checkpoints ab und folge den weiteren Instruktionen!");
SendClientMessage(playerid, COLOR_WHITE, "Solltest du aussteigen oder sterben hast du den Praxis Test leider nicht bestanden!");
SendClientMessage(playerid, COLOR_LIGHTRED, "INFO: Achte auf deine Geschwindigkeit, und deinen Fahrzeugzustand!");
SetVehicleLock(vehicleid, 1);
DisablePlayerCheckpoint(playerid);
QuestCP2[playerid] = 0;
SetPVarInt(playerid,"YEAH",0);
FscheinCP[playerid] = 1;
SetPlayerCheckpoint(playerid, Fahrschule1[0][0],Fahrschule1[0][1],Fahrschule1[0][2], 3.0);
}
//BikeAbschleppen
if(newstate == PLAYER_STATE_ONFOOT)
{
if(GetPVarInt(playerid,"BikeAbschleppen") == 1)
{
ResetVehicleSpeedMax(vehicleid);
SetPVarInt(playerid, "BikeAbschleppen", 0);
if(VehicleStarted[vehicleid] == true)
{
VehicleStarted[vehicleid] = false;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
}
}
}
//Kickstart
if(IsPlayerRacing[playerid] == 1)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && IsOnBike[playerid] == 1 && !IsPlayerInAnyVehicle(playerid))
{
GameTextForPlayer(playerid, "~r~Begebe dich zurück auf dein Motorrad!", 999999, 4);
IsOnBike[playerid] = 0;
IsFallenOffBike[playerid] = 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerInAnyVehicle(playerid))
{
if(vehicleid != INVALID_VEHICLE_ID && vehicleid == StadiumCycle && HasToGetOnBike[playerid] == 1)
{
IsOnBike[playerid] = 1;
GameTextForPlayer(playerid, " ", 100, 4);
HasToGetOnBike[playerid] = 0;
StartGame(playerid);
}
if(vehicleid != INVALID_VEHICLE_ID && vehicleid == StadiumCycle && IsFallenOffBike[playerid] == 1)
{
IsFallenOffBike[playerid] = 0;
IsOnBike[playerid] = 1;
GameTextForPlayer(playerid, " ", 100, 4);
}
}
}
//Piloten Job Flugzeuge
if(spawncar_job[vehicleid] == 212)
{
if(SpielerInfo[playerid][pJob] != 12)
{
SendClientMessage(playerid,COLOR_RED,"Du bist kein Pilot!");
TogglePlayerControllable(playerid, false);
TogglePlayerControllable(playerid, true);
}
if(GetVehicleModel(vehicleid) == 592 && SpielerInfo[playerid][pPilotenRank] < 75)
{
SendClientMessage(playerid,COLOR_RED,"Du benötigst mind. Pilotenrank 6 um dieses Flugzeug fliegen zu können!");
TogglePlayerControllable(playerid, false);
TogglePlayerControllable(playerid, true);
}
if(GetVehicleModel(vehicleid) == 577 && SpielerInfo[playerid][pPilotenRank] < 60)
{
SendClientMessage(playerid,COLOR_RED,"Du benötigst mind. Pilotenrank 5 um dieses Flugzeug fliegen zu können!");
TogglePlayerControllable(playerid, false);
TogglePlayerControllable(playerid, true);
}
if(GetVehicleModel(vehicleid) == 553 && SpielerInfo[playerid][pPilotenRank] < 45)
{
SendClientMessage(playerid,COLOR_RED,"Du benötigst mind. Pilotenrank 4 um dieses Flugzeug fliegen zu können!");
TogglePlayerControllable(playerid, false);
TogglePlayerControllable(playerid, true);
}
if(GetVehicleModel(vehicleid) == 519 && SpielerInfo[playerid][pPilotenRank] < 30)
{
SendClientMessage(playerid,COLOR_RED,"Du benötigst mind. Pilotenrank 3 um dieses Flugzeug fliegen zu können!");
TogglePlayerControllable(playerid, false);
TogglePlayerControllable(playerid, true);
}
if(GetVehicleModel(vehicleid) == 511 && SpielerInfo[playerid][pPilotenRank] < 15)
{
SendClientMessage(playerid,COLOR_RED,"Du benötigst mind. Pilotenrank 2 um dieses Flugzeug fliegen zu können!");
TogglePlayerControllable(playerid, false);
TogglePlayerControllable(playerid, true);
}
}
}
//Taxisystem
if(newstate == PLAYER_STATE_PASSENGER)
{
if(IsATaxi(vehicleid))
{
new driver = GetVehicleDriver(vehicleid);
if(GetPVarInt(driver,"TaxiStarted") == 1)
{
if((GetPlayerEuros(playerid) - GetPVarInt(driver,"TaxiDienstpreis")) < 0)
{
SendClientMessage(playerid,COLOR_LIGHTRED,"Du hast nicht genügend Geld um eine Taxifahrt bezahlen zu können!");
return RemovePlayerFromVehicleEx(playerid);
}
TaxiFahrPreis[playerid] = 0;
PlayerTextDrawShow(playerid,Taxometer[playerid][7]);
PlayerTextDrawSetString(playerid,Taxometer[playerid][7],"Aktueller Fahrpreis: 0 Euro");
format(string,sizeof(string),"Du bist in das Taxi von %s eingestiegen! Dienstpreis : %i€ (Dienstpreis + Fahrzeit alle 15 Sekunden)",GetRoleplayName(driver),GetPVarInt(driver,"TaxiDienstpreis"));
SendClientMessage(playerid,COLOR_WHITE,string);
format(string,sizeof(string),"%s ist in deinem Taxi eingestiegen! Dienstpreis : %i€ (Dienstpreis + Fahrzeit alle 15 Sekunden)",GetRoleplayName(playerid),GetPVarInt(driver,"TaxiDienstpreis"));
SendClientMessage(driver,COLOR_WHITE,string);
TaxiSitzplatz[playerid] = GetPlayerVehicleSeat(playerid);
TaxiTimer[playerid] = SetTimerEx("TaxometerTimer",753,true,"ii",playerid,driver);
TaxiPause[playerid] = gettime() + (1*15);
switch(GetPlayerVehicleSeat(playerid))
{
case 1:
{
format(string,sizeof(string),"%s(%iEuro)",SpielerInfo[playerid][pName],TaxiFahrPreis[playerid]);
PlayerTextDrawSetString(driver,Taxometer[driver][3],string);
}
case 2:
{
format(string,sizeof(string),"%s(%iEuro)",SpielerInfo[playerid][pName],TaxiFahrPreis[playerid]);
PlayerTextDrawSetString(driver,Taxometer[driver][4],string);
}
case 3:
{
format(string,sizeof(string),"%s(%iEuro)",SpielerInfo[playerid][pName],TaxiFahrPreis[playerid]);
PlayerTextDrawSetString(driver,Taxometer[driver][5],string);
}
}
}
}
}
//Enforcer System
if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 427)
{
SetPlayerPosEx(playerid, 4057.1682,-1387.4664,224.0423);
SetPlayerFacingAngle(playerid, 179.0557);
LoadObjekte(playerid);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 10);
InForcer[playerid] = GetPlayerVehicleID(playerid);
SetPlayerVirtualWorld(playerid,GetPlayerVehicleID(playerid));
}
//Betrunken Autofahren
if(newstate == PLAYER_STATE_DRIVER && GetPlayerDrunkLevel(playerid) > 1999 && high[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"Du bist betrunken, du solltest besser nicht Auto fahren!");
}
//Questsystem
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
{
if(SpielerInfo[playerid][pGameIntro] == 1)
{
QuestCP[2][playerid] = CreateDynamicCP(-106.0668,-1572.1654,2.6172, 2, 2, 0, playerid,800.0);
}
}
//Motor Nachricht
if(IsPlayerInAnyVehicle(playerid) && VehicleStarted[vehicleid] == false && MotorKaputt[vehicleid] == 0 && !IsAFahrrad(vehicleid) && newstate != PLAYER_STATE_PASSENGER && Tankmenge[GetPlayerVehicleID(playerid)] >= 1 && GangAutoHausAuto[GetPlayerVehicleID(playerid)] == 0)
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine != VEHICLE_PARAMS_ON)
{
SendClientMessage(playerid,COLOR_YELLOW,"Der Motor deines Fahrzeuges ist aus, bitte starte diesen. (Taste [W] 3 Sekunden lang gedrückt halten)");
return 1;
}
}
//Tanksystem
if(GetPVarInt(playerid, "TankTimer") == 1 && oldstate == PLAYER_STATE_DRIVER)
{
KillTimer(ITankTimer[playerid]);
SetPVarInt(playerid,"TankTimer",0);
}
//Speedometer
if(newstate == PLAYER_STATE_DRIVER)
{
if(VehicleStarted[GetPlayerVehicleID(playerid)] == true)
{
ShowSpeedoMeter(playerid);
UpdateSpeedometer(playerid);
}
}
//Hide Speedometer
if(newstate == PLAYER_STATE_ONFOOT)
{
new keys,ud,lr;
HideSpeedoMeter(playerid);
GetPlayerKeys(playerid,keys,ud,lr);
if(keys & KEY_SPRINT)
{
GameTextForPlayer(playerid, "", 2000, 5);
}
}
//Helmsystem
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
if(IsAHelmBike(GetPlayerVehicleID(playerid)) && SpielerInfo[playerid][pHelm] != -1 && GetPVarInt(playerid, "Helm") == 0)
{
SetPlayerHelm(playerid);
}
}
if(oldstate == PLAYER_STATE_PASSENGER && newstate != PLAYER_STATE_PASSENGER && SpielerInfo[playerid][pHelm] >= 0 && GetPVarInt(playerid, "Helm") == 1 && GangAutoHausAuto[GetPlayerVehicleID(playerid)] == 0)
{
RemovePlayerHelm(playerid);
SetPVarInt(playerid, "Helm", 0);
SpielerInfo[playerid][pHelmStatus] --;
if(SpielerInfo[playerid][pHelmStatus] == 0)
{
SendClientMessage(playerid,COLOR_WHITE,"Dein Helm ist wegen zu vielen Stürzen kaputt gegangen!");
SpielerInfo[playerid][pHelm] = -1;
}
}
if(oldstate == PLAYER_STATE_DRIVER && newstate != PLAYER_STATE_DRIVER && SpielerInfo[playerid][pHelm] >= 0 && GetPVarInt(playerid, "Helm") == 1)
{
RemovePlayerHelm(playerid);
SetPVarInt(playerid, "Helm", 0);
SpielerInfo[playerid][pHelmStatus] --;
if(SpielerInfo[playerid][pHelmStatus] == 0)
{
SendClientMessage(playerid,COLOR_WHITE,"Dein Helm ist wegen zu vielen Stürzen kaputt gegangen!");
SpielerInfo[playerid][pHelm] = -1;
}
//Autoradio
if(SpielerInfo[playerid][pARadio] == 0)
{
TextDrawHideForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
}
}
//Cuffed
if(oldstate == PLAYER_STATE_PASSENGER)
{
if (GetPVarInt(playerid, "Cuffed") == 1)
{
TogglePlayerWalking(playerid,true);
SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_CUFFED);
}
}
//Bussystem
if(newstate == PLAYER_STATE_PASSENGER)
{
if(IsABus(vehicleid))
{
if(SpielerInfo[playerid][pTicket] == 0)
{
Schwarzz[playerid] = SetTimerEx("Schwarzfahren",40063,false,"i",playerid);
ShowPlayerDialog(playerid, DIALOG_TICKET, DIALOG_STYLE_LIST, "{FFFFFF}Welches Busticket möchtest du kaufen?","{007DFF}1.{FFFFFF}Kurzstrecken Ticket (25€)\n{007DFF}2.{FFFFFF}Tages Ticket (100€)\n{007DFF}3.{FFFFFF}Monats Ticket (500€)", "Kaufen", "Abbrechen");
}
}
}
//Radio System
if(SpielerInfo[playerid][pARadio] == 0)
{
if(!IsAFahrrad(vehicleid) && GangAutoHausAuto[GetPlayerVehicleID(playerid)] == 0 && GetVehicleModel(vehicleid) != 525)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER && IsPlayerInAnyVehicle(playerid))
{
new playingid = v_VehicleInfo[vehicleid][RadioPlaying];
#if USE_TEXTDRAW_SET == 2
format(string,sizeof(string),"Aktuelle Radiostation: ~n~~w~%s",r_RadioInfo[playingid][r_Name]);
TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],string);
#else
TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],r_RadioInfo[playingid][r_Name]);
#endif
if(GetPVarInt(playerid,"InGangZone") == 0)
{
TextDrawShowForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
}
SetPVarInt(playerid,"ID_HideRadioTextdraw",SetTimerEx("HideRadioTextdraw",TEXTDRAW_DISAPPEAR_TIME,false,"ii",playerid,vehicleid));
PlayAudioStreamForPlayerEx(playerid,r_RadioInfo[playingid][r_Link]);
SetPVarInt(playerid,"ID_OldVehicle",vehicleid);
return 1;
}
if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
{
new vehicleidd = GetPVarInt(playerid,"ID_OldVehicle"),
timer = GetPVarInt(playerid,"ID_HideRadioTextdraw");
if(timer != 255)
{
TextDrawHideForPlayer(playerid,v_VehicleInfo[vehicleidd][r_Draw]);
KillTimer(timer);
}
StopAudioStreamForPlayer(playerid);
}
}
}
return 1;
}