How to make a moveable gate with a rang?
#1

How can i make a moveable gate with a range and if he isn't in rane it will type error or sth

THANKS
Reply
#2

My idea needs ZCMD:

pawn Код:
CMD:/gate(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, Range, GateX, GateY, GateZ)){
    // Open gate
    } else
    {
     // You're not in range
    }
    return 1
}
Reply
#3

first at the top of script
pawn Код:
// at OnGameModeInt
new gate = CreateObject(modelID, X, Y, Z, X rotation, Y rotation, Z rotation, DrawDistance); // you may use samp map editor or if mta map editor, use http://www.convertffs.com to convert an object from mta to samp..
then as example cmd
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
 {

                      if(!strcmp(cmdtext, "/gate", true))
                      {
                             if(IsPlayerInRangeOfPoint(playerid, float:distance, x, y, z)) // check if the player at the place
                              {
                  SetObjectPos(gate, X, Y,Z); // you can get the pos when you create the gate opens
                                }
                               else // if other
                               {
                              SendClientMessage(playerid, RED, "You are not near the gate!");
                               }
                           return 1;

 
                   }
                   return 0;
  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)