/gate CMD help.
#2

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


Messages In This Thread
/gate CMD help. - by Mr.Lauren - 24.03.2012, 02:02
Re: /gate CMD help. - by ReneG - 24.03.2012, 02:52
Re: /gate CMD help. - by Mr.Lauren - 24.03.2012, 09:17

Forum Jump:


Users browsing this thread: 1 Guest(s)