Danke die lösung mit dem Flugzeug gefällt mir besser
werds jez ausprobiern.
MFG,Cedi
Habe errors:
Das script hier:
#include <a_samp>
forward RampCreate();
forward RemoveRamp(id);
forward Float:GetOptimumRampDistance(playerid);
forward Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
new keydown[MAX_PLAYERS] = {false, ...};
new rampid[MAX_PLAYERS] = {-1, ...};
public OnFilterScriptInit() {
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
print("STG Ramp Filterscript by Matze_Bellic");
print("Idde by Script Monopoly");
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
SetTimer("RampCreate", 100, 1);
}
public RampCreate()
{
new Key1,Key2,Key3;
new Float:px,Float:py,Float:pz,Float:pa;
for (new i; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerPos(i,px,py,pz);
GetPlayerKeys(i,Key1,Key2,Key3);
if (Key1 & KEY_ACTION && IsPlayerInAnyVehicle(i))
{
if (GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
if (!keydown[i])
{
keydown[i] = 1;
if (rampid[i] == -1)
{
pa = GetXYInFrontOfPlayer(i, px, py, GetOptimumRampDistance(i));
pz += 0.5;
rampid[i] = CreateObject(1632, px, py, pz - 0.5, 0.0, 0.0, pa);
SetTimerEx("RemoveRamp", 2000, 0, "d", i);
}
}
}
}
else keydown[i] = 0;
}
}
}
public RemoveRamp(id)
{
if (rampid[id] != -1)
{
DestroyObject(rampid[id]);
rampid[id] = -1;
}
}
stock GetVehicleWithinDistance(playerid, Float:x1, Float:y1, Float:z1, Float:dist, &veh)
{
for (new i = 1; i < MAX_VEHICLES; i++)
{
if (GetVehicleModel(i) > 0)
{
if (GetPlayerVehicleID(playerid) != i)
{
new Float:x, Float:y, Float:z;
new Float:x2, Float:y2, Float:z2;
GetVehiclePos(i, x, y, z);
x2 = x1 - x; y2 = y1 - y; z2 = z1 - z;
new Float:vDist = (x2*x2+y2*y2+z2*z2);
if (vDist < dist)
{
veh = i;
dist = vDist;
}
}
}
}
}
Float:GetOptimumRampDistance(playerid)
{
new ping = GetPlayerPing(playerid), Float:dist;
dist = floatpower(ping, 0.25);
dist = dist*4.0;
dist = dist+5.0;
return dist;
}
Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
else GetPlayerFacingAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
return a;
}
public OnPlayerStateChange
if(IsPlane(vehicleid))
{
RampeAn == false;
SendClientMessage(playerid,0xDB0000F6,"Die RampenFunktion wurde Deaktiviert!");
}
stock IsPlane(vehicleid) // Planes
{
new model = GetVehicleModel(vehicleid);
switch(model)
{
case 592:return 1;
case 577:return 1;
case 511:return 1;
case 512:return 1;
case 593:return 1;
case 520:return 1;
case 553:return 1;
case 464:return 1;
case 476:return 1;
case 519:return 1;
case 460:return 1;
case 513:return 1;
case 539:return 1;
}
return false;
}
Die errors:
D:\Dokumente und Einstellungen\Besitzer\Desktop\rampe(2).pwn(104) : error 001: expected token: ";", but found "if"
MFG,Cedi