Well I haven't got you a link, but I made you the entire script..
pawn Код:
#include <a_samp>
#define RAMP 1632 //Ramp ID
#define DISTANCE 30.0 //Distance infront
#define TIME 5000 //duration of ramp in ms
new tempkey, ramp;
new Float: X, Float: Y, Float: Z, Float: A;
forward Delete(objectid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
tempkey = newkeys - oldkeys;
if(tempkey == 4)
{
if(IsPlayerAdmin(playerid))
{
GetXYInFrontOfPlayer(playerid, X, Y, Z, A);
ramp = CreateObject(RAMP, X, Y, Z, 0.0, 0.0, A);
SetTimerEx("Delete", TIME, 0, "d", ramp);
}
}
}
public Delete(objectid)
{
DestroyObject(objectid);
return 1;
}
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, &Float:z, &Float:a)
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (DISTANCE * floatsin(-a, degrees));
y += (DISTANCE * floatcos(-a, degrees));
}
Ordinarily I wouldn't do this, but I thought it was interesting..
Modify DISTANCE, TIME and RAMP to suit you..
P.S you press the "KEY_FIRE" key...