Hallo com ich habe auf mein server ein Autohaus system erstellt und will nun das die cars an der Trucker Base spawnen unswa Random
AddStaticVehicle(502,-31.5830,-276.6498,5.3175,269.5427,51,75); // autokaufspawn1
AddStaticVehicle(502,-30.5126,-280.0215,5.3186,269.2653,51,75); // autokaufspawn2
AddStaticVehicle(502,-31.2262,-283.4319,5.3170,269.3367,51,75); // autokaufspawn3
AddStaticVehicle(502,-31.4291,-286.8210,5.3192,270.3276,51,75); // autokaufspawn4
AddStaticVehicle(502,-30.6872,-290.2162,5.3215,270.0367,51,75); // autokaufspawn5
AddStaticVehicle(502,-31.2113,-293.6188,5.3206,270.5205,51,75); // autokaufspawn6
AddStaticVehicle(502,-30.9714,-296.9427,5.3215,269.7877,51,75); // autokaufspawn7
AddStaticVehicle(502,-0.9785,-301.1555,5.3132,89.2128,51,75); // autokaufspawn8
AddStaticVehicle(502,-0.3900,-304.6669,5.3173,90.0018,51,75); // autokaufspawn9
AddStaticVehicle(502,-0.4273,-308.1667,5.3223,89.5486,51,75); // autokaufspawn10
AddStaticVehicle(502,0.0562,-311.6645,5.3220,90.0193,51,75); // autokaufspawn11
AddStaticVehicle(502,-0.2071,-315.2568,5.3215,89.2483,51,75); // autokaufspawn12
AddStaticVehicle(502,-0.6865,-318.7336,5.3232,89.6181,51,75); // autokaufspawn13
AddStaticVehicle(502,-0.5670,-322.2784,5.3224,89.8154,51,75); // autokaufspawn14
AddStaticVehicle(502,-0.7787,-325.8391,5.3220,88.6041,51,75); // autokaufspawn15
AddStaticVehicle(502,-0.5788,-329.3296,5.3211,89.3954,51,75); // autokaufspawn16
AddStaticVehicle(502,-0.8341,-332.8588,5.3224,89.2498,51,75); // autokaufspawn17
AddStaticVehicle(502,-0.3046,-336.4436,5.3222,88.9489,51,75); // autokaufspawn18
AddStaticVehicle(502,-0.7694,-339.8704,5.3236,89.9762,51,75); // autokaufspawn19
AddStaticVehicle(502,-0.8461,-343.4076,5.3248,89.5425,51,75); // autokaufspawn20
AddStaticVehicle(502,-0.5109,-346.9451,5.3220,89.8589,51,75); // autokaufspawn21
AddStaticVehicle(502,-0.5799,-350.4830,5.3219,89.6116,51,75); // autokaufspawn22
AddStaticVehicle(502,-0.2762,-354.0208,5.3204,89.5558,51,75); // autokaufspawn23
AddStaticVehicle(502,-0.0255,-357.5459,5.3205,89.8315,51,75); // autokaufspawn24
AddStaticVehicle(502,-0.6771,-361.0365,5.3217,88.9111,51,75); // autokaufspawn25
AddStaticVehicle(502,-1.2926,-364.7119,5.3221,89.1589,51,75); // autokaufspawn26
Das sind die Cordinaten wo sie Spawnen sollen unswa Random wenn ich z.b in Autohaus xxx ein Cheetah kauf soll der dort auf i-ein spawnen unswa soll der Random ausgesucht werden und wenn ich im Autohaus yyy ein Sultan kaufe soll er dort auch spawnen auf i-ein parkplatz der wieder Random ausgesucht werden soll weil wenn spieler xxx ein Auto kauft und spier yyy auch in dem gleichen Autohaus die sonst übereinander buggen bzw ineinander
enum autohausEnum{
Float:s_x,
Float:s_y,
Float:s_z,
Float:s_r
}
enum autohauscarEnum{
model,
Float:c_x,
Float:c_y,
Float:c_z,
Float:c_r,
c_preis,
ah_id,
id_x
}
new ahInfo[][autohausEnum] = {
{-31.5830,-276.6498,5.3175,269.5427},
{-31.4291,-286.8210,5.3192,270.3276}
};
new ahCars[][autohauscarEnum] = {
{411,-1668.7550,1205.7421,20.8833,272.0864,1200000,0},
{541,-1663.4056,1220.9622,20.8833,211.1151,900000,0},
{412,2134.5305,-1130.4222,25.5472,119.9674,60000,1}
};
#define DIALOG_AUTOHAUS 4
//Unter OnGameModeInit
for(new i=0; i<sizeof(ahCars); i++)
{
ahCars[i][id_x]=AddStaticVehicle(ahCars[i][model],ahCars[i][c_x],ahCars[i][c_y],ahCars[i][c_z],ahCars[i][c_r],-1,-1);
}
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;
SetPVarInt(playerid,"buyCarID",i);
new string[265];
format(string,sizeof(string),"Mochten sie das Fahrzeug für %i$ kaufen?",ahCars[i][c_preis]);
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS,DIALOG_STYLE_MSGBOX,"Autokauf",string,"Ja","Nein");
break;
}
return 1;
}
return 1;
}
//OnDialogResponse
if(dialogid==DIALOG_AUTOHAUS)
{
if(response)
{
new id=GetPVarInt(playerid,"buyCarID");
if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
{
SendClientMessage(playerid,ROT,"Du hast nicht genügend Geld");
RemovePlayerFromVehicle(playerid);
return 1;
}
GivePlayerMoney(playerid,-ahCars[id][c_preis]);
createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][s_x],ahInfo[ahCars[id][ah_id]][s_y],ahInfo[ahCars[id][ah_id]][s_z],ahInfo[ahCars[id][ah_id]][s_r]);
SendClientMessage(playerid,LEUCHTENDBLAU,"Herzlichen Glückwunsch zu ihren Kauf");
RemovePlayerFromVehicle(playerid);
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,ROT,"Dann eben nicht ...");
}
return 1;
}