24.03.2012, 02:52
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.