SA-MP Forums Archive
/gate CMD help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /gate CMD help. (/showthread.php?tid=328185)



/gate CMD help. - Mr.Lauren - 24.03.2012

Hello everyone, as you can see, I am new to scripting, and I'd like help about /gate CMD, to make the gate, roll down slowly and rply.

Exc.





Let's say, when I stand close to it, I'll use /gate, and it'll slowly roll down?
How do I make it?
Thanks.


Re: /gate CMD help. - ReneG - 24.03.2012

pawn Код:
new gate; // Make a new variable.
public OnGameModeInit()
{
    // Line below assigns the varable above the gate object.
    gate = CreateObject(/* You would put your gate object code here*/);
    return 1;
}
CMD:gate(playerid,params[])
{
    // You would use the native function "IsPlayerInRangeOfPoint".
    // and insert the coordinates of the gate object instead of x,y,z.
    if(IsPlayerInRangeOfPoint(playerid,10.0,x,y,z)) // The "10.0" param is the radius the player has to be in for the command to work.
    {
        // We will use the MoveObject function to move the gate.
        // So if he IS close to the gate
        MoveObject(gate,/* You would put the new coordinates here.*/);// Notice the first parameter is "gate" which is the variable defined.
    }
    return 1;
}
// This is a very simple run-down on how it is done. Go read some tutorials for more information.



Re: /gate CMD help. - Mr.Lauren - 24.03.2012

Thank you very much.