SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 24/03/2012, 02:02 AM   #1
Mr.Lauren
Little Clucker
 
Join Date: Mar 2012
Posts: 28
Reputation: 0
Default /gate CMD help.

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.
Mr.Lauren is offline   Reply With Quote
Old 24/03/2012, 02:52 AM   #2
ReneG
High-roller
 
Join Date: Oct 2011
Location: Sublime Text 2
Posts: 2,006
Reputation: 333
Default Re: /gate CMD help.

pawn Code:
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.
ReneG is offline   Reply With Quote
Old 24/03/2012, 09:17 AM   #3
Mr.Lauren
Little Clucker
 
Join Date: Mar 2012
Posts: 28
Reputation: 0
Default Re: /gate CMD help.

Thank you very much.
Mr.Lauren is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gate help Bob_Raw Help Archive 2 25/03/2011 05:55 PM
Teams open a gate[have gate script] manunited1878 Help Archive 12 17/02/2010 08:45 PM
[Include] [INC] 0.1 || Easy Gate Script || 1 Line per gate. [F.U.D.D.S] Includes 33 17/01/2010 04:06 PM
/gate command, and only /gate Omega90210 Help Archive 8 25/06/2009 10:16 AM


All times are GMT. The time now is 06:51 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.