Hier ein mal der Dialog zum Kaufen für das Numernschild
new sform[128];
if(dialogid == DIAG_KAUFEN)
{
if(response)
{
for(new i = 1;i<MAX_AUTOS;i++)
{
format(sform,sizeof sform,"auto_%d",i);
if(!djIsSet(F_DATEI,sform))
{
new preis_veh;
for(new a = 0;a<sizeof(ShowCars);a++)
{
if(ShowCars[a][v_id] == GetPlayerVehicleID(playerid))
{
preis_veh = ShowCars[a][preis];
}
}
if(GetPlayerMoney(playerid) < preis_veh)
{
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
return SendClientMessage(playerid,COLOR_WARN,"Du hast zu wenig Geld!");
}
new Float:bx,Float:by,Float:bz,Float:ba,found = 0;
for(new j = 0;j<sizeof(show_ausgang_range);j++)
{
if(IsPlayerInRangeOfPoint(playerid,60.0,show_ausgang_range[j][0],show_ausgang_range[j][1],show_ausgang_range[j][2]))
{
if(!found)
{
bx = Fahrzeug_Spawn[j][0];
by = Fahrzeug_Spawn[j][1];
bz = Fahrzeug_Spawn[j][2];
ba = Fahrzeug_Spawn[j][3];
found = 1;
}
}
}
if(!found)
{
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
return SendClientMessage(playerid,COLOR_WARN,"Dieses Auto ist zu weit vom Händler entfernt!");
}
format(sform,sizeof sform,"auto_%d/model",i);
djSetInt(F_DATEI,sform,GetVehicleModel(GetPlayerVehicleID(playerid)));
format(sform,sizeof sform,"auto_%d/x",i);
djSetFloat(F_DATEI,sform,bx);
format(sform,sizeof sform,"auto_%d/y",i);
djSetFloat(F_DATEI,sform,by);
format(sform,sizeof sform,"auto_%d/z",i);
djSetFloat(F_DATEI,sform,bz);
format(sform,sizeof sform,"auto_%d/a",i);
djSetFloat(F_DATEI,sform,ba);
format(sform,sizeof sform,"auto_%d/key",i);
djSet(F_DATEI,sform,Spielername(playerid));
format(sform,sizeof sform,"auto_%d/farbe1",i);
djSetInt(F_DATEI,sform,-1);
format(sform,sizeof sform,"auto_%d/farbe2",i);
djSetInt(F_DATEI,sform,-1);
new reget[4];
GetVehicleDamageStatus(GetPlayerVehicleID(playerid),reget[0],reget[1],reget[2],reget[3]);
format(sform,sizeof sform,"auto_%d/teile",i);
djSetInt(F_DATEI,sform,reget[0]);
format(sform,sizeof sform,"auto_%d/tueren",i);
djSetInt(F_DATEI,sform,reget[1]);
format(sform,sizeof sform,"auto_%d/lichter",i);
djSetInt(F_DATEI,sform,reget[2]);
format(sform,sizeof sform,"auto_%d/reifen",i);
djSetInt(F_DATEI,sform,reget[3]);
PlayerAuto[i][vmodel] = GetVehicleModel(GetPlayerVehicleID(playerid));
new showCar_get = getShowCarID(GetPlayerVehicleID(playerid));
PlayerAuto[i][v_xc] = (bx);
PlayerAuto[i][v_yc] = (by);
PlayerAuto[i][v_zc] = (bz);
PlayerAuto[i][v_ac] = (ba);
PlayerAuto[i][n_xx] = (bx);
PlayerAuto[i][n_yy] = (by);
PlayerAuto[i][n_zz] = (bz);
PlayerAuto[i][n_aa] = (ba);
PlayerAuto[i][vfarbe1] = -1;
PlayerAuto[i][vfarbe2] = -1;
PlayerAuto[i][neon_type] = 0;
PlayerAuto[i][teile] = reget[0];
PlayerAuto[i][tueren] = reget[1];
PlayerAuto[i][lichter] = reget[2];
PlayerAuto[i][reifen] = reget[3];
PlayerAuto[i][frozen_teile] = reget[0];
PlayerAuto[i][frozen_tueren] = reget[1];
PlayerAuto[i][frozen_lichter] = reget[2];
PlayerAuto[i][frozen_reifen] = reget[3];
PlayerAuto[i][id_x] = CreateVehicle(PlayerAuto[i][vmodel],PlayerAuto[i][v_xc],PlayerAuto[i][v_yc],PlayerAuto[i][v_zc],PlayerAuto[i][v_ac],PlayerAuto[i][vfarbe1],PlayerAuto[i][vfarbe2],1200000);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod0]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod1]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod2]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod3]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod4]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod5]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod6]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod7]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod8]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod9]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod10]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod11]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod12]);
OnVehicleMod(playerid,PlayerAuto[i][id_x],ShowCars[showCar_get][sf_mod13]);
OnVehicleStreamIn(PlayerAuto[i][id_x],playerid);
strmid(PlayerAuto[i][vkey],Spielername(playerid),0,MAX_PLAYER_NAME,MAX_PLAYER_NAME);
GivePlayerMoney(playerid,-preis_veh);
PlayerAuto[i][preisx] = preis_veh/2;
SendClientMessage(playerid,COLOR_GRUEN,"Du hast ein Fahr- oder Flugzeugzeug gekauft! Viel Spass damit!");
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
else
{
SendClientMessage(playerid,COLOR_GRUEN,"Der Kauf wurde abgebrochen");
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
}
}
und hier gleich mal der OnPlayerDisconncet Hier muss das mit dem Autos verschwinden hin wenn ein Spieler off geht..
public OnPlayerDisconnect(playerid,reason)
{
if(VerkaufDat[playerid][verkaufspartner] > -1)
{
TogglePlayerControllable(VerkaufDat[playerid][verkaufspartner],1);
ShowPlayerDialog(playerid,-1,0," "," "," "," ");
}
VerkaufDat[playerid][verkaufspartner] = -1;
VerkaufDat[playerid][autoid] = -1;
VerkaufDat[playerid][preiss] = -1;
VerkaufDat[playerid][current_unlock] = -1;
return 1;
}
bei den anderen weis ich erlich gesagt net was ich hier posten soll also welche Stellen
EDITE: PWN CODE