Please help me again with gates . My faction Nummber is 14. How to make that only a faction of that could open the gate?
I dont understand what i Need to type ""TEAM_MAFIA"" - There need to type my faction name or what? Please explain me
PHP код:
1.// This is a comment
2.// uncomment the line below if you want to write a filterscript
3.#define FILTERSCRIPT
4.
5.#include <a_samp>
6.
7.new Openlagate;
8.
9.#if defined FILTERSCRIPT
10.
11.public OnFilterScriptInit()
12.{
13. print("\n--------------------------------------");
14. print(" Blank Filterscript by your name here");
15. print("--------------------------------------\n");
16. Openlagate = CreateObject(980, 1762.1135253906, -1693.2562255859, 15.201999664307, 0, 0, 266.70568847656);
17. return 1;
18.}
19.
20.public OnFilterScriptExit()
21.{
22. return 1;
23.}
24.
25.#else
26.
27.main()
28.{
29. print("\n----------------------------------");
30. print(" Blank Gamemode by your name here");
31. print("----------------------------------\n");
32.}
33.
34.#endif
35.
36.public OnPlayerCommandText(playerid, cmdtext[])
37.{
38. if (strcmp("/opencpg", cmdtext, true, 10) == 0)
39. {
40. if(GetPlayerTeam(playerid) == TEAM_MAFIA) // change the 'TEAM_MAFIA' to how you defined it.
41. {
42. if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
43. {
44. MoveObject(Openlagate, 1761.650390625, -1700.6632080078, 15.200605392456, 4);
45. SendClientMessage(playerid, 0xFFFFFF, "You've opened the crime place gate");
46. }
47. }
48. return 1;
49. }
50.
51. if (strcmp("/closecpg", cmdtext, true, 10) == 0)
52. {
53. if(GetPlayerTeam(playerid) == TEAM_MAFIA) // again, change it!
54. {
55. if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
56. {
57. MoveObject(Openlagate, 1762.1135253906, -1693.2562255859, 15.201999664307, 4);
58. SendClientMessage(playerid, 0xFFFFFF, "You've closed the crime place gate");
59. }
60. }
61. return 1;
62. }
63.return 0;
If the teamid of your faction is 14, then just change the text of TEAM_MAFIA to 14 or else add a definition to make TEAM_MAFIA stand for 14, like so: