/ramp
#2

It's bit complicated...

First, you check if the player is pressing CTRL, if it is then create an object in front of the player. After creating this object, set a timer to destroy it.

pawn Код:
new GlobalVarForObject[MAX_PLAYERS]; // this is a global variable to store object's ID

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & CTRL_KEY_HERE) // you've gotta change it by yourself
    {
        DestroyObject(GlobalVarForObject[playerid]); // if there's still an object we delete it
        GlobalVarForObject[playerid] = CreateObject(/*object params...*/); // replace by object param, just like modelid and coordinates
        SetTimerEx("DestroyRamp", TIME_HERE, false, "i", playerid); // TIME_HERE has to be replaced by the time of the ramp in milliseconds
    }
    return 1;
}

forward DestroyRamp(playerid);
public DestroyRamp(playerid) // this callback destroy our ramp
{
    DestroyObject(GlobalVarForObject[playerid]); // we destroy the ramp created by the x playerid
    return 1;
}
You'll need GetXYInFrontOfPlayer and the object angle to align it.
Reply


Messages In This Thread
/ramp - by Mr.Jvxmc - 26.10.2010, 21:25
Re: /ramp - by Miguel - 27.10.2010, 01:40
Re: /ramp - by (SF)Noobanatior - 27.10.2010, 05:30
Re: /ramp - by Mr.Jvxmc - 27.10.2010, 13:49

Forum Jump:


Users browsing this thread: 2 Guest(s)