Das alles ist unter Public.
{
if(newkeys == (KEY_CROUCH))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(Sirene[playerid] = false)
{
Sirene[playerid] = true;
new vehicle = GetPlayerVehicleID(playerid);
Sirenen[0] = CreateObject(18646,0,0,0,0,0,0);
AttachObjectToVehicle(Sirenen[0],vehicle, -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
}
else
{
DestroyObject(Sirenen[0]);
Sirene[playerid] = false;
}
{
if(newkeys == 16 && InCargo[playerid])
{
new Float:X, Float:Y, Float:Z;
GetVehiclePos(InCargo[playerid], X, Y, Z);
SetPlayerPos(playerid, X+4, Y, Z);
SetPlayerInterior(playerid, 0);
InCargo[playerid] = 0;
}
if(newkeys == 16 && InLevi[playerid])
{
new Float:X, Float:Y, Float:Z;
GetVehiclePos(InLevi[playerid], X, Y, Z);
SetPlayerPos(playerid, X+4, Y, Z);
SetPlayerInterior(playerid, 0);
InLevi[playerid] = 0;
}
if(dtc_AutohausCat[playerid] != 2000)
{
new autohaus = dtc_AutohausCat[playerid];
new AhCars;
for(new ah = 0; ah < sizeof(dtcKaufliste);ah++)
{
if(dtcKaufliste[ah][dtc_Autohaus] == autohaus)
{
AhCars ++;
}
}
if(newkeys == KEY_ANALOG_RIGHT || newkeys == KEY_LOOK_RIGHT) //right (6 Numpad/e)
{
new carid = dtc_AutohausCar[playerid] +1;
if(carid >= AhCars)
{
carid = 0;
}
new car,preis,counter;
for(new ah = 0; ah < sizeof(dtcKaufliste);ah++)
{
if(dtcKaufliste[ah][dtc_Autohaus] == autohaus)
{
if( counter == carid)
{
car = dtcKaufliste[ah][dtc_CarModel];
preis = dtcKaufliste[ah][dtc_CarPreis];
}
counter ++;
}
}
new c1 = random(120);
new c2 = random(120);
DestroyVehicle(dtc_AutohausSCar[playerid]);
dtc_AutohausSCar[playerid] = CreateVehicle(car, DtcSonstiges[autohaus][1][0],DtcSonstiges[autohaus][1][1],DtcSonstiges[autohaus][1][2],DtcSonstiges[autohaus][1][3],c1,c2,-1);
SetVehicleVirtualWorld(dtc_AutohausSCar[playerid],55+playerid);
new string[246];
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawDestroy(CarKauf[playerid]);
format(string,sizeof(string),"~r~---------- AUTOHAUS ----------~n~~g~Fahrzeug: ~w~%s~n~~g~Preis: ~w~$%d~n~~b~Auswaehlen:~n~~w~ <Num 4<~b~&~w~>Num 6> ~n~~b~Kaufen:~w~ Enter ~n~~b~Abbrechen:~w~ Tab",CarName[car-400],preis);
CarKauf[playerid] = TextDrawCreate(200,310,string);
TextDrawAlignment(CarKauf[playerid],1);
TextDrawUseBox(CarKauf[playerid],1);
TextDrawBoxColor(CarKauf[playerid],0x000000FF);
TextDrawBackgroundColor(CarKauf[playerid],COLOR_BLACK);
TextDrawSetOutline(CarKauf[playerid],1);
TextDrawFont(CarKauf[playerid], 2);
//TextDrawSetProportional(CarKauf[playerid], 2);
TextDrawTextSize(CarKauf[playerid],450,410);
TextDrawShowForPlayer(playerid,CarKauf[playerid]);
dtc_AutohausCar[playerid] = carid;
}
if(newkeys == KEY_ANALOG_LEFT || newkeys == KEY_LOOK_LEFT) //left (4 Numpad/q)
{
new carid = dtc_AutohausCar[playerid] -1;
if(carid < 0)
{
carid = AhCars;
}
new car,preis,counter;
for(new ah = 0; ah < sizeof(dtcKaufliste);ah++)
{
if(dtcKaufliste[ah][dtc_Autohaus] == autohaus)
{
if( counter == carid)
{
car = dtcKaufliste[ah][dtc_CarModel];
preis = dtcKaufliste[ah][dtc_CarPreis];
}
counter ++;
}
}
new c1 = random(120);
new c2 = random(120);
DestroyVehicle(dtc_AutohausSCar[playerid]);
dtc_AutohausSCar[playerid] = CreateVehicle(car, DtcSonstiges[autohaus][1][0],DtcSonstiges[autohaus][1][1],DtcSonstiges[autohaus][1][2],DtcSonstiges[autohaus][1][3],c1,c2,-1);
SetVehicleVirtualWorld(dtc_AutohausSCar[playerid],55+playerid);
new string[246];
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawDestroy(CarKauf[playerid]);
format(string,sizeof(string),"~r~---------- AUTOHAUS ----------~n~~g~Fahrzeug: ~w~%s~n~~g~Preis: ~w~$%d~n~~b~Auswaehlen:~n~~w~ <Num 4<~b~&~w~>Num 6> ~n~~b~Kaufen:~w~ Enter ~n~~b~Abbrechen:~w~ Tab",CarName[car-400],preis);
CarKauf[playerid] = TextDrawCreate(200,310,string);
TextDrawAlignment(CarKauf[playerid],1);
TextDrawUseBox(CarKauf[playerid],1);
TextDrawBoxColor(CarKauf[playerid],0x000000FF);
TextDrawSetOutline(CarKauf[playerid],1);
TextDrawBackgroundColor(CarKauf[playerid],COLOR_BLACK);
TextDrawFont(CarKauf[playerid], 2);
//TextDrawSetProportional(CarKauf[playerid], 2);
TextDrawTextSize(CarKauf[playerid],450,410);
TextDrawShowForPlayer(playerid,CarKauf[playerid]);
dtc_AutohausCar[playerid] = carid;
}
if(newkeys == 16)//Enter
{
new carid = dtc_AutohausCar[playerid];
new car,preis,counter;
for(new ah = 0; ah < sizeof(dtcKaufliste);ah++)
{
if(dtcKaufliste[ah][dtc_Autohaus] == autohaus)
{
if( counter == carid)
{
car = dtcKaufliste[ah][dtc_CarModel];
preis = dtcKaufliste[ah][dtc_CarPreis];
}
counter ++;
}
}
if(GetPlayerMoney(playerid) < preis){SendClientMessage(playerid,COLOR_GREY,"Du hast nicht genug Geld um dieses Fahrzeug zu kaufen!");} else {OnPlayerBuyCar(playerid,car,preis,autohaus);}
//ResetPlayer
DestroyVehicle(dtc_AutohausSCar[playerid]);
SetPlayerPos(playerid, DtcSonstiges[autohaus][4][0],DtcSonstiges[autohaus][4][1],DtcSonstiges[autohaus][4][2]);
SetPlayerFacingAngle(playerid,DtcSonstiges[autohaus][4][3]);
dtc_AutohausCar[playerid] = 0;
dtc_AutohausCat[playerid] = 2000;
SetPlayerVirtualWorld(playerid,0);
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawDestroy(CarKauf[playerid]);
TogglePlayerControllable(playerid,1);
SetCameraBehindPlayer(playerid);
}
if(newkeys == KEY_ACTION) //Tab
{
//ResetPlayer
DestroyVehicle(dtc_AutohausSCar[playerid]);
SetPlayerPos(playerid, DtcSonstiges[autohaus][4][0],DtcSonstiges[autohaus][4][1],DtcSonstiges[autohaus][4][2]);
SetPlayerFacingAngle(playerid,DtcSonstiges[autohaus][4][3]);
dtc_AutohausCar[playerid] = 0;
dtc_AutohausCat[playerid] = 2000;
SetPlayerVirtualWorld(playerid,0);
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawDestroy(CarKauf[playerid]);
TogglePlayerControllable(playerid,1);
SetCameraBehindPlayer(playerid);
}
}
if(newkeys & KEY_SUBMISSION)
{
if(IsPlayerInRangeOfPoint(playerid,15.0,1588.6610,-1638.5031,13.3795))
{
OnPlayerCommandText(playerid,"/pd1");
}
if(IsPlayerInRangeOfPoint(playerid,10.0,1545.2229,-1627.4520,13.3828))
{
OnPlayerCommandText(playerid,"/pd2");
}
if(IsPlayerInRangeOfPoint(playerid,15.0,-1631.8907,690.0701,7.1875))
{
OnPlayerCommandText(playerid,"/sfpdtor");
}
if(IsPlayerInRangeOfPoint(playerid,15.0,135.2632,1941.1360,19.5111))
{
OnPlayerCommandText(playerid,"/armylift1");
}
if(IsPlayerInRangeOfPoint(playerid,15.0,285.6308,1821.0627,17.7795))
{
OnPlayerCommandText(playerid,"/armylift2");
}
if(IsPlayerInRangeOfPoint(playerid,15.0,213.6029,1876.4932,13.1406))
{
OnPlayerCommandText(playerid,"/army1");
}
if(IsPlayerInRangeOfPoint(playerid,5.0,225.8057,1872.3940,13.7421))
{
OnPlayerCommandText(playerid,"/army2");
}
if(IsPlayerInRangeOfPoint(playerid,5.0,2095.8030,-1448.1106,23.5593))
{
OnPlayerCommandText(playerid,"/medic1");
}
if(IsPlayerInRangeOfPoint(playerid,5.0,2000.7635,-1358.1760,23.5345))
{
OnPlayerCommandText(playerid,"/medic2");
}
if(IsPlayerInRangeOfPoint(playerid,25.0,1997.0819,-1450.3594,13.5598))
{
OnPlayerCommandText(playerid,"/medic3");
}
if(IsPlayerInRangeOfPoint(playerid,5.0,367.3445,193.5131,1008.3828))
{
OnPlayerCommandText(playerid,"/präsibüro");
}
if(IsPlayerInRangeOfPoint(playerid,5.0,-2047.5688,-102.3382,39.2918))
{
OnPlayerCommandText(playerid,"/lehrerlift");
}
if(IsPlayerInRangeOfPoint(playerid,10.0,960.2383,-1434.2980,13.5527))
{
OnPlayerCommandText(playerid,"/fw");
}
if(IsPlayerInRangeOfPoint(playerid,15.0,924.185730, -1223.406982, 16.036469))
{
OnPlayerCommandText(playerid,"/oamtls");
}
}
return 1;
}
MfG xAdy