public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(LVPDCars); i++)
{
if(GetPlayerVehicleID(playerid) == LVPDCars[i])
{
if(sInfo[playerid][fraktion] == 2)
{
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "Du bist kein Polizist");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
}
if(oldstate == PLAYER_STATE_DRIVER)
{
TextDrawHideForPlayer(playerid, Textdraw7[playerid]);
}
if(oldstate==PLAYER_STATE_DRIVER)
{
PlayerTextDrawHide(playerid, Textdraw8[playerid]);
}
if(oldstate == PLAYER_STATE_DRIVER)
{
PlayerTextDrawHide(playerid, Textdraw9[playerid]);
}
if(oldstate==PLAYER_STATE_DRIVER)
{
PlayerTextDrawHide(playerid, Textdraw10[playerid]);
}
if(oldstate == PLAYER_STATE_DRIVER)
{
PlayerTextDrawHide(playerid, Textdraw11[playerid]);
}
if(oldstate==PLAYER_STATE_DRIVER)
{
PlayerTextDrawHide(playerid, Textdraw12[playerid]);
}
if(oldstate==PLAYER_STATE_DRIVER)
{
PlayerTextDrawHide(playerid, Textdraw13[playerid]);
}
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(MedicalCars); i++)
{
if(GetPlayerVehicleID(playerid) == MedicalCars[i])
{
if(sInfo[playerid][fraktion] == 15)
{
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "Du bist kein Sanitäter");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(OrdnungsAmtCars); i++)
{
if(GetPlayerVehicleID(playerid) == OrdnungsAmtCars[i])
{
if(sInfo[playerid][fraktion] == 5)
{
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "Du bist kein Mitglied des Ordnungsamtes");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(HitmanCars); i++)
{
if(GetPlayerVehicleID(playerid) == HitmanCars[i])
{
if(sInfo[playerid][fraktion] == 7)
{
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "Du bist kein Hitman");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
}
new w = GetPlayerWeapon(playerid);
if((newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER) && w != 25 && w != 29 && w != 30 && w != 31) SetPlayerArmedWeapon(playerid, 0);
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(SanNewsCars); i++)
{
if(GetPlayerVehicleID(playerid) == SanNewsCars[i])
{
if(sInfo[playerid][fraktion] == 6)
{
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "Du bist kein Mitglied der San News");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(Busse); i++)
{
if(GetPlayerVehicleID(playerid) == Busse[i])
{
if(sInfo[playerid][beruf] == 0)
{
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "Du bist kein Busfahrer");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
//tacho textdraw
TextDrawShowForPlayer(playerid, Textdraw6);
TextDrawShowForPlayer(playerid, Textdraw7[playerid]);
PlayerTextDrawShow(playerid, Textdraw8[playerid]);
PlayerTextDrawShow(playerid, Textdraw9[playerid]);
PlayerTextDrawShow(playerid, Textdraw10[playerid]);
PlayerTextDrawShow(playerid, Textdraw11[playerid]);
PlayerTextDrawShow(playerid, Textdraw12[playerid]);
PlayerTextDrawShow(playerid, Textdraw13[playerid]);
return 1;
}
if(newstate==PLAYER_STATE_DRIVER)
{
new vID=GetPlayerVehicleID(playerid);
new vModel=GetVehicleModel(vID);
for(new i=0; i<sizeof(autosOhneMotor); i++)
{
if(autosOhneMotor[i]!=vModel)continue;
new tmp_engine,
tmp_lights,
tmp_alarm,
tmp_doors,
tmp_bonnet,
tmp_boot,
tmp_objective;
//Motor an/ausschalten
GetVehicleParamsEx(vID, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
SetVehicleParamsEx(vID, 1, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
}
for(new i=0; i<sizeof(ahCars); i++)
{
if(ahCars[i][id_x]!=vID)continue;
//Verkaufsprozess
SetPVarInt(playerid,"buyCarID",i);
new string[256];
format(string,sizeof(string),"Möchten sie das Fahrzeug für %i$ kaufen?",ahCars[i][c_preis]);
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_STYLE_MSGBOX,"Autoverkauf",string,"Ja","Nein");
break;
}
return 1;
}
return 1;
}