Kleine Frage möchte das man nur ein Car Spawnen kann wenn man es gelöscht hat kann man wieder nur eins Spawnen. Aktuell kann man unbegrenzt Fahrzeuge Spawnen.
Ich hoffe das reicht..
if(strcmp(cmd, "/supcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1||PlayerInfo[playerid][pSupporter] >= 1)
{
ShowPlayerDialog(playerid,DIALOG_SUPCAR, DIALOG_STYLE_LIST,"{FFFFFF}Sup Cars Auswahl","Rancher\nSultan\nNRG-500\nMaverick\nSandking\nDune","Auswählen", "Abbrechen");
}
}
}
if(dialogid == DIALOG_SUPCAR)
{
if(response)
{
if(listitem == 0)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new sup_car = CreateVehicle(505, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
SetVehicleToRespawn(sup_car);
PutPlayerInVehicle(playerid,sup_car,0);
}
if(listitem == 1)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new sup_car = CreateVehicle(560, X,Y,Z, 194.1, 0x050000FF, 0x050000FF, 60000);
SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
SetVehicleToRespawn(sup_car);
PutPlayerInVehicle(playerid,sup_car,0);
}
if(listitem == 2)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new sup_car = CreateVehicle(522, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
SetVehicleToRespawn(sup_car);
PutPlayerInVehicle(playerid,sup_car,0);
}
if(listitem == 3)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new sup_car = CreateVehicle(487, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
SetVehicleToRespawn(sup_car);
PutPlayerInVehicle(playerid,sup_car,0);
}
if(listitem == 4)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new sup_car = CreateVehicle(495, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
SetVehicleToRespawn(sup_car);
PutPlayerInVehicle(playerid,sup_car,0);
}
if(listitem == 5)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new sup_car = CreateVehicle(573, X,Y,Z, 0.0, 0x050000FF, 0x050000FF, 60000);
SetVehicleNumberPlate (sup_car, "{0000FF}Admin");
SetVehicleToRespawn(sup_car);
PutPlayerInVehicle(playerid,sup_car,0);
}
}
}