public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate==PLAYER_STATE_DRIVER)
{
new vID=GetPlayerVehicleID(playerid);
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;
}
}
}
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);
}
return 1;
}
return 1;
}
Kompeiler stürzt ab?