grr, gate question
#1

Hey nathan fuller again

Want to know something about gates.

Currently i have a gate at PD that can close and open on command. However, i can use this command any where on the map. I want to know if theres a way i can script a distance thing.. So if im more then say 10 feet the command wont work.
Reply
#2

Use PlayertoPoint?
Reply
#3

i used it like.

if (strcmp("/openpdgate", cmdtext, true, 10) == 0)
{
MoveObject(pdgate1, 1549.95, -1621.68, 6.15, 2.0);
SendClientMessage(playerid, 0xFFFFFFAA, "Gate Now Opening");
return 1;
}

if(strcmp("/closepdgate", cmdtext, true, 10) == 0)
{
MoveObject(pdgate1,1549.95, -1621.68, 12.3, 2.0);
SendClientMessage(playerid, 0xFFFFFFAA, "Gate Now Closing");
return 1;
}



I also added the slash new gate and all that, gates work i just dono how to make it so u can only do it within a specific area
Reply
#4

Use this. It will work fine.
Reply
#5

wow hehe im an idiot. i went to that link, put in everything it said.. am i supposed to change some of the X,Y,Z's or sumthin?
Reply
#6

pawn Код:
if (strcmp("/openpdgate", cmdtext, true, 10) == 0)
    {
    if (PlayerToPoint(20.00, playerid, 1549.95, -1621.68, 12.3))
    {
      MoveObject(pdgate1, 1549.95, -1621.68, 6.15, 2.0);
      SendClientMessage(playerid, 0xFFFFFFAA, "Gate Now Opening");
    }
    else
    {
      SendClientMessage(playerid, 0xf01818FF, "Sorry, not in range of a gate.");
    }
  return 1;
    }

    if(strcmp("/closepdgate", cmdtext, true, 10) == 0)
    {
    if (PlayerToPoint(20.00, playerid, 1549.95, -1621.68, 12.3))
    {
      MoveObject(pdgate1,1549.95, -1621.68, 12.3, 2.0);
      SendClientMessage(playerid, 0xFFFFFFAA, "Gate Now Closing");
    else
    {
      SendClientMessage(playerid, 0xf01818FF, "Sorry, not in range of a gate.");
    }
    return 1;
    }
Try that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)