SA-MP Forums Archive
Need help! Script line - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help! Script line (/showthread.php?tid=622863)



Need help! Script line - SwankyPants - 27.11.2016

Hi samp forum. Right now the script is this.

But is there anyway i can make it so the only two commands you will need is /open & /close?

Код:
CMD:cgate(playerid, params[])
{
	  if(PInfo[playerid][pCop] >= 3) {
	  MoveObject(ogate,1592.7605, -1638.0819, 14.9281,3.0);
	  SendClientMessage(playerid, -1, "You've CLOSED the PD garage gate, /ogate to open it.");
	  }
	  else
	  {
	  SendClientMessage(playerid, COLOR_GREY, "You've to be an Police Officer I to use this.");
	  }
	  return 1;
}

CMD:ogate(playerid, params[])
{
	  if(PInfo[playerid][pCop] >= 3) {
	  MoveObject(ogate, 1592.7605, -1638.0819, 9.8567,3.0);
	  SendClientMessage(playerid, -1, "You've OPENED the PD garage gate, /cgate to close it.");
	  }
	  else
	  {
	  SendClientMessage(playerid, COLOR_GREY, "You've to be an Police Officer I to use this.");
	  }
	  return 1;
}

CMD:bclose(playerid, params[])
{
	  if(PInfo[playerid][pCop] >= 3) {
	  MoveObject(ogate2,1544.6466, -1626.7156, 13.9754,3.0);
	  SendClientMessage(playerid, -1, "You've CLOSED the LSPD main Gate, type /bopen to open it again.");
	  }
	  else
	  {
	  SendClientMessage(playerid, COLOR_GREY, "You've to be an Police Officer I to use this.");
	  }
	  return 1;
}

CMD:bopen(playerid, params[])
{
	  if(PInfo[playerid][pCop] >= 3) {
	  MoveObject(ogate2, 1544.7471, -1619.6561, 13.9754,3.0);
	  SendClientMessage(playerid, -1, "You've OPENED the LSPD main Gate, /bclose to close it");
	  }
	  else
	  {
	  SendClientMessage(playerid, COLOR_GREY, "You've to be an Police Officer I to use this.");
	  }
	  return 1;
}
- Thanks for your help!


Re: Need help! Script line - BrianFaria - 27.11.2016

Explain better, I do not understand, do you want to open and close with a single command?


Re: Need help! Script line - SwankyPants - 27.11.2016

Right now the commands for the gates are /ogate /cgate & the other one /bopen /bclose.

I want it to be (for the both) /open and /close


Re: Need help! Script line - BrianFaria - 27.11.2016

You have to use this, because if not when you execute the command will open the two together.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: Need help! Script line - SwankyPants - 28.11.2016

Quote:
Originally Posted by Speedpro
Посмотреть сообщение
You have to use this, because if not when you execute the command will open the two together.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Great, thanks for that. Totally forgot about that