RCON Ramp Filterscript
#3

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...
Reply


Messages In This Thread
RCON Ramp Filterscript - by Marclang - 18.05.2009, 16:38
Re: RCON Ramp Filterscript - by miokie - 18.05.2009, 16:49
Re: RCON Ramp Filterscript - by Weirdosport - 18.05.2009, 16:56
Re: RCON Ramp Filterscript - by Marclang - 18.05.2009, 17:04
Re: RCON Ramp Filterscript - by Oxside - 18.05.2009, 17:36
Re: RCON Ramp Filterscript - by Weirdosport - 18.05.2009, 17:37

Forum Jump:


Users browsing this thread: 2 Guest(s)