RCON Ramp Filterscript
#1

Hi,

Can anyone direct me to an RCON ramp FS,

It would be cool if when logged into rcon, a ramp spawns for like 5 seconds when you click right mouse button, and then despawns after.

Anyone got any links to hand out?
Reply
#2

Search.

If there not for admin only add to the ramp creating part.
pawn Код:
if(IsPlayerAdmin)
{
//The Ramp creating code here.
}
Reply
#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
#4

Thank you.

I get a few errors when adding that.
Reply
#5

Post the error list here so we can help with fixing the error
Reply
#6

That's interesting, I compiled the exact script without a single error..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)