Guten Tag,
Ich habe einen Befehl /spikes. Aber wenn ich dadurch fahre, gehen die Reifen nicht kaputt!
new panels,tires;
dcmd_spikes(playerid,params[])
{
#pragma unused params
if(IstSpielerMember(playerid,1) || IstSpielerMember(playerid,3) || IstSpielerMember(playerid,4))
{
if(spikes[playerid] == 0)
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
spikes1 = CreateObject(1593,x,y,z-0.85,0.0,0.0,a+180);
spikes[playerid] = 1;
SendClientMessage(playerid,GRÜN," 1. Nagelband erfolgreich verlegt!");
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, 15);
return 1;
}
if(spikes[playerid] == 1)
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
spikes2 = CreateObject(1593,x,y,z-0.85,0.0,0.0,a+180);
spikes[playerid] = 2;
SendClientMessage(playerid,GRÜN," 2. Nagelband erfolgreich verlegt!");
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, 15);
return 1;
}
if(spikes[playerid] == 2)
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
spikes3 = CreateObject(1593,x,y,z-0.85,0.0,0.0,a+180);
spikes[playerid] = 3;
SendClientMessage(playerid,GRÜN," 3. Nagelband erfolgreich verlegt!");
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, 15);
return 1;
}
if(spikes[playerid] == 3)
{
SendClientMessage(playerid,DUNKELGRAU," Du hast bereits 3 Nagelbänder gelegt, gebe /dspikes ein, um alle Nagelbänder zu entfernen!");
}
}
return 1;
}
doors und lights sind oben im Script schon definiert!